Skip to content

Make backpack AP stance costs depend on actual weight instead of a bool checking if a backpack is equipped or not#486

Merged
kitty624 merged 2 commits into
1dot13:masterfrom
BeatAroundTheBuscher:backpack_AP_stance_costs
Aug 15, 2025
Merged

Make backpack AP stance costs depend on actual weight instead of a bool checking if a backpack is equipped or not#486
kitty624 merged 2 commits into
1dot13:masterfrom
BeatAroundTheBuscher:backpack_AP_stance_costs

Conversation

@BeatAroundTheBuscher
Copy link
Copy Markdown
Contributor

The intent of this change is to make sure that backpacks including their content do not add an additional AP cost of +1 if their weight is below a certrain threshold. The old implementation only checks if a backpack is present and ignores its weight. If it is true then a +1 via the bool fBackpackCheck is added as an AP penalty for changing stances (stand-crouch-prone). This means that for changing stance +1 is always added to the AP cost when a backpack is equipped. No other factors are considered.

This implementation allows tactical slings (backpack with 0.2 kg) including content to ignore the +1 AP penalty assuming the final weight is less than ubBackPackWeightFactorForAPPenalty. This makes the tactical sling or light backpacks much more attractive to be used.

ubBackPackWeightFactorForAPPenalty is a new externalized value BACKPACK_WEIGHT_FACTOR (default value 50) to allow changes to be made in the ini.

Note the value BACKPACK_WEIGHT_FACTOR is also used for incurring AP penalty for moving. This value was previously hard coded to 50.

A new ini value BACKPACK_WEIGHT_FACTOR is introduced to replace the hard coded 50.
The value goes from 1 to 250 and its default value is 50 as before.
…ckpack

The same code is also used in GetAPsCrouch as well as GetAPsProne

The intent of the change is to make sure that backpacks including their content
do not add an additional AP cost of +1. Now it checks if
the backpack weight is > ubBackPackWeightFactorForAPPenalty (default value 50).
The min exists to make sure that the AP cost does not become higher than previously.

Previously the bool fBackpackCheck was used to add +1 if there is any backpack.
But this also includes an empty tactical sling (backpack with 0.2 kg) and
therefore makes the item much less interesting to use.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants