setStamina: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " {{GameCategory|arma3|New Scripting Commands}} {{GameCategory|arma3|Scripting Commands}} {{uc:{{PAGENAME}}}} " to "")
m (Text replacement - ">Posted on December ([0-9]{2})[ a-zA-Z]*, ([0-9]{4})" to ">Posted on $2-12-$1")
 
(30 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command
|arma3
|game1= arma3
 
|version1= 1.54
|1.54


|eff= local
|eff= local
Line 9: Line 8:
|gr1= Stamina System
|gr1= Stamina System


| Set units' stamina (seconds until depletion)
|descr= Set units' stamina (seconds until depletion)


| unit '''setStamina''' stamina
|s1= unit [[setStamina]] stamina


|p1= unit: [[Object]]
|p1= unit: [[Object]]
Line 17: Line 16:
|p2= stamina: [[Number]]
|p2= stamina: [[Number]]


| Nothing
|r1= [[Nothing]]


|x1= <code>[[player]] [[setStamina]] 42;</code>
|x1= <sqf>player setStamina 42;</sqf>


| [[setStaminaScheme]], [[getStamina]], [[enableStamina]], [[setFatigue]], [[getFatigue]], [[Arma 3 Stamina]]
|seealso= [[setStaminaScheme]] [[getStamina]] [[enableStamina]] [[setFatigue]] [[getFatigue]] [[Arma 3: Stamina]]
}}
}}


<!-- CONTINUE Notes -->
<dl class="command_description">
<dl class="command_description">
<dd class="notedate">Posted on December 30, 2015 - 01:50 (UTC)</dd>
 
<dt></dt>
<dd class="notedate">Posted on 2015-12-30 - 01:50 (UTC)</dd>
<dt class="note">[[User:Molaron|Molaron]]</dt>
<dt class="note">[[User:Molaron|Molaron]]</dt>
<dd class="note">
<dd class="note">
Line 32: Line 32:
</dd>
</dd>


<dd class="notedate">Posted on December 26, 2018 - 11:34 (UTC)</dd>
<dt><dt>
<dd class="notedate">Posted on 2018-12-26 - 11:34 (UTC)</dd>
<dt class="note">[[User:demellion|demellion]]</dt>
<dt class="note">[[User:demellion|demellion]]</dt>
<dd class="note">
<dd class="note">
Note that [[setStamina]] will not be able to exceed a 100% stamina value given by the engine. It will minimize to a maximum possible value, similar to application of the old command [[setFatigue]] in a range of '''0..1'''. Example:
Note that [[setStamina]] will not be able to exceed a 100% stamina value given by the engine. It will minimize to a maximum possible value, similar to application of the old command [[setFatigue]] in a range of '''0..1'''. Example:
<code>[[getStamina]] [[player]]; // 8.58
<sqf>getStamina player; // 8.58
[[getFatigue]] [[player]]; // 0
getFatigue player; // 0
[[player]] [[setStamina]] 50; // This will be minimized to 8.58 on next unit simulation cycle.  
player setStamina 50; // This will be minimized to 8.58 on next unit simulation cycle. </sqf>
</code>
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 00:13, 14 May 2023

Hover & click on the images for description

Description

Description:
Set units' stamina (seconds until depletion)
Groups:
Stamina System

Syntax

Syntax:
unit setStamina stamina
Parameters:
unit: Object
stamina: Number
Return Value:
Nothing

Examples

Example 1:
player setStamina 42;

Additional Information

See also:
setStaminaScheme getStamina enableStamina setFatigue getFatigue Arma 3: Stamina

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Posted on 2015-12-30 - 01:50 (UTC)
Molaron
"setStamina" has the same effect as "setFatigue".
Posted on 2018-12-26 - 11:34 (UTC)
demellion
Note that setStamina will not be able to exceed a 100% stamina value given by the engine. It will minimize to a maximum possible value, similar to application of the old command setFatigue in a range of 0..1. Example:
getStamina player; // 8.58 getFatigue player; // 0 player setStamina 50; // This will be minimized to 8.58 on next unit simulation cycle.