Difference between revisions of "getFatigue"

From Bohemia Interactive Community
Jump to navigation Jump to search
m
m (Text replacement - "\| *((\[\[[a-zA-Z0-9_ |()]+\]\],? ?)+) * \}\}" to "|seealso= $1 }}")
 
(27 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Command|= Comments
+
{{RV|type=command
____________________________________________________________________________________________
 
  
| arma3 |= Game name
+
| arma3
 +
|0.50
 +
|arg= global
  
|0.50|= Game version
+
|gr1= Stamina System
____________________________________________________________________________________________
 
  
| Returns fatigue of given unit. |= Description
+
| Returns fatigue of given unit.
____________________________________________________________________________________________
 
  
| '''getFatigue''' unit |= Syntax
+
| '''getFatigue''' unit
  
|p1= unit: [[Object]] |= PARAMETER1
+
|p1= unit: [[Object]]
  
| [[Number]] |= RETURNVALUE
+
| [[Number]]
  
 +
|x1= <code> value = [[getFatigue]] [[player]];
 +
</code>
  
|x1= <code> value = '''getFatigue''' player;
+
|x2= <code> [[if]] ([[getFatigue]] [[player]] < 0.5) [[then]] { [[player]] [[sideChat]] "I'm good to go!" };
</code>|= EXAMPLE1
+
</code>
  
|x2= <code> if ('''getFatigue''' player < 0.5) Then { player sideChat "I'm good to go!" };
+
|seealso= [[setFatigue]], [[enableFatigue]], [[getStamina]]
</code>|= EXAMPLE2
 
 
 
____________________________________________________________________________________________
 
 
 
| [[setFatigue]], [[enableFatigue]] |= SEEALSO
 
 
 
|  |= MPBEHAVIOUR
 
____________________________________________________________________________________________
 
 
}}
 
}}
  
<h3 style='display:none'>Notes</h3>
 
 
<dl class='command_description'>
 
<dl class='command_description'>
 
<!-- Note Section BEGIN -->
 
<!-- Note Section BEGIN -->
<dt class="note">'''[[User:Killzone_Kid|Killzone_Kid]]'''<dd class="note">
+
 
<br>
+
<dt class="note">[[User:Killzone_Kid|Killzone_Kid]]<dd class="note">
 
[[getFatigue]] can be applied to remote unit however it will not read the changes made to unit's fatigue with [[setFatigue]] command. Only natural changes resulting from unit moving will be counted. When applied to local unit, it will read resulting value of natural fatigue combined with artificial changes added locally by [[setFatigue]]. In short, the server wouldn't know the correct value of remote unit's fatigue if you used [[setFatigue]] on the unit prior.<br>
 
[[getFatigue]] can be applied to remote unit however it will not read the changes made to unit's fatigue with [[setFatigue]] command. Only natural changes resulting from unit moving will be counted. When applied to local unit, it will read resulting value of natural fatigue combined with artificial changes added locally by [[setFatigue]]. In short, the server wouldn't know the correct value of remote unit's fatigue if you used [[setFatigue]] on the unit prior.<br>
 +
 
<!-- Note Section END -->
 
<!-- Note Section END -->
 
</dl>
 
</dl>
 
<h3 style='display:none'>Bottom Section</h3>
 
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
 
[[Category:Command_Group:_Object_Information|{{uc:{{PAGENAME}}}}]]
 

Latest revision as of 23:41, 16 February 2021

Hover & click on the images for descriptions

Description

Description:
Returns fatigue of given unit.

Syntax

Syntax:
getFatigue unit
Parameters:
unit: Object
Return Value:
Number

Examples

Example 1:
value = getFatigue player;
Example 2:
if (getFatigue player < 0.5) then { player sideChat "I'm good to go!" };

Additional Information

See also:
setFatigueenableFatiguegetStamina
Groups:
Stamina System

Notes

i
Only post proven facts here. Report bugs on the Feedback Tracker and discuss on the Arma Discord or on the Forums.
Killzone_Kid
getFatigue can be applied to remote unit however it will not read the changes made to unit's fatigue with setFatigue command. Only natural changes resulting from unit moving will be counted. When applied to local unit, it will read resulting value of natural fatigue combined with artificial changes added locally by setFatigue. In short, the server wouldn't know the correct value of remote unit's fatigue if you used setFatigue on the unit prior.