Named script

ZDoom can now support using script names instead of numbers in ACS. So, instead of using

Script 1 (void)
{
   <some instructions>
}

It is possible to use:

Script "My named script" (void)
{
   <some instructions>
}

The main advantage is to prevent script collision. For example, you can use script names containing the name of your mod to make them truly unique. Internally, the script name is converted to a unique negative number.

This requires ACC v1.51 or later for compilation.

Work on named scripts began with r3358, and the bulk of the work ended with r3374, with minor additions and fixes up to r3405.

Console

Just as puke is used to execute numbered scripts, pukename can be used to execute named scripts from the console. If your script name includes spaces, you have to enclose it within quotes, for example:

pukename "healing script"

If you have to enclose the pukename instruction itself within quote (for creating an alias or binding, for example), use escaped quotes:

alias help "pukename \"healing script\""
bind h "pukename \"healing script\""

Action specials

Currently, named script functions are supported for ACS and DECORATE only; they do not exist as action specials. However, with the ZDoom namespace of the Universal Doom Map Format, an alternative is available with the arg0str property.

For UDMF, keep using the old specials (use ACS_Execute instead of ACS_NamedExecute, for example). Go to the Custom tab, and add a new "arg0str" property to the thing or linedef. Type the name of the script there. The script number will be ignored.

Doom Builder 2 note: Do not include quotation marks around the property field arg0str or the name of the script in the value field, as this will cause DB2 to crash.

Forum threads

See also

Script functions
ACS_ExecuteACS_NamedExecute
ACS_ExecuteWaitACS_NamedExecuteWait
ACS_ExecuteAlwaysACS_NamedExecuteAlways
ACS_ExecuteWithResultACS_NamedExecuteWithResult
ACS_LockedExecuteACS_NamedLockedExecute
ACS_LockedExecuteDoorACS_NamedLockedExecuteDoor
ACS_SuspendACS_NamedSuspend
ACS_TerminateACS_NamedTerminate
ScriptWaitNamedScriptWait
FS_ExecuteUsePuzzleItem
This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.