HowTo:Make Weapons
MOD | HowTos | Add Upgrades |
Contents
Adding weapons to the weapon list
Weapon descriptons are stored in the weapon_list.xml in the data directory.
Weapons are classified as FIXME DIFFERENCES BETWEEN CATEGORIES
- Beam
- Bolt
- Ball
- Missile
Weapon XML Schema
FIXME ADD DESCRIPTIONS TO SCHEMA
Beam
<beam ... >
-
name
-
mountsize
-
-
<Energy ... />
-
rate
- Energy requirement/second, in units of 100s of MJ -
stability
- Maximum continuous firing duration -
refire
- Rest time, in seconds, between firing -
locktime
- N/A for beams
-
-
<Damage ... />
-
rate
- Damage output/second, in units of 5.4 MJ -
phasedamage
- Damage/second, in units of 5.4 MJ that ignores shields -
longrange
- Fraction of damage applied at max range
-
-
<Distance ... />
-
speed
- Speed at which beam travels linearly through space, in meters/second (usually rather fast) -
radialspeed
- Speed at which beam reaches full radius, and full damage, in meters/second -
radius
- Beam radius, in meters -
length
- N/A for beams -
pulsespeed
- Controls visual wave effect in beam -
range
- Max damaging range, in meters -
detonationrange
- N/A for beams -
volume
- N/A for beams
-
-
<Appearance ... />
-
file
-
soundwav
-
r
-
g
-
b
-
a
-
Bolt
Ball
Missile
Weapon AI's
Example 1: Beam Weapon
<Beam name="LR_PminusBeamMKIV" mountsize="capship-massive"> <Energy rate="1500" stability="8" refire="2" /> <Damage rate="15000" longrange=".8" /> <Distance speed="300000" radialspeed="60" radius="60" length="8" pulsespeed="36" range="150000" /> <Appearance file="weapons/heavylaserbeam.png" soundwav="beam1.wav" r=".6" g=".1" b=".8" a=".6" /> </Beam>
Example 2: Spinning Weapon
You can make it spin as well by making it an accessory of the missle/weapon:
- You make it a subunit (turret) at the center, which has the word
accessory
in its name (e.g call it torpedo_accessory) - Set the
max_yaw
,max_pitch
, andmax_roll
to whatever you want it to spin at. - Make an invisible (or e.g torpedo casing) main body.
Creating a weapon upgrade
prestidigitator documented his steps to create new weapons in a forum post. Here it is:
You will need to create an upgrade file for this weapon that appears in master_parts_list.csv as well as units.csv.
Here is what I have done:
- weapon_list.xml: Copied the entire <Beam name="LaserBeam' ...> node to the end of the file (just before the </WEAPONS> end tag), changed the name from "LaserBeam" to "MyLaserBeam", and modified the values to be what I wanted (I left the "mountsize" attribute as "light").
- master_part_list.csv: Copied the line starting with "laser_beam" to the end of the file and changed "laser_beam" to "my_laser_beam".
- units/units.csv: Copied the line starting with "laser_beam__upgrades" to the end of the file, changed "laser_beam__upgrades" to "my_laser_beam__upgrades", changed "./factions/upgrades/laser_beam" to "./factions/upgrades/my_laser_beam", changed the second "laser_beam" to "my_laser_beam", and finally changed the "LaserBeam" to "MyLaserBeam".
- units/factions/upgrades/: Copied the "laser_beam/laser_beam" file to "my_laser_beam/my_laser_beam" and changed the "weapon" attribute of the <mount> node from "LaserBeam" to "MyLaserBeam".
There's an ordering problem. I moved all the additions to immediately after those entries for the laser beam, and it worked.
So, I guess if you are trying to do this, consider my steps above to be a mini-HowTo, with the caveat that you should be careful about WHERE in the files you add things.
See also
MOD | HowTos | Add Upgrades |