Skip to content

I am having trouble applying an effect to a non NPC object

4BOLTMAIN4BOLTMAIN Member Posts: 90
edited March 2020 in Builders - Scripting
As the title states I am trying to apply a specific effect to a non NPC object in an area and I do not know how to make this work. If I choose a NPC to apply the effect to it works fine. I am able to do other effects on objects but this one is stubborn. Here is what I have tried...
/*    I CANT GET THIS TO WORK... LOL!
    if (GetTag(oObject) == "MagicSparksBlue")
        {
        DelayCommand( 0.2, ApplyEffectToObject(DURATION_TYPE_PERMANENT, MagicalEffect(EffectVisualEffect(VFX_DUR_PROT_EPIC_ARMOR)), oObject));
        DelayCommand( 0.2, ApplyEffectToObject(DURATION_TYPE_INSTANT, MagicalEffect(EffectVisualEffect(VFX_DUR_PROT_EPIC_ARMOR)), oObject));
        DelayCommand( 0.2, ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, MagicalEffect(EffectVisualEffect(VFX_DUR_PROT_EPIC_ARMOR)), GetLocation(oObject)));
        DelayCommand( 0.2, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, MagicalEffect(EffectVisualEffect(VFX_DUR_PROT_EPIC_ARMOR)), GetLocation(oObject)));
        DelayCommand( 0.2, ApplyEffectToObject(DURATION_TYPE_PERMANENT, SupernaturalEffect(EffectVisualEffect(VFX_DUR_PROT_EPIC_ARMOR)), oObject));
        DelayCommand( 0.2, ApplyEffectToObject(DURATION_TYPE_INSTANT, SupernaturalEffect(EffectVisualEffect(VFX_DUR_PROT_EPIC_ARMOR)), oObject));
        DelayCommand( 0.2, ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, SupernaturalEffect(EffectVisualEffect(VFX_DUR_PROT_EPIC_ARMOR)), GetLocation(oObject)));
        DelayCommand( 0.2, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, SupernaturalEffect(EffectVisualEffect(VFX_DUR_PROT_EPIC_ARMOR)), GetLocation(oObject)));
        DelayCommand( 0.2, ApplyEffectToObject(DURATION_TYPE_PERMANENT, MagicalEffect(EffectVisualEffect(VFX_DUR_PROT_EPIC_ARMOR, TRUE)), oObject));
        DelayCommand( 0.2, ApplyEffectToObject(DURATION_TYPE_INSTANT, MagicalEffect(EffectVisualEffect(VFX_DUR_PROT_EPIC_ARMOR, TRUE)), oObject));
        DelayCommand( 0.2, ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, MagicalEffect(EffectVisualEffect(VFX_DUR_PROT_EPIC_ARMOR, TRUE)), GetLocation(oObject)));
        DelayCommand( 0.2, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, MagicalEffect(EffectVisualEffect(VFX_DUR_PROT_EPIC_ARMOR, TRUE)), GetLocation(oObject)));
        DelayCommand( 0.2, ApplyEffectToObject(DURATION_TYPE_PERMANENT, SupernaturalEffect(EffectVisualEffect(VFX_DUR_PROT_EPIC_ARMOR, TRUE)), oObject));
        DelayCommand( 0.2, ApplyEffectToObject(DURATION_TYPE_INSTANT, SupernaturalEffect(EffectVisualEffect(VFX_DUR_PROT_EPIC_ARMOR, TRUE)), oObject));
        DelayCommand( 0.2, ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, SupernaturalEffect(EffectVisualEffect(VFX_DUR_PROT_EPIC_ARMOR, TRUE)), GetLocation(oObject)));
        DelayCommand( 0.2, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, SupernaturalEffect(EffectVisualEffect(VFX_DUR_PROT_EPIC_ARMOR, TRUE)), GetLocation(oObject)));
        }

*/

How can I apply this effect to a location without using a NPC?

Comments

  • DazDaz Member Posts: 127
    Try unchecking the static flag in the object's properties
  • ProlericProleric Member Posts: 1,316
    If that doesn't work, try it on a non-static invisible object at the same location. You might need to raise the object above the ground, to about chest height for an NPC.
  • 4BOLTMAIN4BOLTMAIN Member Posts: 90
    edited March 2020
    Thanks guys, unchecking the static flag did the trick. I have been trying to do this off and on for months. The wiki doesn't say anything about an objects static flag.

    I was able to put an invisible object in the center of a castle interior tileset fountain with the z location set to -0.4 and it still worked.
  • meaglynmeaglyn Member Posts: 151
    The static flag is for the placeable. The wiki does mention the static flag in that context.
  • 4BOLTMAIN4BOLTMAIN Member Posts: 90
    meaglyn wrote: »
    The static flag is for the placeable. The wiki does mention the static flag in that context.

    "The object that this command is applied to has to be usable or, at least, not static (for a placeable)."

    I did not see this when I was looking through the information. This would have saved me a lot of time. Thanks for clarifying.
Sign In or Register to comment.