Beamdog / nwn-issues

Neverwinter Nights: Enhanced Edition Technical Bug Tracker
http://nwn.beamdog.com
31 stars 1 forks source link

[8193.29] EffectIcon not working when linked #345

Closed FrogsOfDoom closed 3 years ago

FrogsOfDoom commented 3 years ago

I've been running the latest development patch, and EffectIcon doesn't seem to work when linked with another effect. Here's a snippet of script where it doesn't work:

    effect eIcon = EffectIcon(EFFECT_ICON_ABILITY_DECREASE_CHA);
    eIcon = EffectLinkEffects(EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE), eIcon);
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eIcon, OBJECT_SELF, 20.0f);
Daztek commented 3 years ago

I guess it works as a visual effect and can't be linked with other visual effects. It'll need a non vfx/icon effect in the link.

If you want an effect that does nothing you can just use an empty EffectRunScript() to the link

    effect eIcon = EffectIcon(EFFECT_ICON_ABILITY_DECREASE_CHA);
    eIcon = EffectLinkEffects(EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE), eIcon);
    eIcon = EffectLinkEffects(EffectRunScript(), eIcon);
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eIcon, oPlayer, 20.0f);
FrogsOfDoom commented 3 years ago

Thanks; that worked like a charm. Going to close it then.