ScheduleCall

Category: Script
Since engine version: 4.9.5.0 CE

Description

Calls a function after a specified delay.

Syntax

bool ScheduleCall (object pObj, string szFunction, int iInterval, int iRepeat,  ...);

Parameters

pObj:
Object in which to call the function. Can be 0 in local calls.
szFunction:
Name of the function to call.
iInterval:
Delay after which the first call is made. If iRepeat is greather than 1, this is also the delay inbetween subsequent calls.
iRepeat:
Number of calls. If 0 or not specified, the call is made exactly once.
...:
Additional parameters which are passed to the function called.

Remark

This function is implemented in System.c4g using the effect "IntScheduleCall" in function Call.

Example

ScheduleCall(FindObject(CLNK), "Redefine", 500, 0, MCLK);
Calls the function "Redefine" in a clonk with a delay of 500 ticks and passes "MCLK" as additional parameter. This will cause the clonk to change into a magician after 500 frames unless the call is cancelled earlier using ClearScheduleCall.
See also: ClearScheduleCall, Schedule
PeterW, August 2005