Some major notes on visualeffects.2da, vfx_persistent and progfx.2da - you reference these lines using EffectVisualEffect() and EffectBeam() usually to apply them in game.
They rely on MDL models and/or MDL emitters.
Hardcoded Effects
There are two areas things are hardcoded:
- Models loaded into a cache at game start (you'll notice this if you ever run compileloadedmodels in the console): VFX Effect Caching
- Models loaded by MDL reference or by visualeffects.2da line by the engine directly: Hardcoded VFX References
Usually Hardcoded Engine Visual Effect Parameters ("programmed effects" or "progfx")
Up until 1.80.8193.14 these effect lines are hardcoded:
- 40 - VFX_FNF_WEIRD - This line will always play at 0.8 animation speed. Presumably the animator made it too fast and Bioware hacked in this speed.
- 999 - **** - This line is used for the dm_cowsfromhell and is basically encoded into the engine. This will likely override your use of the line so don't use it, and skip it.
- Spike Trap, Summon Celestial and the vfx_persistent line for Blade Barrier are the only lines allowed to use envmaps while no other VFX can do
- As of latest patches the Blade Barrier is the only line in vfx_persistent that is hardcoded. The others are optional with progfx.2da
- Stoneskin, Barkskin and other "skins" that affect a monsters actual texture are all hardcoded (no new ones can be added)
Essentially any column with "ProgFX" is "HardCodedVisualEffect" in the engine. However NWN:EE patches this as per below.
Softcoded Effect Parameters - progfx.2da
As of 1.80.8193.14 you can now change all the parameters of visual effects meaning new beams, new skins, new envmaps. See the contents of progfx.2da for more information (the default ones are decoupled to this).
Visual Effect Transforming
The 1.80.8193.14 patch includes new ways to translate and transform a visual effect using EffectVisualEffect() and EffectBeam():
effect EffectVisualEffect(int nVisualEffectId, int nMissEffect=FALSE, float fScale=1.0f, vector vTranslate=[0.0,0.0,0.0], vector vRotate=[0.0,0.0,0.0]); effect EffectBeam(int nBeamVisualEffect, object oEffector, int nMissEffect=FALSE, float fScale=1.0f, vector vTranslate=[0.0,0.0,0.0], vector vRotate=[0.0,0.0,0.0]);
Using these to rotate the original base game effects have varied amounts of success - many are tied to a plane, are essentially "2d" or somehow hardcoded.
Translate is as expected - it moves the centre of the VFX to an offset to the original.
The scale parameter may be very useful - bigger lightning bolts, bigger persistent visual effects and bigger fireball explosions. New visual effects can be of course significantly altered.
Tilemagic - Visual Effects versus Placeables
Tiles can now properly use environmental maps (envmaps) using progfx.2da but there are still some differences in rendering tiles as visual effects, versus a placeables.2da entry:
Render order is different
Priority is different
Tiles rendered from VFX also won't cast shadows (sometimes probably a good thing!) and there may be other benefits to using placeables as "tile magic" such as:
- Allowing the WOK to raise and lower heightmaps of the walkmesh - pits can be dynamically added for instance
- Additional effects - placeables can be activated/deactivated and so forth
- Less errors - such as the "repeating VFX" bug that occurs when moving in and out of LOS of the thing the VFX is playing on/location it is at