wapeddell1 Posted April 19, 2020 Share Posted April 19, 2020 (edited) So I have in place a perk with a spell attach that supposed to activate when the if statement is met but it doesn't seem to work. The script compiles but the game isn't running the script. Scriptname necroplasmacheck extends ActiveMagicEffect Event OnInit() RegisterForSingleUpdate(1.0) Debug.Notification("Your Necroplasma is 9:9:9:9") EndEvent Event OnUpdate() float playersMagicka = Game.GetPlayer().GetActorValuePercentage("magicka") If ( playersMagicka < 0.5) Debug.Notification("Your Necroplasma is less than 4:9:9:9, find souls to devour.") elseif ( playersMagicka < 0.1) Debug.Notification("Your Necroplasma is less than 0:9:9:9, you're about to die Spawn.") EndIf Endevent Edited April 19, 2020 by wapeddell1 Link to comment Share on other sites More sharing options...
NexusComa Posted April 20, 2020 Share Posted April 20, 2020 Not sure here never done any spell scripting ...It looks like it's set up to have the script tell you the one time when you load up the game if the stat magicka is below a %. Again I'm not sure here but ...I think you may need to re-call RegisterForSingleUpdate(). Maybe make that a bit longer - as it will be running every second you play the game after that.Event OnUpdate() float playersMagicka = Game.GetPlayer().GetActorValuePercentage("magicka") UnregisterForUpdate() If (playersMagicka < 0.5) Debug.Notification("Your Necroplasma is less than 4:9:9:9, find souls to devour.") elseif (playersMagicka < 0.1) Debug.Notification("Your Necroplasma is less than 0:9:9:9, you're about to die Spawn.") else RegisterForSingleUpdate(8.0) EndIfEndevent Something like that maybe. Sorry if I'm way off. Didn't test anything here. Link to comment Share on other sites More sharing options...
ReDragon2013 Posted April 20, 2020 Share Posted April 20, 2020 (edited) You wrote: "So I have in place a perk with a spell attach that supposed to activate when the if statement is met but it doesn't seem to work." 1. Keep watching the names you are using. Its still a simple project, but it is growing you will quickly lose the overview.2. At least use two magic effects and make for each effect a single condition, remove any other condition you show us with images NecroplasmaItemScript Scriptname NecroplasmaItemScript extends ObjectReference ; https://forums.nexusmods.com/index.php?/topic/8617233-need-help-with-making-debug-notification-appear-when-magicka-gets-to-a-certain/ ; if player is wearing the enchanted item, give him the special perk Perk PROPERTY necroplasmacheck auto ; your perk ; -- EVENTs -- 2 its like script DLC1DawnguardItemScript, DLC1LD_AetherialShieldScript EVENT OnEquipped(Actor akActor) Debug.Trace(self + "OnEquipped() - actor = " +akActor) akActor.AddPerk(necroplasmacheck) ENDEVENT EVENT OnUnEquipped(Actor akActor) Debug.Trace(self + "OnUnEquipped() - actor = " +akActor) akActor.RemovePerk(necroplasmacheck) ENDEVENT NecroplasmaMGEFScript Scriptname NecroplasmaMGEFScript extends ActiveMagicEffect ; https://forums.nexusmods.com/index.php?/topic/8617233-need-help-with-making-debug-notification-appear-when-magicka-gets-to-a-certain/ ; script can be used for more than one magic effect ; 1. magicka <= 0.5 ; 2. magicka <= 0.1 ; Perk : "necroplasmacheck" no conditions ; -> Spell: "PerkNecroCheckAbility" no conditions ; -> MGEF 1: "NecroPlasmaMGEF1" S GetActorValue Magicka < 0.500 ; -> MGEF 2: "NecroPlasmaMGEF2" S GetActorValue Magicka < 0.100 ; -- EVENTs -- 2 ; Hint: If you need the target use this as follow! ; float f = akTarget.GetActorValuePercentage("magicka") EVENT OnEffectStart(Actor akTarget, Actor akCaster) float f = akCaster.GetActorValuePercentage("magicka") Debug.Trace(" start with Necroplasma: " + f) ; for debugging IF (f < 0.5) Debug.Notification("Your Necroplasma is less than 4:9:9:9, find souls to devour.") ELSE ;IF (f < 0.1) Debug.Notification("Your Necroplasma is less than 0:9:9:9, you're about to die Spawn.") ENDIF ENDEVENT EVENT OnEffectFinish(Actor akTarget, Actor akCaster) float f = akCaster.GetActorValuePercentage("magicka") Debug.Trace(" finish with Necroplasma: " + f) ; for debugging ENDEVENT Edited April 20, 2020 by ReDragon2013 Link to comment Share on other sites More sharing options...
NexusComa Posted April 20, 2020 Share Posted April 20, 2020 This was more what I was thinking too. I've always tried to stay away from that register timer. Also didn't see anything about an item being worn . Link to comment Share on other sites More sharing options...
Recommended Posts