setFatigue: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "<code>([a-zA-Z0-9_]+) +\[\[([a-zA-Z0-9_]+)\]\] +([a-zA-Z0-9_]+);?<\/code>" to "<sqf>$1 $2 $3;</sqf>")
 
(40 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma3 |= Game name
|game1= arma3
|version1= 0.50


|0.50|= Game version
|arg= global
|arg= global |= Arguments in MP


|eff= local |= Effects in MP
|eff= local
____________________________________________________________________________________________


| Sets the person's fatigue, from 0 to 1.  |= Description
|gr1= Stamina System
____________________________________________________________________________________________


| unit '''setFatigue''' value |= Syntax
|descr= Sets the person's fatigue, from 0 to 1.


|p1= unit: [[Object]] |= PARAMETER1
|s1= unit [[setFatigue]] value


|p2= value: [[Number]] |= PARAMETER2
|p1= unit: [[Object]]


| [[Nothing]] |= RETURNVALUE
|p2= value: [[Number]] - in 0..1 ''available'' fatigue range: 0 is fully energised, 1 is fully exhausted


|r1= [[Nothing]]


|x1= <code> player '''setFatigue''' 1;
|x1= <sqf>player setFatigue 1;</sqf>
</code>|= EXAMPLE1


____________________________________________________________________________________________
|seealso= [[Arma 3: Stamina]] [[getFatigue]] [[enableFatigue]] [[setStamina]] [[getStamina]] [[enableStamina]]
 
}}
| [[getFatigue]], [[enableFatigue]] |= SEEALSO


|  |= MPBEHAVIOUR
<dl class="command_description">
____________________________________________________________________________________________
}}


<h3 style='display:none'>Notes</h3>
<dt></dt>
<dl class='command_description'>
<dd class="notedate">Posted on 05 April, 2014</dd>
<!-- Note Section BEGIN -->
<dt class="note">[[User:Killzone_Kid|Killzone_Kid]]</dt>
<dd class="notedate">Posted on 05 April, 2014
<dd class="note">
<dt class="note">'''[[User:Killzone_Kid|Killzone_Kid]]'''<dd class="note">
[[setFatigue]] will affect fatigue of a local unit only. If you execute it on remote unit, the [[getFatigue]] value will only change locally with no effect on remote unit. Scripted [[setFatigue]] changes don't broadcast at all. In short, use [[setFatigue]] on local units only.
<br>
</dd>
[[setFatigue]] will affect fatigue of a local unit only. If you execute it on remote unit, the [[getFatigue]] value will only change locally with no effect on remote unit. Scripted [[setFatigue]] changes don't broadcast at all. In short, use [[setFatigue]] on local units only.<br>
<dd class="notedate">Posted on 15 October, 2015
<dt class="note">'''[[User:Pierre MGI|Pierre MGI]]'''<dd class="note">
<br>
Usage of this command is tricky as the fatigue is always changing!  You need to use a loop for enabling a "stable level" of fatigue.<br/>
If you want to  limit the fatigue for players in a group, just add in init.sqf, something like:<br/>
0= [] spawn {<br/>
{while {alive _x} do {scopename "fatigued"; sleep 0.5; waituntil {sleep 0.5; getFatigue _x > 0.4 }; _x setFatigue 0.4}; breakTo "fatigued"} forEach units my_group;
};<br/>
Precision tends to be reached with smaller value of sleep commands, probably at the cost of CPU load * nbr of players/units in group.
This works for AI units as well.<br/>


<!-- 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_Manipulation|{{uc:{{PAGENAME}}}}]]

Latest revision as of 14:25, 5 May 2022

Hover & click on the images for description

Description

Description:
Sets the person's fatigue, from 0 to 1.
Groups:
Stamina System

Syntax

Syntax:
unit setFatigue value
Parameters:
unit: Object
value: Number - in 0..1 available fatigue range: 0 is fully energised, 1 is fully exhausted
Return Value:
Nothing

Examples

Example 1:
player setFatigue 1;

Additional Information

See also:
Arma 3: Stamina getFatigue enableFatigue setStamina getStamina enableStamina

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 05 April, 2014
Killzone_Kid
setFatigue will affect fatigue of a local unit only. If you execute it on remote unit, the getFatigue value will only change locally with no effect on remote unit. Scripted setFatigue changes don't broadcast at all. In short, use setFatigue on local units only.