A very large number, as close to “forever” as we can get with milliseconds of time.

Member Functions

Add

nil Add(Entity ent, number timeToWatchMS)

If a function called “OnWatchTimeout” exists in the Entity’s namespace, it will be called when the watch times-out (finishes). The function must accept a parameter that will be a boolean set to TRUE if the Entity is currently on the screen. If an Entity is deleted who was on the watch list, it is automatically removed.

Usage

//we want to know when the watch is overOnWatchTimeout(bIsOnScreen) LogMsg("Watch complete, no longer letting this entity run on its own!");

if (bIsOnScreen) then LogMsg("Entity is currently on the screen!"); else LogMsg("Entity is off screen."); endend

Notes

If you would like an entity to become as its map is loaded, you can call this function in an entity’s OnMapInsert() script function.