Terminate

terminate;

Usage

Terminate is a function used in ACS to end the current script early. You can also use ACS_Terminate to terminate other scripts.

Example

This script will terminate itself if the player has not collected all the keys yet.

int keys = 0; // See Scope

script 1 (void)
{
    keys++;

    if (keys < 3)
         terminate;

    // All keys collected, open the door.
    Door_Open (24, 16, 0);
}

Note that there is no need to add the terminate command to the very end of a script. (After the Door_Open line in this example) When the closing brace is reached, the script will terminate itself automatically.

See also

This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.