ripple Posted April 1, 2012 Share Posted April 1, 2012 (edited) I want to be able to -manually- purge cell buffer without having to directly access the console to type 'PCB' (useful for people using game controllers rather than keyboard + mouse). My script won't save in the GECK, so obviously I am doing it wrong. Not surprising since I really haven't a clue what I am doing. Appreciate pointers. Right now the PCB hotkey assigned is 'backspace' (would prefer it to be something like ctrl + backspace). scn PurgeCellBufferHotKeyScript short PurgeCellBufferKeySetOnce short PurgeCellBufferKey short HasPressedKey Begin GameMode if PurgeCellBufferKeySetOnce == 0 set PurgeCellBufferKeySetOnce to 1 set PurgeCellBufferKey to 8 endif if isKeyPressed PurgeCellBufferKey == 1 set HasPressedKey to 1 PurgeCellBuffer elseif HasPressedKey == 1 set HasPressedKey to 0 endif end Edited April 1, 2012 by ripple Link to comment Share on other sites More sharing options...
Gribbleshnibit8 Posted April 1, 2012 Share Posted April 1, 2012 Are you using GECK Power Up? It fixes the error reporting in GECK so that it will tell you where the error in your code is. I also suggest Cipscis' code validator, which will tell you about errors in your code. To use multiple keys, you should just be able to check forif isKeyPressed 14 if isKeyPressed 29 || isKeyPressed 157The first one is backspace, the second two are left and right control respectively. You don't need to do the ==1 check because that is the automatic check (1 is true, and if something is true, then the if statement is valid). If you're having trouble with the hotkey press, then I would suggest looking at a mod like CASM for examples. I use it when I'm having trouble with hotkeys. Alternatively, you can also use MCM, which will handle hotkey setting for you when you set up a hotkey section. This would also allow your users to set the hotkey to whatever they want, if they use backspace for something else. Link to comment Share on other sites More sharing options...
ripple Posted April 1, 2012 Author Share Posted April 1, 2012 (edited) Thanks for the tip. I do use GECK Power Up with NVSE support but there was no error message when the script did not compile. I used Cipsis' Script Validator and the only error that came back was 'Unknown Function "isKeyPressed"'....I have no idea why. Right now I just want to get this script working. It shouldn't be so hard to hotkey a simple console command but as you can see, I am capable of fubar-ing some simple operations. Once I get it working, I'll think about setting up a customizable hotkey through MCM. How's this for a much simpler script for Hotkey PCB? scn PurgeCellBufferHotKeyScript Begin GameMode if isKeyPressed 14 PurgeCellBuffers endif end No error messages in the Script Validator but still won't compile in the GECK though.... Edited April 2, 2012 by ripple Link to comment Share on other sites More sharing options...
ripple Posted April 3, 2012 Author Share Posted April 3, 2012 I figured out why the script was not compiling--it was because of GECK PU. I went back to GECK with NVSE support and everything worked fine. Link to comment Share on other sites More sharing options...
Recommended Posts