Sleep Module

This module allows objects to delay actions. Objects can pass a function object to the Sleep Module, with a timeout in game frames. When the timeout  expires, this module will “wake up” the object in question.

This is very useful for unit behaviours and delayed actions. Just remember to clean up after yourself so that the Sleep Module doesn’t try to wake up dead units.

To use it, make a call to the Wait function, passing a functor and how many frames to wait:

ai.sleep.Wait( callable, 1800 )