antstubell Posted July 15, 2019 Share Posted July 15, 2019 So what is my title about? First off check the attachment. The orange bar is the invisible activator that has the script which controls a 3 stage fire. Everything works as inteneded. Only by accident did I discover an issue. Player starts fire, watches if so inclined, but the activator stays 'active' until the 3 stages (20 secs.) have finished meaning player can restart fire repeatedly until script is done and activator is disabled. I can't disable the activator while the script is doing its 'thing'.Ideas/advice please.Video will help too,..https://onedrive.live.com/?cid=B60C11D037429D8E&id=B60C11D037429D8E%2134169&parId=B60C11D037429D8E%21191&o=OneUp Link to comment Share on other sites More sharing options...
IsharaMeradin Posted July 15, 2019 Share Posted July 15, 2019 Without seeing the script, cannot make any accurate suggestions. However, I suspect that you may benefit from using either a bool or states. Bool example Bool isBusy = false Event OnActivate(ObjectReference akActivator) If isBusy == false isBusy = true ;do stuff EndIf EndEvent Reset the bool to false when the script is done "doing its thing" State example Auto State Waiting Event OnActivate(ObjectReference akActivator) GoToState(Busy) ;do stuff EndEvent EndState State Busy Event OnActivate(ObjectReference akActivator) ;do nothing EndEvent EndStateSwitch back to the waiting state when the script is done "doing its thing" FYI - I am a bit rusty on states so if the example is off, hopefully someone will swing by with any necessary corrections. Link to comment Share on other sites More sharing options...
antstubell Posted July 15, 2019 Author Share Posted July 15, 2019 Sorry, I fogot that. Scriptname My_StartFire extends ObjectReferenceObjectReference Property StartFireMarker AutoObjectReference Property MiddleFireMarker AutoObjectReference Property TreeFallMarker AutoLight Property HasTorch AutoMessage Property Greet AutoMessage Property EquipTorch AutoMessage Property NeedFlame AutoEvent OnActivate(ObjectReference akActionRef)Int iButton = Greet.Show() ; Shows your menu.If iButton == 0 && (Game.GetPlayer().GetEquippedItemType(0) == 11)StartFireMarker.enable()Utility.wait(20.0); player has torch equipped main fire startsTreeFallMarker.enable()MiddleFireMarker.enable()StartFireMarker.disable()Utility.wait(20.0); tree falls fire goes from main to midMiddleFireMarker.disable()Disable(self); fire dies down activator disablesElseIf iButton == 0 && (Game.GetPlayer().GetItemCount(HasTorch) >= 1)EquipTorch.show(); player has torch but not equippedElseIf iButton == 0 && (Game.GetPlayer().GetItemCount(HasTorch) < 1)NeedFlame.show(); player does not have a torch at allElseIf iButton == 1EndIfEndEvent Link to comment Share on other sites More sharing options...
Evangela Posted July 16, 2019 Share Posted July 16, 2019 (edited) Switch back to the waiting state when the script is done "doing its thing" FYI - I am a bit rusty on states so if the example is off, hopefully someone will swing by with any necessary corrections.I think that it should be GoToState("Busy"). Edited July 16, 2019 by Rasikko Link to comment Share on other sites More sharing options...
maxarturo Posted July 16, 2019 Share Posted July 16, 2019 (edited) Scriptname My_StartFire extends ObjectReference ObjectReference Property StartFireMarker Auto ObjectReference Property MiddleFireMarker Auto ObjectReference Property TreeFallMarker Auto Light Property HasTorch Auto Message Property Greet Auto Message Property EquipTorch Auto Message Property NeedFlame Auto Auto State Waiting Event OnActivate(ObjectReference akActionRef) Int iButton = Greet.Show() If iButton == 0 && (Game.GetPlayer().GetEquippedItemType(0) == 11) GotoState("Activated") ; Protects itself from being reactivated - No need for declaring a State, will work as is. StartFireMarker.enable() Utility.wait(20.0) TreeFallMarker.enable() MiddleFireMarker.enable() StartFireMarker.disable() Utility.wait(20.0) MiddleFireMarker.disable() Utility.wait(0.2) self.Disable() ; Triggers its deletion after finishing its functions. Utility.wait(0.5) self.Delete() ElseIf iButton == 0 && (Game.GetPlayer().GetItemCount(HasTorch) >= 1) EquipTorch.show() ElseIf iButton == 0 && (Game.GetPlayer().GetItemCount(HasTorch) < 1) NeedFlame.show() ElseIf iButton == 1 EndIf EndEvent EndState IsharaMeradin suggestions will also work, choose and pick your way... Edited July 16, 2019 by maxarturo Link to comment Share on other sites More sharing options...
antstubell Posted July 16, 2019 Author Share Posted July 16, 2019 @IsharaMeradin 2nd script... (5,14): variable Busy is undefined. Link to comment Share on other sites More sharing options...
maxarturo Posted July 16, 2019 Share Posted July 16, 2019 GoToState("Busy") > with quotes Link to comment Share on other sites More sharing options...
antstubell Posted July 18, 2019 Author Share Posted July 18, 2019 Thanks all, learned stuff as usual :thumbsup: Link to comment Share on other sites More sharing options...
Recommended Posts