onPreloadFinished: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " <dl class="command_description"> <dt><dt>" to " <dl class="command_description"> <dt><dt>")
m (Some wiki formatting)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


| arma2
|game1= arma2
|1.00
|version1= 1.00


|game2= arma2oa
|game2= arma2oa
Line 15: Line 15:
|gr1= Event Handlers
|gr1= Event Handlers


| Defines an action performed after the preload screen finished. Preload event occurs after briefing screen on mission start.{{Feature | important | This event handler also fires on client after user closes the main map. }}<br>
|descr= Defines an action performed after the preload screen finished. Preload event occurs after briefing screen on mission start.
{{Feature|Informative|Since '''Arma 3''' ''v1.57'' a stackable version of this EH is available: [[Arma_3:_Event_Handlers/addMissionEventHandler#PreloadFinished|PreloadFinished]]}}<br>
{{Feature | important | This event handler also fires on client after user closes the main map. }}
{{Feature|arma3|In order to keep compatibility between official and community content the functions [[BIS_fnc_addStackedEventHandler]] and [[BIS_fnc_removeStackedEventHandler]] should be used instead.}}
{{Feature|arma3|
* Since {{arma3}} v1.57 a stackable version of this EH is available: [[Arma_3:_Event_Handlers/addMissionEventHandler#PreloadFinished|PreloadFinished]]
* Before that, the [[BIS_fnc_addStackedEventHandler]] and [[BIS_fnc_removeStackedEventHandler]] functions should be used instead.}}


| '''onPreloadFinished''' command
|s1= [[onPreloadFinished]] command


|p1= command: [[String]] or [[Code]]
|p1= command: [[String]] or [[Code]]
Line 26: Line 28:


|x1= <code>[[onPreloadFinished]] {TAG_ReceivingScreenDone = [[true]]};</code>
|x1= <code>[[onPreloadFinished]] {TAG_ReceivingScreenDone = [[true]]};</code>
|x2= <code>//removes the event immediately after the first run again
 
[[onPreloadFinished]] {TAG_ReceivingScreenDone = [[true]]; [[onPreloadFinished]] ""};</code>
|x2= <code>{{cc|removes the event immediately after the first run again}}
[[onPreloadFinished]] { TAG_ReceivingScreenDone = [[true]]; [[onPreloadFinished]] "" };</code>


|seealso= [[onPreloadStarted]]
|seealso= [[onPreloadStarted]]
Line 37: Line 40:
<dd class="notedate">Posted on July 24, 2009</dd>
<dd class="notedate">Posted on July 24, 2009</dd>
<dt class="note">[[User:Tophe|Tophe]]</dt>
<dt class="note">[[User:Tophe|Tophe]]</dt>
<dd class="note">There is a bug in Arma2 that will make this command execute every time the screen with "Receiving..." has been displayed. <br>
<dd class="note">There is a bug in {{arma2}} that will make this command execute every time the screen with "Receiving..." has been displayed.<br>
If this code is put in the Init.sqf it will run the startcam.sqf script when the loading screen has disappeared <br>
If this code is put in the Init.sqf it will run the startcam.sqf script when the loading screen has disappeared
<pre>onPreloadFinished '[fire1] execVM "scripts\startcam.sqf"';</pre>
<code>[[onPreloadFinished]] '[fire1] [[execVM]] "scripts\startcam.sqf"';</code>
It will however also run every time a player change graphics settings, alt-tab or do anything else that will trigger the loading screen.<br>
It will however also run every time a player change graphics settings, alt-tab or do anything else that will trigger the loading screen.<br>
You will have to script around it with if statements to get it to run only in the beginning of the mission.<br>
You will have to script around it with if statements to get it to run only in the beginning of the mission.
</dd>
 
</dl>
</dl>
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}

Revision as of 20:14, 12 June 2021

Hover & click on the images for description

Description

Description:
Defines an action performed after the preload screen finished. Preload event occurs after briefing screen on mission start.
This event handler also fires on client after user closes the main map.
Arma 3
Groups:
Event Handlers

Syntax

Syntax:
onPreloadFinished command
Parameters:
command: String or Code
Return Value:
Nothing

Examples

Example 1:
onPreloadFinished {TAG_ReceivingScreenDone = true};
Example 2:
// removes the event immediately after the first run again onPreloadFinished { TAG_ReceivingScreenDone = true; onPreloadFinished "" };

Additional Information

See also:
onPreloadStarted

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 July 24, 2009
Tophe
There is a bug in Arma 2 that will make this command execute every time the screen with "Receiving..." has been displayed.
If this code is put in the Init.sqf it will run the startcam.sqf script when the loading screen has disappeared onPreloadFinished '[fire1] execVM "scripts\startcam.sqf"'; It will however also run every time a player change graphics settings, alt-tab or do anything else that will trigger the loading screen.
You will have to script around it with if statements to get it to run only in the beginning of the mission.