PDA

View Full Version : Creating New Weapon Type


radioonfire
04-08-2013, 02:49 PM
I am attempting to create an entirely new weapon type without overriding the existing types, but I'm unclear if this is possible.
So far here is what I have done:

Created projectile data (per projectiles.gdb)
Created skills (per Skills.gdb)
Created Magic Modifier (for power load, per MagicModifiers/Components.gdb)
Created component data (based on WeaponBeams.gdb)
Created overrides of the races (e.g., RaceHuman) to allow them to research new weapons.
Created item names in a separate .tm file (per items.tm)

For now all of my data/assets are based on beam weapons, but the component names are different. So if it works, the components should look/act like beams but be called Microwave Weapons. I haven't encountered such weapons in my game (after very brief testing), so this may or may not be working.
Below is the first version of the mod if anyone wants to check it out, fix it, or play with it more. As I test more and actually add modified behavior and assets I'll update here.

Shadow
04-08-2013, 06:28 PM
You should be able to make a new type just fine. The only gotcha I can think of is that the game will only automatically find new gdb files that are directly in the Database directory. To work in a subdirectory you would need to change database.dbl which you shouldn't do in a mod.

To test, you should probably make SpawnChance in your component really high temporarily.

radioonfire
04-08-2013, 06:51 PM
Shadow, thanks for the pointers. Increasing SpawnChance helps with testing a lot. As for the other directory, I'm keeping the language file there (for the human-readable weapon names). Is there a different spot to put this that will make it work?
I can now verify that the mod is having some effect. The weapons are successfully spawning and acting like beams.
The major problem now is that none of the races are equipping their ships. They are building ships like normal, and the ships act as they should, but for some reason they are spawning with absolutely no equipment. This is handled correctly (in that they die easily and without a fight), but it's not a desired outcome of this mod.
If anyone wants to take a crack at debugging my work, just download the mod from the first post. I'll keep trying as well.
One possible problem. The only override I'm doing (all the rest is new custom parms) is on the races. Here is an example on the humans:

ModMicrowaveHuman overrides RaceHuman
{
ResearchTechName BaseWeaponMicrowave
ResearchTechPriorityMult 1.0
}

