Editing
EDF basics
(section)
From Eternity Wiki
Jump to navigation
Jump 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.
Anti-spam check. Do
not
fill this in!
==Enable Functions== Starting with EDF 1.2, special functions are provided which allow the user to enable or disable options within the EDF parser. The primary use for these functions is to instruct the parser to skip definitions for game modes other than the one currently being played. Although all the thing, frame, sound, and sprite definitions will not conflict and can be loaded with each other, most of the time this is unnecessary and requires a significant amount of memory which will never be used. Allowing such definitions to be discarded during parsing speeds up processing and reduces memory usage. Note that all of these functions are only valid at the topmost level of an EDF file, and not within definitions. Enable Functions ====enable(<option>) ==== This function enables the provided option from the point of its call onward. If the option is already enabled, no change takes place. If an invalid option name is provided, an error will occur. ====disable(<option>) ==== This function disables the provided option from the point of its call onward. If the option is already disabled, no change takes place. If an invalid option name is provided, an error will occur. ====ifenabled(<option>, ...) ==== This function tests if the the provided option is enabled. If so, nothing will change. Otherwise, the EDF parser will be instructed to skip forward until it finds an endif function (see below). The endif function will then be invoked. If the option provided is invalid, an error will occur. Note that ifenabled/endif pairs cannot be nested. As of EDF 1.5, it is possible to provide any number of valid enable options to this function. In the case that more than one enable option is provided, *all* specified options must be enabled or the section will be skipped. ====ifenabledany(<option>, ...) ==== New to EDF 1.5, this function tests if *any* of the provided options are enabled. If any are, nothing will change. Otherwise, parsing will skip to the next endif function. ====ifdisabled(<option>, ...) ==== New to EDF 1.5, this function tests if *all* of the provided options are disabled. If all options are disabled, nothing will change. Otherwise, parsing will skip to the next endif function. ====ifdisabledany(<option>, ...) ==== New to EDF 1.5, this function tests if *any* of the provided options are disabled. If any of the options are disabled, nothing will change. Otherwise, parsing will skip to the next endif function. ====endif() ==== This function marks the end of a section of the file started by an ifenabled, ifenabledany, ifdisabled, ifdisabledany, ifgametype, or ifngametype call. When any of the aforementioned functions tests an option or value that is not enabled or is set to a different value, the parser will look for this function and then call it. This function will cause the parser to start recognizing definitions again from its line onward. If this function does not appear after one of the mentioned functions and before the end of the current file, a "missing conditional function" error will occur. Available Options ====DOOM ==== When this option is enabled, DOOM thing, frame, state, and sound definitions will be available. This variable is enabled by default for all user EDFs, but is disabled if the game is loaded in Heretic mode and the default root.edf file in Eternity's directory is loaded. ====HERETIC ==== When this option is enabled, Heretic thing, frame, state, and sound definitions will be available. This variable is enabled by default for all user EDFs, but is disabled if the game is loaded in DOOM or DOOM II mode and the default root.edf in Eternity's directory is loaded. Notes on Game Mode Options: As mentioned in their descriptions, the DOOM and HERETIC options will be enabled by default when user EDF files are loaded. However, user EDF files can explicitly call the disable function to turn off one or both options before including any of Eternity's defaults. It is best to do this when you know you will not be using any of one of the game modes' definitions. Example: // this thing type is only available if HERETIC is enabled ifenabled(HERETIC) thingtype foo { spawnstate = S_FOO1 } endif() Note on command-line option "-edfenables": The -edfenables command-line option allows the user to override the default behavior explicitly and enable all gamemodes' definitions without adding an EDF file. This does not interfere with explicit usage of enable functions in user EDFs, but it does allow older DeHackEd patches and WADs which might assume Heretic definitions are available in DOOM or vice versa to work.
Summary:
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)
Navigation menu
Page actions
Page
Discussion
Read
Edit
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Log in
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
Tools
What links here
Related changes
Special pages
Page information