Stamina – Arma 3

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " it's" to " it is")
Line 18: Line 18:


=Scripting commands=
=Scripting commands=
 
[[:Category:Command Group: Stamina System|Command Group: Stamina System]]
=== [[setStaminaScheme]] ===
Where scheme is one of the following:
<br>"Normal" - current default Active Elements (white by default);
<br>"FastDrain" - current default Warnings (orange by default);
<br>"Exhausted" - current default Errors (red by default);
<br>"Default" - applies default behavior, lets engine switch the colors;
 
=== [[setCustomAimCoef]] ===
Replace aimPrecision from animation state with custom value that will directly affects weapon sway size and speed.
 
=== [[getCustomAimCoef]] ===
Returns aimPrecision from animation state with custom value that will directly affects weapon sway size and speed.
 
=== [[getAnimAimPrecision]] ===
Returns aimPrecision value of the current animation state (parameter '''aimPrecision''')
 
=== [[setAnimSpeedCoef]] ===
Define animation slowdown speed multiplier. Default value is 1. Please bear in mind that this command ignore the relative thresholds defined for animation states (parameters '''relSpeedMin''' and '''relSpeedMax''') so you have to check for them manually if you wish to respect our internal slowdown standards (you don't have to of course).
 
=== [[getAnimSpeedCoef]] ===
Return current animation slowdown value.
 
=== [[setStamina]] ===
Set given amount of stamina. Please note that it sets absolute value, not fraction of Stamina.
 
=== [[getStamina]] ===
Return current stamina. Please note that it returns absolute value, not fraction of Stamina.
 
=== [[setFatigue]] ===
Legacy command from old Fatigue system. Now it set Stamina pool state on interval [0,1].
 
=== [[getFatigue]] ===
Legacy command from old Fatigue system. Now it return current state of Stamina pool on interval [0,1].
 
=== [[enableStamina]] ===
On / Off switch.
 
=== [[isStaminaEnabled]] ===
Check whether stamina is in effect.
 
=== [[allowSprint]] ===
Enable/disable Sprint for infantry movement (for all stances).
 
=== [[isSprintAllowed]] ===
Returns whether unit can sprint or not. Complementary to ''allowSprint''.
 
=== [[forceWalk]] ===
Enable/disable force walk.
 
=== [[isForcedWalk]] ===
Returns whether unit is forced to walk or not. Complementary to ''forceWalk''.
 
=== [[enableAimPrecision]] ===
Set whether animation's aim precision affects weapon sway.


=Parameters=
=Parameters=
All Stamina related parameters are described in: [[CfgMovesFatigue|CfgMovesFatigue]]
All Stamina related parameters are described in: [[CfgMovesFatigue|CfgMovesFatigue]]

Revision as of 14:33, 21 September 2020

Template:Cfg ref

General

Stamina is the new exhaustion mechanics that will replace the old Fatigue system as of Arma 3 Nexus update (1.54). It is supposed to be much simpler, clearer, better communicated and easier to grasp mechanics that will allow for management of exhaustion, encumbrance, terrain gradient penalties and overall mobility of infantry while it is also much more open to modifications and should serve as a solid platform for community made solutions as suggested by our own Legacy Fatigue Mod & Sample.

Functionality

Stamina work as reservoir used for Sprinting in vanilla game. Full Stamina bar allows for 60 seconds of Sprinting (staminaDuration). However, as carried equipment fills up your Inventory bar, the exact same portion is also reserved from the overall Stamina and thus cannot be used for Sprinting. Total mass of the entire inventory bar is defined to be 1000 mass units (parameter maxSoldierLoad defined in class CfgInventoryGlobalVariable).

Whatever remains at your disposal is your Stamina pool. Whenever you exhaust all of your Stamina pool, you have to recuperate for 10 seconds (staminaCooldown) until you can Sprint again, but Stamina pool is regenerating during this exhaustion period. The whole Stamina pool always regenerate in 30 seconds (staminaRestoration) from the total exhaustion to the full, regardless of how much Stamina it actually is. Less equipped soldiers can therefore Sprint for longer and will regenerate their Stamina faster than more equipped ones.

Parameter stamina defined for every animation state defines the behavior of Stamina while the soldier remains in that particular state. Positive values determine regeneration, negative values determine exhaustion, while the magnitude defines the multiplier of exhaustion (staminaDuration) and regeneration (staminaRestoration) time defined for the whole Stamina. Zero value means that current stamina state is conserved in that animation state.

Stamina bar indicating you current Stamina pool is positioned at the upper right corner, just below the weapon info. It is hidden by default, and is only visible when you are in the inventory or when your Stamina pool is changing or not full. It's position can be shifted in UI settings as it is separate from Weapon Info panel. It is red whenever you try (hold Sprint button), but cannot Sprint (due to injury or terrain gradient) and whenever you are fully exhausted. It is also augmented with Terrain and Injury icons that became visible whenever the terrain prevents you from sprinting and / or running.

Relation to Weapon Sway

Every particular state you are in has it is predefined aiming precision coefficient (parameter aimPrecision in every animation state), multiplying the magnitude of the default sway. The longer you remain in certain state, the more is your actual sway approaching the precision defined for that state. Time needed to reach that value is directly related to your equipment load, so that the more equipment you carry the sooner your weapon sway deteriorate in states bad for precision and it is also slower to stabilize back in states with good precision and vice versa. Overall time coefficient is controlled by general Stamina setting (parameter aimPrecisionSpeedCoef).

Scripting commands

Command Group: Stamina System

Parameters

All Stamina related parameters are described in: CfgMovesFatigue