BIS fnc runLater: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\{\{ *cc*\| *([^}]+) *\}\}" to "// $1") |
Lou Montana (talk | contribs) m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *U([a-z ])" to "$1 - u$2") |
||
(3 intermediate revisions by the same user not shown) | |||
Line 10: | Line 10: | ||
|s1= [id, code, timer, timerType, condition] call [[BIS_fnc_runLater]] | |s1= [id, code, timer, timerType, condition] call [[BIS_fnc_runLater]] | ||
|p1= id: [[String]] - | |p1= id: [[String]] - unique Id | ||
|p2= code: [[Code]] or [[String]] - | |p2= code: [[Code]] or [[String]] - code/function that is executed later | ||
|p3= timer: [[Number]] - | |p3= timer: [[Number]] - the timer value (can be in seconds or frames) | ||
|p4= timerType: [[String]] - can be "seconds" or "frames" | |p4= timerType: [[String]] - can be "seconds" or "frames" | ||
|p5= condition: [[Code]] - | |p5= condition: [[Code]] - the custom condition, code is only executed if timer is validated and condition is met | ||
|r1= [[Nothing]] | |r1= [[Nothing]] | ||
|x1= < | |x1= <sqf>// Hints current game time in the next frame after 5 seconds have passed | ||
["uniqueId", { hint str time; }, 5] call BIS_fnc_runLater;</ | ["uniqueId", { hint str time; }, 5] call BIS_fnc_runLater;</sqf> | ||
|x2= < | |x2= <sqf>// Hints current game time in the next frame after 120 frames have passed | ||
["uniqueId", { hint str time; }, 120, "frames"] call BIS_fnc_runLater;</ | ["uniqueId", { hint str time; }, 120, "frames"] call BIS_fnc_runLater;</sqf> | ||
|x3= < | |x3= <sqf>// Hints current game time in the next frame after BIS_variable is assigned | ||
["uniqueId", { hint str time; }, nil, nil, { !isNil { BIS_variable } }] call BIS_fnc_runLater;</ | ["uniqueId", { hint str time; }, nil, nil, { !isNil { BIS_variable } }] call BIS_fnc_runLater;</sqf> | ||
|x4= < | |x4= <sqf>// Hints current game time in the next frame after 5 seconds have passed and BIS_variable is assigned | ||
["uniqueId", { hint str time; }, 5, "seconds", { !isNil { BIS_variable } }] call BIS_fnc_runLater;</ | ["uniqueId", { hint str time; }, 5, "seconds", { !isNil { BIS_variable } }] call BIS_fnc_runLater;</sqf> | ||
|x5= < | |x5= <sqf>// Hints current game time in the next frame | ||
["uniqueId", { hint str time; }] call BIS_fnc_runLater;</ | ["uniqueId", { hint str time; }] call BIS_fnc_runLater;</sqf> | ||
|seealso= [[BIS_fnc_CPWaitUntil]] [[waitUntil]] [[BIS_fnc_loop]] | |seealso= [[BIS_fnc_CPWaitUntil]] [[waitUntil]] [[BIS_fnc_loop]] | ||
}} | }} |
Latest revision as of 15:52, 8 November 2023
Description
- Description:
- Stack code/function that should be run later, after some time/frames or/and custom condition. Internally calls BIS_fnc_loop.
- Execution:
- call
- Groups:
- Program Flow
Syntax
- Syntax:
- [id, code, timer, timerType, condition] call BIS_fnc_runLater
- Parameters:
- id: String - unique Id
- code: Code or String - code/function that is executed later
- timer: Number - the timer value (can be in seconds or frames)
- timerType: String - can be "seconds" or "frames"
- condition: Code - the custom condition, code is only executed if timer is validated and condition is met
- Return Value:
- Nothing
Examples
- Example 1:
- Example 2:
- Example 3:
- Example 4:
- Example 5:
Additional Information
- See also:
- BIS_fnc_CPWaitUntil waitUntil BIS_fnc_loop
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