User Tools

Site Tools


ded:state

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
ded:state [2019-12-22 20:05] โ€“ [Action] skyjakeded:state [2020-04-10 03:53] (current) โ€“ [Action] skyjake
Line 1: Line 1:
 +====== State (DED) ======
 +
 +===== Syntax =====
 +
 +  <Copy> State
 +  {
 +     ID = "";
 +     Flags = flaga | flagb | flagc;
 +     Sprite = "";
 +     Frame = 0;
 +     Tics = 0;
 +     Action = "";
 +     Next State = "";
 +     Execute = "";
 +   }
 +
 +
 +==== Id ====
 +
 +The name of the state, case sensitive. Contrary to the uniformity of the original games state names, this field can actually contain any combination of letters, numbers or symbols (i.e. you can name a state "fwefe234d" if you really want to).
 +
 +
 +==== Flags (1.9.7 โ†’) ====
 +
 +^ Name ^ Description |
 +| fullbright | Will be drawn fully bright whilst in this state. |
 +| noautolight | Disable use of any automatically calculated [[light]] and [[halo]]. |
 +
 +
 +==== Sprite ====
 +
 +Name of the [[sprite]] to be used during this state.
 +
 +A sprite name consists of four letters or numbers. For instance, the sprtie name of Doom's Imp is "TROO".
 +
 +
 +==== Frame ====
 +
 +The frame of the sprite to display during this state. Note that while the actual sprite frames are letter coded, here you enter a number.
 +
 +If you want to use the A frame of the TROO sprite, you would enter 0 in this field. If you want to use the C frame, you would enter a 2 in this frame. Basically A=0, B=1, C=2...
 +
 +Examples of frames are xxxxA1 and xxxxA2A8
 +
 +The number refers to the eight rotations an object in Doom can have. 1 is front facing, 3 is left, 5 is back and 7 right.
 +
 +You can also set the sprite to be full bright here by offsetting the frame number by 32768. In this case A=32768, B=32769, C=32770. But this method is deprecated as of Doomsday 1.9.0-beta6 (use [[#Flags|Flags]] instead).
 +
 +
 +==== Tics ====
 +
 +How long the state will last. 35 tic's equal 1 second. Any non-decimal value including -1 and 0 can be placed here. Indeed, having a series of states with 0 tic length can be useful for appearing to call multiple actions at the same time. a value of -1 is infinite.
 +
 +
 +==== Action ====
 +
 +The action to be performed when a [[thing]] enters this state. Each game plugin defines its own set of action routines (native code).
 +
 +Since [[version:2.2]], the action may also be defined using Doomsday Script. In this case, the contents of the Action string are parsed as a script and executed when a thing or psprite enters the state. Variables available in the script:
 +  * //self// refers to the thing itself, or the player mobj in case of a psprite action ([[script:module:world#worldthing|World.Thing]])
 +  * //player// refers to the current player ([[script:module:app#appplayer|App.Player]], psprite actions only)
 +
 +[[:script|All features of Doomsday Script]] are available in the action script.
 +
 +
 +==== Next State ====
 +
 +What state to go to after this one has finished. An infinite number of things can use the same state and you can set up a loop of states if you wish (the original games loop their spawn and see states for instance).
 +
 +If you write a state name that doesn't exist for the things next state, the thing will simply vanish when it reaches the end of the current state. It is officially recommended that if you want a thing to simply vanish after it has ran through a state or series of states that you enter "NULL" in this field.
 +
 +
 +==== Execute ====
 +
 +Execute a [[console_command_reference|console command]] every time a [[thing]] enters this state.
 +
 +
  
ded/state.txt ยท Last modified: 2020-04-10 03:53 by skyjake