ACS scripting: Difference between revisions

From Eternity Wiki
Jump to navigationJump to search
(Updated the description, removed wrong or outdated information)
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
For the upcoming Hexen implementation, Eternity supports ACS scripts. As well as it can run the vanilla Hexen ACS script bytecodes, it can run the modern ACS as produced for ZDoom, and it's designed to be compatible with the functions and definitions provided in ''zcommon.acs''.  
For the upcoming Hexen implementation, Eternity supports ACS scripts. As well as it can run the vanilla Hexen ACS script bytecodes, it can run the modern ACS as produced for ZDoom, and it's designed to be compatible with the functions and definitions provided in ''zcommon.acs''.


Comprehensive information regarding the ACS language for Hexen can be found at the [http://doomlegacy.sourceforge.net/hosted/hexenspec09.txt Official Hexen Technical Specs] by Ben Morris and Ben Gokey.
Comprehensive information regarding the ACS language for Hexen can be found at the [http://doomlegacy.sourceforge.net/hosted/hexenspec09.txt Official Hexen Technical Specs] by Ben Morris and Ben Gokey.


Most or all of the [[Detailed parameterized linedef specification|parameterized]] specials can be called from ACS as functions, though the equivalent numbers they use (as listed in ''zspecial.acs'') are from the Hexen namespace. This is also to keep easy compatibility with ''zcommon.acs'', so there will be as little need as possible to rewrite the include files.
Most or all of the [[Detailed parameterized linedef specification|parameterized]] specials can be called from ACS as functions, though the equivalent numbers they use (as listed in ''zspecial.acs'') are from the Hexen and UDMF namespaces. This is also to keep easy compatibility with ''zcommon.acs'', so there will be as little need as possible to rewrite the include files.
{{Backto|Editing reference}}
{{Backto|Editing reference}}


== Using ACS for your map ==
== Using ACS for your map ==
=== Doom (classic) format maps ===
This information does not apply for UDMF or Hexen format maps.


ACS scripts can be loaded with Doom-format maps through the help of [[MapInfo|EMAPINFO]] and [[ExtraData]]. The MapInfo entry for the map needs at least a specifier for its ExtraData lump and compiled ACS lump (setting the '''extradata''' and '''acsscript''' entries).
ACS scripts can be loaded with Doom-format maps through the help of [[MapInfo|EMAPINFO]] and [[ExtraData]]. The MapInfo entry for the map needs at least a specifier for its ExtraData lump and compiled ACS lump (setting the '''extradata''' and '''acsscript''' entries).


The script can be written in a text editor and compiled using acc. Wad tools like SLADE also have the capability to compile ACS scripts. After obtaining the behavior lump (usually with the .o extension), import it in a wad and place it between lumps '''A_START''' and '''A_END'''. The '''acsscript''' entry from EMAPINFO should then reference this compiled lump.
The script can be written in a text editor and compiled using the '''acc''' tool (see https://devbuilds.drdteam.org/ACC/). After obtaining the behavior lump (usually with the .o extension), import it in a wad and place it between lumps '''A_START''' and '''A_END'''. The '''acsscript''' entry from EMAPINFO should then reference this compiled lump.
 
Wad tools like SLADE also have the capability to compile ACS scripts from source lumps, and will automatically place them inside '''A_START''' and '''A_END''', creating these marker lumps if necessary.
 
''Important'': do not place the compiled ACS script as a BEHAVIOR lump after the level lumps, as it is done in Hexen or UDMF format maps. This will cause Eternity to assume your map is designed in the Hexen format (with Hexen-format THINGS and LINEDEFS), despite it being in the Doom format, resulting in errors or unpredictable effects when loading the level.
 
ACS scripts will be callable from map linedefs by using the parameterized script specials or the legacy non-parameterized specials.


''Important'': do not place the compiled ACS script as a BEHAVIOR lump after the level lumps, as it is done in Hexen-format maps. This will cause Eternity to assume your map is designed in the Hexen format (with such specified THINGS and LINEDEFS), despite it being in the Doom format, resulting in errors or unpredictable effects when loading the level.
=== Hexen format ===
Most editors which support ZDoom and Hexen editing should have the ability to compile scripts built-in. Otherwise, you can still use the command-line '''acc''' tool and import the resulting '''.o''' file into a '''BEHAVIOR''' lump after the last level lump ('''BLOCKMAP''').


ACS scripts will be callable from map linedefs by using the parameterized script specials or the legacy non-parameterized specials which used to call FraggleScript or Small before they were removed.
=== UDMF format ===
This is similar to the Hexen format, except that '''BEHAVIOR''' has to be placed within the '''TEXTMAP''' - '''ENDMAP''' lump range.


== Calling ACS scripts from actor frames ==
== Calling ACS scripts from actor frames ==


Eternity actors can call ACS scripts directly, by using the [[StartScript]] codepointer.
Eternity actors can call ACS scripts directly, by using the [[StartScript]] codepointer. Named scripts are also supported, and generally recommended, using the [[StartScriptNamed]] codepointer.


== Testing ACS scripts from console ==
== Testing ACS scripts from console ==
Line 27: Line 38:
*[[ACS spawn IDs]]
*[[ACS spawn IDs]]
*[[ACS built-in functions]]
*[[ACS built-in functions]]
*[[ACS constants]]
*[[ACS directives]]
*[[ACS libraries]]


[[Category:ACS]]
[[Category:Editing reference]]
[[Category:Editing reference]]

Revision as of 07:02, 8 April 2017

For the upcoming Hexen implementation, Eternity supports ACS scripts. As well as it can run the vanilla Hexen ACS script bytecodes, it can run the modern ACS as produced for ZDoom, and it's designed to be compatible with the functions and definitions provided in zcommon.acs.

Comprehensive information regarding the ACS language for Hexen can be found at the Official Hexen Technical Specs by Ben Morris and Ben Gokey.

Most or all of the parameterized specials can be called from ACS as functions, though the equivalent numbers they use (as listed in zspecial.acs) are from the Hexen and UDMF namespaces. This is also to keep easy compatibility with zcommon.acs, so there will be as little need as possible to rewrite the include files.

Back to Editing reference

Using ACS for your map

Doom (classic) format maps

This information does not apply for UDMF or Hexen format maps.

ACS scripts can be loaded with Doom-format maps through the help of EMAPINFO and ExtraData. The MapInfo entry for the map needs at least a specifier for its ExtraData lump and compiled ACS lump (setting the extradata and acsscript entries).

The script can be written in a text editor and compiled using the acc tool (see https://devbuilds.drdteam.org/ACC/). After obtaining the behavior lump (usually with the .o extension), import it in a wad and place it between lumps A_START and A_END. The acsscript entry from EMAPINFO should then reference this compiled lump.

Wad tools like SLADE also have the capability to compile ACS scripts from source lumps, and will automatically place them inside A_START and A_END, creating these marker lumps if necessary.

Important: do not place the compiled ACS script as a BEHAVIOR lump after the level lumps, as it is done in Hexen or UDMF format maps. This will cause Eternity to assume your map is designed in the Hexen format (with Hexen-format THINGS and LINEDEFS), despite it being in the Doom format, resulting in errors or unpredictable effects when loading the level.

ACS scripts will be callable from map linedefs by using the parameterized script specials or the legacy non-parameterized specials.

Hexen format

Most editors which support ZDoom and Hexen editing should have the ability to compile scripts built-in. Otherwise, you can still use the command-line acc tool and import the resulting .o file into a BEHAVIOR lump after the last level lump (BLOCKMAP).

UDMF format

This is similar to the Hexen format, except that BEHAVIOR has to be placed within the TEXTMAP - ENDMAP lump range.

Calling ACS scripts from actor frames

Eternity actors can call ACS scripts directly, by using the StartScript codepointer. Named scripts are also supported, and generally recommended, using the StartScriptNamed codepointer.

Testing ACS scripts from console

ACS scripts can be tested from the console by using the puke command.

ACS details