startLoadingScreen: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (forgot Name2 !)
m (Text replacement - "with [https://community.bistudio.com/wiki/Arma_3:_Cheats#ENDLOAD ENDLOAD cheat code]" to "with the {{Link|Arma 3: Cheats#ENDLOAD|ENDLOAD cheat code}}")
 
(90 intermediate revisions by 13 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


| 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
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| '''startLoadingScreen''' [text] or [text,resource] |= Syntax
|game4= arma3
|version4= 0.50


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


|p2= |= PARAMETER2
|descr= 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]]).


|p3= |= PARAMETER3
{{Feature|informative|2=
By default, [[startLoadingScreen]] will use "RscDisplayNotFreeze" resource.<br>
A custom resource can be defined in [[Description.ext]], and a full black background will be used by default - the following controls are supported by the engine:
* idc = 101 - text (type = 0) or picture (type = 48). The text will be set to the value provided by the command argument.
* idc = 103 - progress (type = 8) or animated texture (type = 45). This control indicates global hardcoded mission loading progress and is useless after the mission is loaded.
* idc = 104 - progress (type = 8). This control's progress is initially set to 0 and can be manipulated with [[progressLoadingScreen]] command.


| Nothing |= RETURNVALUE
Resource can be defined in [[Description.ext]]; it must NOT be defined as {{hl|RscTitles}}!
 
<spoiler text="See config example">
 
<syntaxhighlight lang="cpp">
|x1= <code>startLoadingScreen ["Loading My Mission, please wait..."];</code>|= EXAMPLE1
// basic defines - pre "import" keyword in v2.02
 
____________________________________________________________________________________________
 
| [[endLoadingScreen]], [[progressLoadingScreen]] |= SEEALSO
 
|  |= MPBEHAVIOUR
____________________________________________________________________________________________
}}
 
<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
 
<dd class="notedate">Posted on July 15, 2009 - 01:47 (CEST)</dd>
<dt class="note">'''[[User:Lou Montana|Lou Montana]]'''</dt>
<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>
 
<dd class="notedate">Posted on January 18, 2010 - 08:07 (CEST)</dd>
<dt class="note">'''[[User:Lou Montana|Lou Montana]]'''</dt>
<dd class="note">resource has to be defined in description.ext. here is an example :
<code>
// '''basic defines'''
//
class RscText
class RscText
{
{
Line 53: Line 37:
h = 0.037;
h = 0.037;
w = 0.3;
w = 0.3;
style = 0x100;  
style = 0x100;
font = Zeppelin32;
font = Zeppelin32;
SizeEx = 0.03921;
SizeEx = 0.03921;
colorText[] = {1,1,1,1};
colorText[] = { 1, 1, 1, 1 };
colorBackground[] = {0, 0, 0, 0};
colorBackground[] = { 0, 0, 0, 0 };
linespacing = 1;
linespacing = 1;
};
};
class RscPicture
class RscPicture
{
{
access=0;
access = 0;
type=0;
type = 0;
idc=-1;
idc = -1;
style=48;
style = 48;
colorBackground[]={0,0,0,0};
colorBackground[] = { 0, 0, 0, 0 };
colorText[]={1,1,1,1};
colorText[] = { 1, 1, 1, 1 };
font="TahomaB";
font = "TahomaB";
sizeEx=0;
sizeEx = 0;
lineSpacing=0;
lineSpacing = 0;
text="";
text = "";
};
};
class RscLoadingText : RscText
class RscLoadingText : RscText
{
{
Line 81: Line 67:
h = 0.039216;
h = 0.039216;
sizeEx = 0.03921;
sizeEx = 0.03921;
colorText[] = {0.543,0.5742,0.4102,1.0};
colorText[] = { 0.543, 0.5742, 0.4102, 1.0 };
};
};
class RscProgress
class RscProgress
{
{
Line 90: Line 77:
h = 0.0261438;
h = 0.0261438;
texture = "\ca\ui\data\loadscreen_progressbar_ca.paa";
texture = "\ca\ui\data\loadscreen_progressbar_ca.paa";
colorFrame[] = {0,0,0,0};
colorFrame[] = { 0, 0, 0, 0 };
colorBar[] = {1,1,1,1};
colorBar[] = { 1, 1, 1, 1 };
};
};
class RscProgressNotFreeze
class RscProgressNotFreeze
{
{
Line 104: Line 92:
texture = "#(argb,8,8,3)color(0,0,0,0)";
texture = "#(argb,8,8,3)color(0,0,0,0)";
};
};
//
 
// '''the loading screen itself'''
// end of basic defines
//
 
