Moderate Weight Limit

If you liked this item, please rate it up on Steam Workshop page.

Authors: flussvalentin, NSWDG Red Squadron

Last revision: 14 May at 16:43 UTC

File size: 27.69 KB

On Steam Workshop

Description:
Moderate Weight Limit

You run your own unit and you are tired of some "special" people that run around with 4 main weapons, 2 secondaries and launchers, while being an airstrike-calling, sniping, IED-defusing medic all at the same time?
Let them meet Moderate Weight Limit, which will leave them walking slowly away while normal operators are able to sprint and save their skin!

This mod started as an evolution of Simple Weight Limit by J3FF. J3FF did some great groundwork, but since the invisible containers from both KJW’s mods and the Animate-Rewrite Slinging System do not contribute to the weight and the original author may not have the time to implement this, here comes Moderate Weight Limit.

How it Works

It’s super simple. You set a Medium weight and a Max weight limit.

  • Go over the Medium Limit? You lose the ability to sprint, but you can still jog.
  • Go over the Max Limit?. You can no longer sprint OR jog. Have fun walking.

The "Ground Truth" UI Read-Out

You might have noticed that some custom vests or gear mods pull some shenanigans and like to use custom mass multipliers to make their inventory artificially lighter. They lie to the inventory and ACE Arsenal, meaning players think they are carrying 30kg when they are actually carrying 40kg. Shenanigans, you see.
To combat this, I added a "Ground Truth" UI. When you open the Inventory, Virtual Arsenal, or ACE Arsenal, a text box appears at the top of your screen showing your absolute true weight directly from the physics engine. It breaks it down by Vanilla gear, KJW stowed weapons, Animate slings and Backpacks on Chest.

Real-Time Recalculation: While using the Inventory, Virtual Arsenal, or ACE Arsenal, an event listener automatically triggers a weight recalculation whenever your gear changes. This provides instant, per-item feedback as you equip your loadout or make changes to the inventory and gear in the field.

Compatibility Features

Players love to stow extra weapons to dodge weight limits. Not anymore:

  • Full, exact weight calculation for KJW’s Two Primary Weapons and Two Secondary Weapons.
  • Full weight calculation for Animate – Rewrite 1-point, 2-point, 3-point slings and Lanyards.
  • Full weight calculation for BackpackOnChest – Redux.
  • Seamless integration with Better Inventory. The weight UI automatically detects the mod and repositions itself to perfectly match the expanded inventory layout if Separate UI is disabled.

Role-Based Overrides

Need your Medics to carry more medical supplies or your Machine Gunners to lug around that heavy M249 without being forced to walk? You can now define custom weight limits for specific roles!

How to Set Up Roles:

1. Define Roles in CBA Settings:
In the Addon Options or cba_settings.sqf, find the Role Overrides setting and enter your roles in this exact format (using double-double quotes for the names):

Addon-Options:

[[""medic"", 39, 42], [""mg"", 41, 45]]

cba_settings.sqf

fluss_roleOverrides = "[[""medic"", 39, 42], [""mg"", 41, 45]]";

(This example gives medics a 39/42 limit and machine gunners a 41/45 limit.)

2. Assign the Role to a Player:
In your mission, put the following code into the Init field of the player unit:

this setVariable ["fluss_role", "medic", true];
this setVariable ["fluss_role", "mg", true];

(Change "medic" or "mg" to the role name defined in the settings.)

The mod will automatically detect the role and apply the custom limits to that player. If no role is assigned, the global limits are used.

100% Server-Side Only!

The original mod was already server-side only. Due to a nasty bug which ocurred during testing where the server’s loadAbs command fails to count the weight of weapon attachments (scopes, suppressors, magazines) on remote players, some code needs to be executed on clients via Code Injection (Thanks to @Dimon UA for the info) directly from the server.
Clients do NOT need to download the mod!
Note: This requires your server to allow bis_fnc_call via remoteExec (which most do by default).
Note 2: To set up the CBA settings, your admin may want to load the mod as a client to see the settings in the addon options.

CBA Settings

Everything is fully configurable under "Weight Limit" in CBA Settings:

  • Max / Med Weight Limits: Set exactly when the punishments kick in.
  • Freedom Units Toggle: Choose between Kilograms (kg) and Freedom Units (lbs).
  • Include KJW / Animate / BOC – Redux: Checkboxes to easily turn off third-party mod weight tracking if your unit doesn’t want it.
  • Split Performance Intervals: Separate sliders for Calculation (full player weight calculation) and Enforcement (applying movement penalties). This decoupling allows you to run the cpu heavier weight scans less often (e.g., every 10s) while ensuring movement penalties are enforced instantly and smoothly (e.g., every 0.5s).
  • Separate UI Toggles: Choose between a floating top-center box or an integrated look for the Inventory and ACE Arsenal independently. (Note: The integrated ACE Arsenal UI is currently optimized for Interface Size "Small" and might appear offset on other sizes.)
  • Enable Debug Logging: Need to catch a hoarder? Enable this, set the Debug Print Interval, and the server will spam the system chat with a breakdown of exactly how much weight everyone is carrying.

All CBA-Settings:

  • fluss_maxWeight = 40;
  • fluss_medWeight = 37;
  • fluss_useFreedomUnits = false;
  • fluss_includeKJW = true;
  • fluss_includeAnimate = true;
  • fluss_includeBOCR = true;
  • fluss_calcInterval = 10;
  • fluss_enforceInterval = 0.50;
  • fluss_separateInventoryUI = false;
  • fluss_separateAceArsenalUI = true; // (False is optimized for Interface Size: Small)
  • fluss_roleOverrides = "[[""medic"", 39, 42], [""mg"", 41, 45]]";
  • fluss_debug = false;
  • fluss_debugInterval = 10;

Credits & License

Licensed under APL-SA (Credit required when re-uploading).
Huge thanks to J3FF for the original "Simple Weight Limit" mod that served as the foundation and inspiration for this project.
Thanks to @Dimon UA for the code injection hint.

Eigenwerbung

Auf der Suche nach einem aktiven deutschen SEAL Team 6 MilSim Clan?
NSWDG Red Squadron[www.nswdg-redsquadron.de]

Download
Required items:

Click the title to search on this site.


CBA_A3Steam Workshop