From ZDoom Wiki
Jump to navigation Jump to search

void PolyWait (int polyid);


PolyWait delays the script it is 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).



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.