Jump to content

Help with RegisterForKey SKSE


Boomsin

Recommended Posts

Hi everyone,

 

I want to write a Script that would detect user input (keystrokes) to call actions using different keys other than the default for Skyrim.

 

My first try was with this script added to a weapon:

 

Event OnEquipped(Actor akActor)
RegisterForKey(49)
EndEvent


Event OnKeyUp(int keyCode, float holdTime)
if keyCode == 49
Debug.MessageBox("KeyPressed N")
endif
EndEvent


Event OnUnEquipped(Actor akActor)
UnregisterForAllKeys()
EndEvent
but although the OnEqupped and OnUnEquipped methods are being called, the OnKeyUp it's not.
Next I tried making a quest with the same code, as suggested by this thread: https://forums.nexusmods.com/index.php?/topic/843007-skse-keypress-event-script-help/, but i can't even start the Quest. I created a new Quest in the Object Window, added the script, and selected 'Start Game Enabled', what do I need to do to start the Quest?
Thank you for the help in advance!
Link to comment
Share on other sites

A start game enabled quest starts when the game is started. This includes the very first time that the game is started for a new character as well as the first time the mod is loaded on an existing game.

 

Check your papyrus log for any errors that may be related to your script.

Also, confirm that your script is still on the quest. Some times if you do not close and reopen the quest window after creating it, added scripts (and/or other information) may not remain.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...