EFU VFX tags

Started by Kotenku, July 05, 2014, 04:54:47 AM

Previous topic - Next topic

Kotenku

In order to create placeables that glow in EfU, give the placeables tags according to the visual effect you want.

The tags which exist, and which should hopefully be self-explanatory are:

o_Shadowed
o_Barkskin
o_Stoned
o_Iced

as well as:

o_Glow_Color


Be advised that unless you add additional scripting to your module, you won't actually see the visual effects when testing things in single-player, nor while toolsetting.

where Color is Red, Purple Green, Blue, Orange, White, Yellow, Brown, or Grey

So for example the Tag would read o_Glow_Green

For other VFX, you can create give an object the variable 'nVFX' and assign it a value corresponding to the Visual Effect you want, from this page. The Object needs to have the tag "o_VFX"

I'm working on a script that will allow for it since, for highly  aesthetic areas, it may be very desirable to see things as they will be  once imported to EFU. Don't uh, hold your breath though.

Kotenku

Here is the code which will apply visual effects. Set this in an Area's OnEnter Script when testing, and it will step through and apply Visual effects to all objects in the area with the tags "o_Stoned", "o_Barkskin", "o_Iced", "o_Shadowed", or "o_VFX". Objects tagged o_VFX will default to effect 0 and Glow Blue and White, unless a variable is set on the object.

#include "x0_i0_destroy"

void main()
{
    object oEntering = GetEnteringObject();


        int nShadowed = CountAllObjectsInAreaByTag("o_Shadowed", oEntering);
        int nIced = CountAllObjectsInAreaByTag("o_Iced", oEntering);
        int nBarked = CountAllObjectsInAreaByTag("o_Barkskin", oEntering);
        int nStoned = CountAllObjectsInAreaByTag("o_Stoned", oEntering);
        int nVFXtotal = CountAllObjectsInAreaByTag("o_VFX", oEntering);
        int nShadowIndex, nIceIndex, nBarkIndex, nStoneIndex, nVFXIndex;


           for (nShadowIndex=1; nShadowIndex<=nShadowed; nShadowIndex++)
                {
                object oTarget = GetNearestObjectByTag("o_Shadowed", oEntering, nShadowIndex);
                ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR), oTarget);
                }

           for (nIceIndex=1; nIceIndex<=nIced; nIceIndex++)
                {
                object oTarget = GetNearestObjectByTag("o_Iced", oEntering, nIceIndex);
                ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_ICESKIN), oTarget);
                }

           for (nBarkIndex=1; nBarkIndex<=nBarked; nBarkIndex++)
                {
                object oTarget = GetNearestObjectByTag("o_Barkskin", oEntering, nBarkIndex);
                ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_PROT_BARKSKIN), oTarget);
                }

           for (nStoneIndex=1; nStoneIndex<=nStoned; nStoneIndex++)
                {
                object oTarget = GetNearestObjectByTag("o_Stoned", oEntering, nStoneIndex);
                ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_PROT_STONESKIN), oTarget);
                }

           for (nVFXIndex=1; nVFXIndex<=nVFXtotal; nVFXIndex++)
                {
                object oTarget = GetNearestObjectByTag("o_VFX", oEntering, nVFXIndex);
                int nVFXref = GetLocalInt(oTarget, "nVFX");
                effect eVis = EffectVisualEffect(nVFXref);
                ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis, oTarget);
                }

}
I haven't implemented the colored glows, and don't have any plans to right now. If you feel like building on the general template I've got here, feel free to go for it and post back.

Edit:

Important thing I forgot to mention! Objects must not be static! If they're static the script won't work on them at all.

Took me like 3 hours to figure that out.