class Harrier_loadingScreen
class WIKI_loadingScreen
{  
{  
idd = -1;
idd = -1;
Line 116: Line 104:
class controlsBackground
class controlsBackground
{
{
class blackBG : RscText
class blueBackground : RscText // covers the black screen
{
{
x = safezoneX;
x = safezoneXAbs;
y = safezoneY;
y = safezoneY;
w = safezoneW;
w = safezoneWAbs;
h = safezoneH;
h = safezoneH;
text = "";
text = "";
colorText[] = {0,0,0,0};
colorText[] = { 0, 0, 0, 0 };
colorBackground[] = {0,0,0,1};
colorBackground[] = { 0, 0, 1, 1 };
};
};
class nicePic : RscPicture
class nicePic : RscPicture
{
{
style = 48 + 0x800; // '''ST_PICTURE + ST_KEEP_ASPECT_RATIO'''
style = 48 + 0x800; // ST_PICTURE + ST_KEEP_ASPECT_RATIO
x = safezoneX + safezoneW/2 - 0.25;
x = safezoneX + safezoneW/2 - 0.25;
y = safezoneY + safezoneH/2 - 0.2;
y = safezoneY + safezoneH/2 - 0.2;
Line 136: Line 125:
};
};
};
};
class controls
class controls
{
{
class Title1 : RscLoadingText
class Title1 : RscLoadingText
{
{
text = "$STR_LOADING"; // '''"Loading" text in the middle of the screen'''
text = "$STR_LOADING"; // "Loading" text in the middle of the screen
};
};
class CA_Progress : RscProgress // '''progress bar, has to have idc 104'''
 
class CA_Progress : RscProgress // progress bar, has to have idc 104
{
{
idc = 104;
idc = 104;
type = 8; // '''CT_PROGRESS'''
type = 8; // CT_PROGRESS
style = 0; // '''ST_SINGLE'''
style = 0; // ST_SINGLE
texture = "\ca\ui\data\loadscreen_progressbar_ca.paa";
texture = "\ca\ui\data\loadscreen_progressbar_ca.paa";
};
};
class CA_Progress2 : RscProgressNotFreeze // '''progress bar that will go reverse'''
 
class CA_Progress2 : RscProgressNotFreeze // progress bar that will go reverse
{
{
idc = 103;
idc = 103;
};
};
class Name2: RscText // '''the text on the top-left'''
 
class Name2 : RscText // the text on the top-left
{
{
idc = 101;
idc = 101;
Line 162: Line 155:
text = "";
text = "";
sizeEx = 0.05;
sizeEx = 0.05;
colorText[] = {0.543,0.5742,0.4102,1.0};
colorText[] = { 0.543, 0.5742, 0.4102, 1.0 };
};
};
};
};
};
};
</code>
</syntaxhighlight>
</dd>
</spoiler>
}}
 
{{Feature|warning|
* The loading screen does '''not''' end by itself and absolutely needs a call to [[endLoadingScreen]] command
* Game simulation is disabled during Loading Screen operation (at least in single player):
** do '''not''' use the [[sleep]] command between [[startLoadingScreen]] and [[endLoadingScreen]] as '''it may freeze the game''' - use [[uiSleep]] instead
** [[waitUntil]] ''can'' be used to wait for variable initialisation or script loading
}}
{{Feature|arma3|
* Use [[BIS_fnc_startLoadingScreen]] to prevent potential usage conflicts.
* The loading screen can be force-ended with the {{Link|Arma 3: Cheats#ENDLOAD|ENDLOAD cheat code}}.
}}


<!-- Note Section END -->
|s1= [[startLoadingScreen]] [text, resource]
</dl>


<h3 style='display:none'>Bottom Section</h3>
|p1= text: [[String]]
[[Category:ArmA 2: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
|p2= resource: [[String]] - (Optional)
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
 
|r1= [[Nothing]]
 
|x1= <sqf>startLoadingScreen ["Loading My Mission, please wait..."];</sqf>
 
|x2= <sqf>startLoadingScreen ["Can't skip loading time...", "MyLoadingRsc"];</sqf>
 
|x3= <sqf>
startLoadingScreen ["Loading My Mission"];
// code
progressLoadingScreen 0.5;
// code
endLoadingScreen;
</sqf>
 
|x4= <sqf>
// this structure prevents error-prone or lengthy code to miss endLoadingScreen.
private _maxTime = diag_tickTime + 30; // max 30s of loading
 
startLoadingScreen ["Loading"];
private _handle = 0 spawn {
// code that may crash or take too long
};
 
waitUntil { uiSleep .1; scriptDone _handle || diag_tickTime > _maxTime };
endLoadingScreen;
</sqf>
 
|seealso= [[endLoadingScreen]] [[progressLoadingScreen]] [[BIS_fnc_startLoadingScreen]] [[import (Config)]]
}}
 
{{Note
|user= Killzone_Kid
|timestamp= 20151121183800
|text= The default {{arma3}} loading screen has no control to display text.
}}

Latest revision as of 09:44, 6 September 2024

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).
By default, startLoadingScreen will use "RscDisplayNotFreeze" resource.

A custom resource can be defined in Description.ext, and a full black background will be used by default - the following controls are supported by the engine:

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

Resource can be defined in Description.ext; it must NOT be defined as RscTitles!

// basic defines - pre "import" keyword in v2.02
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)";
};

// end of basic defines

class WIKI_loadingScreen
{ 
	idd = -1;
	duration = 10e10;
	fadein = 0;
	fadeout = 0;
	name = "loading screen";
	class controlsBackground
	{
		class blueBackground : RscText // covers the black screen
		{
			x = safezoneXAbs;
			y = safezoneY;
			w = safezoneWAbs;
			h = safezoneH;
			text = "";
			colorText[] = { 0, 0, 0, 0 };
			colorBackground[] = { 0, 0, 1, 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
  • The loading screen does not end by itself and absolutely needs a call to endLoadingScreen command
  • Game simulation is disabled during Loading Screen operation (at least in single player):
Arma 3
Groups:
System

Syntax

Syntax:
startLoadingScreen [text, resource]
Parameters:
text: String
resource: String - (Optional)
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"]; // code progressLoadingScreen 0.5; // code endLoadingScreen;
Example 4:
// this structure prevents error-prone or lengthy code to miss endLoadingScreen. private _maxTime = diag_tickTime + 30; // max 30s of loading startLoadingScreen ["Loading"]; private _handle = 0 spawn { // code that may crash or take too long }; waitUntil { uiSleep .1; scriptDone _handle || diag_tickTime > _maxTime }; endLoadingScreen;

Additional Information

See also:
endLoadingScreen progressLoadingScreen BIS_fnc_startLoadingScreen import (Config)

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
Killzone_Kid - c
Posted on Nov 21, 2015 - 18:38 (UTC)
The default Arma 3 loading screen has no control to display text.