Faceshifter Posted June 7, 2011 Share Posted June 7, 2011 I get I have to do it with OnKeyDown, but I do not know how to apply it to the V key.I suspect I have to place number 47 somewhere, but do know where. Link to comment Share on other sites More sharing options...
fg109 Posted June 7, 2011 Share Posted June 7, 2011 I think you would use it like this: if (OnKeyDown 47) ;do stuff endif I'm not exactly sure though... In the OBSE documentation, it says that it only returns 1 for one frame. So that would mean that your script would need to be running every frame to catch it right? But on the CS Wiki it says that it works like GetGameLoaded. I've used GetGameLoaded before it quest scripts, and quest scripts only run once every 5 seconds (or whatever fquestdelaytime is set to). Link to comment Share on other sites More sharing options...
Faceshifter Posted June 7, 2011 Author Share Posted June 7, 2011 Isn't it a Start command? It looks like Begin OnEquip or Begin OnUnequip. I tried it with Begin, but that didn't compile. Link to comment Share on other sites More sharing options...
fg109 Posted June 7, 2011 Share Posted June 7, 2011 I'm pretty sure it's just a function. This compiled when I tried it: scn somescript Begin GameMode if (OnKeyDown 47) Player.ModAV Strength 10 endif End Link to comment Share on other sites More sharing options...
Faceshifter Posted June 7, 2011 Author Share Posted June 7, 2011 All right then. My script does not require holding the key, so the delay won't form a problem. Thanks a lot. Link to comment Share on other sites More sharing options...
Faceshifter Posted June 7, 2011 Author Share Posted June 7, 2011 It does not seem to work, should it be something else than 47? Link to comment Share on other sites More sharing options...
fg109 Posted June 7, 2011 Share Posted June 7, 2011 I just tested it with the example script I posted and it worked. More specifically, I had to keep the key pressed for a few seconds before it worked. Then I changed the script to this: scn somescript float fquestdelaytime Begin GameMode if (fquestdelaytime != 0.01) set fquestdelaytime to 0.01 endif if (OnKeyDown 47) Player.ModAV Strength 10 endif End This changed it so it ran 100 times per second. It detected the key press right after I pressed it. This proves that the article on CS wiki is wrong and the OBSE documentation is right. It only returns 1 for one frame, which is why it only works properly after I changed the script to run so often. Link to comment Share on other sites More sharing options...
Faceshifter Posted June 7, 2011 Author Share Posted June 7, 2011 Okay! Thank you very much, again :D Link to comment Share on other sites More sharing options...
OvadWolfeye Posted December 13, 2020 Share Posted December 13, 2020 (edited) is there a chart somewhere to know what number i need to type in for a different key? so 47 is the v key, what would the k key be? I also need some help with my script to work scn OnKeyDownHelpScript short key Begin GameMode if OnKeyDown 47 == 1 set key to 1 elseif OnKeyDown 47 == 0 set key to 0 endif If key == 1 player.equipitemsilent Item elseif key == 0 player.unequipitemsilent Item endifEnd I want the item to only be equipped while holding the v key down. Edited December 13, 2020 by CountryRoberts Link to comment Share on other sites More sharing options...
Pellape Posted December 13, 2020 Share Posted December 13, 2020 (edited) Yes there is. I do not know where I got it from as it is included in one mod (I found it as well) but it is also at CS Wiki (Took some damn time to find this one for sure :wink: ) and also maybe at UESP but now I cannot find it (I did). The common ascii-table will also work as reference but that page is also loaded with advertising... :wink: I was lucky I guess, the Enhanced hotkey's documentation did point it out. :wink: Very very cool mod indeed by the way that makes life MUCH easier. Edited December 13, 2020 by Pellape Link to comment Share on other sites More sharing options...
Recommended Posts