setGusts: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
Lou Montana (talk | contribs) m (Text replacement - "user= samatra" to "user= Sa-Matra") |
||
(One intermediate revision by one other user not shown) | |||
Line 24: | Line 24: | ||
{{Note | {{Note | ||
|user= | |user= Sa-Matra | ||
|timestamp= 20220706041709 | |timestamp= 20220706041709 | ||
|text= Unlike most of weather commands, this one does not set gusts instantly but on next frame. | |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> | <sqf> | ||
// | // Initial gusts you want | ||
0 setGusts | 0 setGusts 0; | ||
100 setGusts 1; | |||
// | // 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 | |||
}; | |||
}; | |||
}; | |||
</sqf> | </sqf> | ||
}} | }} |
Latest revision as of 19:09, 16 December 2024
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
Examples
- Example 1:
- 60 setGusts 0.75;
Additional Information
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 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 }; }; };