kxdace Posted July 12, 2019 Posted July 12, 2019 I am trying to create a button that activates a quest if it's not running and deactivates a quest if its running (toggle): ===PART One Success=== Scriptname wrScriptQuestOnOff extends ObjectReference Quest property AliasesQuest auto Event OnActivate (ObjectReference akActionRef) if (AliasesQuest.isRunning()) AliasesQuest.Stop() debug.notification("Quest is online shutting quest down") elseIf(AliasesQuest.isStopped()) AliasesQuest.Reset() debug.notification("Quest is offline starting quest") endIf EndEvent ===PART One Success=== When the quest is active any time the right ALT button is pressed down I should get the message: "Hotkey Pressed" and when I let go it should say hotkey released. However it never does this: ===PART Two Failure=== Scriptname QF_0Quest_TestBTN_OnOff_060DF1FA Extends Quest Hidden Bool bIsHotkeyPressed ; = False Int Property iHotkey = 184 Auto ; R-Alt by default Event OnInit() RegisterForSingleUpdate(0.25) EndEvent Event OnUpdate() If bIsHotkeyPressed != Input.IsKeyPressed(iHotkey) ; Only run code when the status changes bIsHotkeyPressed = !bIsHotkeyPressed ; Set bool to whatever it isn't If bIsHotkeyPressed ; == True Debug.MessageBox("Hotkey Pressed") Else ; If bIsHotkeyPressed == False Debug.MessageBox("Hotkey Released") EndIf EndIf RegisterForSingleUpdate(0.25) EndEvent===PART Two Failure=== Please advise.
kxdace Posted July 13, 2019 Author Posted July 13, 2019 Adding debug.MessageBox("") made it work... WTF LOL Event OnInit() debug.MessageBox("") RegisterForSingleUpdate(0.25) EndEvent
Recommended Posts
Archived
This topic is now archived and is closed to further replies.