ScheduleCall

Category: Script
Since engine version: 1.0 OC

Description

Calls a function after a specified delay.

Syntax

bool ScheduleCall(object obj, string function, int delay, int repeat,  ...);

Parameters

obj:
Object in which to call the function. nil for no object context.
function:
Name of the function to call.
delay:
Delay after which the first call is made. If repeat is greather than 1, this is also the delay inbetween subsequent calls.
repeat:
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.ocg using the effect "IntScheduleCall" in function Call.

Example

ScheduleCall(this, "Explode", 500, 0, 50);
Calls the function "Explode" in this object with a delay of 500 ticks and passes 50 as additional parameter. This will cause the object to explode with a strength of 50 after 500 frames unless the call is cancelled earlier using ClearScheduleCall.
See also: ClearScheduleCall, Schedule
PeterW, 2005-08