setGusts: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[[Cc]ategory:[ _]?Arma[ _]3:[ _]([^|]*)[ _]?\|.*\]\]" to "{{GameCategory|arma3|$1}}")
No edit summary
 
(26 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


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


|0.50|Game version=
|gr1= Environment


|gr1= Environment |GROUP1=
|eff= local


|descr= Changes the gusts value smoothly during the given time (in seconds). A time of zero means there will be an immediate change. Value is 0 to 1.


|eff= local |Multiplayer Effects=
|s1= time [[setGusts]] value
____________________________________________________________________________________________


| Changes the gusts value smoothly during the given time (in seconds). A time of zero means there will be an immediate change. Value is 0 to 1. |DESCRIPTION=
|p1= time: [[Number]]
____________________________________________________________________________________________


| time '''setGusts''' value |SYNTAX=
|p2= value: [[Number]]


|p1= time: [[Number]] |PARAMETER1=
|r1= [[Nothing]]


|p2= value: [[Number]]  |PARAMETER2=  
|x1= <sqf>60 setGusts 0.75;</sqf>


| [[Nothing]] |RETURNVALUE=
|seealso= [[gusts]] [[wind]] [[setWind]]
 
}}
 
|x1= <code>60 '''setGusts''' 0.75;
</code>|EXAMPLE1=


____________________________________________________________________________________________
{{Note
|user= samatra
|timestamp= 20220706041709
|text= Unlike most of weather commands, this one does not set gusts instantly but on next frame (in 2 frames in practice), so running it multiple times will overwrite each other. [[setRainbow]] has same behavior. In order to set gusts to some value and then have it change to another over time, you need to first do <sqf inline>0 setGusts 0</sqf> and then <sqf inline>100 setGusts 1</sqf> after 2 frames. Example:
<sqf>
// Initial gusts you want
0 setGusts 0;


| [[gusts]], [[wind]], [[setWind]] |SEEALSO=  
// A thread to wait for 2 frames
 
(diag_frameNo + 2) spawn {
|  |MPBEHAVIOUR=
waitUntil {
____________________________________________________________________________________________
// Code in braces is not executed until wanted frame is reached because of lazy evaluation
diag_frameNo >= _this && {
100 setGusts 1;
true; // positive condition result to end waitUntil and spawned thread
};
};
};
</sqf>
}}
}}
<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style='display:none'>Bottom Section</h3>
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_Environment|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
{{GameCategory|arma3|New_Scripting_Commands_List}}

Latest revision as of 05:37, 6 July 2022

Hover & click on the images for description

Description

Description:
Changes the gusts value smoothly during the given time (in seconds). A time of zero means there will be an immediate change. Value is 0 to 1.
Groups:
Environment

Syntax

Syntax:
time setGusts value
Parameters:
time: Number
value: Number
Return Value:
Nothing

Examples

Example 1:
60 setGusts 0.75;

Additional Information

See also:
gusts wind setWind

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
samatra - c
Posted on Jul 06, 2022 - 04:17 (UTC)
Unlike most of weather commands, this one does not set gusts instantly but on next frame (in 2 frames in practice), so running it multiple times will overwrite each other. setRainbow has same behavior. In order to set gusts to some value and then have it change to another over time, you need to first do 0 setGusts 0 and then 100 setGusts 1 after 2 frames. Example:
// Initial gusts you want 0 setGusts 0; // A thread to wait for 2 frames (diag_frameNo + 2) spawn { waitUntil { // Code in braces is not executed until wanted frame is reached because of lazy evaluation diag_frameNo >= _this && { 100 setGusts 1; true; // positive condition result to end waitUntil and spawned thread }; }; };