{"name":"BIS_fnc_eventTimeline","operator":null,"title":"BIS fnc eventTimeline","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_eventTimeline","revid":352082,"updated":"2024-02-01T23:24:45Z","groups":["Timeline","Systems"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.78"}],"since":{"game":"arma3","name":"Arma 3","version":"1.78"},"arma3_since":"1.78","branch":null,"locality":{"argument":null,"effect":"local","server_exec":false},"exec":"spawn","description":"Universal system for playing sequential events defined by time. \n\n> [!NOTE]\n> *codeInterrupt* and *codeEnd* are called while the code in the timeline is spawned.","syntaxes":[{"syntax":"[timeline, index, music, codeInterrupt, codeEnd] call BIS_fnc_eventTimeline","since":null,"effect":null,"exec":null,"params":[{"name":"timeline","type":"Array","optional":false,"default":null,"description":"timeline in format [[1.0, {code}], [2.0, {code}], [2.3, {code}], [4.7, {code}]]","types":["Array"],"since":null,"text":"timeline: Array - timeline in format [[1.0, {code}], [2.0, {code}], [2.3, {code}], [4.7, {code}]]"},{"name":"index","type":"Number","optional":true,"default":"0","description":"index of the event to play","types":["Number"],"since":null,"text":"index: Number - (Optional, default 0) index of the event to play"},{"name":"music","type":"String","optional":true,"default":"\"\"","description":"music to be played which will provide the sync time for the timeline","types":["String"],"since":null,"text":"music: String - (Optional, default \"\") music to be played which will provide the sync time for the timeline"},{"name":"codeInterrupt","type":"Code","optional":true,"default":"`params [\"_pointer\", \"_baseTime\", \"_evenTime\"]; [\"Timeline interrupted while playing event nr.: %1 (%2)\", _pointer, _baseTime + _eventTime] call BIS_fnc_logFormat;`","description":"Code to be executed if the timeline is interrupted with\n`missionNamespace setVariable [\"BIS_fnc_eventTimeline_playing\", false]`","types":["Code"],"since":null,"text":"codeInterrupt: Code - (Optional, default\n`params [\"_pointer\", \"_baseTime\", \"_evenTime\"]; [\"Timeline interrupted while playing event nr.: %1 (%2)\", _pointer, _baseTime + _eventTime] call BIS_fnc_logFormat;`)\nCode to be executed if the timeline is interrupted with\n`missionNamespace setVariable [\"BIS_fnc_eventTimeline_playing\", false]`"},{"name":"codeEnd","type":"Array or Code","optional":true,"default":"nil","description":"Code or Array of codes to be executed once the timeline is finished. The codes are called one after the other.","types":["Array","Code"],"since":null,"text":"codeEnd: Array or Code - (Optional, default nil) Code or Array of codes to be executed once the timeline is finished. The codes are called one after the other."}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"}}],"examples":[{"text":"```sqf\nprivate _timeline =\n[\n    [0.0, { hint \"Start of the Timeline\" }],\n    [1.0, { hint \"Event 1\" }],\n    [3.0, { hint \"End of the timeline\" }]\n];\n\n[_timeline, 0, \"\", { hint \"Interrupted\" }, { hint \"Timeline done\" }] spawn BIS_fnc_eventTimeline;\n```","code":["private _timeline =\n[\n\t[0.0, { hint \"Start of the Timeline\" }],\n\t[1.0, { hint \"Event 1\" }],\n\t[3.0, { hint \"End of the timeline\" }]\n];\n\n[_timeline, 0, \"\", { hint \"Interrupted\" }, { hint \"Timeline done\" }] spawn BIS_fnc_eventTimeline;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["BIS_fnc_animatedBriefing"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Systems","Function Group: Timeline","Functions","Functions: Local Effect","Introduced with Arma 3 version 1.78"],"docblock":null,"filled_from_docblock":[]}