Vermenin Posted February 16, 2013 Share Posted February 16, 2013 Hello and thanks for your time, I am trying to make a mod into which I wont go into much detail, but it's my first mod and I need some help with scripting with SKSE. I have download SKSE the latest version and I have the latest Skyrim Updates. I wanted to test out SKSE so before beginning the mod I (without loading in Update.esm or Skyrim.esm) made a few things in CK. I made a quest which runs on startup, I made a script and attached the script to the quest. The problem is that the script isn't working. Here it is: Scriptname DremoraTransform extends QuestBool IsBKeyPressedFunction OnlyYouCanMakeAllThisWorldSeemRight() RegisterForUpdate(0.25)EndFunctionEvent OnUpdate() IsBKeyPressed = Input.IsKeyPressed(48) If IsBKeyPressed == True UnregisterForUpdate() Debug.MessageBox("Working") EndIfEndEvent I am not sure exactly as to what's the problem, as it seems to complie perfectly. Also to test I dont use any of my saves, to test I simply to into the console in the main menu and use the cheat "COC Whiterun" to spawn with a default Skyrim character. Thank you. Link to comment Share on other sites More sharing options...
keegars Posted February 16, 2013 Share Posted February 16, 2013 The quest will be running but the actual script itself won't execute anything at all. Your using a custom function which needs to be called for the registerforupdate to then fire the onupdate event, seeing as the function isn't being called anywhere, no onupdate will fire. However, if you use Event OnInit(), that'll run the first time the quest is ran, so put your registerforupdate there or call your function. It should now work, alternatively if your wanting to use SKSE they do have registerforkeypress, for such situations that a key is pressed that allows you to not use an onupdate and will fire the event straight away instead of having to check every 0.25 seconds. Also, look into registerforsingleupdate if your wanting to use an onupdate more than once every second, will save up on queue time and event build up. Link to comment Share on other sites More sharing options...
Recommended Posts