N3cr0mancerJ1m Posted June 16, 2018 Share Posted June 16, 2018 Hello everybody, I'm working on an alternate world mod at the moment where you don't have a PipBoy so you don't have access to VATS that way. The idea is that you pick up a pair of early prototype goggles that give you an "advanced targeting system overlay" which is just VATS under a different guise but you'll only have access to it while you're wearing the goggles which means I need VATS disabled the rest of the time. I've tried every different combination of search terms I can think of to try and find an example of a script to do this but no dice so here's what I do know: - I need to make the script a Quest type and then attach it to a quest that runs at startup (Start Game Enabled in the quest window)- The script processing delay needs to be pretty low so it runs all the time (0.1 from what I've read)- The "DisableKey" command and the scancode for the V key (47) I've typed "DisableKey 47" into the console and it's worked but I don't know how to incorporate it into its own script. Here's what I have so far: scn DisableVATS Begin GameMode DisableKey 47End Now I'm guessing there should be a command line in there that enables the key again when the goggles are on, an "if" statement and maybe a variable but as to what they need to be, I have no idea. If anyone could point me in the right direction or explain the correct composition of such a script that would be unbelievably helpful. N3cr0mancerJ1m Link to comment Share on other sites More sharing options...
dubiousintent Posted June 20, 2018 Share Posted June 20, 2018 I think what you want is an "EventHandler", so it will pick up every instance of depressing that key without needing a running dedicated quest script. Then you can simply have it automatically re-enable the key when your "diversion" script is done. Please see the 'Scripting' section of the wiki "Getting started creating mods using GECK" article. You might want to PM a moderator (Wasteland Assassin?) to move this to the "GECK and Modders" sub-forum. Different eyeballs. -Dubious- Link to comment Share on other sites More sharing options...
N3cr0mancerJ1m Posted June 20, 2018 Author Share Posted June 20, 2018 Thanks for the reply dubiosintent, I appreciate the help. I'll sling a message to Wasteland Assassin and get this shifted. Cheers,N3cr0mancerJ1m Link to comment Share on other sites More sharing options...
EPDGaffney Posted June 20, 2018 Share Posted June 20, 2018 (edited) Assuming you're using JIP LN, you want a quest script that does it like this: Begin MenuMode 4 If GetGameRestarted If IsControlDisabled 16 Else DisableControl 16 EndIf EndIf End If you're not using JIP LN, just running it in MenuMode should work. Then when you equip the goggles, they should have their own script that runs EnableControl in an OnEquip block and disables it again in an OnUnequip block. Edited June 21, 2018 by EPDGaffney Link to comment Share on other sites More sharing options...
N3cr0mancerJ1m Posted June 21, 2018 Author Share Posted June 21, 2018 I used your script and after much screwing around with different combos for the script on the goggles I finally got it all working how I wanted it to. My thanks, sir, you've solved the riddle that's had my head spinning for a week. Link to comment Share on other sites More sharing options...
EPDGaffney Posted June 21, 2018 Share Posted June 21, 2018 Glad to help. Link to comment Share on other sites More sharing options...
EPDGaffney Posted June 21, 2018 Share Posted June 21, 2018 (edited) Just thought of something. If the player dies or loads a different save, if the goggles are on or off when that happens, but they're in the opposite state in the file that's being loaded, it's going to mess things up. You'll need to do a GetGameLoaded check in a GameMode block in that quest, and disable or enable Control 16 accordingly, based on whether or not the goggles are equipped. If you weren't aware, whether or not it's disabled is almost certainly not baked into the save data. You can test that if you want, though. Edited June 21, 2018 by EPDGaffney Link to comment Share on other sites More sharing options...
N3cr0mancerJ1m Posted June 22, 2018 Author Share Posted June 22, 2018 I went and tested it after you mentioned it and there was indeed a problem but I followed your advice on the GetGameLoaded block and that fixed it. Thanks again for the help. Link to comment Share on other sites More sharing options...
EPDGaffney Posted June 22, 2018 Share Posted June 22, 2018 Fantastic. Link to comment Share on other sites More sharing options...
Recommended Posts