Editing EDF state reference

From Eternity Wiki
Jump to navigationJump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
The Frame EDF block allows definition of each individual actor frame in Eternity, independent from the thing types. Frames are commonly referred to by name in the [[thingtype]] definitions. Their data structure resembles the Dehacked "Frame" block, but is expanded upon, and uses different keywords.
The Frame EDF block allows definition of each individual actor frame in Eternity, independent from the thing types. Frames are commonly referred to by name in the [[thingtype]] definitions. Their data structure resembles the Dehacked "Frame" block, but is expanded upon, and uses different keywords.
 
=Syntax=
NOTE: most of the time you'll want to use the [[DECORATE state syntax]] right inside the [[thingtype]] definition. It is more concise than the classic frame definition described here. In any case, this information is still useful if you want to use '''framedelta''' or provide compatibility with Dehacked (even though this can also be ensured by using '''firstdecoratestate''' in the thing type definition).
==Expanded form==
{{see|List of codepointers}}
{{see|DECORATE state syntax}}
{{backto|EDF}}
==Syntax==
===Expanded form===
The following is the expanded, uncompressed frame definition. It is seldom needed to be specified this way in Eternity, unless [[delta structures]] are employed, which use these keywords. Instead, the compressed frame definitions are preferred.
The following is the expanded, uncompressed frame definition. It is seldom needed to be specified this way in Eternity, unless [[delta structures]] are employed, which use these keywords. Instead, the compressed frame definitions are preferred.


Line 16: Line 11:
   fullbright    <true/false or yes/no or on/off>
   fullbright    <true/false or yes/no or on/off>
   tics          <integer number>
   tics          <integer number>
   action        <[[List of codepointers|codepointer]] name> [(arg, ...)]
   action        <[[List of codepointers|codepointer]] name>
   nextframe      <frame mnemonic or '@' keyword>
   nextframe      <frame mnemonic or '@' keyword>
   misc1          <numeric or identifier data>
   misc1          <numeric or identifier data>
   misc2          <numeric or identifier data>
   misc2          <numeric or identifier data>
   particle_event <particle event identifier>
   particle_event <particle event identifier>
   args           { <argument value>, ... }
   args         {<data1>, <data2>, <data3>, <data4>, <data5>}
  +|-decorate
  +|-skill5fast
  +|-interpolate
   dehackednum    <integer unique number>
   dehackednum    <integer unique number>
  }
  }
 
==Compressed form==
===Compressed form===
This form allows frames to be conveniently written on one line without becoming difficult to read.
This form allows frames to be conveniently written on one line without becoming difficult to read.
  frame <unique mnemonic> {cmp "sprite|frame|bright|tics|action(arg, ...)|nextframe|p_event|misc1|misc2"}
  frame <unique mnemonic> {cmp "sprite|frame|bright|tics|action|nextframe|p_event|misc1|misc2|args1|args2|args3|args4|args5"}
Defaulted fields ''which are in the middle'' may '''not''' be simply omitted, they must use the '''*''' character in their place. Trailing fields may be omitted.
Defaulted fields ''which are in the middle'' may '''not''' be simply omitted, they must use the '''*''' character in their place. Trailing fields may be omitted.
Previous versions of Eternity supported specification of args at the end of the cmp frame, but this is now deprecated. Any arguments placed in a compressed frame definition should be put inside parentheses immediately after the action.


Note that dehackednum is not supported inside the '''cmp''' field, but unless Dehacked patch support is intended, it's not required.
Note that dehackednum is not supported inside the '''cmp''' field, but unless Dehacked patch support is intended, it's not required.


====Examples====
===Examples===


''These frames do not exist in the original game and are only referenced for example purposes''
''These frames do not exist in the original game and are only referenced for example purposes''
Line 45: Line 34:
  frame monster_thinkdecide {cmp "MONS|D|*|0|[[RandomJump]]|monster_withdraw|*|monster_engage|100"}
  frame monster_thinkdecide {cmp "MONS|D|*|0|[[RandomJump]]|monster_withdraw|*|monster_engage|100"}
Here, the frame takes 0 tics, as it uses a frame-scripting action (see the '''tics''' description), the next frame is explicitly named (so this definition can be placed anywhere in the file), and the '''misc1''', '''misc2''' parameters of RandomJump are specified individually - see below.
Here, the frame takes 0 tics, as it uses a frame-scripting action (see the '''tics''' description), the next frame is explicitly named (so this definition can be placed anywhere in the file), and the '''misc1''', '''misc2''' parameters of RandomJump are specified individually - see below.
 
==Fields==
===Fields===
 
*'''sprite'''
*'''sprite'''
:Default: BLANK
:Default: BLANK
:Specifies the four-letter part of the sprite lump to be used by the calling actor, or the special word BLANK, which results in not drawing anything. If the name contains special characters or spaces, it has to be enclosed in quotation marks. Make sure to write the sprite name exactly as the four-letter lump stem, because it's case sensitive.
:Specifies the four-letter part of the sprite lump to be used by the calling actor, or the special word BLANK, which results in not drawing anything. If the name contains special characters or spaces, it has to be enclosed in quotation marks. Make sure to write the sprite name exactly as the lump name, because it's case sensitive.
*'''spriteframe'''
*'''spriteframe'''
:Default: 0
:Default: 0
:Specifies the sprite frame letter or 0-based index. For example, C is equivalent to 2, A to 0 and so on. In Doom-engine games the sprite lump is named of a four letter stem (specified by the '''sprite''' field) followed by one or two pairs of a letter (specified by '''spriteframe''') and a rotation number. In-game the sprite will be viewed normally when the actor gets the first letter from the name, at the designated rotation, or viewed flipped when it gets the second letter, also at the designated rotation. Possible rotations are numbered from 0 to 8. 0 means that the lump name will be used no matter how the actor is oriented against the viewport, while 1-8 mean face-to-face rotated progressively by 45 degrees. There may be more lumps for the same letter (such as Zombieman's POSSA1, POSSA2A8 etc.) and single lumps servicing two letters (SPIDA1D1, SPIDB1E1...)
:Specifies the sprite frame letter or 0-based index. For example, C is equivalent to 2, A to 0 and so on. In Doom-engine games the sprite lump is named of a four letter word (specified by the '''sprite''' field) followed by one or two pairs of letter (specified by '''spriteframe''') and rotation number. In-game the sprite will be viewed normally when the actor gets the first letter from the name, at the designated rotation, or viewed flipped when it gets the second letter, also at the designated rotation. Possible rotations are numbered from 0 to 8. 0 means that the lump name will be used no matter how the actor is oriented against the viewport, while 1-8 mean face-to-face rotated progressively by 45 degrees. There may be more lumps for the same letter (such as Zombieman's POSSA1, POSSA2A8 etc.) and single lumps servicing two letters (SPIDA1D1, SPIDB1E1...)
*'''fullbright'''
*'''fullbright'''
:Default: false
:Default: false
Line 59: Line 46:
*'''tics'''
*'''tics'''
:Default: 1
:Default: 1
:Specifies how many gametics (units of 1/35 second each) this frame lasts. In frame loops, at least one of the frames has to take longer than 0 tics, otherwise the game will hang. For certain types of frames, whose purpose includes scripting and random or controlled frame jumping, this value is usually set to 0, because the engine jumps to target frames instantly if a condition is met, regardless of '''tics'''. For static, non-animated things, as well as all non-disintegrating corpses, the '''tics''' value is usually -1 (forever), and is required to be this way if the corpse in question is supposed to be resurrectable by a monster with [[VileChase]] walking frames.
:Specifies how many tics (units of 1/35 second each) this frame lasts. In frame loops, at least one of the frames has to take longer than 0 tics, otherwise the game will hang. For certain types of frames, whose purpose includes scripting and random or controlled frame jumping, this value is usually set to 0, because the engine jumps to target frames instantly if a condition is met, regardless of '''tics'''. For static, non-animated things, as well as all non-disintegrating corpses, the '''tics''' value is usually -1, and is required to be this way if the corpse in question is supposed to be resurrectable by a monster with [[VileChase]] walking frames.
*'''action'''
*'''action'''
:Default: NULL
:Default: NULL
Line 73: Line 60:
:Default: 0
:Default: 0
:This is the first argument, used by certain [[list of codepointers|codepointers]] which were inherited from MBF, see their enumeration above.
:This is the first argument, used by certain [[list of codepointers|codepointers]] which were inherited from MBF, see their enumeration above.
:It is also used for weapon sprites to offset their graphics relative to center horizontally. Positive means to the right
*'''misc2'''
*'''misc2'''
:Default: 0
:Default: 0
:This is the second argument used by some MBF inherited codepointers.
:This is the second argument used by some MBF inherited codepointers.
:It is also used for weapon sprites to offset their graphics relative to center vertically. Be careful that the origin is 32 and greater values mean downwards.
*'''particle_event'''
*'''particle_event'''
:Default: pevt_none
:Default: pevt_none
:Specifies a special particle effect to occur when the actor enters this frame. Possible values are:
:Specifies a special particle effect to occur when the actor enters this frame. Possible values are:
:*'''pevt_none''' - No effect. The default.
:*'''pevt_none''' - no effect. The default.
:*'''pevt_rexpl''' - Rocket explosion effect. Orange dots exploding in all directions from the thing's origin.
:*'''pevt_rexpl''' - rocket explosion effect. Yellow dots exploding in all directions from the thing's origin.
:*'''pevt_bfgexpl''' - BFG explosion effect. Same as rocket explosion, except green.
:*'''pevt_bfgexpl''' - similar to the rocket explosion, but using green dots.
:For other particle effects, which continuously affect the actor, see the [[Thingtype]] definition.
:For other particle effects, which continuously affect the actor, see the [[Thingtype]] definition.
*'''args'''
*'''args'''
:Default: all arguments default to 0.
:Default: {0,0,0,0,0}
:This is a comma-separated list of codepointer arguments, in the form of numbers or identifiers. As of Eternity Engine v3.35.92, frames support any number of arguments, and argument evaluation is performed at runtime and is specific to each action function.
:This is a list of codepointer arguments, in the form of numbers or identifiers. If the called codepointer uses fewer than 5 arguments, it is safe to write less than 5 in the EDF file. Any omitted argument will default to 0. They have to be separated by commas.
:For normal frame definitions, setting the arguments from the '''args''' field is no longer required. It is instead preferred to include them in the '''action''' property, inside parentheses, appended to the action name. '''args''' may still be useful for frame [[delta structures]], however.
:For normal frame definitions, setting the arguments from the '''args''' field is no longer required, preferring to include them in the '''action''' property, inside parantheses, appending the pointer name. '''Args''' may still be useful for frame [[delta structures]].
*'''+decorate'''
:This keyword, if included in the frame definition, will let the parser know that this frame is part of a sequence of externalized [[DECORATE state syntax|Decorate]]-defined frames from the '''states''' heredoc of [[thingtype]], starting from the one declared by '''firstdecoratestate''' of [[thingtype]].
*'''+skill5fast'''
:If added, will make the state take half '''tics''' on skill 5 and fast mode. Used by the demon in Doom. Note that on Heretic the faster [[Chase]] state behaviour is different and not influenced by this.
*'''+interpolate'''
:This flag only has meaning for weapon state if '''misc1''' and '''misc2''' are nonzero. These two fields will change the weapon sprite offset and by default that will happen without visual interpolation. If this flag is set, interpolation will be enabled even for this case.
*'''dehackednum'''
*'''dehackednum'''
:Default: -1
:Default: -1
:Specifies what number to be used if Dehacked patches are used to tweak the gameplay defined by an EDF code. Safe user values are greater than or equal to 10000.
:Specifies what number to be used if Dehacked patches are used to tweak the gameplay originally defined by an EDF code. Safe values are greater than or equal to 10000, others may be used by Eternity subsequent versions.
 
==Frame blocks==
 
As of March 13 2016, Eternity supports Decorate-like frame blocks to concisely define groups of frames that don't belong to certain thing types. Currently this is being used to define some Dehacked-compatible frames that aren't currently used by any thing. The syntax is as follows:
frameblock
{
  firststate <mnemonic>
  states
  @"
    <Decorate style syntax>
  "@
}
The fields are:
*'''firststate'''
:This is the name of the first of several EDF '''frame''' blocks defined consecutively. Each such '''frame''' must have the '''+decorate''' field included, and the number of these blocks must match the number of Decorate-style items defined in the '''states''' property of '''frameblock'''.
*'''states'''
:[[Decorate]]-style definition of the frames.


----
----
''Back to [[Editing reference]]''
''Back to [[Editing reference]]''
[[category:EDF]]
Please note that all contributions to Eternity Wiki are considered to be released under the GNU Free Documentation License 1.2 (see Eternity Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)

Templates used on this page: