EffectVisualEffect(int, int)

Creates a new visual effect object

effect EffectVisualEffect(
    int nVisualEffectId,
    int nMissEffect = FALSE
);

Parameters

nVisualEffectId

The visual effect to be applied

nMissEffect

if this is TRUE, a random vector near or past the target will be generated, on which to play the effect (Default: FALSE)


Description

This function creates a new Visual Effect.

Visual effects are all in the file "visualeffects.2da" and there are normally several which do not have effect constants (under VFX_ in the constants list).

Some are special beams, however, and must be applied using EffectBeam(). Some can only be fired at a creature (EG: Stoneskin effect) and are normally VFX_IMP_ and VFX_DUR_ constants, while some should be really only fired at a location, usually VFX_FNF_.

VFX_DUR_ (Visual effect: Duration) usually need a temporary or permanent application. VFX_FNF_ (Visual Effect: Fire & Forget) usually are fired instantly, as are VFX_IMP_ (Visual Effect: Impact).

If nMissEffect is TRUE, a random location is chosen for where the effect will be applied to.



Remarks

In NWN Script each effect that you are allowed to place on an object has it’s own constructor that creates a new instance of the specified effect (Constructors are special methods that return a new instance of an object). This effect object can then be used in an ApplyEffectToObject() Command.


Version

1.22

Example

//Create the new visual effect
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
//Apply the effect
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDur, oTarget);

See Also

functions: ApplyEffectAtLocation | ItemPropertyVisualEffect
categories: Effects Functions | Visual Effects Functions
constants: VFX_IMP_* Constants


 author: Michael Nork, editor: Jasperre
 Send comments on this topic.