Trying to intercept/get wasd input, for alternate car controls.
Posted: Wed Sep 04, 2024 2:29 am
So, The idea was pretty much to make a mod that did the cardinal car controls. However, getting the WASD keys isn't directly possible. I tried several ideas, and have a few more, but actually doing some of them is beyond me,
Capture "walking.direction" - only works with character, not when in vehicle.
Capture "player.riding_state" - Works, but I have to set this to alter Car behavior, which causes it to not work. - Current file displays this.
Hotkeys - Only registers keypressed, not holds or releases.
Options that might work.
- Override car behavior entirely. Not actually sure if there is a way to set the acceleration/turning without overriding controls. Might be able to do an on-tick manually cancel out movement (or set acceleration/turning to 0 or infinitesimal) and manually set the location of the car each tick. But I dont actually know how the car has to behave precisely, and those kinds of things tend to hog update cycles.
- Dummy player. Somehow add a dummy player/car that the player controls, rather than the actual vehicle, which can "Move" enough for the direction/riding_state to be set, captured, and not overridden by the car's instructions. Also probably needs to handle 2 players in a car and weapon control and inventory crap and so on, but might be possible.
-Capture Actual keypresses/holds/releases. Can't, API denied, for latency/performance reasons. Wish I could register as hotkeys anways.
Any other ideas, or ideas on how I might get one of the two ideas to work? Or am I missing something obvious?
Capture "walking.direction" - only works with character, not when in vehicle.
Capture "player.riding_state" - Works, but I have to set this to alter Car behavior, which causes it to not work. - Current file displays this.
Hotkeys - Only registers keypressed, not holds or releases.
Options that might work.
- Override car behavior entirely. Not actually sure if there is a way to set the acceleration/turning without overriding controls. Might be able to do an on-tick manually cancel out movement (or set acceleration/turning to 0 or infinitesimal) and manually set the location of the car each tick. But I dont actually know how the car has to behave precisely, and those kinds of things tend to hog update cycles.
- Dummy player. Somehow add a dummy player/car that the player controls, rather than the actual vehicle, which can "Move" enough for the direction/riding_state to be set, captured, and not overridden by the car's instructions. Also probably needs to handle 2 players in a car and weapon control and inventory crap and so on, but might be possible.
-Capture Actual keypresses/holds/releases. Can't, API denied, for latency/performance reasons. Wish I could register as hotkeys anways.
Any other ideas, or ideas on how I might get one of the two ideas to work? Or am I missing something obvious?