#[0.33] Both Brakes Control

119 messages · Page 1 of 1 (latest)

molten agate
#

Client-sided keybind to TOGGLE both or either air/wheel brakes

Idea by @light heart

  1. Airbrake: Since airbrake are tied to throttle % the mod cache that value before subtracting by 100%, yet toggling off will instantly revert the %
  • Throttle % are still affected by acceleration input even when toggle is on
  1. Wheelbrake: I know it's been done before, sorry
  2. Bothbrakes: Instantly toggle both
    https://github.com/SonPamungkas/both-brakes-control
GitHub

client-sided keybind to TOGGLE both or either air/wheel brakes - SonPamungkas/both-brakes-control

quartz river
#

What a superbly helpful mod, this basically cleans up a workaround of using something like AHK or Joystick Gremlin (Ex) or some other control tool software (if it's capable of modifiers/scripts like that) to control say throttle axis (read by game as throttle input) with a modifier to temporarily override it to 0% and return to previous % throttle

#

It also perfectly handles one scenario I immediately thought of testing, which is to be at say 90% throttle, toggle airbrakes on so in game throttle goes to 0%, but in meanwhile reduce my throttle axis down to say 30% (using relative throttle as I'm not using a throttle controller), whether then un-toggling the airbrake would make the mod put it back to 90% as it was before toggling or anything weird, but no when airbrakes go off it goes to 30% as expected where throttle is

#

Depending on how feasible that is, one potential option that I think would be great is to be able to set whether these binds are a toggle, or hold (for the airbrakes and both brakes at least, as for regular braking we already have just that with the vanilla brake bind)

Since for airbrakes a hold bind might be more comfortable for some, if you just need a quick temporary airbrake to slow you down and then release the key and throttle to be back right away, especially handy for very brief inputs during certain manoeuvring

molten agate
#

If I recall correctly, the cached throttle is impossible to be changed when you input deceleration once you toggled airbrakes.
While I could find a workaround, I'm afraid that it'll remove it's client side compatibility

#

As for the keybind for hold instead of toggle, easier done than said

quartz river
quartz river
#

but even with just say very simple binary keyboard key input with relative throttle with shift to increase, ctrl to decrease, it still works

molten agate
#

Idk lol

#

Well that's a feature now
(Definitely not an unintended bug)

quartz river
#

so quick example, I put throttle to 10%, then toggle airbrake
during that, if I hold shift a while, of course nothing happens yet
then if I toggle airbrakes off, it'll be at say 80%

#

since I increased it during the airbrake, which I think feels very natural at least

#

so yea I'm happy it does that

molten agate
quartz river
#

wouldn't be end of the world if it didn't but was curious how it'd handle this situation (even just in case it does something very unintended that breaks something) so was nice to see that it indeed does whether intended or not 🤣

#

yus indeed

molten agate
mellow spruce
#

IVE PRAYING FOR A MOD LIKE THIS

#

NOW MY TOE BRAKES HAVE A USE! (instead of being used to select and deselect targets dont call me crazy)

quartz river
#

I think at some point I had weapon reload in some FPS game bound to a pedal

quartz river
#

I don't remember if I tried it in the previous version (I quickly checked airbrake functionality in flight right away), but just got to tinkering around with 1.1 and the wheel brakes seem to not be working (whether on hold mode or not)

#

I've just been independently testing them, and neither the "both brakes" or "wheel brakes" activate the wheel brakes when pressed (both brakes only does airbrake)

molten agate
#

I had that issue too. Because I binded it with the vanilla Wheelbrake hotkey

quartz river
#

Yea I had my vanilla wheel brake on B and I rebound that to P as a placeholder so I can use it still as a fallback when testing

molten agate
#

Unbinding or removing the vanilla bind works

quartz river
#

Oooo I didn't try that, was my first instinct but wanted a quick fallback mode just in case

#

That'd make sense, since this'd take over that functionality anyway

#

Hmm vanilla brakes unbound and restarted game, it still doesn't brake with it

molten agate
quartz river
#

well I have this now set up real quick just as testing

#

and braking in vanilla keybinds are all unbound

#

also had a quick look whether I had any conflicts with B or P in either any vanilla binds, or any other mod binds

#

with this setup can no longer brake wheels, only deploy airbrakes (those have been working great as it sets throttle % properly)

#

My original goal for myself was mostly just so I could press one button (B) and it'd do both brakes, seemed quite convenient
I can still reach that technically by keeping vanilla bind brakes on B, and also set the mod's airbrakes (with hold mode) on B, and then they work simultaneously properly

#

One downside of that is in case someone would like to set up a separate hold vs toggle mode for using both brakes (in mod) vs say wheel brakes
Like having hold B = deploy brakes and airbrakes, and press another button = toggle wheel brakes or something

#

Just had a quick look with deleted configs and rolled back to v1.0 of the mod, the wheel brakes don't work there either (even with vanilla brake unbound and game restarted), so it's not something that broke between 1.0 and 1.1

molten agate
#

Making it a priority fix now. I only tested the bothbrakes so far. Skimmed a lot to get it done first

#

Thanks for the thorough feedback btw

quartz river
#

The one tiny confusing part why I thought initially that they worked (or sometimes worked) is when you come to a (near) standstill and go to 0% throttle the game also auto deploys wheel brakes until you throttle up enough

#

So just testing it from a stand still and throttling up then pulsing brakes on and off makes it look like they both work

#

But once you start rolling a bit and then try to apply either the both brakes or wheel brakes only with the mod, the wheel brakes don't end up applying

quartz river
molten agate
quartz river
#

I think it's related to some functionality of detecting those keys being pressed with a wildcard ignoring any other keys during it or not, where it's currently exclusively checking if only that specific key is pressed

#

So setting say B to any of the 3 mod's braking functionality does work, but only if it's the only key being pressed

#

So for example if I'm pressing B while I'm pressing any other KB button like WASD/QE for flight inputs, the brake input is entirely ignored

molten agate
#

Good feedback👍 will be fixed later

quartz river
#

It does work really well outside of that!

#

I'll test a couple edge cases people could run into as well

#

O okay so it seems toggle modes don't work atm for either, was doing some isolated tests (restarting game in between every time to be sure) where I only have say wheel or airbrakes bound to a key and not in hold mode for that

#

The toggle modes only very momentarily activate on key press, I think for just one frame basically

#

Like say toggle wheel brakes (and not on hold mode), pressing that button you see brakes light up for one frame then gone, same for toggle airbrake (or both)

#

Didn't notice this at first since I was mainly looking into it with hold mode only

quartz river
#

I couldn't find some flag to make it ignore other key presses with it

#

So I had a look at how other plugins do it, autopilot also uses the same struct and it has the same issue (pressing AP keybinds while also pressing other keys, like say trying to toggle AP while pitching, also doesn't work, but this is not really that much of an issue with AP as per nature of the mod)

#

NOTT however does handle this well (and needs to), like say being able to use the MFD binds to shuffle between target selection, that keeps working during other keyboard inputs when manoeuvring

#

And it seems to be using more of a custom InputCatcher referenced in binds (like in TargetListController), here: https://github.com/clumzy/NO_Tactitools/blob/main/NO_Tactitools/src/Core/InputCatcher.cs

It seems to be using Rewired to handle and detect inputs, at the ControllerInputInterceptionPatch class I noticed it's checking to make sure to disable inputs when chat is open with controller.name.Trim() == "Keyboard" and controller.name.Trim() == "Mouse" so it seems like Rewired might be the way to go to handle inputs that work when other keys are being pressed

quartz river
molten agate
#

Thank you very much

molten agate
quartz river
#

Oh yea that's very crisp, it behaves perfectly in a quick test with various test conditions, and a combination of both brakes on hold B and toggle wheel brakes on P

#

Thank you for making this!

hushed bluff
#

🙂

#

This is good, and I can replace my old implement with this great work

#

I did something similar before, but it had some problems and I'm too lazy to fix it

#

Thank you for making this!

#

😋

molten agate
molten agate
#

@strange moat

strange moat
#

my bad lmaoo

#

i confused it with the other mod

#

so do all 3 files go in there?

molten agate
#

Extract the folder out into bepinex plugins

strange moat
#

okay

#

thanks

#

got sooo many new mods its so crazy

molten agate
#

Plugins/BothBrakesMod/3 files inside the BBM folder

strange moat
#

oh

#

can you airbrake and afterburner at the same time

molten agate
#

No, airbrake tied to throttle

#

Can't Airbrake with any throttle

#

My solution is to cut throttle directly to 0, triggering the Airbrake

molten agate
dire locust
#

Would it be possible to disable airbrake from throttle alongside this mod? Like the lowest the throttle can go from throttle control is 0%, but not activate airbrake, so the only way to activate airbrake is this mod? Kind of like war thunder or similar

molten agate
dire locust
#

Yeah I know you can't have it go to 0%, but like a limiter that stops it going below 0.1%? So the throttle is functionally 0% but the airbrake hasn't activated yet

molten agate
#

Oh, throttle limiter

#

I could. I'll add it in the next update

compact hemlock
#

atlast

#

i can flare witouth loosing half of my energy because of airbrakes

molten agate
molten agate
compact hemlock
#

all i need is airbrake different from throttle

#

thats it

#

airbrakes and handbrakes can be se the same

molten agate
#

Because airbrakes are hardcoded, tied, binded, linked to the throttle

quartz river
#

Yea I think what they meant is to limit throttle% to basically like 0.1% to 100% instead of 0% to 100%

#

So that when you throttle down fully from controls, you're stuck at 0.1% unable to go lower and thus game never deploys airbrakes

#

Somehow hooking into/intercepting player throttle input and disallowing it to go below 0.1% or whatever %

#

I think it's a very tiny sliver of low % that activates airbrake, I've seen the HUD say 0% or even -1% throttle and still not be on airbrakes and then right below it it activates it, so it might be like 0.1% or even less on a 0 to 100% scale

dire locust
#

Yeah that's exactly what I meant

dire locust
quartz river
#

Yep that's not surprising because of rounding but I was really confused when I rarely saw it at -1% (no airbrake yet) lmao

#

So there should be a good bit of leeway to clamp lower throttle without triggering it

hushed bluff
#

Actually, I think we could combine the ideas from both mods — mine and the LZ’s.

#

My old implementation decoupled the throttle from the airbrake, so reducing throttle would no longer trigger the airbrake, and the airbrake would instead be activated through a separate key binding.

#

However, this isn’t a particularly ideal solution, because it requires the aircraft to actually have an ‘airbrake.’

#

For example, aircraft like the KR-67 use split flaps for this purpose, so my method doesn’t work for them.

#

I think we could perhaps handle this on a per-aircraft basis: if the aircraft uses airbrakes, then use my method; if it doesn’t, then use the throttle-cut method instead.