{"name":"BIS_fnc_runLater","operator":null,"title":"BIS fnc runLater","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_runLater","revid":349313,"updated":"2023-11-08T14:52:25Z","groups":["Program Flow"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.16"}],"since":{"game":"arma3","name":"Arma 3","version":"1.16"},"arma3_since":"1.16","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Stack code/function that should be run later, after some time/frames or/and custom condition. Internally calls BIS_fnc_loop.","syntaxes":[{"syntax":"[id, code, timer, timerType, condition] call BIS_fnc_runLater","since":null,"effect":null,"exec":null,"params":[{"name":"id","type":"String","optional":false,"default":null,"description":"unique Id","types":["String"],"since":null,"text":"id: String - unique Id"},{"name":"code","type":"Code or String","optional":false,"default":null,"description":"code/function that is executed later","types":["Code","String"],"since":null,"text":"code: Code or String - code/function that is executed later"},{"name":"timer","type":"Number","optional":false,"default":null,"description":"the timer value (can be in seconds or frames)","types":["Number"],"since":null,"text":"timer: Number - the timer value (can be in seconds or frames)"},{"name":"timerType","type":"String","optional":false,"default":null,"description":"can be \"seconds\" or \"frames\"","types":["String"],"since":null,"text":"timerType: String - can be \"seconds\" or \"frames\""},{"name":"condition","type":"Code","optional":false,"default":null,"description":"the custom condition, code is only executed if timer is validated and condition is met","types":["Code"],"since":null,"text":"condition: Code - the custom condition, code is only executed if timer is validated and condition is met"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"}}],"examples":[{"text":"```sqf\n// Hints current game time in the next frame after 5 seconds have passed\n[\"uniqueId\", { hint str time; }, 5] call BIS_fnc_runLater;\n```","code":["// Hints current game time in the next frame after 5 seconds have passed\n[\"uniqueId\", { hint str time; }, 5] call BIS_fnc_runLater;"]},{"text":"```sqf\n// Hints current game time in the next frame after 120 frames have passed\n[\"uniqueId\", { hint str time; }, 120, \"frames\"] call BIS_fnc_runLater;\n```","code":["// Hints current game time in the next frame after 120 frames have passed\n[\"uniqueId\", { hint str time; }, 120, \"frames\"] call BIS_fnc_runLater;"]},{"text":"```sqf\n// Hints current game time in the next frame after BIS_variable is assigned\n[\"uniqueId\", { hint str time; }, nil, nil, { !isNil { BIS_variable } }] call BIS_fnc_runLater;\n```","code":["// Hints current game time in the next frame after BIS_variable is assigned\n[\"uniqueId\", { hint str time; }, nil, nil, { !isNil { BIS_variable } }] call BIS_fnc_runLater;"]},{"text":"```sqf\n// Hints current game time in the next frame after 5 seconds have passed and BIS_variable is assigned\n[\"uniqueId\", { hint str time; }, 5, \"seconds\", { !isNil { BIS_variable } }] call BIS_fnc_runLater;\n```","code":["// Hints current game time in the next frame after 5 seconds have passed and BIS_variable is assigned\n[\"uniqueId\", { hint str time; }, 5, \"seconds\", { !isNil { BIS_variable } }] call BIS_fnc_runLater;"]},{"text":"```sqf\n// Hints current game time in the next frame\n[\"uniqueId\", { hint str time; }] call BIS_fnc_runLater;\n```","code":["// Hints current game time in the next frame\n[\"uniqueId\", { hint str time; }] call BIS_fnc_runLater;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["BIS_fnc_CPWaitUntil","waitUntil","BIS_fnc_loop"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Program Flow","Functions","Introduced with Arma 3 version 1.16"],"docblock":null,"filled_from_docblock":[]}