LOADACS

From ZDoom Wiki
Jump to navigation Jump to search

LOADACS is a lump which supports automatically loading ACS objects (even for Doom-format maps).

To use it, compile the ACS files as ordinary libraries placed between A_START/A_END markers in WADs, or the acs/ directory in PK3s (the ACS namespace).

Then outside the markers, create a lump called LOADACS. This is just a plain text lump that lists all the library lumps you want to autoload with every map. You can do this with as many scripts as you want, and LOADACS lumps are also cumulative.

NB: This is often referred to as Global ACS, though this is not, and has never been, its true name.

Error.gif
Warning: While scripts will work via LOADACS correctly if the script is missing the "library" header, this will cause all strings and named scripts to conflict with the map's default script. For more information see libraries.


Example

Here's an example of using LOADACS to include compiled ACS lumps which should be in the ACS namespace. First here's the scripts lump:

#library "myscript" // Name of the library
#include "zcommon.acs"

script "myscript_Player_Damage" ENTER // A unique name is less likely to conflict with other maps with scripts
{
DamageThing(10); // Damage the player as soon as he spawns. How evil!
}

And here is the LOADACS lump after compiling the above.

myscript // The name of the lump.

If done correctly script will be used in every map, and the player will be damaged. The compiled script lump name does not have to be the same as the library name. The LOADACS lump itself must be found in the Global Namespace (not in the ACS namespace).

See Also

Scripts