Deleted28154640User Posted January 29, 2016 Share Posted January 29, 2016 Hiya I hope this day finds you all well I'm trying to make a script work but I'm having troubles getting it to work. What I'm trying to do is when the player uses the craft table the weather changes to a storm and my custom witch music plays, the activation successfully works but when the player exists the crafting table the weather and music are supposed to return to normal here is my script I'm trying to get to work.------------------------------------------------------------------------------------------------------------------Scriptname ZZZ_WitchesCauldronScript extends ObjectReference MusicType Property WitchesMusic Auto Weather Property Storm Auto Weather Property Clear Auto Event OnActivate(ObjectReference akActionRef) Storm.setActive(true) WitchesMusic.Add()Endevent Event Ondeactivate(ObjectReference akActionRef) Clear.setActive(true) Weather.ReleaseOverride() WitchesMusic.Remove()EndEvent----------------------------------------------------------------------------------------------------------------- Please help, thank you :) Link to comment Share on other sites More sharing options...
sLoPpYdOtBiGhOlE Posted January 29, 2016 Share Posted January 29, 2016 (edited) Sorry to say there is no such thing as OnDeactivate() event natively in the game. Here's another approach, instead register for the the animation event when the player is exiting the furniture and then set the weather back. crude tested example (tried it on an Alchemy Lab and works ok for me). Scriptname ZZZ_WitchesCauldronScript extends ObjectReference MusicType Property WitchesMusic Auto Weather Property Storm Auto Weather CurWeather Event OnActivate(ObjectReference akActionRef) CurWeather = Weather.GetCurrentWeather() Storm.SetActive(true) WitchesMusic.Add() RegisterForAnimationEvent(Game.GetPlayer(), "IdleFurnitureExit") Endevent Event OnAnimationEvent(ObjectReference akSource, string asEventName) If (akSource == Game.GetPlayer()) && (asEventName == "IdleFurnitureExit") CurWeather.SetActive(true) Weather.ReleaseOverride() WitchesMusic.Remove() Utility.Wait(1.0) UnregisterForAnimationEvent(Game.GetPlayer(), "IdleFurnitureExit") EndIf EndEventOn another note:If you would like to see a list of available functions and events that you can use then maybe check this out (if you haven't already).http://www.creationkit.com/Category:Papyrus Edited January 29, 2016 by sLoPpYdOtBiGhOlE Link to comment Share on other sites More sharing options...
Deleted28154640User Posted January 30, 2016 Author Share Posted January 30, 2016 Wow thank you this problem has been plaguing me for a while :) Link to comment Share on other sites More sharing options...
Deleted28154640User Posted January 31, 2016 Author Share Posted January 31, 2016 Ok if you could please help Im trying to make an object cast storm call on itself when activated but it doesnt work, nothing seems to happen. Please help here is my script---------------------------------------------------------------------------------------------Scriptname SkullTotem extends ObjectReference Spell Property TotemFX autoobjectreference property skulltotemfx autoobjectreference property DeconstructMarker auto Event OnActivate(ObjectReference akActionRef) Totemfx.Cast(self, self) game.getplayer().Additem(Skulltotemscroll, 1)EndEvent Scroll Property Skulltotemscroll Auto Link to comment Share on other sites More sharing options...
Recommended Posts