Stored in weapons.ddf. Lump is DDFWEAP. Names should be unique.
This file allows you to define weapons for the player to use.
COMMAND | TYPE | DESCRIPTION |
AMMOPERSHOT | [integer] | The number of ammo of type AMMOTYPE to decrease everytime the weapon is shot. Eg BFG is 40, Super Shotgun is 2, and everything else is 1. |
AMMOTYPE | [special] | The type of ammo this weapon uses. Valid values are NOAMMO, BULLETS, SHELLS, ROCKETS and CELLS. |
CLIPSIZE | [integer] | The number of shots that a weapon will fire before going into its reloadstate. Tracks shots fired from individual weapons. Weapon must have reload states for this to work. |
AUTOMATIC | [boolean] | TRUE = Weapon is fully automatic. FALSE = Weapon is semi automatic. If you want a weapon to be semi-automatic, you must check it doesn't have the REFIRE action in it's attack states. Use SHOOT instead. |
SEC_AMMOPERSHOT | [integer] | Like AMMOPERSHOT but for the secondary attack. |
SEC_AMMOTYPE | [special] | Like AMMOTYPE but for the secondary attack. |
SEC_CLIPSIZE | [integer] | Like CLIPSIZE but for the secondary attack. |
SEC_AUTOMATIC | [boolean] | Like AUTOMATIC but for the secondary attack. |
FREE | [boolean] | TRUE = Player starts with this weapon. (E.g punch, pistol) |
FORCE_AIM | [boolean] | Only required with closecombat weapons. Set to TRUE to make closecombat attacks work (fixes bug with chainsaw/punch) |
ATTACK | [attack] | Attack type to use when player pulls the trigger. (Must refer to a valid entry in attacks.ddf) |
SECOND_ATTACK | [attack] | Attack type to use for the weapon's secondary attack. |
EJECT_ATTACK | [attack] | Attack type to use for ejecting shells. Used by the EJECT action. |
BINDKEY | [integer] | The key this weapon binds to. Valid values are 0 - 9. Any number of weapons can bind to a single key, so it is recommended you group them accordingly, e.g key 1 for close combat weapons, key 5 for missile/grenade weapons etc. Note only the normal six weapon lights will be shown in the status bar. |
PRIORITY | [integer] | This is used for selecting another weapon when the current weapon runs out of ammo. When a weapon runs out of ammo, the highest priority weapon with enough ammo to shoot will be selected. (-1 means that you will need to manually select the weapon) |
UPGRADES | [special] | A previously declared weapon name that this weapon should replace. E.g a silencer for a pistol, or homing rocket for the rocket launcher. |
IDLE_SOUND | [sound] | Sound played while the weapon is idle. See chainsaw. |
ENGAGED_SOUND | [sound] | Sound played when trigger is pulled, but target missed. |
HIT_SOUND | [sound] | Sound played when the trigger is pulled and a target is found. |
START_SOUND | [sound] | Sound played when the weapon is selected. |
SOUND1 SOUND2 SOUND3 | [sound] | Miscellaneous sounds played by the SOUND# actions. |
NOTHRUST | [boolean] | Targets will not be pushed away by a hit from this weapon. See chainsaw. |
FEEDBACK | [boolean] | Player will be thrown around by this weapon. See chainsaw. |
KICK | [float] | Amount the player receives as kick from the weapon, making the weapon aim and view `jiggle'. Values between 0 and 0.2 are best.Works well on weapons like the shotgun, or auto bullet weapons (i.e chaingun). |
ZOOM_FOV | [float] | When this is used, the weapon has a zoom capability. The value is the FOV angle, for example 10. Should be used in conjunction with the levels.ddf special LIMIT_ZOOM, which prevents zooming unless the player is holding a weapon with zoom capability. |
STATES(UP) | [state] | The states to use when this weapon is selected. |
STATES(DOWN) | [state] | The states to use when this weapon is deselected. (Usually, but not necessarily the same as the upstate) |
STATES(READY) | [state] | The normal state for a weapon, when it is ready to be fired. |
STATES(ATTACK) | [state] | The state to use when the trigger is pulled. |
STATES(RELOAD) | [state] | State for reloading weapon. (See shotgun) |
STATES(FLASH) | [state] | Miscellaneous state for use of muzzle flashes etc... |
STATES(CROSSHAIR) | [state] | Used to create custom crosshairs, can be static or animated. |
STATES(SECATTACK) | [state] | State for when user triggers secondary attack. |
STATES(SECRELOAD) | [state] | Like STATES(RELOAD), but for the secondary attack. |
STATES(SECFLASH) | [state] | Like STATES(FLASH), but for the secondary attack. |
Actions that can be used in weapon states:
ACTION | DESCRIPTION |
RAISE | Raises the player's weapon sprite onto the screen when selecting a new weapon. |
LOWER | Lowers the player's weapon sprite off the screen when selecting a new weapon or dead. |
READY | Checks for trigger pulled, and enters the ATTACK states if it is (or SECATTACK states for the secondary attack key). |
SHOOT | Starts attack associated with weapon. If the FLASH action hasn't been called, starts the flash state. The SHOOT action uses the weapon's default attack, but a valid attack can be placed in brackets after the statement, for example: SHOOT(GRENADE). |
REFIRE | Checks whether the player has stopped firing. If yes, then the weapon returns to the READY states. If not, the weapon goes back to the ATTACK states. Only needed for automatic weapons. |
NOFIRE | When using more than one attack per weapon, the firing sequence is reset once the player stops firing. e.g the quake super nailgun. |
NOFIRE_RETURN | When using more than one attack per weapon, this will 'remember' the firing sequence. |
CHECKRELOAD | Checks whether the player has used up the clip quantity of ammo. If yes, then force a reload by jumping into the RELOAD states. |
EJECT | Like weapon_shoot, but without any kick, flash or change in player state, and without using any ammo. Used to create ejecting shells from weapons. Used like EJECT (attack_name). |
KICK | Causes the kick effect. The kick amount should be placed in brackets, for example: KICK(0.05). |
SOUND1 SOUND2 SOUND3 | Plays a previously defined sound. |
LIGHT0 | Sets light around player to normal. |
LIGHT1 | Sets light around player to bright. |
LIGHT2 | Sets light around player to brightest. |
SEC_SHOOT | Same as SHOOT, but used for the secondary attack. |
SEC_REFIRE | Same as REFIRE, but used for the secondary attack. |
SEC_NOFIRE | Same as NOFIRE, but used for the secondary attack. |
SEC_CHECKRELOAD | Same as CHECKRELOAD, but used for the secondary attack. |
SPECIAL | DESCRIPTION |
SILENT_TO_MONSTERS | Monsters cannot hear this attack. Used for punch or other weapon you'd like to silence. |
Example:
[FIST]
[SUPERSHOTGUN]
STATES(ATTACK)=
STATES(RELOAD)=
STATES(FLASH)= |
back to top
DDF docs written by Andy Baker and Ziggy Gnarly, with updates by Andrew Apted.
Site design by Fanatic (with graphics and modifications by Ziggy Gnarly). Problems with the docs, errors and comments should be directed to the EDGE team.
© EDGE Team 1998, 1999, 2000.