onPreloadFinished: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_{10,} " to "")
m (Text replacement - "Since {{arma3}} v1.57 a stackable version of this EH is available:" to "Since {{arma3}} v1.58 a stackable version of this EH is available:")
 
(35 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command


| arma2 |Game name=
|game1= arma2
|version1= 1.00


|1.00|Game version=
|game2= arma2oa
|version2= 1.50


|gr1= Event Handlers |GROUP1=
|game3= tkoh
|version3= 1.00


| Defines an action performed after the preload screen finished. Preload event occurs after briefing screen on mission start.<br><br>
|game4= arma3
{{Important | This event handler also fires on client after user closes the main map. }}<br>
|version4= 0.50
{{Informative|Since '''Arma 3''' ''v1.57'' a stackable version of this EH is available: [[Arma_3:_Event_Handlers/addMissionEventHandler#PreloadFinished|PreloadFinished]]}}<br>
{{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.}}
|DESCRIPTION=


| '''onPreloadFinished''' command |SYNTAX=
|gr1= Event Handlers


|p1= command: [[String]] or [[Code]] |PARAMETER1=
|descr= 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. }}
{{Feature|arma3|
* Since {{arma3}} v1.58 a stackable version of this EH is available: [[Arma 3: Mission Event Handlers#PreloadFinished|PreloadFinished]]
* Before that, the [[BIS_fnc_addStackedEventHandler]] and [[BIS_fnc_removeStackedEventHandler]] functions should be used instead.}}


|p2= |PARAMETER2=  
|s1= [[onPreloadFinished]] command


|p3= |PARAMETER3=  
|p1= command: [[String]] or [[Code]]


| [[Nothing]] |RETURNVALUE=
|r1= [[Nothing]]


|x1= <sqf>onPreloadFinished {TAG_ReceivingScreenDone = true};</sqf>


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


 
|seealso= [[onPreloadStarted]]
| [[onPreloadStarted]] |SEEALSO=
 
|  |MPBEHAVIOUR=
}}
}}


<h3 style='display:none'>Notes</h3>
<dl class="command_description">
<dl class='command_description'>
<!-- Note Section BEGIN -->


<dd class="notedate">Posted on July 24, 2009
<dt><dt>
<dt class="note">[[User:Tophe|Tophe]]
<dd class="notedate">Posted on 2009-07-24</dd>
<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>
<dt class="note">[[User:Tophe|Tophe]]</dt>
If this code is put in the Init.sqf it will run the startcam.sqf script when the loading screen has disappeared <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>
<pre>onPreloadFinished '[fire1] execVM "scripts\startcam.sqf"';</pre>
If this code is put in the Init.sqf it will run the startcam.sqf script when the loading screen has disappeared
<sqf>onPreloadFinished '[fire1] execVM "scripts\startcam.sqf"';</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.<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.
<!-- Note Section END -->
</dd>
 
</dl>
</dl>
<h3 style='display:none'>Bottom Section</h3>
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 19:15, 15 September 2024

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 2009-07-24
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.