CreateEffect

Category: Effects
Since engine version: 8.0 OC

Description

Creates an effect. Returns the effect if successful or nil if not (e.g. because the effect was rejected). If the effect was accepted by another effect which is deleting itself within the same call, the return value is probably nil. Effects can be created on objects, Global and Scenario. This is passed as the first parameter to the effect callbacks.

Syntax

proplist CreateEffect(proplist prototype, int priority, int timer, any var1, any var2, any var3, any var4);

Parameters

prototype:
A proplist containing the callback functions for the new Effect. The name (GetName) of this proplist becomes the name of the effect.
priority:
Effect priority. Must be greater than zero.
timer:
[opt] Interval for the timer calls. With nil, no timer calls are made and the effect stays on permanently until it is deleted by other calls.
var1:
[opt] First extra parameter to be passed to Construction, Start and Effect callbacks.
var2:
[opt] Second extra parameter to be passed to Construction, Start and Effect callbacks.
var3:
[opt] Third extra parameter to be passed to Construction, Start and Effect callbacks.
var4:
[opt] Fourth extra parameter to be passed to Construction, Start and Effect callbacks.

Remark

For examples and more information see the effects documentation.
See also: CheckEffect, EffectCall, Effects Documentation, GetEffect, GetEffectCount, RemoveEffect
Sven2, 2004-03
Günther, 2014