AddEffect (deprecated)

Category: Effects
Since engine version: 1.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.

Syntax

proplist AddEffect(string name, object target, int priority, int timer, object command_target, id  command_target_id, any var1, any var2, any var3, any var4);

Parameters

name:
Name of the effect without prepended 'Fx'.
target:
[opt] Target object for the effect. If nil, Global is used, but the target parameter of the callbacks will get nil.
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.
command_target:
[opt] Command target. If specified, all callbacks are executed in this object. Otherwise the callbacks are made without any object context. If the command target object is deleted, all effects belonging to this object are deleted without any further callbacks. If the target object changes its definition, belonging effects should reassign their callback functions using effect.Name = effect.Name.
command_target_id:
[opt] Definition in which callbacks are to be executed if no command target object is specified. If both command_target and command_target_id are nil, callbacks are made globally. For this, the Fx* must also be declared globally or they must be engine functions.
var1:
[opt] First extra parameter to be passed to Fx*Start and Fx*Effect callbacks.
var2:
[opt] Second extra parameter to be passed to Fx*Start and Fx*Effect callbacks.
var3:
[opt] Third extra parameter to be passed to Fx*Start and Fx*Effect callbacks.
var4:
[opt] Fourth extra parameter to be passed to Fx*Start and Fx*Effect callbacks.

Remark

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