Since engine version: 9.0 OC
Adds a function from a proplist, effect, definition, or object to the calling context.
nil AddFunction(func call, bool override);
- This is the function that should be added.
- [opt] Overriding an existing function in the target context is not allowed and will lead to a FatalError if this is set to
When using this function be sure that you know what you are doing. Replacing functions can have unintended side effects.
// Make a specific rock explode if it hits with high velocity! var boom = CreateObject(Rock); boom->AddFunction(Firestone.Hit2);
This script makes a rock explode like a firestone. Note that only this one specific function is copied, so there will be no fuse effect, for example.