PolyWait

From ZDoom Wiki

Jump to: navigation, search

void PolyWait (int polyid)

Usage

Delays the script it's in until the polyobject with an id number specified (polyid) has finished its movement. For instance if a polyobject door is specified then the script will delay until it has been reset to its original location. This function is useful if you want something to happen exactly after a polyobject stops moving (or similar).

Parameters

  • polyid
The polyobject id to wait for.

Examples

The most straightforward use of this command would be after Polyobj_Move.

script 1 (void)
{
    Polyobj_Move (0, 10, 128, 64);
    PolyWait (0);
    Print (s:"Entryway is open.");
}

This script can be used in an adaptation of the example wad (729 bytes) at the polyobject page. Instead of using a line special on the doors, this script could be accessed via a switch or a thing special. It opens the door and reports to the player that this has happened.

Personal tools