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
.
- name:
Name of the effect without prepended 'Fx'.
- target:
[opt]
Target object for the effect. If nil
, a global effect is created.
- 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.
For examples and more information see the
effects documentation.