You can ignore the first few lines, which look like the following
<?xml version="1.0" encoding="UTF-8"?>
<weaponsfile>
You should add new weapons to the end of the file only.
<missile
name="Friend or Foe"
mesh="friendfoe.mesh.bin"
range="6000"
damage="280"
image="dumbfire2d.png"
locktime="0"
tracking="true"
refire_delay="2000"
icon="ff2d.bmp">
<speeds
velocity="1800"
roll="3"
pitch="90"
yaw="90"
acceleration="2500"
/>
<armor
front="2"
rear="2"
left="2"
right="2" />
</missile>
name: This is the name that will appear in the cockpit
mesh: The name of the file containing the gun's mesh. You can use the mesh converter to import gun meshes from Prophecy. For more information, see the readme that comes with the mesh import tool.
range: The range is in game units, not the units you see from the cockpit. The range of a laser is approximately 200-300, to give you a ballpark idea.
damage: The amount of damage the gun does.
image: A 64x64 bitmap, with 24 bits/pixel, that is a 2d picture of the missile that will appear when the missile is targeted. You can leave this as the default dumbfire2d.bmp
locktime: The number of milliseconds it takes to obtain a lock on a target.
tracking: Set tracking to "true"
if the missile can track a target. If the missile is a dumbfire,
set tracking to "false".
refire_delay: The minimum time to wait before firing another missile. In milliseconds.
icon: An image that appears in the
cockpit when the player has selected this as the current missile.
velocity: Velocity
velocity: Acceleration
roll, pitch, yaw: The ability of a missile to turn.
front, rear, left, right: The amount of armor the missile has.
range: The range is in game units, not the units you see from the cockpit. The range of a laser is approximately 200-300, to give you a ballpark idea.
name: This is the name that will appear in the cockpit
mesh: The name of the file containing the gun's mesh. You can use the mesh converter to import gun meshes from Prophecy. For more information, see the readme that comes with the mesh import tool.
damage: The amount of damage the gun does.
refire_delay: The amount of time, in milliseconds, a player will have to wait before the same gun fires again.
energy: The amount of energy that the gun uses up when it gets fired.
sound: If you open up sounds.xml
in notepad, you will see an area listing the sounds for weapons.
It looks like the following.
<weaponsounds numsounds="2"> <sound name="laser.wav"/> <sound name="particle.wav"/> </weaponsounds> You can add more weapon sounds to sounds to sounds.xml by adding another sound line, and changing numsounds above to the number of sound entries. To pick one of these sounds for your weapon, the sound field is a index into weaponsounds. The index starts with 0. So to pick laser.wav for your weapon, do the following. sound="0" And to pick particle.wav, choose |
<?xml version="1.0" encoding="UTF-8" ?>
<shipfile name="wasp" image="wasp2d.png" mass="18000"
hitpoints="200">
<meshfile name="wasp.mesh.bin" />
<cockpit mesh="co_wasp.mesh.bin">
<point x="0" y="0" z="0" />
</cockpit>
<mounts number="9" decoys="36">
<mount>
<point x="-2" y="0"
z="2" />
<weapon number="1"
/>
</mount>
<mount>
<point x="2" y="0"
z="2" />
<weapon number="1"
/>
</mount>
<mount>
<point x="-2" y="0"
z="2" />
<weapon number="5"
/>
</mount>
<mount>
<point x="2" y="0"
z="2" />
<weapon number="5"
/>
</mount>
<mount>
<point x="-2" y="0"
z="2" />
<weapon number="16"
/>
</mount>
<mount>
<point x="2" y="0"
z="2" />
<weapon number="16"
/>
</mount>
<mount number_of_shots="4">
<point x="4.05002"
y="0" z="2" />
<weapon number="25"
/>
</mount>
<mount number_of_shots="6">
<point x="-4.05828"
y="0" z="2" />
<weapon number="12"
/>
</mount>
<mount number_of_shots="2">
<point x="4.05002"
y="0" z="2" />
<weapon number="11"
/>
</mount>
</mounts>
<thrusters number="2">
<thruster radius="0.35">
<point x="-2.2"
y="-0.12" z="-2.23" />
</thruster>
<thruster radius="0.35">
<point x="2.2"
y="-0.12" z="-2.23" />
</thruster>
</thrusters>
<shields front="260" left="230" right="230" rear="200"
regeneration_rate="22" />
<armor front="260" left="240" right="240" rear="220"
/>
<speeds roll="120" pitch="70" yaw="80"
angular_acceleration="190" velocity="480" acceleration="590" />
<afterburner velocity="1400" acceleration="1600"
fuel="360" />
<energy total="600" recharge_rate="60" />
</shipfile>
At this point, you should have already created a mesh. For
information on how to import meshes from Prophecy, please see the
readme
in the mesh converter. After the mesh conversion process, we have
obtained wasp.mesh.bin. You will also need the original mesh
file from prophecy, for example wasp.iff.
To try out a newly converted mesh, you only need to change 3 fields, at minimum
<shipfile name="Wasp"
image="wasp2d.bmp" mass="100">
<meshfile name="wasp.mesh.bin"/>
shipfile name: The name that will appear when you target this ship.
image: A 64x64 24-bit bmp file, which has a two dimensional picture of the ship. It can be created in mspaint, for example. This is optional, since you can use an existing image from another ship. However, taking the time to create a 2d image enhances the game.
meshfile name: The name of the newly
converted
mesh. Make sure to use the .mesh.bin extension.
mass: The mass of the ship. This
affects the collision response.
<shields front="260" left="230" right="230"
rear="200" regeneration_rate="22" />
<armor front="260" left="240" right="240" rear="220"
/>
<speeds roll="120" pitch="70" yaw="80"
angular_acceleration="190" velocity="480" acceleration="590" />
<afterburner velocity="1400" acceleration="1600"
fuel="360" />
<energy total="600" recharge_rate="60" />
shields (right, rear, left, front):
The amount of shields the ship has for each area.
shields (regeneration_rate): The amount of shields that are regenerated in each game turn.
armor (right, rear, left, front): The amount of armor the ship has for each area.
speeds (yaw, roll, pitch, angular acceleration): These influence the ability of the ship to turn on each axis.
speeds (velocity, acceleration): How fast the ship can move forward.
energy total: The total amount of energy available for firing guns.
energy recharge_rate: The amount of energy that is recharged per game turn.
All three of these editable sections use 3d coordinates.
Now that we have the 3d coordinates, we can start adding them to the
ship. First, we can change the cockpit location.
<cockpit mesh="co_wasp.mesh.bin">
<point x="0" y="0" z="0" />
</cockpit>
Also, using the mesh field within the cockpit tag, you can select the 3d cockpit struts mesh to use.
For the thrusters, we also need to specify how many thrusters there are, in addition to the locations.
<thrusters number="2">
<thruster radius="0.35">
<point x="-2.2"
y="-0.12" z="-2.23" />
</thruster>
<thruster radius="0.35">
<point x="2.2"
y="-0.12" z="-2.23" />
</thruster>
</thrusters>
If the thrusters appear too large or too small, you can change the
radius.
Note that x, y, and z may appear out of order in the ship.xml file, so
be sure to match x to x, y to y, and z to z.
For mounts, you specify the location, the weapon, and the number of
shots.
<mounts number="2">
<mount>
<point z="5.094" y=" -.833 "
x="0"/>
<weapon number="0"/>
</mount>
<mount number_of_shots="3">
<point z="5.094" y=" -.833 "
x="0"/>
<weapon number="5"/>
</mount>
</mounts>
mounts number: The number of mount entries that will follow.
weapon number: The index into weapons.xml, specifying which weapon will be located at this mount. The index starts at 0: If you specify 0, you will get the first weapon in weapons.xml, and if you put in 1, you will get the second weapon in weapons.xml.
number_of_shots: Use this to limit the number of shots. This is especially helpful for missiles. Above, we give the player 3 missiles.
<turret type="Gun Turret" mesh="midhtr.mesh.bin" damaged_mesh="" hit_points = "800" >
<turretlocation>
<point x = "-369.223" y = "-32.9294" z = "-263.404" />
<rotation matrix = "0 -1 0 1 0 0 0 0 1 " />
</turretlocation>
<barrel barrel_mesh="midtrhg.mesh.bin">
<point x = "0" y = "6" z = "0" />
<rotation matrix = "1 0 0 0 1 0 0 0 1 " />
</barrel>
<turretmounts>
<mount>
<point x = "-4.27085" y = "0" z = "12.9463" />
<weapon number = "43" />
</mount>
<mount>
<point x = "4.20305" y = "0" z = "12.9463" />
<weapon number = "43" />
</mount>
</turretmounts>
<jointconstraint>
<point x = "180" y = "180" z = "90" />
</jointconstraint>
</turret>
<turret type="Gun Turret" mesh="midhtr.mesh.bin" damaged_mesh="" hit_points = "800" >
<turretlocation>The rotation matrix describes the turret's orientation
<point x = "-369.223" y = "-32.9294" z = "-263.404" />
<rotation matrix = "0 -1 0 1 0 0 0 0 1 " />
</turretlocation>
<barrel barrel_mesh="midtrhg.mesh.bin">
<point x = "0" y = "6" z = "0" />
<rotation matrix = "1 0 0 0 1 0 0 0 1 " />
</barrel>
<mount>The weapon number can be any number in weapons.xml.
<point x = "4.20305" y = "0" z = "12.9463" />
<weapon number = "43" />
</mount>
<jointconstraint>
<point x = "180" y = "180" z = "90" />
</jointconstraint>
This says the turret can rotate 180 degrees around the x axis, 180 degrees around the y axis, and 90 degrees around z.