BIS fnc VRTimer: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "\[\[Category\:Function Group\: VR(\|\{\{[a-zA-Z0-9_:]+\}\})?\]\]" to "") |
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
||
Line 1: | Line 1: | ||
{{Function|Comments= | {{Function|Comments= | ||
| arma3 |Game name= | | arma3 |Game name= | ||
Line 9: | Line 8: | ||
|eff= local |MP Effects= | |eff= local |MP Effects= | ||
| Timer for VR and time trials. The following [[missionNamespace]] variables can be used: | | Timer for VR and time trials. The following [[missionNamespace]] variables can be used: | ||
Line 15: | Line 13: | ||
* <tt>RscFiringDrillTime_current</tt>: fill with [[Structured Text]] to display text instead of timer (when timer is stopped) | * <tt>RscFiringDrillTime_current</tt>: fill with [[Structured Text]] to display text instead of timer (when timer is stopped) | ||
* <tt>RscFiringDrillTime_done</tt>: set to [[true]] to close the display. '''''Stop the timer first''''' |Description= | * <tt>RscFiringDrillTime_done</tt>: set to [[true]] to close the display. '''''Stop the timer first''''' |Description= | ||
| [colour] spawn [[BIS_fnc_VRTimer]] |Syntax= | | [colour] spawn [[BIS_fnc_VRTimer]] |Syntax= | ||
Line 22: | Line 19: | ||
| [[Nothing]] |Return value= | | [[Nothing]] |Return value= | ||
|x1= <code>[] [[spawn]] [[BIS_fnc_VRTimer]];</code> |Example 1= | |x1= <code>[] [[spawn]] [[BIS_fnc_VRTimer]];</code> |Example 1= | ||
Line 29: | Line 25: | ||
|x3= <code>["#025D00"] [[spawn]] [[BIS_fnc_VRTimer]];</code> |Example 3= | |x3= <code>["#025D00"] [[spawn]] [[BIS_fnc_VRTimer]];</code> |Example 3= | ||
| [[BIS_fnc_displayColorGet]], [[BIS_fnc_colorRGBtoHTML]] |See also= | | [[BIS_fnc_displayColorGet]], [[BIS_fnc_colorRGBtoHTML]] |See also= |
Revision as of 22:35, 16 January 2021
Description
- Description:
- Timer for VR and time trials. The following missionNamespace variables can be used:
- BIS_stopTimer: set to true to stop the timer. Once stopped, the function must be executed again to restart the timer
- RscFiringDrillTime_current: fill with Structured Text to display text instead of timer (when timer is stopped)
- RscFiringDrillTime_done: set to true to close the display. Stop the timer first
- Execution:
- call
- Groups:
- VR
Syntax
- Syntax:
- [colour] spawn BIS_fnc_VRTimer
- Parameters:
- colour: String (Optional, default
(["IGUI", "WARNING_RGB"] call BIS_fnc_displayColorGet) call BIS_fnc_colorRGBtoHTML
) timer colour in HTML format (#RRGGBB) - Return Value:
- Nothing
Examples
- Example 1:
[] spawn BIS_fnc_VRTimer;
- Example 2:
"#025D00" spawn BIS_fnc_VRTimer;
- Example 3:
["#025D00"] spawn BIS_fnc_VRTimer;
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
Notes
- Posted on June 04, 2018 - 19:50 (UTC)
- Lou Montana
-
Here is a countdown, inspired by this function:
and to use it:LM_fnc_timeoutCountdown = { params [ ["_time", 30, [0]], ["_colour", "#FFFFFF", [""]] ]; private _timeout = time + _time; RscFiringDrillTime_done = false; 1 cutRsc ["RscFiringDrillTime", "PLAIN"]; while { time < _timeout } do { private _remainingTime = _timeout - time; private _timeFormat = [_remainingTime, "MM:SS.MS", true] call BIS_fnc_secondsToString; private _text = format ["<t align='left' color='%1'><img image='%2' />%3:%4<t size='0.8'>.%5</t>", _colour, "A3\Modules_F_Beta\data\FiringDrills\timer_ca", _timeFormat select 0, _timeFormat select 1, _timeFormat select 2 ]; RscFiringDrillTime_current = parseText _text; sleep 0.01; }; private _timeFormat = [0, "MM:SS.MS", true] call BIS_fnc_secondsToString; RscFiringDrillTime_current = parseText format ["<t align='left' color='%1'><img image='%2' />%3:%4<t size='0.8'>.%5</t>", _colour, "A3\Modules_F_Beta\data\FiringDrills\timer_ca", _timeFormat select 0, _timeFormat select 1, _timeFormat select 2]; sleep 4; RscFiringDrillTime_done = true; };
↑ Back to spoiler's top[10, "#FF5500"] spawn LM_fnc_timeoutCountdown;