From ZDoom Wiki
Jump to navigation Jump to search

void ACS_NamedExecuteWait (string script, int unused, int arg1, int arg2, int arg3)


Using ACS_NamedExecuteWait is exactly equivalent to the following two commands:

ACS_NamedExecute (script, 0, arg1, arg2, arg3);
NamedScriptWait (script);

Note that where you would specify a map number with ACS_NamedExecute, you must specify 0 here because you can only wait on scripts in the current map.


  • script: The script name to execute.
  • unused: Not currently used. Should always be set to 0.
  • arg1: First argument passed to the script.
  • arg2: Second argument passed to the script.
  • arg3: Third argument passed to the script.


Like ACS_ExecuteWait there are often other solutions to achieve the desired effect, however, this method could save unnecessary code repetition.

 script "WaitOnMonsters" (int tid)
     while (ThingCount(T_NONE, tid))
 script "MonsterChallengeA" (int tid, int tag, int speed)
     print(s:"Kill all the monsters to open the door.");
     ACS_NamedExecuteWait("WaitOnMonsters", 0, tid);
     Door_Open(tag, speed, TRUE);
 script "MonsterCallengeB" (int tid, int tag, int speed)
     Print(s:"Kill all the monsters to lower the floor.");
     ACS_NamedExecuteWait("WaitOnMonsters", 0, tid);
     Floor_LowerToLowest(tag, speed);
Script functions
ACS_Execute ACS_NamedExecute
ACS_ExecuteWait ACS_NamedExecuteWait
ACS_ExecuteAlways ACS_NamedExecuteAlways
ACS_ExecuteWithResult ACS_NamedExecuteWithResult
ACS_LockedExecute ACS_NamedLockedExecute
ACS_LockedExecuteDoor ACS_NamedLockedExecuteDoor
ACS_Suspend ACS_NamedSuspend
ACS_Terminate ACS_NamedTerminate
ScriptWait NamedScriptWait
FS_Execute UsePuzzleItem