startLoadingScreen: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(populated)
m (Text replacement - "Category:Scripting Commands ArmA2" to "Category:Scripting Commands Arma 2")
(33 intermediate revisions by 13 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{Command|Comments=
____________________________________________________________________________________________
____________________________________________________________________________________________


| arma2 |= Game name
| arma2 |Game name=


|1.00|= Game version
|1.00|Game version=
____________________________________________________________________________________________
____________________________________________________________________________________________


| Shows loading screen with the given text,using the given resource.,When loading screen is shown,simulation and scene drawing is disabled, scripts run at full speed. |= Description
| Shows loading screen with the given text, using the given resource. While loading screen is shown, simulation and scene drawing is disabled, user control is disabled, mouse cursor is hidden, scripts run at full speed (50ms per frame instead of 3ms per frame for [[Scheduler|Scheduled Scripts]]). The loading screen does not end by itself and needs [[endLoadingScreen]] command, so make sure there is one at the end of loading operation.
{{warning | NOTE: The game simulation is disabled during Loading Screen operation (at least in SP), therefore any use of [[sleep]] command will pause the game indefinitely. If you have to "sleep", use [[uiSleep]]}}
 
By default (if custom resource is not provided) [[startLoadingScreen]] will use "RscDisplayNotFreeze" resource. If you are using custom resource (could be also defined in [[description.ext]]), the following resource's controls are supported by the engine:
* idc <nowiki>=</nowiki> 101; - text (type <nowiki>=</nowiki> 0;) or picture (type <nowiki>=</nowiki> 48;). The text will be set to the text provided by the command param.
* idc <nowiki>=</nowiki> 103; - progress (type <nowiki>=</nowiki> 8;) or animated texture (type <nowiki>=</nowiki> 45;). This control indicates global hardcoded mission loading progress and is useless after mission is loaded.
* idc <nowiki>=</nowiki> 104; - progress (type <nowiki>=</nowiki> 8;). This control's progress is initially set to 0 and can be manipulated with [[progressLoadingScreen]] command. |DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| '''startLoadingScreen''' [text] or [text,resource] |= Syntax
| '''startLoadingScreen''' [text, resource] |SYNTAX=


|p1= [text] or [text,resource]: Array -  |= PARAMETER1
|p1= [text, resource]: [[Array]] -  |PARAMETER1=  


|p2= |= PARAMETER2
|p2= text: [[String]] |PARAMETER2=  


|p3= |= PARAMETER3
|p3= resource (Optional): [[String]]  |PARAMETER3=


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




|x1= <code>(example)</code>|= EXAMPLE1
|x1= <code>[[startLoadingScreen]] ["Loading My Mission, please wait..."];</code>|EXAMPLE1=
|x2= <code>[[startLoadingScreen]] ["Can't skip loading time...", "MyLoadingRsc"];</code>|EXAMPLE2=
|x3= <code>[[startLoadingScreen]] ["Loading My Mission"];
//Batch of code
//Batch of code
//Batch of code
[[progressLoadingScreen]] 0.5;
//Batch of code
//Batch of code
//Batch of code
[[endLoadingScreen]];</code>|EXAMPLE3=


____________________________________________________________________________________________
____________________________________________________________________________________________


| |= SEEALSO
| [[endLoadingScreen]], [[progressLoadingScreen]] |SEEALSO=  


|  |= MPBEHAVIOUR
|  |MPBEHAVIOUR=  
____________________________________________________________________________________________
____________________________________________________________________________________________
}}
}}
Line 34: Line 50:
<dl class='command_description'>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on July 15, 2009 - 01:47 (CEST)
<dt class="note">'''[[User:Lou Montana|Lou Montana]]'''
<dd class="note">As it stops simulation as well as scene drawing, be sure not to put any [[sleep]] (or [[waitUntil]] if you are checking for in-game changes ; waitUntil for var initialization or script loading is ok) command between '''startLoadingScreen''' and [[endLoadingScreen]].
<dd class="notedate">Posted on January 18, 2010 - 08:07 (CEST)
<dt class="note">'''[[User:Lou Montana|Lou Montana]]'''
<dd class="note">edit 10:15 : Whatever transparence you define in your own resource, there will be a black screen to cache loading.<br />
It's up to you to choose a nice blue background :-)<br />
<br />
Resource has to be defined in description.ext ; it must NOT be defined as RscTitles ! Here is an example :
<spoiler>
<code>
// '''basic defines'''
//
class RscText
{
type = 0;
idc = -1;
x = 0;
y = 0;
h = 0.037;
w = 0.3;
style = 0x100;
font = Zeppelin32;
SizeEx = 0.03921;
colorText[] = {1,1,1,1};
colorBackground[] = {0, 0, 0, 0};
linespacing = 1;
};
class RscPicture
{
access=0;
type=0;
idc=-1;
style=48;
colorBackground[]={0,0,0,0};
colorText[]={1,1,1,1};
font="TahomaB";
sizeEx=0;
lineSpacing=0;
text="";
};
class RscLoadingText : RscText
{
style = 2;
x = 0.323532;
y = 0.666672;
w = 0.352944;
h = 0.039216;
sizeEx = 0.03921;
colorText[] = {0.543,0.5742,0.4102,1.0};
};
class RscProgress
{
x = 0.344;
y = 0.619;
w = 0.313726;
h = 0.0261438;
texture = "\ca\ui\data\loadscreen_progressbar_ca.paa";
colorFrame[] = {0,0,0,0};
colorBar[] = {1,1,1,1};
};
class RscProgressNotFreeze
{
idc = -1;
type = 45;
style = 0;
x = 0.022059;
y = 0.911772;
w = 0.029412;
h = 0.039216;
texture = "#(argb,8,8,3)color(0,0,0,0)";
};
//
// '''the loading screen itself'''
//
class Harrier_loadingScreen
{
idd = -1;
duration = 10e10;
fadein = 0;
fadeout = 0;
name = "loading screen";
class controlsBackground
{
class blackBG : RscText
{
x = safezoneX;
y = safezoneY;
w = safezoneW;
h = safezoneH;
text = "";
colorText[] = {0,0,0,0};
colorBackground[] = {0,0,0,1};
};
class nicePic : RscPicture
{
style = 48 + 0x800; // '''ST_PICTURE + ST_KEEP_ASPECT_RATIO'''
x = safezoneX + safezoneW/2 - 0.25;
y = safezoneY + safezoneH/2 - 0.2;
w = 0.5;
h = 0.4;
text = "img\nicePic.paa";
};
};
class controls
{
class Title1 : RscLoadingText
{
text = "$STR_LOADING"; // '''"Loading" text in the middle of the screen'''
};
class CA_Progress : RscProgress // '''progress bar, has to have idc 104'''
{
idc = 104;
type = 8; // '''CT_PROGRESS'''
style = 0; // '''ST_SINGLE'''
texture = "\ca\ui\data\loadscreen_progressbar_ca.paa";
};
class CA_Progress2 : RscProgressNotFreeze // '''progress bar that will go reverse'''
{
idc = 103;
};
class Name2: RscText // '''the text on the top-left'''
{
idc = 101;
x = 0.05;
y = 0.029412;
w = 0.9;
h = 0.04902;
text = "";
sizeEx = 0.05;
colorText[] = {0.543,0.5742,0.4102,1.0};
};
};
};
</code>
</spoiler>


<!-- Note Section END -->
<!-- Note Section END -->
Line 39: Line 194:


<h3 style='display:none'>Bottom Section</h3>
<h3 style='display:none'>Bottom Section</h3>
[[Category:ArmA 2: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on February 19, 2015 - 12:31 (UTC)</dd>
<dt class="note">[[User:Bull A|Bull A]]</dt>
<dd class="note">
Based on what Lou Montana has previously said, the simulation does become disabled upon using this command. If you wish to use a delay 'sleep' will not work. The work around would be to use 'uiSleep'
</dd>
</dl>
<!-- DISCONTINUE Notes -->
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on November 21, 2015 - 18:38 (UTC)</dd>
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
<dd class="note">
In Arma 3 default loading screen has no control do display text. The description of the command now contains information what is needed to create custom loading screen resource.
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Revision as of 17:04, 10 January 2020

Hover & click on the images for description

Description

Description:
Shows loading screen with the given text, using the given resource. While loading screen is shown, simulation and scene drawing is disabled, user control is disabled, mouse cursor is hidden, scripts run at full speed (50ms per frame instead of 3ms per frame for Scheduled Scripts). The loading screen does not end by itself and needs endLoadingScreen command, so make sure there is one at the end of loading operation.
NOTE: The game simulation is disabled during Loading Screen operation (at least in SP), therefore any use of sleep command will pause the game indefinitely. If you have to "sleep", use uiSleep

By default (if custom resource is not provided) startLoadingScreen will use "RscDisplayNotFreeze" resource. If you are using custom resource (could be also defined in description.ext), the following resource's controls are supported by the engine:

  • idc = 101; - text (type = 0;) or picture (type = 48;). The text will be set to the text provided by the command param.
  • idc = 103; - progress (type = 8;) or animated texture (type = 45;). This control indicates global hardcoded mission loading progress and is useless after mission is loaded.
  • idc = 104; - progress (type = 8;). This control's progress is initially set to 0 and can be manipulated with progressLoadingScreen command.
Groups:
Uncategorised

Syntax

Syntax:
startLoadingScreen [text, resource]
Parameters:
[text, resource]: Array -
text: String
resource (Optional): String
Return Value:
Nothing

Examples

Example 1:
startLoadingScreen ["Loading My Mission, please wait..."];
Example 2:
startLoadingScreen ["Can't skip loading time...", "MyLoadingRsc"];
Example 3:
startLoadingScreen ["Loading My Mission"]; //Batch of code //Batch of code //Batch of code progressLoadingScreen 0.5; //Batch of code //Batch of code //Batch of code endLoadingScreen;

Additional Information

See also:
endLoadingScreenprogressLoadingScreen

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 July 15, 2009 - 01:47 (CEST)
Lou Montana
As it stops simulation as well as scene drawing, be sure not to put any sleep (or waitUntil if you are checking for in-game changes ; waitUntil for var initialization or script loading is ok) command between startLoadingScreen and endLoadingScreen.
Posted on January 18, 2010 - 08:07 (CEST)
Lou Montana
edit 10:15 : Whatever transparence you define in your own resource, there will be a black screen to cache loading.
It's up to you to choose a nice blue background :-)

Resource has to be defined in description.ext ; it must NOT be defined as RscTitles ! Here is an example :

// basic defines // class RscText { type = 0; idc = -1; x = 0; y = 0; h = 0.037; w = 0.3; style = 0x100; font = Zeppelin32; SizeEx = 0.03921; colorText[] = {1,1,1,1}; colorBackground[] = {0, 0, 0, 0}; linespacing = 1; }; class RscPicture { access=0; type=0; idc=-1; style=48; colorBackground[]={0,0,0,0}; colorText[]={1,1,1,1}; font="TahomaB"; sizeEx=0; lineSpacing=0; text=""; }; class RscLoadingText : RscText { style = 2; x = 0.323532; y = 0.666672; w = 0.352944; h = 0.039216; sizeEx = 0.03921; colorText[] = {0.543,0.5742,0.4102,1.0}; }; class RscProgress { x = 0.344; y = 0.619; w = 0.313726; h = 0.0261438; texture = "\ca\ui\data\loadscreen_progressbar_ca.paa"; colorFrame[] = {0,0,0,0}; colorBar[] = {1,1,1,1}; }; class RscProgressNotFreeze { idc = -1; type = 45; style = 0; x = 0.022059; y = 0.911772; w = 0.029412; h = 0.039216; texture = "#(argb,8,8,3)color(0,0,0,0)"; }; // // the loading screen itself // class Harrier_loadingScreen { idd = -1; duration = 10e10; fadein = 0; fadeout = 0; name = "loading screen"; class controlsBackground { class blackBG : RscText { x = safezoneX; y = safezoneY; w = safezoneW; h = safezoneH; text = ""; colorText[] = {0,0,0,0}; colorBackground[] = {0,0,0,1}; }; class nicePic : RscPicture { style = 48 + 0x800; // ST_PICTURE + ST_KEEP_ASPECT_RATIO x = safezoneX + safezoneW/2 - 0.25; y = safezoneY + safezoneH/2 - 0.2; w = 0.5; h = 0.4; text = "img\nicePic.paa"; }; }; class controls { class Title1 : RscLoadingText { text = "$STR_LOADING"; // "Loading" text in the middle of the screen }; class CA_Progress : RscProgress // progress bar, has to have idc 104 { idc = 104; type = 8; // CT_PROGRESS style = 0; // ST_SINGLE texture = "\ca\ui\data\loadscreen_progressbar_ca.paa"; }; class CA_Progress2 : RscProgressNotFreeze // progress bar that will go reverse { idc = 103; }; class Name2: RscText // the text on the top-left { idc = 101; x = 0.05; y = 0.029412; w = 0.9; h = 0.04902; text = ""; sizeEx = 0.05; colorText[] = {0.543,0.5742,0.4102,1.0}; }; }; };

↑ Back to spoiler's top

Bottom Section

Posted on February 19, 2015 - 12:31 (UTC)
Bull A
Based on what Lou Montana has previously said, the simulation does become disabled upon using this command. If you wish to use a delay 'sleep' will not work. The work around would be to use 'uiSleep'
Posted on November 21, 2015 - 18:38 (UTC)
Killzone Kid
In Arma 3 default loading screen has no control do display text. The description of the command now contains information what is needed to create custom loading screen resource.