FAQ - ysaroka/InediaStamina GitHub Wiki
- I set some parameters in configuration file, but server ignores them
- Where can I view the default configuration file?
- How to make the impact of weight on stamina consumption more casual or hardcore?
- How does character's load weight affect stamina consumption?
- Can I disable the general stamina or sleep mechanics separately?
- How to adjust the influence of various factors on the character's movement speed?
- How can I disable speed restrictions under certain conditions?
- How can I disable general stamina consumption under certain conditions?
I set some parameters in configuration file, but server ignores them
If there is an parse error in configuration file, the server will ignore all parameters from the configuration file and will use the default parameters.
If for some reason server ignores parameters from configuration file - check content of the config file using:
JSON validator: https://jsonlint.com
Just copy contents of the file, paste it into text area and click "Validate JSON" button, the validator will output errors if there are any.
Also be sure to check the server crash report, as the online validator cannot detect parameter type mismatch errors:
%DayZserverDir%/profiles/crash_*.log
However, to avoid constantly checking the configuration file for errors, I recommend adding your SteamID to the administrators configuration to gain access to additional commands (entered in the game chat) and features of this mod. For example, this will allow you to reload the mod configuration without restarting the server. Most importantly, in case of errors in the configuration file, you as an administrator will receive a message about it in the game chat when logging into the server or reloading the configuration, preventing any issues with a non-working config. Learn more about how to do this here.
Where can I view the default configuration file?
If you've changed a parameter and want to revert it back without deleting the current configuration file, you can check the current configuration file with default values here. It gets updated after each modification update.
How to make the impact of weight on stamina consumption more casual or hardcore?
This can be achieved with just one parameter, StaminaGeneralOptions.WeightOverloadThresholdKg.
For more details on the influence of the character's load weight on general stamina consumption, as well as the direct impact of this parameter, you can read here.
How does character's load weight affect stamina consumption?
Percentage of stamina consumed is simply multiplied by the character's load weight multiplier.
For example, if during a certain movement the character's stamina per second consumption value specified in config is -0.15%, and the character's load weight multiplier is 1.7, then the character will spend: -0.15% * 1.7 = -0.255% stamina per second
Player's weight multiplier is determined by the formula:
WEIGHT_MULTIPLIER = 1 + (CURRENT_WEIGHT_KG/OVERLOAD_THRESHOLD)^3
Where CURRENT_WEIGHT_KG is the character's current load weight, and ^3 means to third power.
As for OVERLOAD_THRESHOLD, it is a cornerstone in influencing the impact of weight on the consumption of general stamina. This is the player's weight overload threshold in kilograms, after which the player will start experiencing certain difficulties, i.e., stamina consumption will rapidly and exponentially increase. In simpler terms, the higher the value of this parameter, the easier it will be for the character to run with excess weight. Or the higher the value of the parameter - the more casual the mechanics of how the load weight affects stamina, the lower - the more hardcore it is. The default value is "25" kg and it is the closest to real life in terms of its impact.
This parameter can be adjusted in the configuration through the option StaminaGeneralOptions.WeightOverloadThresholdKg. If you don't want to bother with adjusting a multitude of parameters in the configuration to decrease or increase the difficulty of this mod, this parameter is what you need. By default, its value is set to "25" kg.
Please note that regardless of the character's weight CURRENT_WEIGHT_KG
, the weight multiplier WEIGHT_MULTIPLIER
cannot exceed the value of StaminaGeneralOptions.WeightOverloadMultiplierMax. By default, the value of this parameter is set to 10. This means that regardless of the current load weight of the character, the general stamina consumption will not increase by more than a factor of 10.
Can I disable the general stamina or sleep mechanics separately?
You can do this in the config file, StaminaGeneralOptions.IsActive => 0 to disable the general stamina functionality, StaminaSleepOptions.IsActive => 0 to disable the sleep feature.
If the sleep stamina functionality is disabled, the sleepiness multiplier for the general stamina will always be "1".
If the functionality of the general stamina is disabled, the lack of sleep loses its meaning, since before that the lack of sleep lowered the regeneration rate of the general stamina.
Therefore, in case of disabling the functionality of the general stamina - lack of sleep imposes the following debuffs:
- Affects the speed of movement depending on the critical or low level of sleep (parameter StaminaSleepOptions.MovementSpeedReductionWhenLessLowIsActive will be forcibly enabled);
- Adds a chance to lose consciousness when the level of sleep is below the critical (parameter StaminaSleepOptions.LossOfConsciousnessWhenLessCriticalIsActive will be forcibly enabled);
How to adjust the influence of various factors on the character's movement speed?
This modification integrates another modification, InediaMovement, which adds realistic effects of various factors (such as the character's load weight, terrain slope, surface type, collisions with bushes) on the character's movement speed.
The settings for this modification are available in the "InediaStamina" configuration, parameters InediaMovementOptions.*.
Descriptions of all these parameters can be found in the "InediaMovement" wiki, here.
How can I disable speed restrictions under certain conditions?
Sometimes, under certain conditions, it is necessary to disable the influence of load weight, terrain slope, etc., on the character's speed.
For example, this might be needed in situations where the character equips a modded exoskeleton or activates a certain medical status.
To disable speed restrictions, simply override the InediaMovement_Restrictions.AllRestrictionsAreActive(...) method in your modification, returning "false" when specific conditions are met:
modded class InediaMovement_Restrictions
{
override static bool AllRestrictionsAreActive(PlayerBase player)
{
if ( #your conditions# ) {
// If the method returns false, all handlers affecting the character's speed will cease to do so.
return false;
}
return true;
}
}
The check is performed once per second, so keep this in mind and avoid placing heavy functions there.
How can I disable general stamina consumption under certain conditions?
Sometimes, under certain conditions, it is necessary to disable general stamina consumption.
For example, this might be needed in situations where the character equips a modded exoskeleton or activates a certain medical status.
To disable consumption, simply override the InediaStamina_Restrictions.GeneralStaminaConsumptionIsActive(...) method in your modification, returning "false" when specific conditions are met:
modded class InediaStamina_Restrictions
{
override static bool GeneralStaminaConsumptionIsActive(PlayerBase player)
{
if ( #your conditions# ) {
// If the method returns false, stamina consumption will be disabled, and stamina will only regenerate as if the character is not moving.
return false;
}
return true;
}
}
The check is performed once per second, so keep this in mind and avoid placing heavy functions there.