ACS scripting: Difference between revisions

From Eternity Wiki
Jump to navigationJump to search
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
For the upcoming Hexen implementation, Eternity supports ACS scripts. Note that unlike in ZDoom, it requires the vanilla Hexen format, which can be compiled using modern ACC by using the -h command-line switch, or by using an old version of ACC. 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.
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''.


All [[Detailed parameterized linedef specification|parameterized]] specials can be called from ACS as functions.
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 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 ==


ACS scripts can be used 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).
=== Doom (classic) format maps ===
This information does not apply for UDMF or Hexen format maps.


The script can be written in a text editor and compiled using acc (or, in new ACC's case, acc -h) and imported with a tool like SLADE3, which supports editing your map with Doom Builder 2 simultaneously.
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).


''Important'': don't set the acs script name to BEHAVIOR and put it after BLOCKMAP. This will break forward compatibility of your map with future versions of Eternity that support the Hexen format, which can be identified by looking for the annexed BEHAVIOR lump. Only use BEHAVIOR when Hexen and/or UDMF format becomes possible in Eternity.
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.


ACS scripts will be callable from map linedefs by using the parameterized 365 ('''ACS_Execute''') special through an ExtraData record of the linedef. Note that currently there is no ACS_ExecuteAlways special.
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.


== Calling ACS scripts from actor frames ==
''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.


Eternity actors can call ACS scripts directly, by using the [[StartScript]] codepointer.
ACS scripts will be callable from map linedefs by using the parameterized script specials or the legacy non-parameterized specials.


== Testing ACS scripts from console ==
=== 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 can be tested from the [[console]] by using the '''puke''' command.
=== UDMF format ===
This is similar to the Hexen format, except that '''BEHAVIOR''' has to be placed within the '''TEXTMAP''' - '''ENDMAP''' lump range.


== ACS spawn IDs ==
== Calling ACS scripts from actor frames ==


For Hexen compatibility, parameterized specials like '''Thing_Spawn''' or '''Thing_SpawnNoFog''' use the '''acs_spawndata''' { '''num''' } properties of [[thingtype]]s, instead of using doomednum, dehackednum or EDF mnemonics.
Eternity actors can call ACS scripts directly, by using the [[StartScript]] codepointer. Named scripts are also supported, and generally recommended, using the [[StartScriptNamed]] codepointer.


=== Doom spawn IDs ===
== Testing ACS scripts from console ==
The following ACS spawn numbers will only work in Doom mode.
==== Monsters====
*Zombieman: 4
*Sergeant: 1
*Archvile: 111
*Revenant: 20
*Mancubus: 112
*Chaingunner: 2
*Doom Imp: 5
*Demon: 8
*Spectre: 9
*Cacodemon: 19
*Baron of Hell: 3
*Hell Knight: 113
*Lost Soul: 110
*Spiderdemon: 7
*Arachnotron: 6
*Cyberdemon: 114
*Pain Elemental: 115
*Wolf SS: 116


====Projectiles====
ACS scripts can be tested from the [[console]] by using the '''puke''' command.
*Tracer Shot: 52
*Mancubus Shot: 153
*Baron Shot: 154
*Doom Imp Shot: 10
*Cacodemon Shot: 126
*Rocket Shot: 127
*Plasma Shot: 51
*BFG Shot: 128
*Arachnotron Shot: 129
 
====Effects====
*Boss Spawn Fire: 98
*Bullet Puff: 131
*Doom Blood: 130
 
====Interactive inanimate====
*Doom Barrel: 125
 
====Items====
=====Health and armour=====
*Green Armor: 68
*Blue Armor: 69
*Health Bonus: 152
*Armor Bonus: 22
*Stim Pack: 23
*Medi Kit: 24
*Soul Sphere: 25
*Mega Sphere: 132
 
=====Keys=====
*Doom Blue Card: 85
*Doom Red Card: 86
*Doom Yellow Card: 87
*Doom Yellow Skull: 88
*Doom Red Skull: 89
*Doom Blue Skull: 90
 
=====Powerups=====
*Invuln Sphere: 133
*Berzerk Box: 134
*Invisi Sphere: 135
*Radiation Suit: 136
*Computer Map: 137
*Light Amp Visor: 138
 
=====Ammunition=====
*Ammo Clip: 11
*Ammo Bullet Box: 139
*Ammo Rocket: 140
*Ammo Rocket Box: 141
*Ammo Cell: 75
*Ammo Cell Pack: 142
*Ammo Shells: 12
*Ammo Shell Box: 143
*Backpack: 144
=====Weapons=====
*Weapon BFG: 31
*Weapon Chaingun: 28
*Weapon Chainsaw: 32
*Weapon Rocket Launcher: 29
*Weapon Plasma Gun: 30
*Weapon Shotgun: 27
*Weapon SSG: 33
=====Decoration=====
*Dead Doom Player Gibs: 145
*Crushed Gibs: 146
*Flaming Barrel: 149
*Pool Blood and Guts: 147
*Pool Blood: 148
*Pool Brain: 150
 
=== Heretic spawn IDs ===
The following ACS spawn numbers will only work in Heretic mode.
 
====Items====
=====Health and armour=====
*Crystal Vial: 23
*Silver Shield: 68
*Enchanted Shield: 69
=====Ammunition=====
*Bag of Holding: 136
*H Ammo Wand Wimpy: 11
*H Ammo Wand Hefty: 12
*H Ammo Mace Wimpy: 35
*H Ammo Mace Hefty: 36
*H Ammo CBow Wimpy: 33
*H Ammo CBow Hefty: 34
*H Ammo Skull Wimpy: 158
*H Ammo Skull Hefty: 159
*H Ammo Phoenix Wimpy: 161
*H Ammo Phoenix Hefty: 162
*H Ammo Blaster Wimpy: 37
*H Ammo Blaster Hefty: 38
 
=====Powerups=====
*Map Scroll: 137
=====Keys=====
*Heretic Green Key: 86
*Heretic Blue Key: 85
*Heretic Yellow Key: 87
====Interactive inanimate====
*Pod: 125
*Pod Generator: 126
*Heretic Volcano: 150
====Effects====
*Tele Glitter Red: 166
*Tele Glitter Blue: 167
====Monsters====
*Golem: 4
*Nitro Golem: 2
*Golem Ghost: 8
*Nitro Golem Ghost: 9
*Weredragon: 3
*Ophidian: 132
*Sabre Claw: 1
*Disciple: 19
*Death Knight: 6
*Death Knight Ghost: 129
*Serpent Rider D'sparil: 142
*D'sparil: 143
*Maulotaur: 114
*Iron Lich: 20
*Heretic Imp: 5
*Heretic Imp Leader: 7
 
====Projectiles====
*Golem Shot: 131
*Weredragon Shot: 120
*Ophidian Shot A: 138
*Ophidian Shot B: 139
*Disciple Shot: 140
*Knight Axe: 127
*Knight Axe Red: 128
*SR D'sparil Shot 1: 144
*D'sparil Shot 1: 146
*D'sparil Shot 2: 145
*Volcano Ball: 123
*Volcano Ball Small: 124
*Maulotaur Shot: 115
*Maulotaur Floor Fire: 116
*Maulotaur Floor Flame: 117
*Iron Lich Shot 1: 164
*Lich Whirlwind: 165
*Heretic Imp Shot: 10


====Ambient sounds====
== ACS details ==
*Heretic Ambience Wind: 110
*[[ACS spawn IDs]]
*Heretic Ambience Water: 111
*[[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