EDF weapon reference: Difference between revisions

From Eternity Wiki
Jump to navigationJump to search
m (Fix a few dumb mistakes.)
(Add ID and state parameters.)
Line 57: Line 57:
===Explanation of fields===
===Explanation of fields===
====ID / Type Info====
====ID / Type Info====
*'''dehackednum'''
:Default = -1
:Fake array index number, for Dehacked patch (BEX or DEH file) compatibility. It has to be an unique number if not -1. Safe numbers are from 10000 up.
*'''inherits'''
:Default = (nothing)
:Sets the weapon info from which this will copy properties. All of the properties except '''dehackednum''' will be copied from the base actor type.
====States====
*'''firstdecoratestate'''
:Sets the first frame in a sequential list of dummy frames that use the internal Decorate-style defined '''states''' of this actor for [[EDF delta structures|framedelta]] compatibility. It's not required unless the intention is to make the Decorate states of this thing accessible from other thing types. Default games' (Doom, Heretic) thing types use externalized frames for all thing types, for compatibility.
*'''states'''
{{see|DECORATE state syntax}}
:Default = nothing
:Defines frames using [http://zdoom.org/wiki/DECORATE DECORATE]-style state definitions. This means it won't be necessary to define separate [[frame]] blocks for each individual frame. See the DECORATE reference at the ZDoom wiki for documentation on its syntax. Using the '''states''' field instead of any of the ones below results in more concise text, but also the newly created frames won't be accessible from outside (other thingtypes, Dehacked patches or delta structures), unless you use the '''firstdecoratestate''' field as well. Like normally, [[List of codepointers|codepointers]] may or may not be preceded by '''A_'''. The DECORATE code has to be implemented via a heredoc: a text string that spans on multiple lines. Unlike a regular string which uses quotation marks, the heredoc is marked by @" and "@ respectively. Example on an shotgun-like (the '=' sign is optional):
states =
  @"
  Ready:
      SHTG A 1 A_WeaponReady
      loop
  Deselect:
      SHTG A 1 A_Lower
      loop
  Select:
      SHTG A 1 A_Raise
      loop
  Fire:
      SHTG A 3
      SHTG A 7 A_FireShotgun
      SHTG BC 5
      SHTG D 4
      SHTG CB 5
      SHTG A 3
      SHTG A 7 A_ReFire
      goto Ready
  Flash:
      SHTF A 4 Bright A_Light1
      SHTF B 3 Bright A_Light2
      goto LightDone
  "@
*'''upstate'''
:Default = S_NULL
:Sets the frame which a weapon starts in when it is raised.If the object is supposed to have any dynamic purpose or be visible, do not leave the '''upstate''' at S_NULL.
*'''downstate'''
:Default = S_NULL
:Sets the frame which a weapon starts in when it is being lowered. If the object is supposed to have any dynamic purpose or be visible, do not leave the '''downstate''' at S_NULL.
*'''readystate'''
:Default = S_NULL
:Sets the frame which a thing starts in when it is ready to be fired. If the object is supposed to have any dynamic purpose or be visible, do not leave the '''readystate''' at S_NULL.
*'''attackstate'''
:Default = S_NULL
:Sets the frame which a weapon goes to if the user tries to perform a primary attack. Though not necessary, it is suggested for weapons to have an attackstate for primary firing purposes.
*'''flashstate'''
:Default = S_NULL
:Sets the frame which a weapon jumps to if a [[List of codepointers|codepointer]] causes a weapon to flash.
*'''holdstate'''
:Default = S_NULL
:Sets the frame jumped to by [[A_ReFire]] if the player is still holding the primary attack button.
*'''attackstate2''', '''flashstate2''', '''holdstate2'''
:Default = S_NULL
: The equivalent of '''attackstate''', '''flashstate''', and '''holdstate''', but for alternate fire.

Revision as of 09:31, 11 July 2017

TODO: Initial spiel.

See User:Altazimuth/Weapon info flags
Back to EDF

Eternity Alfheim syntax

For versions of Eternity from Alfheim up, EDF weaponinfo support the following syntax. Make sure to add:

setdialect("ALFHEIM")

before using this syntax:

weaponinfo <unique name> : <inherited weaponinfo>, <dehackednum>
{
  <other attributes>
}

Header properties

  • <inherited weaponinfo> must be a value, even if the weaponinfo doesn't inherit from anything else. In that case, it must be Weapon, which is a placeholder value belonging to no real weaponinfo.
  • <dehackednum> -1 if not used. If -1, it can be omitted, leaving just this:
weaponinfo <unique name> : <inherited weaponinfo> {<attributes>}
  • If header properties are used, the pre-Alfheim syntax inherits and dehackednum attributes are not used.

Syntax

weaponinfo <unique name> [: <parent type> [, <dehackednum>]]
{
  dehackednum            <unique number>
  inherits               <weaponinfo>
  
  ammotype               <artifact mnemonic>
  
  upstate                <frame>
  downstate              <frame>
  readystate             <frame>
  attackstate            <frame>
  flashstate             <frame>
  
  ammouse                <number>
  
  nextincycle            <weapon info mnemonic>
  previncycle            <weapon info mnemonic>
  
  cflags                 <flag list>
  addflags               <flag list>
  remflags               <flag list>
  
  mod                    <MOD name OR number>
  
  recoil                 <number>
  hapticrecoil           <number>
  haptictime             <number>
  
  upsound                <sound>
  readysound             <sound>
  
  tracker                <string, TO BE REMOVED>
  
  firstdecoratestate     <frame>
  states                 <DECORATE state syntax heredoc>
}

Explanation of fields

ID / Type Info

  • dehackednum
Default = -1
Fake array index number, for Dehacked patch (BEX or DEH file) compatibility. It has to be an unique number if not -1. Safe numbers are from 10000 up.
  • inherits
Default = (nothing)
Sets the weapon info from which this will copy properties. All of the properties except dehackednum will be copied from the base actor type.


States

  • firstdecoratestate
Sets the first frame in a sequential list of dummy frames that use the internal Decorate-style defined states of this actor for framedelta compatibility. It's not required unless the intention is to make the Decorate states of this thing accessible from other thing types. Default games' (Doom, Heretic) thing types use externalized frames for all thing types, for compatibility.
  • states
See DECORATE state syntax
Default = nothing
Defines frames using DECORATE-style state definitions. This means it won't be necessary to define separate frame blocks for each individual frame. See the DECORATE reference at the ZDoom wiki for documentation on its syntax. Using the states field instead of any of the ones below results in more concise text, but also the newly created frames won't be accessible from outside (other thingtypes, Dehacked patches or delta structures), unless you use the firstdecoratestate field as well. Like normally, codepointers may or may not be preceded by A_. The DECORATE code has to be implemented via a heredoc: a text string that spans on multiple lines. Unlike a regular string which uses quotation marks, the heredoc is marked by @" and "@ respectively. Example on an shotgun-like (the '=' sign is optional):
states =
  @"
  Ready:
     SHTG A 1 A_WeaponReady
     loop
  Deselect:
     SHTG A 1 A_Lower
     loop
  Select:
     SHTG A 1 A_Raise
     loop
  Fire:
     SHTG A 3
     SHTG A 7 A_FireShotgun
     SHTG BC 5
     SHTG D 4
     SHTG CB 5
     SHTG A 3
     SHTG A 7 A_ReFire
     goto Ready
  Flash:
     SHTF A 4 Bright A_Light1
     SHTF B 3 Bright A_Light2
     goto LightDone
 "@
  • upstate
Default = S_NULL
Sets the frame which a weapon starts in when it is raised.If the object is supposed to have any dynamic purpose or be visible, do not leave the upstate at S_NULL.
  • downstate
Default = S_NULL
Sets the frame which a weapon starts in when it is being lowered. If the object is supposed to have any dynamic purpose or be visible, do not leave the downstate at S_NULL.
  • readystate
Default = S_NULL
Sets the frame which a thing starts in when it is ready to be fired. If the object is supposed to have any dynamic purpose or be visible, do not leave the readystate at S_NULL.
  • attackstate
Default = S_NULL
Sets the frame which a weapon goes to if the user tries to perform a primary attack. Though not necessary, it is suggested for weapons to have an attackstate for primary firing purposes.
  • flashstate
Default = S_NULL
Sets the frame which a weapon jumps to if a codepointer causes a weapon to flash.
  • holdstate
Default = S_NULL
Sets the frame jumped to by A_ReFire if the player is still holding the primary attack button.
  • attackstate2, flashstate2, holdstate2
Default = S_NULL
The equivalent of attackstate, flashstate, and holdstate, but for alternate fire.