Jump to content

Hijacking game controls


Hyomoto

Recommended Posts

I'm hoping someone here will have had some success or use in this kind of situation. I want to 'hijack' the game's hotkeys for various functions but unfortunately it isn't as straightforwards as I'd hoped. Essentially I have a script which checks if the player presses a key, done and done, easy day. However, I want it to ONLY perform my scripted function and ignore it's own BUT be linked to the keys the player has set up. Tough one, right?

 

If I use DisableControl, it also disables the key so that's a no go. I can DisablePlayerControls for the PipBoy which will cancel PipBoy and Hotkeys, but it has the same issue. The last idea I came up with was simply to disable the Hotkeys when the player goes into MenuMode so essentially, they can't be set up for anything (but that idea is slightly retarded in its own right).

 

Here's the basic premise: I set up 3 and 4 as primary/secondary weapons. When the player equips a weapon it will equip it into one of these slots. By doing so I can add models to the player so that these weapons so when you 'unequip' an item but its still in one of these slots it will show up on your character. However, two issues, 3 and 4 are hotkeys so I don't want the player to be able to assign them, it needs to be taken care of in code. Additionally, when in combat you won't be able to PipBoy, thus when picking up a weapon (in FPS style) it will equip it into one of these slots (one one hand and one two hand). On top of that I want these to be the ONLY weapons the player can access in combat. However, the most important part is the ability to hijack these keys. Otherwise I have to disable them and be like 'Q is for swapping!' which feels artifical.

 

I hope this gives an idea of what I'm trying to accomplish, I hope someone will have some ideas on how to handle the issue with the keys. If I could simply assign hotkeys myself there wouldn't be any problems, if anyone knows how to do that it would be a big help but I haven't seen anything besides the NVSE GetHotkey which obviously isn't useful.

 

Anyone have any success hijacking game controls? And if so, how did you go about doing it?

 

Thanks in advance,

Hyomoto

Edited by Hyomoto
Link to comment
Share on other sites

  • Recently Browsing   0 members

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