Editing User:Altazimuth/EDF animation and switches

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:
TODO: Initial spiel.
TODO: Initial spiel.


Eternity supports defining animations and switches through [[EDF]]. It also supports Hexen [[ANIMDEFS]] lumps with some ZDoom extensions, allowing cross-port mods to run on it. This article describes the EDF version. New Eternity features will be added in EDF in the future, while the ANIMDEFS lump support will be updated with the GZDoom-compatible features integrated into Eternity.
If an animation's mnemonic is not unique, the latest definition of a thing type with that mnemonic replaces any earlier ones. Like most other identifiers in EDF (but not lump names or subnames), animation mnemonics are completely case-insensitive.


{{Backto|EDF}}
{{Backto|EDF}}


==Animations==
==Syntax==
Animations in Eternity are of two types: Doom and Hexen. The Doom animations are similar to the ones from the binary [[ANIMATED]] lump, having a start and end texture in the sequence, whereas the Hexen animations (based on Hexen's ANIMDEFS definition) require you to specify each frame but allow finer control.
  animation <unique name>
 
Animated textures can also "swirl" by having the special liquid effect introduced in [[SMMU]].
 
Below are presented the two ways these animations can be defined in EDF.
 
===Doom animations===
 
====Syntax====
  animation
  {
  {
   // One of the following:
   flat   <string>
   flat <name>
   wall   <string>
   wall <name>
   lastpic <string>
   tics   <number>
   lastpic <name>
    
   tics <number>
   flags   <flag list>
   flags <flags>
   pic     {num <number> tics <number> random {min <number> max <number>} flags <flag list>}
}
====Explanation====
An Doom '''animation''' must have either '''flat''' or '''wall''' defined (but not both or neither). The choice of the keyword decides whether the animation is designated for floor/ceiling textures ('''flat''') or '''wall''' textures. Unlike vanilla Doom and Boom, Eternity normally allows you to interchange walls and flats, but this distinction is still useful if there are flats with the same name as wall textures. Most notably, the default Doom IWADs have STEP1 and STEP2 defined for both kinds of surfaces.
 
'''Lastpic''' is the last texture in the animation sequence. '''Tics''' (by default 8) is the duration of each frame.
 
'''Flags''' is optional and can only be '''SWIRL'''. When set, this causes the texture to spin like a liquid, using the effect introduced in [[SMMU]]. If you set '''SWIRL''', then '''lastpic''' and '''tics''' become optional, but you can also combine them. This is unlike the ANIMATED lump, which doesn't allow swirling textures to be combined with frame animations.
 
====Examples====
animation { flat WATER1 lastpic WATER8 tics 4 flags SWIRL } // swirling fast-rippling water
animation { wall WATRFAL1 lastpic WATRFAL4 tics 16 }        // slow wall waterfall
animation { flat GOO flags SWIRL }                          // swirling goo, single frame
 
You can use EDF to modify Doom animations defined in ANIMATED, but '''flat''' and '''wall''' must match the designation and starting texture name from ANIMATED. For example:
animation { flat NUKAGE1 flags SWIRL }
successfully modifies the ANIMATED nukage animation by giving it the swirling effect. The frame animation is preserved. To remove it, and keep only NUKAGE1 showing up, be sure to add "tics 0" in the definition.
 
===Hexen animations===
 
====Syntax====
animation
{
  // One of the following:
  flat <name>
  wall <name>
   flags <flags>
  // List of "pic" entries
   pic { name <name or number> tics <number> random <min>, <max> flags <flags> }
  pic { name <name or number> tics <number> random <min>, <max> flags <flags> }
}
 
====Explanation====
For Hexen animations, '''flat''' or '''wall''' is still required, having the same role as in Doom animations. The actual animation however is defined by the several '''pic''' entries. Defining '''flat''' or '''wall''' is required because, unlike Doom animations which always define ranges, Hexen animations require the exact '''flat''' or '''wall''' texture to be applied in the map editor for the sector or sidedef to animate.
 
Each '''pic''' has a '''name''', which can be the exact texture name, or a number like in vanilla Hexen's ANIMDEFS, starting from 1 and counting each neighbouring texture. The time it takes can be expressed exactly in '''tics''' (default 8) or as a random range using '''random'''.
 
'''Flags''' is also supported for Hexen animations and once again it can only be '''SWIRL''' if specified. It can be applied globally to the animation or locally per '''pic'''.
 
====Examples====
animation  // Water with random duration frames
{
  flat WATER1
  pic { name WATER1 random 4, 8 }
  pic { name WATER2 random 4, 8 }
  pic { name WATER3 random 4, 8 }
}
animation  // A demon eye that stays shut most of the time, then opens and then has the swirl effect.
{
  wall DEMONIC  // the wall or flat definition can be unrelated to the first pic. It won't show in-game though,
                // but in the map editor the texture will have to be DEMONIC.
  pic { name EYECLOSE tics 150 }
  pic { name EYEOPEN1 random 20, 30 }
  pic { name EYEOPEN2 random 15, 35 }
  pic { name EYEHYPNO tics 105 flags SWIRL }
  pic { name EYEOPEN1 }      // default tics is 8
}
animation  // This uses the number notation. MAGMA1 may be followed by MAGMA2 in the texture list.
{
  flat MAGMA1
  pic { name 1 }
  pic { name 2 }
}
 
==Switches==
 
Switches can be defined in EDF. You can also define switches with [[ANIMDEFS]] or [[SWITCHES]], but any new Eternity features will be added in EDF as they get developed.
 
They have the following syntax:
switch <name>
{
  on <texture>
  sound <mnemonic>
  offsound <mnemonic>
  gameindex <number>
  }
  }
===Explanation of fields===
===Explanation of fields===
The '''name''' field is the "off" texture of the switch, and is also used to identify the entry. Usually in Doom it has a name starting with SW1, like "SW1LION" in original Doom. The '''on''' field is the activated texture, starting in Doom usually with SW2, like SW2LION.
====ID / Type Info====
*'''flat'''
:Default = ""
:Lorem ipsum and stuff.
*'''wall'''
:Default = ""
:Lorem ipsum and stuff.
*'''lastpic'''
:Default = ""
:Lorem ipsum and stuff.
*'''tics'''
:Default = 8
:Lorem ipsum and stuff.
*'''flags'''
:Default = ""
:Lorem ipsum and stuff.
====Pic(?) Sub-Block====
*'''pic'''
:Default = (nothing)
:Lorem ipsum and stuff.
pic { name F_FOO; tics 8; random {4, 12}; flags SWIRL }
TODO: Talk here, fix above.


You can also give sounds to switches. The '''sound''' field, if specified, lets you set a custom sound to a switch. In addition, you can set '''offsound''' if you want an alternate sound to go from the '''on''' texture back to the '''name''' texture.
'''Gameindex''' is a compatibility setting from [[SWITCHES]] which declares if the switch is available for Doom shareware, Doom registered or Doom commercial. Not meaningful for mods, so you can ignore it.
===Example===
switch SW1LEVER { on SW2LEVER  sound clank  offsound lvreset }
 


[[category:EDF]]
[[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)

Template used on this page: