Stops the rifle from following your hand's leftover motion right after a bolt cycle, so your aim stays where it was while your hand settles back into the gun. Also supports straight-pull rifles!
Straight-pull ("closed bolt") rifles are supported. Vanilla has no quickbolting for them, so the hand-back to the rifle comes from the gun mod instead (OpenScripts2's ClosedBoltQuickbolting, Volks' ClosedBoltQBFixed, or a copy of either), and the buffer used to ignore it. Any hand coming back to a rifle from a bolt / charging handle now starts the buffer: BoltActionRifle_Handle, ClosedBolt, ClosedBoltHandle, RailTater_Handle, and a gun mod's own copy of a bolt class. The rifle and receiver types themselves are still excluded.
New [StraightPull] Regrab (default true), for straight-pull rifles whose bolt has no quickbolt script: you let go of the grip to work the bolt, and when you take the grip again the rifle re-anchors to that hand, so the aim jumps by however differently you grabbed it. Taking hold of a rifle that is already in your hands now starts the buffer on the pose from just before the grab, so the aim stays where it was. It works on any gun, so switch it off if you would rather have the plain grab back.
New [StraightPull] TakeOverScripts (default true): gun mods that ship their own quickbolt stabiliser write the rifle's transform after the physics tick this mod controls, which overwrites our hold (Volks' ClosedBoltQBFixed does this for 0.5 s after the bolt closes). That component's own stabilisation is now switched off for as long as our buffer runs and restored afterwards, so the trigger gate does the steadying instead - measured against the Swiss K31's own stabiliser, ours drifts less. Only components whose type name says quickbolt and that carry a bool field about stabilising are ever touched.
Both new triggers are still gated by the support hand's trigger and still end the hold the moment it is released.
Fixed: hand-editing the config file while the game is running did nothing (no reload and no log line), because the file's last-write stamp was kept in a float - DateTime.Ticks is about 6.4e17, which a float rounds to a quantum of roughly an hour, so a real edit never registered as a change. Stamps are compared exactly now: a hand-edit reloads the settings live and logs config file changed on disk, reloaded.
1.1.0
The buffer is now gated by the game's own way of steadying a rifle: it only holds while your support (foregrip) hand is holding its trigger - the same input vanilla reads for LongGunSnipingAssist. Release the trigger and the hold ends at once, then the speed-capped tail finishes the cycle as usual. Thanks to BitWizrd for this idea!
Removed the whole [Escape] section (grace period, deliberate-move test with its arming/settle logic, support-hand drift test, blunt fallback tests) together with ReleaseOnTrigger. The trigger gate replaces all of them: nobody keeps the foregrip trigger held while swinging the rifle onto another target, so swinging to a new target releases instantly.
New [Gate] section: UseTriggerHold (default true) turns the gate on; ReleaseOnFire (default true, moved from [Escape]) drops the hold the moment you fire. With UseTriggerHold = false the mod falls back to the plain time window, so the old behaviour is one key away.
Tuning keys and their defaults are unchanged (WindowSeconds 1.3, RotationStrength 0.95, PositionStrength 0.9, RampOutSeconds 0.7, speed caps).
Old [Escape] keys left in an existing config file are simply ignored.
1.0.0
Initial release
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.