Dragonfire12 Posted December 4, 2018 Share Posted December 4, 2018 I need some help with a mod I’m working on trying to get a script to fire.The game is Skyrim Special Edition.The Mod is my Vampire Follower, Athenasia. I want to spoof the movie Beetlejuice by using a shout to say Athenasia’s name three times fast. This transforms her into a Vampire Hag. Using the Shout a second time transforms her back to Athenasia. I created a version of the Whispmother, red and horribly awesome (called a Vampire Hag), and tied it to a summon spell.I’ve created the shout and have gotten it to load, etc., and I can use the shout in game but I can’t get the script to fire when I use the shout.I’m placing the script within the Magic Effect for the third word of the shout.The script compiles and I’m able to Fill all the Properties.Here is the script. Scriptname _AthanasiaShoutScript extends activemagiceffect Actor property pPlayerRef autoActor property pAthanasiaNPC autoObjectReference property pAthanasiaStorageMarker autospell property pAth_SummonVampireHag autoQuest property p0AthanasiaShoutQuest autoMessage Property p0Ath_ShoutMessage AutoMessage Property p0Ath_ShoutMessage1 AutoMessage Property p0Ath_ShoutMessage2 Auto Event OnInit() If p0AthanasiaShoutQuest.GetCurrentStageID() == 0 p0AthanasiaShoutQuest.SetCurrentStageID(10) p0Ath_ShoutMessage.show() ;Show first time use Message - will only display once in message window box. p0Ath_ShoutMessage1.show() ;Message Shout Stage 1 displayed top left screen pAthanasiaNPC.EquipSpell(pAth_SummonVampireHag, 0) pAth_SummonVampireHag.cast(pAthanasiaNPC) pAthanasiaNPC.moveto(pAthanasiaStorageMarker) pAthanasiaNPC.EnableAI(false) ;turn Athanasia AI processing off and store her someplace safe ElseIf p0AthanasiaShoutQuest.GetCurrentStageID() == 1 p0AthanasiaShoutQuest.SetCurrentStageID(10) ;First time the shout was used so set Quest Stage to prepare for the second time p0Ath_ShoutMessage1.show() ;Message Shout Stage 1 displayed top left screen pAthanasiaNPC.EquipSpell(pAth_SummonVampireHag, 0) pAth_SummonVampireHag.cast(pAthanasiaNPC) pAthanasiaNPC.moveto(pAthanasiaStorageMarker) pAthanasiaNPC.EnableAI(false) ;turn Athanasia AI processing off and store her someplace safe ElseIf p0AthanasiaShoutQuest.GetCurrentStageID() == 10 p0AthanasiaShoutQuest.SetCurrentStageID(1) ;Second time the shout was used so reset the Quest/Script p0Ath_ShoutMessage2.show() ;Message Shout Stage 2 displayed top left screen pAthanasiaNPC.EnableAI() ;turn Athanasia AI processing back on, summon her back to the player float az = pPlayerRef.GetAngleZ() pAthanasiaNPC.SetAngle(0.0, 0.0, az + 180.0) pAthanasiaNPC.MoveTo(pPlayerRef, 200.0 * Math.sin(az), 200.0 * Math.cos(az), 0.0, false) pAthanasiaNPC.DispelSpell(pAth_SummonVampireHag) ;dispel the Vampire Hag Endif EndEvent I think the problem may be how I am starting the script with, Event OnInit() I have looked and searched and I can’t seem to find the right Event to use to launch a script from a magic effect. Any Help? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted December 4, 2018 Share Posted December 4, 2018 OnEffectStart is the event you are looking for. Beyond that, make sure the properties are properly filled out and that you are testing on a new game / clean save (i.e. one that has not seen the mod before). Link to comment Share on other sites More sharing options...
Dragonfire12 Posted December 9, 2018 Author Share Posted December 9, 2018 (edited) @ IsharaMeradin It got the script to fire but it was firing twice. It took me forever to figure out that the Shout remained longer than it took for the script to run. This caused the script to fire twice.I rewrote the entire script added Utility.Wait(5.0) to the end to give the Shout time to dissipate. Seems like I've worked on this for months and it finally works. Thank you for your help. Scriptname _AthanasiaShoutScript extends activemagiceffect Actor Property pPlayerRef AutoActor Property pAthanasiaNPC AutoActor Property pAthanasia_VampireHag1 AutoObjectReference Property pAthanasiaStorageMarker AutoObjectReference Property pOAthVampireHagMarker AutoSpell Property p0HagVampireBats AutoSpell Property p0HagVolley AutoSpell Property p0HagVampireDrain AutoMessage Property p0Ath_ShoutMessage AutoMessage Property p0Ath_ShoutMessage1 AutoMessage Property p0Ath_ShoutMessage2 AutoGlobalVariable property WWAthHagCounter auto Event OnEffectStart(Actor akTarget, Actor akCaster) If WWAthHagCounter.GetValue() == 0 || WWAthHagCounter.GetValue() == 1 WWAthHagCounter.Mod(2) ;First time the shout was used so prepare for the second time the shout is used pAthanasiaNPC.EnableAI(False) ;turn Athanasia AI processing off and store her someplace safe pAthanasiaNPC.moveto(pAthanasiaStorageMarker) pAthanasia_VampireHag1.Enable() ;Summon the Vampire Hag pAthanasia_VampireHag1.EnableAI() float az = pPlayerRef.GetAngleZ() pAthanasia_VampireHag1.SetAngle(0.0, 0.0, az + 180.0) pAthanasia_VampireHag1.MoveTo(pPlayerRef, 200.0 * Math.sin(az), 200.0 * Math.cos(az), 0.0, false) pAthanasia_VampireHag1.EquipSpell(p0HagVampireBats, 0) p0HagVampireBats.cast(pAthanasia_VampireHag1) Utility.Wait(2.0) pAthanasia_VampireHag1.UnequipSpell(p0HagVampireBats, 0) pAthanasia_VampireHag1.EquipSpell(p0HagVolley, 1) pAthanasia_VampireHag1.EquipSpell(p0HagVampireDrain, 0) p0Ath_ShoutMessage1.show() ;Message Shout Stage 1 Else WWAthHagCounter.Mod(2) pAthanasia_VampireHag1.RemoveSpell(p0HagVampireBats) pAthanasia_VampireHag1.DispelSpell(p0HagVampireBats) ;pAthanasia_VampireHag1.UnequipSpell(p0HagVampireBats, 0) pAthanasia_VampireHag1.EnableAI(False) pAthanasia_VampireHag1.moveto(pOAthVampireHagMarker) ;turn Vampire Hag AI processing off and put her back into storage pAthanasia_VampireHag1.Disable() pAthanasiaNPC.EnableAI() ;turn Athanasia AI processing back on, summon her back to the player float az = pPlayerRef.GetAngleZ() pAthanasiaNPC.SetAngle(0.0, 0.0, az + 180.0) pAthanasiaNPC.MoveTo(pPlayerRef, 200.0 * Math.sin(az), 200.0 * Math.cos(az), 0.0, false) p0Ath_ShoutMessage2.show() ;Message Shout Stage 2 EndIfEndEvent Event OnEffectFinish(Actor Target, Actor Caster) Utility.Wait(5.0) ;Keep the shout from firing the script twice If WWAthHagCounter.GetValue() == 2 p0Ath_ShoutMessage.show() ;Show first time use Message - will only display once Utility.Wait(1.0) ElseIf WWAthHagCounter.GetValue() > 3 WWAthHagCounter.SetValue(1) ;Second time the shout was used so reset the Script EndIfEndEvent Edited December 9, 2018 by Dragonfire12 Link to comment Share on other sites More sharing options...
Recommended Posts