User Tools

Site Tools


ded:thing

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ded:thing [2018-09-30 15:36]
skyjake [Flags]
ded:thing [2019-12-22 21:42] (current)
skyjake [On death]
Line 1: Line 1:
 +====== Thing (DED) ======
 +
 +===== Syntax =====
 +
 +<​code>​
 +Thing
 +{
 +  ID = ""​
 +  Doomed Number = 0
 +  Name = ""​
 +  ​
 +  Spawn State = ""​
 +  See State = ""​
 +  Pain State = ""​
 +  Melee State = ""​
 +  Missile State = ""​
 +  Crash State = ""​
 +  Death State = ""​
 +  Xdeath State = ""​
 +  Raise State = ""​
 +  ​
 +  See Sound = ""​
 +  Attack Sound = ""​
 +  Pain Sound = ""​
 +  Death Sound = ""​
 +  Active Sound = ""​
 +  ​
 +  Reaction Time = 0
 +  Pain Chance = 0
 +  Spawn Health = 0
 +  Speed = 0.0
 +  Radius = 0.0
 +  Height = 0.0
 +  Mass = 0
 +  Damage = 0
 +  Flags = ""​
 +  Flags2 = ""​
 +  Flags3 = ""​
 +  ​
 +  On touch = ""​
 +  On death = ""​
 +}
 +</​code>​
 +
 +
 +==== Spawn/​See/​Pain... State ====
 +
 +A [[state]] defines what a thing will be doing and looks like at any given time in game.
 +
 +The things "​spawn"​ state(s) defines a things default function, as it what it does simply by itself. Scenery and pickup things will usually only have spawn states. A thing must have at least one spawn state or it will be removed imediately from the gameworld at map start up.
 +
 +The other states series are called by various actions attached to other state series. Said actions will make the thing immediately enter one of these state series. Bad guys and such will usually use all of these other state series.
 +
 +
 +==== See/​Attack/​Pain... Sound ====
 +
 +Various sounds that will be played at different times by the thing. These are all tied to either entering various state series or states with certain actions attached.
 +
 +The See Sound will be played when the thing is forced to enter it's "​see"​ state from its spawn state, while the Attack Sound will be played every time the thing tries to attack the player in melee.
 +
 +
 +==== Reaction Time ====
 +
 +A forced delay that determines how long a bad guy will take to first attack the player after being alerted. Note that this is canceled out if the thing enters its pain or melee state series'​ for whatever reason.
 +
 +
 +==== Pain Chance ====
 +
 +Whenever a bad guy is hit, it has a certain chance to enter its "​pain"​ state series. This field can be any value from 0-255. 255 means 100%, while 0 obviously means 0. Note that if a thing has a pain chance higher than 0, it must have a "​pain"​ state series must be defined.
 +
 +
 +==== Spawn Health ====
 +
 +How much damage the thing can take. When a things health is reduced to 0 it will automatically enter its "​death"​ state series or simply vanish if it doesn'​t have any death states.
 +
 +
 +==== Speed ====
 +
 +How far a thing moves in the game world during every state it enters that has the ''​A_Chase''​ action attached. Note that how long the thing takes to move this distance is controlled by the state itself.
 +
 +
 +==== Radius ====
 +
 +Radius of the thing.
 +
 +
 +==== Height ====
 +
 +Height of the thing. ​
 +
 +
 +==== Mass ====
 +
 +How much the thing will be pushed when it is hit. Higher numbers mean it won't be pushed as far.
 +
 +
 +==== Damage ====
 +
 +The amount of damage the thing will do if it collides with something. This field is reserved for things with the "​mf_missile"​ flag and a couple of very specific actions. It will have no affect otherwise.
 +
 +
 +==== Flags ====
 +
 +Any number of flags can be attached to a thing, but not all flags will work in all games. To use more than one flag, use the following syntax:
 +
 +    Flags = solid | shootable
 +
 +^ Flag^ Doom^ Heretic^ Hexen^ Description |
 +| special| Yes| Yes| Yes|  |
 +| solid| Yes| Yes| Yes| The thing can not be walked through. |
 +| shootable| Yes| Yes| Yes| The thing can be shot and auto-aimmed at by any weapon. |
 +| nosector| Yes| Yes| Yes|  |
 +| noblockmap| Yes| Yes| Yes|  |
 +| ambush| Yes| Yes| Yes|  |
 +| justhit| Yes| Yes| Yes|  |
 +| justattacked| Yes| Yes| Yes|  |
 +| spawnceiling| Yes| Yes| Yes| The thing spawns attached to the sectors ceiling, rather than the default floor. It should be noted that if the thing doesn'​t have the mf_nogravity flag attached that it will fall to the floor as soon as the map starts. |
 +| nogravity| Yes| Yes| Yes| The thing is unaffected by gravity. |
 +| dropoff| Yes| Yes| Yes| Allows a non-flying thing (i.e the player) to travel off cliff'​s higher than 24 unit'​s. Missiles also need this flag. |
 +| pickup| Yes| Yes| Yes|  |
 +| clip| Yes| Yes| Yes|  |
 +| slide| Yes| Yes| Yes|  |
 +| float| Yes| Yes| Yes| The thing can fly if it also has mf_nogravity attached to it. |
 +| teleport| Yes| Yes| Yes|  |
 +| missile| Yes| Yes| Yes| The thing is considered a missile. It will enter it's death state as soon as it touches another thing or floor/wall. |
 +| dropped| Yes| Yes| |  |
 +| altshadow| | | Yes| The thing is rendered as near completely transparrent. |
 +| shadow| Yes| Yes| Yes| The thing is rendered as semi-transparrent. |
 +| noblood| Yes| Yes| Yes| When the the thing is hit, puff's will be spawned instead of blood splays. |
 +| corpse| Yes| Yes| Yes|  |
 +| infloat| Yes| Yes| Yes| The thing is spawned at a random height between the floor and ceiling of the sector it start'​s in. It should be noted that if the thing doesn'​t have the mf_nogravity flag attached that it will fall to the floor as soon as the map starts. |
 +| countkill| Yes| Yes| Yes| This thing is counted on the kill counter at the intermission screen. |
 +| countitem| Yes| Yes| | This thing is counted on the item counter at the intermission screen. |
 +| icecorpse| | | Yes|  |
 +| skullfly| Yes| Yes| Yes|  |
 +| tdmatch| Yes| Yes| Yes|  |
 +| translation| Yes| Yes| Yes|  |
 +| transshift| Yes| Yes| Yes|  |
 +| local| Yes| Yes| Yes|  |
 +| brightexplode| Yes| Yes| Yes|  |
 +| brightshadow| Yes| Yes| Yes|  |
 +| viewalign| Yes| Yes| Yes| The thing will always be aligned to the camera. |
 + 
 +
 +==== Flags2 ====
 +
 +
 +^ Flag^ Doom^ Heretic^ Hexen^ Description |
 +| alwayslit| Yes| Yes| | The thing is always lit. This is the same effect as applying 327xx frame numbers to every state. |
 +| lograv| Yes| Yes| Yes|  |
 +| windthrust| | Yes| Yes| The thing will be affected by wind sectors (both Heretic/​HeXen default sector types and XG). |
 +| floorbounce| Yes| Yes| Yes| The thing will bouce along/off the floor/​ceiling. Note that a missile that hits the floor/​ceiling will enter it's death state even with this flag. |
 +| blasted| | | Yes|  |
 +| thrughost| Yes| Yes| | If attached to a missile, this will make it go through a thing with the mf_shadow flag. |
 +| fly| Yes| Yes| Yes|  |
 +| footclip| Yes| Yes| Yes| If the thing enters sectors with certain floor graphics, it's graphics will be lowered by a few pixels to give the impression of it wading (i.e through water). |
 +| spawnfloat| Yes| Yes| Yes|  |
 +| noteleport| Yes| Yes| Yes| The thing will not activate teleporter line types. |
 +| rip| Yes| Yes| Yes|  |
 +| pushable| Yes| Yes| Yes| The thing can be pushed like Heretic'​s puff pods. Currently there is no way to determine how far a thing will be pushed though. |
 +| slide| Yes| Yes| Yes|  |
 +| onmobj| | | Yes|  |
 +| passmobj| Yes| Yes| Yes|  |
 +| cantpush| Yes| Yes| Yes|  |
 +| dropped| | | Yes|  |
 +| boss| Yes| Yes| Yes| In Doom. Heretic and HeXen, this renders the bad guy immune to splash damage. In Heretic and HeXen no bad guy will try to fight it if struck by it andit also raises the things ascioated sound effects to max volume (i.e the sounds become unaffected by distance). |
 +| firedamage| | Yes| Yes| If a shootable thing is killed by a missile with this flag attached, it will burst into flames. |
 +| dmgthrust| Yes| Yes| Yes|  |
 +| telestomp| Yes| Yes| Yes| The thing can use a teleporter line type even if something is standing on the destination (it gib's them) |
 +| floatbob| Yes| Yes| Yes| The thing will bob up and down. Note this can lead to it clipping through the floor/​ceiling. |
 +| dontdraw| Yes| Yes| Yes|  |
 +| impact| | | Yes|  |
 +| pushwall| | | Yes|  |
 +| mcross| | | Yes| Things with this flag attached will actiavte standard HeXen lines with a "​monster cross" requirement. Note this flag is not required for monsters to be able to activate XG lines with a monster cross requirement. |
 +| pcross| | | Yes| Things with this flag attached will actiavte standard HeXen lines with a "​player cross" requirement. Note this flag is not required for players to be able to activate XG lines with a player cross requirement. |
 +| cantleavefloorpic| | | Yes| The thing can not enter sectors that are higher or lower than the one it starts in unless pushed by an attack. |
 +| nonshootable| | | Yes| The thing can't be hurt and auto-aim will not register it as a target. Some Hexen actions can turn this flag on and off in a things states. |
 +| invulnerable| | | Yes| The thing can't be hurt. Some Hexen actions can turn this flag on and off in a things states. |
 +| dormant| | | Yes| The thing will start in a "​dormant"​ state. Namely it won't move and is invulnerable. Note that this can be set on individual bad guys in a map editor, so there isn't any need to use this flag in a ded (the flag is present to allow a standard HeXen line type to enable and disable thing(s) being "​dormant"​ in game. |
 +| icedamage| | | Yes| If a missile has this flag attached, anything killed by it will turn into an ice statue. |
 +| seekermissile| | | Yes|  |
 +| reflective| | | Yes| The thing will reflect any missile that hit's it back at it's origin. Some Hexen actions can turn this flag on and off in a things states. |
 + 
 +
 +==== Flags3 ====
 +
 +^ Flag^ Doom^ Heretic^ Hexen^ Description |
 +| noinfight| Yes| Yes| Yes| Thing will not be attacked by another monster even if accidently hurt by them. But ''​mf_justhit''​ will still be called toward the player even if it is another monsters attack that causes it. |
 +| noblast | | | Yes | Not affected by blast damage. |
 +| nomorph | | Yes | Yes | Cannot be morphed to Chicken/​Pig. |
 +
 +
 +==== On touch ====
 +
 +(As of [[version:​2.2]]:​ only supported in Heretic.)
 +
 +[[:Script]] that gets run when the thing is touched. If set, this replaces any hardcoded logic that would have affected the thing. Example:
 +
 +  On touch = "
 +    import Game;
 +    print '​Toucher:',​ toucher.id(),​ 'is touching:',​ self.id();
 +    self.startSound('​impsit'​);​
 +    Game.setMessage('​Got it, yes');
 +    return '​dormant';​
 +    "; ​   ​
 +
 +The return value of the script determines what happens to the special thing afterwards. It must be ''​None''​ or one of these strings:
 +
 +  ; "​keep"​ : Do nothing — the script will likely run again on the next game tick.
 +  ; "​dormant"​ : Put the thing in dormant state, i.e., it is hidden and may be respawned if game rules allow respawning items.
 +  ; "​hide"​ : Hide the thing, but keep it around.
 +  ; "​destroy"​ : Destroy the thing (note that sounds emitted by the thing require that it remains in existence).
 +
 +Please note:
 +  * All features of Doomsday Script are available during this callback.
 +  * The special mobj being touched is referenced by //self//.
 +  * The toucher mobj (e.g., the player) is referenced by //​toucher//​.
 +  * Semicolons must be used like this at the end of each line because the DED parser replaces whitespace around newlines with a single space.
 +  * The entire script is inside a DED string token, which means double quotes need to escaped. Single quotes can be used normally.
 +
 +
 +==== On death ====
 +
 +(Since [[version:​2.3]])
 +
 +[[:Script]] that gets run when the thing is killed. The key difference to a script action in the Death/​Xdeath state is that the On death script is also provided a reference to the killer. All the normal processing of a thing'​s death occurs even if an On death script has been specified.
 +
 +Variables available in the script:
 +  * //self// is the thing that has been killed.
 +  * //killer// refers to the killer. This may also be None.
 +
 +See the notes of the [[#On touch]] script regarding the syntax requirements.