Difference between revisions of "ATTACKS"

From 3DGE Wiki
Jump to: navigation, search
m
Line 1: Line 1:
 +
__NOTOC__
 
=ATTACKS=
 
=ATTACKS=
  
Line 5: Line 6:
 
Attacks.ddf 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.
 
Attacks.ddf 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 [[weapons.ddf]] and [[things.ddf]] files.
+
The attack name should be descriptive of what it does and/or who uses it, and is referred to in the [[WEAPONS|DDFWEAP]] and [[THINGS|DDFTHING]] files.
  
 
<div style="background: #f2e0ce; border: 2px solid #bfb1a3; padding: 0.6em; margin-top: 0.8em;">There are three general types of attacks: ''Closecombat attacks'' (e.g punch, beserk, chainsaw), ''bullet attacks'' (e.g chaingun, pistol etc) and ''projectile attacks'' (plasma, bfg, rockets, many monster attacks). There are a number of other attacks too, which are normally associated with specific monsters (e.g archvile flames, lost souls, mancubus attacks).</div>
 
<div style="background: #f2e0ce; border: 2px solid #bfb1a3; padding: 0.6em; margin-top: 0.8em;">There are three general types of attacks: ''Closecombat attacks'' (e.g punch, beserk, chainsaw), ''bullet attacks'' (e.g chaingun, pistol etc) and ''projectile attacks'' (plasma, bfg, rockets, many monster attacks). There are a number of other attacks too, which are normally associated with specific monsters (e.g archvile flames, lost souls, mancubus attacks).</div>
Line 520: Line 521:
 
=EXAMPLES=
 
=EXAMPLES=
  
The following are examples of complete weapon entries:
+
The following are a few examples of completed attack entries:
  
 
{| width="95%" border="1" frame="box" cellpadding="2" frame="box" BGCOLOR="#FFE4B5"
 
{| width="95%" border="1" frame="box" cellpadding="2" frame="box" BGCOLOR="#FFE4B5"
Line 535: Line 536:
 
</font>
 
</font>
 
|}
 
|}
 +
 +
{{DDF}}

Revision as of 21:46, 29 April 2016

ATTACKS

Stored in attacks.ddf file or in the DDFATK data lump.

Attacks.ddf 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 and DDFTHING files.

There are three general types of attacks: Closecombat attacks (e.g punch, beserk, chainsaw), bullet attacks (e.g chaingun, pistol etc) and projectile attacks (plasma, bfg, rockets, many monster attacks). There are a number of other attacks too, which are normally associated with specific monsters (e.g archvile flames, lost souls, mancubus attacks).

COMMANDS

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

[#attackspec [flags]]

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 attackrange is greater than the creature's radius.
ATTACKTYPE

[#attacktypes [special]]

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 monsters 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.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 it's 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.
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.INTENSITY [float]

This value is the starting dynamic light intensity of the projectile. This can be modified as the projetile moves using the [#dlight DLIGHT] SET and FADE actions.

DLIGHT.TYPE [special] This value is the type of dynamic lighting to use for the projectile. At present only QUADRATIC lighting is known about, though there may be others.
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.
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.

[#projspec PROJECTILE_SPECIAL]

[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

[#spawn [special]]

Sets the state that the spawned object will be spawned in (e.g chase, spawn or attack state)
SPAWNED_OBJECT

[#spawn [special]]

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] Used for bouncing projectiles in QDoom. ??
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.
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.

STATES

Each named STATES entry defines an animation sequence to play when an attack is in progress, as well as calling the actions required at the appropriate frames in the animation. These consist of a series of states, which are individual frames of the animation. A state is defined like this:
   Sprite:Frame:Tics:Bright:Action
as follows:

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' or 'NORMAL' Bright frames are always drawn full brightness.
Action

Action to be carried out. [#actions Actions] are listed below.

Each frame ends with either a semincolon ; if it is the last frame in the animation or a comma , if it is not.

In addition, any line may include a #Command at the end. This will either be #STATENAME which causes a jump to the first frame in the animation of the named state. #STATENAME:FRAME causing a jump to the specified frame number in the animation of the named state. OR #REMOVE to remove the animation shown from the HUD.

Special STATES

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).

ATTACKTYPES

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.
FIXED_SPREADER Launches missiles in an ordered way like the Mancubus.
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!).

[#spawn SPAWNER]

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.
TRIPLE_SPAWNER Launches three creatures of the same type. E.g. Pain Elemental death.

ATTACK SPECIALS

These are flags that are used to modify an attack in some way.
You can combine one or more terms as such
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 it's target.
FORCE_AIM The attacker will automatically aim at it's target.
KILL_FAILED_SPAWN For SPAWNER attacktypes, 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.
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.

PROJECTILE_SPECIAL

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  ? - used in Qdoom
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.
SLIDER Will make projectile slide when it hits a wall.
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.

ACTIONS

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).
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_UP Causes the projectile to drift upwards by the specified amount. 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.
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.
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 projectile to alternate between visible and invisible at the rate specified.
TRANS_FADE Used like TRANS_FADE(10%) to fade the transparency of the projectile to the specified amount.
TRANS_LESS Used like TRANS_LESS(10%) to make the projectile less transparent by the specified amount.
TRANS_MORE Used like TRANS_MORE(10%) to make the projectile more transparent by the specified amount.
TRANS_SET Used like TRANS_SET(10%) to set the projectiles transparency to the specified amount.

EXAMPLES

The following are a few examples of completed 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;

Doom Definition Files
DDFlogo.gif