Custom Weapons  Ship Gam [BACK] [ MAIN]
 
Now that we know how to control the weapon we need to see how to control it's actual firing from the ship.  The ship's .gam file is where we choose which gunpoint it fires from, how fast it the firing repeats, maximum payload, etc..

Ship's weapon setups are similar to robot weapon setups.  One BIG difference, though, is ships only use one battery so everything is specified at the Weapon entry.

Since a good part of the discussion involves reference to the gunpoints I threw in these diagrams of the Pyro. 
Each weapon used by the ship is listed under Weapons.  Weapons 0-4 are the first five primaries, 5-9 are their second selection (2= Vauss, 6= Mass Driver).  10-14, 15-19 are the secondaries, 20 isn't used.  CounterMeasures are scripted.
As you can see not all weapons use "Fire Sound".  Most use Gunpoint Sound causing the sound to come from a gunpoint upon firing (usually only one, even if firing from multiple points). Fire and Release Sound is used for effects such as the charge and release of Fusion or the Lock and Release sound of  a Mass Driver.

Firing Flags: Open set for "Fusion Style" effect "Zoom" effect (Mass Drive).  Also to set ammo usage to 10ths.
Spew powerup:  the powerup that spews when player is destroyed.
Max Ammo: Maximum payload (see Vauss, Mass Driver, any missile)
(inside Weapon Battery)
Energy Usage: The Drain of using an Energy Weapon.
Ammo Usage: Rounds such as Vauss and Mass Driver
Gunpoint weapons: Open to assign a weapon, by index number,  to fire from a gunpoint. This only makes it "available" to fire.  Note! Wolf On Air has pointed out that this may be an obsolete field that does not require being set,  TEST IT!
Firing Info: Where the actual firing is set up (See opened Firing Info)
Number Masks: Think of masks as Volleys. This sets how many Volleys the firing sequence loops through before repeating the sequence.
Aiming Flag, dot, distance, XZ dot.   don't know  ;) 
Flags (see opened Flags)
Fire From (Quad fire): open to set which points to fire from if QuadLaser is picked up.  Only effects Weapon[0] unless you do some heavy scripting. 
Gunpoint Sounds: Open to set a sound to be played when a weapon is fired from a particular gunpoint.  If the same weapon is being shot from 2 points at once, only assign a sound to 1 of those points,
Weapon Slots:  Open to assign a weapon, by name, to a gunpoint.  This only makes it "available" to fire.  NECESSARY!

This is the where you set up the release for 1 mask or volley.  For every mask, you must set up a 'Firing Info'. 

To the left are the 2 Firing Info's used when firing the Vauss. 

Fire From:  Open to assign which gunpoint to fire from during That Particular Volley.
Wait Time: The amount of time until the next volley is fired.  If it's the last volley (or 'mask'), it's the amount of until repeating the sequence.  This also prevents the weapon from being fired gain until the time expires (ex.  Mass Driver)

Animations- info for animating the ship.  the animation time starts upon the firing of that volley.  I haven't confirmed that it works.  I HAVE CONFIRMED. That Animation fire frame (at which point of the animation the weapon is fired) does NOT work in ships (does work for robots).  No matter what you do (unless you can do a MOD) it will ALWAYS fire from Frame#1, even if frame 1 is not among the animation frames.

By looking at the Vauss's  Fire Info's we see that it will fire from GP #2, wait .10 secs, fire from GP #1, wait .10 secs, then repeat.

This is how the Black Pyro has it's Plasma fired in 'bursts'.  It uses 8 masks with a shorter wait time the standard Pyro.  The last mask has it's wait time set considerably longer.  This causes it to shoot 8 fast volleys, pause, shoot 8 fast volleys again.

I haven't test this area of the battery but by looking into the Napalm thrower and Omega you can get an idea of what is going on.  Most non-animated weapons don't use these flags except, of course, the Guided Missiles.


I hope this section has given you a good foundation for you to start building you own custom weapons.  There's more
you can do with heavy duty scripting but that's something I doubt I'll evr have time to explore.

Good Luck.

[BACK]  [ MAIN]