Elementargewalt Posted August 31, 2020 Share Posted August 31, 2020 And yet another issue i recently have when trying to put a few custom spells together... I created some custom toggleable spells, which are working flawlessly with the script i´m using- one slow time spell and a night vision spell.Toggle on, toggle off- no problem. Now i want to do that with a detect life spell and it works too, but not as intended.When i toggle the spell on, everything is fine, but when i toggle it off the effect shader persists- really weird. Is there a command a can use in the script to ensure,that the shader go away too when toggleing the spell off? Or is there something else i´ve missed? It is possible to do it, because the predator vision mod does this without problems, but i cant figure out, how it would work...any ideas? Here is the script i use for the spells (property change with the spell): Scriptname AADetectAuraEffectToggleScript extends ActiveMagicEffect SPELL Property DetectAura AutoEvent OnEffectStart (Actor akTarget, Actor akCaster) If akTarget.HasSpell(DetectAura) == false akTarget.AddSpell(DetectAura, false) Else akTarget.RemoveSpell(DetectAura) EndIfEndEvent Thanks in advance Link to comment Share on other sites More sharing options...
ReDragon2013 Posted August 31, 2020 Share Posted August 31, 2020 DispelSpell() is the native function to remove all running effects of a spell. https://www.creationkit.com/index.php?title=DispelSpell_-_Actor maybe something like this:AADetectAuraEffectToggleScript Scriptname AADetectAuraEffectToggleScript extends ActiveMagicEffect ; https://forums.nexusmods.com/index.php?/topic/9069473-and-the-next-problemtoggle-effect-script-works-but-effect-shader-persists/ Spell PROPERTY DetectAura auto ; vanilla spell for comparing ; -- EVENT -- ; https://www.creationkit.com/index.php?title=AddSpell_-_Actor ; https://www.creationkit.com/index.php?title=DispelSpell_-_Actor ; https://www.creationkit.com/index.php?title=Cast_-_Spell EVENT OnEffectStart (Actor akTarget, Actor akCaster) IF akTarget.AddSpell(DetectAura, false) ; is TRUE, because the player or NPC does not have the spell already ;DetectAura.Cast(akTarget) ; spell was added before, now we cast this spell on the target actor ELSE ; is False, because the player has this spell akTarget.DispelSpell(DetectAura) ; remove spell effects akTarget.RemoveSpell(DetectAura) ; remove the spell(knowledge) from actor ENDIF ENDEVENT Link to comment Share on other sites More sharing options...
Elementargewalt Posted September 11, 2020 Author Share Posted September 11, 2020 No, this won´t work either. Spell toggles off as intended, but visual fx persists... Link to comment Share on other sites More sharing options...
Elementargewalt Posted September 11, 2020 Author Share Posted September 11, 2020 (edited) i figured out that the author of the predator vision mod used the blablabla.stop(target) command for the shaders, but when i try to use it, my script won´t compile. Man, such a simple task, but so much headache... Edited September 11, 2020 by Elementargewalt Link to comment Share on other sites More sharing options...
Evangela Posted September 12, 2020 Share Posted September 12, 2020 (edited) The syntax for that is EffectPlaying.Stop(target of the EffectPlaying) EffectShader property thisEffect auto .... thisEffect.Stop(Game.GetPlayer()) Edited September 12, 2020 by Rasikko Link to comment Share on other sites More sharing options...
Elementargewalt Posted September 12, 2020 Author Share Posted September 12, 2020 Unfortunately, this won´t remove the shader fx from the npcs. As the name of the command suggests, it would only affect the player, but not the npcs...Is there another way to affect npcs? Link to comment Share on other sites More sharing options...
Evangela Posted September 13, 2020 Share Posted September 13, 2020 That was an example to show you the syntax. The argument for that function that I passed the playing into can accept any objectreference. Link to comment Share on other sites More sharing options...
Recommended Posts