-
Notifications
You must be signed in to change notification settings - Fork 13
DDF Attacks
Attacks are stored in the DDFATK data lump, or attacks.ddf.
DDFATK allows you to define and modify all weapon and creature attacks in EDGE, as well as using them for ejecting shell cases, or spawning gibs. Each entry consists of a unique name, enclosed in square brackets, plus a series of commands that specify the type and characteristics of the attack.
The attack name should be descriptive of what it does and/or who uses it, and is referred to in the DDFWEAP/weapons.ddf and DDFTHING/things.ddf files.
There are three general types of attacks: melee attacks (e.g punch, beserk, chainsaw), bullet attacks (e.g chaingun, pistol etc) and projectile attacks (plasma, bfg, rockets, many monster attacks). There are some unique attacks too, which are normally associated with specific monsters (e.g archvile flames, lost souls, mancubus attacks). Anyway, if you want to create the world's coolest flamethrower, this is the place to start!
The commands used for attack entries are as follows:
COMMAND | TYPE | DESCRIPTION |
---|---|---|
ACCURACY_ANGLE | [float] | How accurate the attack is across the horizontal plane. The value is an angle. |
ACCURACY_SLOPE | [float] | How accurate the attack is over the vertical plane. The value is an angle. |
ACTIVE_SOUND | [sound] | The sound to make while a projectile is in flight. |
ANGLE_OFFSET | [integer] | Angles an attack in the horizontal plane. +ve values send the attack right, while -ve values send it left. E.g a value of 45 will make your attack fly off 45 degrees to your right hand side. |
ASSAULT_SPEED | [integer] | Used for [SKULLFLY](#skullfly) attacks -- the speed at which the skull will fly. |
ATTACK_CLASS | [bitset] | Give an attack a certain class. Only useful in conjunction with IMMUNITY_CLASS in Things.ddf There are 26 possible classes, A thru Z. Three are reserved: `M' is the default for missile attacks, `B' is the default ATTACK_CLASS for bullet/shot attacks, and `C' is the default for close-combat attacks. Examples: ATTACK_CLASS=U; or ATTACK_CLASS=UV; |
ATTACK_HEIGHT | [float] | How high above the attacking creature the attack is. If it is 0, the attack will come from the creature's foot, so it is generally a good idea to make it bigger. Most DOOM creatures have this set at 32. |
ATTACK_SPECIAL | flags(#attackspec) | Flags for this attack. |
ATTACKRANGE | [integer] | The target must be inside this fixed range, or the attacking creature won't bother shooting, but will attempt to get closer. In player weapon attacks, this is used for autoaim purposes. (removing this value will permanently disable autoaim on that weapon) Close attacks must have an ATTACKRANGE to work properly. Make sure the attack range is greater than the creature's radius. |
ATTACKTYPE | special(#attacktypes) | The type of attack this is, eg close combat, projectile etc |
ATTEMPT_SOUND | [sound] | The sound to make just an attack is launched. |
BERSERK_MULTIPLY | [float] | How much this attack is improved by picking up a Berserk pack. |
BOUNCE_SPEED | [float] | Value which sets how much a projectile will bounce off walls. 1 never loses speed, 0 completely stops, 0.5 loses 50% speed each time it bounces. |
DAMAGE.DEATH_STATE | [STATE] | The custom states to be used (defined in things.ddf) when this attack causes the death of a creature. Ideal for having a flamethrower attack which sets the monster on fire! Example of use: In the attack you have DAMAGE.DEATH_STATE=BURNKILL and in your monsters DDF entry you create a STATES(BURNKILL)=... with some burning monster's sprites. |
DAMAGE.ERROR | [float] | When combined with the DAMAGE.VAL command this forces the attack damage to be calculated on a weighted average basis in the range from (DAMAGE.VAL - DAMAGE.ERROR) to (DAMAGE.VAL + DAMAGE.ERROR). The value for DAMAGE.ERROR should be less than the value for DAMAGE.VAL otherwise this won't work properly. |
DAMAGE.MAX | [float] | When combined with the DAMAGE.VAL command this forces the attack damage to be calculated in the range from DAMAGE.VAL to DAMAGE.MAX. The value for DAMAGE.MAX should be more than the value for DAMAGE.VAL otherwise this won't work. |
DAMAGE.OBITUARY | [lang] | Message shown when the player is killed by this attack. The message can contain the following conversions:
%o : the player's name %k : the monster or opponent which killed the player i.e. the language.ddf entry could be OB_Chaingun = "%o was torn apart by %k."; |
DAMAGE.OVERKILL_STATE | [STATE] | The custom states to be used (defined in things.ddf) when this attack causes overkill to a creature. |
DAMAGE.PAIN_STATE | [STATE] | The custom states to be used (defined in things.ddf) when this attack causes pain to a creature. |
DAMAGE.VAL | [float] | On its own, this command sets a fixed amount of damage done by the attack. It can also be combined with either the DAMAGE.MAX or DAMAGE.ERROR commands to allow a range of possible damage values. |
DAMAGE.DAMAGE_IF_BENEFIT | [benefit] | A list of benefits (separated by commas): Player will take damage if they have at least one of these benefits. See below for benefit format. |
DAMAGE.DAMAGE_UNLESS_BENEFIT | [benefit] | A list of benefits (separated by commas): Player will take damage unless they have at least one of these benefits. See below for benefit format. |
DAMAGE.FLASH_COLOUR | [colourmap] | Allows a custom color to be used as the pain effect when a player is hit by this damage type i.e. to emulate effects like Hexen's cold/poison damage. |
DEATH_SOUND | [sound] | The sound played when the projectile explodes. |
DLIGHT.COLOUR | [special] | This value is the colour to use for any dynamic lighting associated with the projectile. It's value takes the form of three pairs of digits in hexadecimal E.g. #RRGGBB to specify the proportion of each of the three colours in the mix. So for example #FF0000 would be pure red, #990000 would be a darker red and #FFFFFF would be a bright white. Experimentation is probably the best way to find the colour you want. |
DLIGHT.LEAKY | [boolean] | Normally a light will not affect a surface that is facing away from the light. Setting this to TRUE causes the light to affect all surfaces. |
DLIGHT.RADIUS | [float] | This value is the starting furthest distance that a light can reach (every wall and thing beyond that distance is unaffected by it) of the object. This can be modified as the object changes, using the [DLIGHT](#dlight) SET and FADE actions. |
DLIGHT.INTENSITY | [float] | This value is the starting dynamic light intensity of the projectile. This can be modified as the projectile moves using the [DLIGHT](#dlight) SET and FADE actions. **Deprecated**: use DLIGHT.RADIUS instead. |
DLIGHT.TYPE | [special] | This value is the type of dynamic lighting to use for the projectile. Possible values are: MODULATE (light is multiplied with the wall texture), ADD (adds the light to the texture). Note: old QUADRATIC and LINEAR types have been deprecated. |
DUALATTACK1 | [attack] | Attack number 1 to use for an attack of type DUALATTACK. A dual attack can execute other dual attacks, but cannot reference itself |
DUALATTACK2 | [attack] | Attack number 2 to use for an attack of type DUALATTACK. A dual attack can execute other dual attacks, but cannot reference itself |
ENGAGED_SOUND | [sound] | The sound to make when attacking. |
EXPLODE_DAMAGE.ERROR | [float] | Same as DAMAGE.ERROR, except for explosion damage rather than ordinary attack damage.. |
EXPLODE_DAMAGE.MAX | [float] | Same as DAMAGE.MAX, except for explosion damage rather than ordinary attack damage.. |
EXPLODE_DAMAGE.VAL | [float] | Same as DAMAGE.VAL, except for explosion damage rather than ordinary attack damage.. |
EXPLODE_RADIUS | [float] | Normally the explosion radius is the same as the damage caused, but this command forces the explosion radius to a particular value (e.g. 200). The amount of damage is not affected. |
FAST | [float] | The attack speed will be multiplied by this value in nightmare mode or when using -fastparm from the command line. Therefore, if speed=2, this will make that attack twice as fast as normal if you play in nightmare mode. |
FUSE | [time] | For projectile weapons only. Projectiles will explode on contact with an object, or after the fuse time has elapsed. Hence, can be used to limit the distance projectiles can travel. The time can be specified in seconds or tics (e.g to make the projectile explode after two seconds, set this value to 2 or 70T). |
HEIGHT | [float] | The height of the projectile. |
KEEP_FIRING_CHANCE | [percentage] | Specifies the chance that a creature using this attack will keep firing as opposed to finding a better spot/moving etc. |
LAUNCH_SOUND | [sound] | The sound to play when the projectile is launched. |
LIFESPAN | [time] | Another word for FUSE (see above). |
MASS | [float] | How heavy this projectile is. (e.g heavy objects won't be shoved around or tossed into the air by explosions. Used primarily for boss brain spawn cube projectiles. |
MODEL_ASPECT | [float] | Change the models width and length, therefore making it fatter/skinnier. 0.5 would be half width(skinny), 2.0 would be double width(fatter) |
MODEL_BIAS | [float] | Move model up or down. Negative numbers move the model lower on-screen, postive numbers move it up. |
MODEL_FORWARD | [float] | Move the model forward/backward |
MODEL_SIDE | [float] | Move the model left or right on screen. Negative numbers move it more left, Positive numbers move it more to the right. |
MODEL_SKIN | [integer] | Up to nine skins can currently be used (1 to 9). Skins must be defined in DDFImages |
NO_TRACE_CHANCE | [percentage] | Specifies the chance that a homing missile will lock onto target. 0% is lock every time, 100% is fail every time. |
[PROJECTILE_SPECIAL](#projspec) | [flags] | Flags that should be added to a missile. |
PUFF | [special] | The name of an animation to play when a bullet weapon strikes a wall. (this must be defined in things.ddf) Hence, different puff animations can be created for different weapons. If you set a rocket or other projectile as `smoking', the puff animation is used as a smoke trail. |
RADIUS | [float] | The radius of the projectile. |
REACTIONTIME | [time] | ??? Used for boss brain spawn cube attack in DDF 3.7. |
SHOTCOUNT | [integer] | Determines the actual number of bullets fired when you use a bullet weapons. For instance, the shotguns use a high shotcount value. Note, this value does **not** effect how much ammo each weapon uses. |
SLOPE_OFFSET | [integer] | Changes vertical angle of attack (up or down). Good for giving grenades a realistic arc. |
SPARE_ATTACK | [attack] | Default attack to use when the SPARE_ATTACK action is called from the STATES. |
SPAWN_OBJECT_STATE | special(#spawn) | Sets the state that the spawned object will be spawned in (e.g chase, spawn or attack state) |
SPAWNED_OBJECT | special(#spawn) | Object that is generated by a spawn attack. Must be the name of an object defined in things.ddf |
SPAWNHEALTH | [float] | The amount of health this object begins with. Used for boss brain spawn cube. |
SPEED | [float] | How fast the spawned object moves. Values from 0 to 100 will work. Most doom projectile attacks are of a speed between 20-30\. High values can make projectiles behave strangely. |
SPRITE_ASPECT | [float] | Alters the aspect ratio of the projectiles graphic by affecting the horizontal image size. Values beween 0 and 1 make the object look narrower, whereas values above 1 make it look fatter. |
SPRITE_SCALE | [float] | Alters the size of the projectiles graphic. Values beween 0 and 1 make the object look smaller, whereas values above 1 make it look bigger. Much bigger! |
STEP_SIZE | [float] | Maximum height of wall/step that this thing can get over. Used for bouncing projectiles |
TEMPLATE | [existing DDF entry] | This allows a new DDF entry to be based off an existing one. Inheritance for DDF basically. |
TOO_CLOSE_RANGE | [integer] | The attacking creature won't use this attack if the target is inside this range. Used if this is a ranged attack and the creature should close for a close combat attack. |
TRACE_ANGLE | [float] | Specifies how sharply a homing missile can turn while following a target. The value is an angle. |
TRANSLUCENCY | [percentage] | Specifies how translucent the missile is.. 100% is invisible, whereas 0% is completely solid. |
X_OFFSET | [integer] | Normally attacks are spawned from the centre of the attacking creature. Positive values shift the attack to the right, negative to the left. If you set the offset too wide for player attacks, projectiles and/or shots can be absorbed by nearby walls, objects etc. |
Y_OFFSET | [integer] | Similar to X_OFFSET, but moves an attack forwards or backwards relative to the target. Positive is forwards, negative is backwards. |
Sprite | The four letter name of the sprite to use. |
Frame | The frame reference, A-Z, '[', '\', ']' If you need more than this, use another sprite. |
Tics | Number of tics to spend on this frame. -1 means the frame should last forever. |
Bright | Can be 'BRIGHT', 'NORMAL' or 'LIT00-99'. Bright frames are always drawn full brightness. LIT00-LIT99: This allows fine-grained control of dynamic lights. LIT00 is the same as 'NORMAL', LIT99 is the same as 'BRIGHT'. |
Action | Action to be carried out. [Actions](#actions) are listed below. |
The following are predefined state names that have specific purposes:
STATE NAME | SPECIAL USE |
---|---|
SPAWN | Animation to play when projectile is spawned. |
IDLE | Frames to play when projectile is in air. |
BOUNCE | States that a projectile enters when bouncing. |
DEATH | Frames to play when a projectile explodes/dies. |
Note that states can have a single rotation (like the plasma shots that look identical from any angle) or multiple rotations (e.g rocket in flight).
In DDF, player and monster attacks are completely interchangeable. You could make a Baron of Hell fire BFG blasts, the cyberdemon fire a stream of plasma, and give yourself a homing rocket launcher to fight back with. However, you cannot create new attack types, you can only pick from the list of attack types below.
TYPE | DESCRIPTION |
---|---|
CLOSECOMBAT | Any close combat attack, like the demon's bite, the baron's scratch, or the chainsaw. |
DUALATTACK | Can execute two independent attack definitions with a single action. DUALATTACK1/2 must both be present, even if referring to the same attack. |
FIXED_SPREADER | Launches missiles in an ordered way like the Mancubus. |
PSYCHIC | Instant ranged direct damage attack. Will not cause infighting. |
PROJECTILE | Launch a single missile at the target. e.g. Rockets, Imp Fireballs. |
RANDOM_SPREADER | Launches a spread of missiles in a random pattern |
SHOOTTOSPOT | Used for Spawn Cubes (used in Doom2, map30 to regularly spawn random monsters). |
SHOT | Fires a bullet weapon. e.g. pistol, shotgun, chaingun. |
[SKULLFLY](#skullfly) | For an object that launches itself at the target. |
SMARTPROJECTILE | Launch a missile at the target on an intercept course based on the target's current speed and direction. (Makes circle strafing a dangerous sport! Don't try this with a cyberdemon unless you like outrageous pain!). |
[SPAWNER](#spawn) | Launch a creature at the target. e.g. Pain Elementals |
SPRAY | Instantly do damage to every monster in sight. e.g. the BFG. |
TRACKER | Remote attack which tracks it's target. e.g. arch-vile. |
DOUBLE_SPAWNER | Launches two creatures of the same type. e.g. D64 Pain Elemental death. |
TRIPLE_SPAWNER | Launches three creatures of the same type. e.g. Pain Elemental death. |
These are flags that are used to modify an attack in some way.
You can combine one or more terms such as
ATTACK_SPECIAL=NEED_SIGHT,FACE_TARGET;
SPECIAL | DESCRIPTION |
---|---|
ANGLED_SPAWN | Causes a spawner attack to have the initial angle, slope and moving speed of the spawner object. |
FACE_TARGET | The attacker will be turned to face its target. |
FORCE_AIM | The attacker will automatically aim at it's target. |
KILL_FAILED_SPAWN | For SPAWNER attack types, if the spawned object doesn't fit it will be killed. Use this for rockets, so that when players shoot directly into a wall, the rocket explodes and does the damage the player deserves. |
NEED_SIGHT | The attack will only take place if the attacker can see it's target. |
NOTARGET | The attack will NOT auto-aim. For object spawners (like the Pain Elemental), the spawned things won't automatically hate the player (or whatever their parent has a grudge against) |
NO_TRIGGER_LINES | This attack will not trigger any special linedef types it passes or strikes. |
PLAYER_ATTACK | The attack behaves as if originating from the player, even if it's an indirect secondary attack: this ensures the player gets his VAMPIRE health and KillBenefits. |
PRESTEP_SPAWN | Moves a SPAWNED object slightly forward so it is not spawned on top of it's master. |
REMOVE_FAILED_SPAWN | For SPAWNER attacktypes, if the spawned object doesn't fit it will be removed. This is the default. |
SILENT_TO_MONSTERS | Monsters cannot hear this attack. Used for punch or other weapon you'd like to silence |
SMOKING_TRACER | Homing missile with a line of smoke behind it. |
VAMPIRE | Causes the inflictor of damage to gain the health from the damage done to the victim. The health/damage ratio is hard-coded as 25% for monsters and 50% for players |
Used in a very similar way to ATTACK_SPECIAL.
For example PROJECTILE_SPECIAL=MISSILE, DROPOFF, NOBLOCKMAP;
SPECIAL | DESCRIPTION |
---|---|
BARE_MISSILE | Identifies the projectile as a missile. |
BOSSMAN | Identifies the projectile as a bossman (e.g. boss brain spawn cube). Explosions do little damage and there is no volume change. |
BOUNCE | Object will bounce off walls and ceilings/floors, and enters BOUNCE states too. |
CROSSLINES | Allows the projectile to travel over any line in a map. Main use is for spawner attacks, so the spawned monsters can cross lines marked 'blockmonster' in a map editor. |
DROPOFF | Missiles can travel over cliffs (a cliff is any part of a map where sector height varies by 32 units or so). Always specify this. |
MISSILE | Combination of MISSILE + CROSSLINES + NOFRICTION. |
NOBLOCKMAP | Allows projectiles to cross lines in a map (important!). |
NOCLIP | Allows object to go through solid walls. |
NOFRICTION | Projectile is never slowed down by air or ground friction. |
NOGRAVITY | This means that projectiles are unaffected by gravity (e.g rockets don't drop). Remove this setting from rocket attacks to make yourself an instant grenade |
NOSHADOW | Projectile does not cast a shadow. |
PRESERVE_MOMENTUM | Will add the x/y/z momentum of the projectile attack source to the newly created projectile. For slow projectiles from fast moving shooters, so they aren't outrun by the shooter. |
SLIDER | Will make projectile slide when it hits a wall. |
TILT | Only for MD2 models: will be vertically tilted (using the mlook angle) |
TUNNEL | Missile can tunnel through enemies. Causes missiles to pass through enemies rather than blowing up on impact. Still damaging them though, but only once and then keep on going. Handy for a railgun. |
WATERWALKER | Projectile will not pass through liquid extrafloors. |
The following actions can be used in the attacks.ddf STATES:
ACTION | DESCRIPTION |
---|---|
BOUNCE_REARM | Ready projectile to bounce again |
CUBE_SPAWN | Spawn boss brain cub projectile |
CUBE_TRACER | Track boss brain cube to spawn spot |
DIE | Mainly for Bex compatibility |
DLIGHT_FADE | Fade dynamic lighting to specified value. Used like DLIGHT_FADE(500). |
DLIGHT_SET | Set dynamic lighting to specified value. Used like DLIGHT_SET(1000). |
DROPITEM | Causes the attack to drop the a specified item. The dropped item is non-solid (but may be pick-up-able), and is dropped a random distance away from the attack (so multiple drops don't all land on the exact same spot). The name must be given in brackets, e.g. DROPITEM(CLIP) |
EXPLOSIONDAMAGE | Makes projectile explode and deals appropriate damage. |
JUMP | Used like JUMP(IDLE:7,20%) and gives an % chance that the animation will skip to the listed frame of the specified state. Useful for adding randomness to a projectiles animation |
KILLSOUND | Stop sounds associated with the projectile. |
MAKEACTIVESOUND | Plays the projectiles active sound |
MOVE_DOWN | Causes this object to move down by the amount specified in brackets. |
MOVE_FWD | Causes this object to move forward by the amount specified in brackets. Use a negative value to move backwards. |
MOVE_RIGHT | Causes this object to move right by the amount specified in brackets. Use a negative value to move left. |
MOVE_UP | Causes this object to move up by the amount specified in brackets. Used like MOVE_UP(6) |
NOTHING | Does nothing. This is the action to use if a frame has no other action. |
PLAYSOUND | Used like PLAYSOUND(EXPLD) to play the specified sound. |
RANDOM_TRACER | IF this is a tracer projectile, this action will randomly lock the projectile onto a target. |
SET_SKIN | Dynamically change the current skin to a different one. The skin number must be given in brackets e.g. SET_SKIN(2) |
SMOKING | Makes the projectile trail smoke. |
SPARE_ATTACK | This action launches an additional attack. Used like SPARE_ATTACK(SPAWN_GIBS) to call the specified attack in attacks.ddf file. |
SPAWN | Similar to DROPITEM action, but it doesn't force the object to be non-SOLID like DROPITEM does, plus the spawned object will have the same Angle and Side as the parent object. The name must be given in brackets, e.g. SPAWN(IMP) |
TRACER | If this is a tracer projectile, this action will keep the projectile locked onto it's target. |
TRACKERACTIVE | Follow target's movement and play sound????? |
TRACKERFOLLOW | Follow target's movement with tracker attack |
TRACKERSTART | Start tracker attack and follow target's movement. |
TRANS_ALTERNATE | Used like TRANS_ALTERNATE(10%) and causes the object to alternate between visible and invisible at the rate specified. |
TRANS_FADE | Used like TRANS_FADE(10%) to fade the transparency of the object to the specified amount. |
TRANS_LESS | Used like TRANS_LESS(10%) to make the object less transparent by the specified amount. |
TRANS_MORE | Used like TRANS_MORE(10%) to make the object more transparent by the specified amount. |
TRANS_SET | Used like TRANS_SET(10%) to set the object transparency to the specified amount. |
The following are examples of complete attack entries:
[PLAYER_SHOTGUN]
ATTACKTYPE=SHOT;
SHOTCOUNT=7;
DAMAGE.VAL=5;
DAMAGE.MAX=15;
ATTACK_HEIGHT=32;
ACCURACY_ANGLE=6;
ACCURACY_SLOPE=0;
ENGAGED_SOUND=SHOTGN;
ATTACKRANGE=1024;
PUFF=PUFF;
[ELEMENTAL_SPAWNER]
ATTACKTYPE=SPAWNER;
ATTACK_HEIGHT=8;
ATTACK_SPECIAL=PRESTEP_SPAWN;
SPAWNED_OBJECT=LOST_SOUL;
SPAWN_OBJECT_STATE=MISSILE:2;
ATTACK_SPECIAL=FACE_TARGET;
[PLAYER_MISSILE]
ATTACKTYPE=PROJECTILE;
HEIGHT=8;
RADIUS=11;
SPEED=20;
DAMAGE.VAL=20;
DAMAGE.MAX=160;
ATTACKRANGE=1024;
ATTACK_SPECIAL=KILL_FAILED_SPAWN;
PROJECTILE_SPECIAL=NOBLOCKMAP,DROPOFF,NOGRAVITY,MISSILE,NOSHADOW;
ATTACK_HEIGHT=32;
EXPLODE_DAMAGE.VAL=128;
LAUNCH_SOUND=RLAUNC;
DLIGHT.TYPE=QUADRATIC;
DLIGHT.INTENSITY=300;
DLIGHT.COLOUR=#FFFF00;
STATES(IDLE)=MISL:A:1:BRIGHT:NOTHING;
STATES(DEATH)=MISL:B:0:BRIGHT:DLIGHT_SET(1000),MISL:B:0:BRIGHT:DLIGHT_FADE(0),
MISL:B:0:BRIGHT:TRANS_FADE(0%), MISL:B:0:BRIGHT:KILLSOUND,MISL:B:0:BRIGHT:PLAYSOUND(BAREXP),
MISL:B:8:BRIGHT:EXPLOSIONDAMAGE,MISL:C:6:BRIGHT:NOTHING,MISL:D:4:BRIGHT:NOTHING,#REMOVE;
[SKULL_ASSAULT]
ATTACKTYPE=SKULLFLY;
DAMAGE.VAL=3;
DAMAGE.MAX=24;
ASSAULT_SPEED=20;
ATTEMPT_SOUND=SKLATK;
ATTACK_SPECIAL=FACE_TARGET;
[BARON_CLOSECOMBAT]
ATTACKTYPE=CLOSECOMBAT;
DAMAGE.VAL=10;
DAMAGE.MAX=80;
ENGAGED_SOUND=CLAW;
ATTACKRANGE=64
ATTACK_SPECIAL=NEED_SIGHT,FACE_TARGET;
DDF docs written by Andy Baker and Ziggy Gnarly, with updates by Andrew Apted, Andy Brewood and Luke Brennan. © EDGE Team, et al. 1998 - 2024.