ZDoom Line Specials

83:ACS_LockedExecute

Name

ACS_LockedExecute — begin execution of a script, provided the player has the right key.

Synopsis

ACS_LockedExecute (script, map, s_arg1, s_arg2, lock);
ACS_LockedExecute (
  script,    // script to execute
  map,       // map containing the script
  s_arg1,    // first argument passed to the script
  s_arg2,    // second argument passed to the script
  lock       // required key, if any
);

Parameters

script
The script to execute. The specified map's BEHAVIOR resource is searched for a matching script first. If the BEHAVIOR does not have a matching script, then any libraries imported by the BEHAVIOR will be searched for the script. If the script cannot be found, a warning will be printed to the console, and no other action will be taken.
map
The map to execute the script on. This corresponds to the map's levelnum set in the MAPINFO lump. If you set map to zero, then the script will be executed on the current map.
s_arg1
The first parameter passed to the script.
s_arg2
The first parameter passed to the script.
lock
The key required to execute this script. If this is zero, this special is no different from ACS_Execute. See the list of key types for values you can use here.

ACS

This special's function is the same whether you activate it on a line or use it in a script.

Remarks

The only difference between this special and ACS_Execute is that this special will only execute the script if the player is carrying the correct key. If the player does not have the key, a message is printed to the screen to tell him which key he needs, and the script is not executed.

Just as with ACS_Execute, if the specified script is already running, this special will not start it again unless all the running copies of the script were started with ACS_ExecuteAlways.

Unlike ACS_Execute, you must specify two parameters to pass to the script. If the script only needs one parameter, you can use zero for the second parameter. If the script does not take any parameters, you can use zero for both of them.

See the Remarks section of ACS_Execute for more details on script execution.

Examples

Executing a script on the current map if the player has any key

ACS_LockedExecute (1, 0, 0, 0, 100);

Executing a script on another map if the player has any key

This example executes a script on a map with levelnum 3. Unless you specify otherwise in your MAPINFO, this will correspond to MAP03.

ACS_LockedExecute (1, 3, 0, 0, 100);

First Available In

Hexen

See Also

ACS_Execute | ACS_ExecuteAlways | ACS_Suspend | ACS_Terminate