Jump to content

Disabling VATS Scripting Syntax (mod help)


N3cr0mancerJ1m

Recommended Posts

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 47

End

 

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

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

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 by EPDGaffney
Link to comment
Share on other sites

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 by EPDGaffney
Link to comment
Share on other sites

  • Recently Browsing   0 members

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