It's not apparently causing other problems with the races other than lack of a loadout, and it's also happening with Legion (which is technically a sub-race and I'm not modifying it directly). Everything else about the races, including diplomacy, colonization, quests etc. appears to be working fine.

Tyrax Lightning
04-08-2013, 08:15 PM
Are these Mod Microwave Weapons good for Hit-Roll AOE Damage? Hit Roll Weapons have only a couple AOE options, & they all suck... Computer & Hit Roll using Ships are horribly susceptible to destruction vs large numbers of foes simultaneously... :(

radioonfire
04-08-2013, 09:07 PM
Are these Mod Microwave Weapons good for Hit-Roll AOE Damage? Hit Roll Weapons have only a couple AOE options, & they all suck... Computer & Hit Roll using Ships are horribly susceptible to destruction vs large numbers of foes simultaneously... :(
Tyrax, can you explain the term Hit-Roll?
To answer your question, or at least clarify, right now the Microwave weapons are exactly like the normal beam weapons. All I have so far is a prototype, so the stats/function are identical to default beams (since I copied all the parms, attributes, and values from there). The names are different ("Microwave 1" and so on), and that's the only way to distinguish them right now. As I start to actually define this weapon type, I would really love some input about how it should behave.
I've attached an update, so you can check it out. The language file loads correctly, and I've broken the .gdb file into several separate files for easier parsing and editing.

Tyrax Lightning
04-08-2013, 11:14 PM
I dunno if there's actual official terms, so i've been using 'Hit-Roll' & 'Non-Hit-Roll' & such for terms as a band aid fix. "Hit Roll" means that the weapon lands on the enemy, then the game 'rolls' your Attack Stat against the enemy's Defense Stat to determine if the attack lands on the enemy & does it's damage or not, kinda like D&D's AC vs Thwacko. (sp?) Example Weapons are Beams, Missiles, & the EM Burst. "Non Hit Roll" means that if the weapon lands on the enemy, then the enemy has no choice but to be just plain hit. These kinds of Weapons are manually targeted by you, the player. Example Weapons are the EM Shockwave, Hellfire, & the Lightning Field.

Right now, I only know of 2 Hit Roll AOE Damage Weapons, & both are sub species of Missiles... & both suck. We need more Hit Roll AOE Damage because right now, Hit Roll Weapon users are at a bad disadvantage vs large numbers of simultaneous enemies... a situation ya come across commonly in the game.

Non Hit Roll Weapon users have far better AOE options, I know... I got 5 Characters atm, 2 Hit Rollers (Goliathan the Brunt & Glitch the Utopian) & 3 Non Hit Rollers (My Main Tyrax the Drakk, Raiden the Fringe, & Alpha Omega the Hive) & I plan a future Lithosoid Non Hit Roll Weapon user.

Here's the Non Hit Roll Weapons with AOE Damage I know of & can think of:
Bombs (*Sigh* I miss the old bombs... My poor Main Character... :()
Pulsar Generator
EM Shockwave
Lightning Field
Geomagnetic Storm
Self Destruct (Combo with Escape Pods for best results...)
Mines
Mines: Remote DetonationHere's the Hit Roll Weapons with AOE Damage I know of:
Shock Torpedoes (Too hard to get them to land in groups well enough, not enough blast radius, & not enough damage... though to be fair, post patch Bombs are struggling to do enough damage too... :'( )
EM Missiles (Similar to the Shock Torpedoes, but do even worse damage in exchange for some AOE Attack & Defense Debuffing, & being a Medium Slot Component to the Shock Torpedoes's Heavy Slot Component.)Hit Roll Weapon AOE Damage power needs help... I wonder if Microwaves could be of help...? Maybe they could land on the enemy, & IF they successfully hit, then explode from the enemy & also hit a large radius of foes around the initially hit enemy...? :) (Preferably with a Radius that doesn't suck... I would recommend the same Radius that Bombs use.)

radioonfire
04-08-2013, 11:26 PM
I like what you're saying here. I think we could find a good balance of energy use, AOE and damage to balance against the idea of a beam-type targeting.
First I need to figure out how in the heck I've vaporized all of the equipment for race ships or how I can force drops without adding microwaves to the race tech trees.
If we get this working, I also want to try a gatling gun style ballistic weapon and some kind of death blossom a la Last Starfighter. Changing the weapon behavior should be the easy part, though, after we get the framework going.
By the way, thanks for the clarification. That makes sense now.

radioonfire
04-09-2013, 03:31 AM
I changed the way we're modifying the tech tree. Now we are loading a new Races.gdb file rather than overriding the race parms. This is somewhat more fragile (in that future patches could change things in the Races.gdb that we would override), but it fixes the bug where we neutered the race ships. The weapon is still just a renamed beam weapon, but at least it's properly integrated into the game. Oh, since it's really in testing, the SpawnChance is set to 40.0 (default 3.0), so you'll be sure to see them all over the place.
Our Races.gdb file is current as of v 1.007, and I'll try to keep it updated at least until this mod is complete.

Shadow
04-09-2013, 10:05 AM
I think one of the problems you are running into is the override of the tech stuff. If I remember correctly, on things that can have multiple entries like ResearchTechName & ResearchTechPriorityMult if you override one of them, you must override all of them. So you would need to include the normal engines, missiles, computers, etc.

radioonfire
04-09-2013, 01:13 PM
I think one of the problems you are running into is the override of the tech stuff. If I remember correctly, on things that can have multiple entries like ResearchTechName & ResearchTechPriorityMult if you override one of them, you must override all of them. So you would need to include the normal engines, missiles, computers, etc.
I might try to do this so that I can avoid the issue of maintaining the entire Races.gdb file when we only want to change something small. If racial tech priorities change we would still need to update, but otherwise it would simplify things.

radioonfire
04-09-2013, 03:07 PM
So I have started working on the weapon function, and I'm trying to create a damage-over-time aura around the target of a beam attack. This actually comes close to working with a modified StatusEffectLightningField. Everything is the same except with no EM resistance. The problem is that the field works similarly to how it works on the player, in the sense that it targets that ship's enemies (monsters that are not allies, race ships and the player). I want it to target all ships except the subject of the effect (and ideally the player). The targeting seemed to be controlled by the following parm:
DamageOthersRange 125.0
I tried using an aura (a la some of the doomsday weapons), but it didn't behave as expected. I created a separate aura status effect (to avoid the recursive nature of the doomsday auras like Grey Goo), and I set the AuraChance to 0.0. So it looks something like this:
Aura 1
AuraChance 0.0
AuraDistance 125.0
AuraAll 1

AuraStatusEffect StatusEffectEmFeedbackAura //My custom effect
However, the aura attacks the victim of the aura and it still seems to be contagious; anything that comes close to the victim takes damage for the full duration of the effect (even after the victim dies or moves out of range).
I would love an explanation of the aura parms or a different single parm like DamageAllRange if it exists.
SIDENOTE: Shadow's fix of including entire tech trees in the race overrides fixed the problem of race ships with no equipment (and is much less cumbersome than what I was doing).

Tyrax Lightning
04-09-2013, 08:31 PM
Hmm... I wonder if there's any kinda Code that would say something like "If Target = Destroyed, Effect = False"? Or something like this...?

I'm still a Code Newbie...

radioonfire
04-11-2013, 05:49 PM
Hmm... I wonder if there's any kinda Code that would say something like "If Target = Destroyed, Effect = False"? Or something like this...?

I'm still a Code Newbie...

I like what you're thinking, the weird thing is that this doesn't automatically happen.
I've given up on the status effect, but I've run into a new problem. I am trying to add AOE damage to the end of a beam weapon. The following is my code:
BaseSkillMicrowave
{
Base BaseSkillOffense

Power 8.5

ReuseTime 0.75
ReuseTimeBasedOnAttackTime 1

MinDamage 2.0 // Beam=2.5
MaxDamage 4.0 // Beam=5.0
DamageType Poison

MaxRange 400.0

FullDamageRange 200.0
MaxRangeDamageMult 0.1

// AOE Controls

ProjDamageType Lightning

ProjMinDamage 3.0 // Bomb=4.0
ProjMaxDamage 5.0 // Bomb=8.0

CanMiss 1
}
In many ways, this works perfectly (which shows the flexibility of this modding framework, since there are no stock weapons that behave this way). The beam shoots the primary target with radiation damage, then the projectile damage (same way a bomb works except instead of a bomb it's the beam) does a bunch of EM damage.
The problem is the projectile explosion radius. With my new weapon, the explosion damage only affects the targeted ship (i.e., no AOE). In the bomb skill is this commented line:
// ProjRadius 115.0 // This is the value I want, but real value is in the projectile
That's fine; so I modified the bomb explosion projectile as follows:
BaseProjMicrowaveExplosion
{
Base BaseProj

ModelName Models/Projectiles/ballLightning.mdl

Speed 460.0
ProjectileType Ring
Life 0.25
StartsAtTarget 1

FullDamageRange 500.0
MaxRangeDamageMult 0.1

LightColor Blue
LightIntensity 30.0
}
The only range parm I saw was FullDamageRange, and as you can see I set it absurdly high for testing purposes. My question is what parm sets the range or radius?

Shadow
04-11-2013, 06:41 PM
Speed 460.0
ProjectileType Ring
Life 0.25

}
The only range parm I saw was FullDamageRange, and as you can see I set it absurdly high for testing purposes. My question is what parm sets the range or radius?

The radius of a ring type of projectile is basically speed * life, because the projectile will expand out from the center point at the specified speed for the specified length of time.

radioonfire
04-11-2013, 07:05 PM
The radius of a ring type of projectile is basically speed * life, because the projectile will expand out from the center point at the specified speed for the specified length of time.

This makes sense, but it should yield around 115 range. Is there a reason why changing the projectile from a StraightLob to Beam would cause the explosion to only affect the beam's target?

radioonfire
04-11-2013, 07:18 PM
Here is the newest version of the mod. Shadow, hopefully you'll have a chance to run it or else tell me what I'm doing wrong. I set the spawn rate really high and the explosion radius to around 300 to make it really easy to see what's happening (or not happening). Does the beam Life need to be set differently?

Tyrax Lightning
06-10-2013, 05:10 PM
My Utopian Character is still getting raped by large swarms of Monsters. I'm DLing this Mod to help with testing because Attack Stat users need some freaking AOE Damage, ASAP! O_0

Tuidjy
06-10-2013, 06:42 PM
My Utopian ship wipes huge swarms of monster ships by turning on the deadly aim active boost, and firing its shockwave.

The above does not use attack, but why should it? Attack would be better named if it were 'precision', and you do not need precision when you are firing at a horde.

Tyrax Lightning
06-11-2013, 01:26 AM
My Utopian ship wipes huge swarms of monster ships by turning on the deadly aim active boost, and firing its shockwave.

The above does not use attack, but why should it? Attack would be better named if it were 'precision', and you do not need precision when you are firing at a horde.
Equipping a Weapon that doesn't use Attack after all the trouble & Component Installation ya go through to raise your Attack Stat is bad synergy. It would be like having the Self Destruct equipped without an Escape Pod... some combos just don't work, ya can't afford to waste power or synergy even when ya are using the 8 Crew Points per Level Mod & the Balanced Command Mod. There's only 2 practical options in this game, Computers & +Attack Build with Aimed Weapons, & Computer-negligent build with non-Aimed Weapons. (Non-Aimed Weapons still have proper AOE options vs Aimed Weapons having none. :()

If Aimed Weapons can't have AOE, then auto-firing weapons to aid in the demolition might help even the playing field at least. :)

Edit: Oh crud, i'm getting my Mods crossed... I forgot this wasn't the Mod Thread about those Green Slot Auto-Firing Cannons. Still, a Aimed AOE Weapon is needed!

CoolColJ
08-17-2013, 05:07 AM
Chain lightning style weapon anyone? :)

Tyrax Lightning
08-17-2013, 01:35 PM
Chain lightning style weapon anyone? :)
This sounds like a win idea! Maybe it could be like a non-Aimed Weapon equivalent of the EM Pulse & Lightning Cannons! :D