Skip to content

Recoil - Add custom recoil shake coef#11379

Open
some-evil-kitty wants to merge 10 commits into
acemod:masterfrom
some-evil-kitty:camshake-settings
Open

Recoil - Add custom recoil shake coef#11379
some-evil-kitty wants to merge 10 commits into
acemod:masterfrom
some-evil-kitty:camshake-settings

Conversation

@some-evil-kitty
Copy link
Copy Markdown
Contributor

@some-evil-kitty some-evil-kitty commented May 14, 2026

When merged this pull request will:

  • title
  • ace_recoil_customShakeCoef in CfgRecoils
  • would like feedback on whether it's better to do per-weapon/muzzle or per-recoil as well as code in general

Some guns have a TON of shake if they have a ton of kickBack, so it'd be nice to be able to manually tune it down on import. (I specifically need this because of a launcher gun thing, but the idea is applicable to rifles with large amounts of kickBack in the recoil)

@some-evil-kitty
Copy link
Copy Markdown
Contributor Author

...come to think of it i could also make this scale based on weapon inertia (more inertia == less shake because Gun Move Slower)

Comment thread addons/recoil/functions/fnc_camshake.sqf Outdated
@some-evil-kitty
Copy link
Copy Markdown
Contributor Author

For my specific application, I need to reduce launcher shake dramatically. It's far too niche IMO to be an actual setting, but I made it a gvar rather than a magic number.

Comment thread addons/recoil/XEH_postInit.sqf Outdated
_recoil = [0, 0];
};

private _customShakeCoef = if (isNumber (configFile >> "CfgRecoils" >> _recoil >> QGVAR(customShakeCoef))) then {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_recoil will be an array here
needs to be moved above line 41

Comment thread addons/recoil/XEH_postInit.sqf Outdated
#include "script_component.hpp"

// This is too niche to be a setting, but making it not just hardcoded is good
GVAR(extraLauncherShake) = 25.0;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should move this to preInit to reduce load order conflicts (if another mod sets in their postInit)
or just use

    _powerCoef = _powerCoef + (missionNamespace getVariable [QGVAR(extraLauncherShake), 25]);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, will move to preinit. Mods then won't need to load-order it.

@PabstMirror PabstMirror added the kind/enhancement Release Notes: **IMPROVED:** label May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement Release Notes: **IMPROVED:**

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants