Jump to content
Coladebote

Problem with an intro

Recommended Posts

Hello guys:
I have prepared a very simple intro for the missions. It is a black background where several texts appear every 10 seconds. It lasts one minute, which is accompanied by a musical tune.

When I test it in the editor, in MP mode, it works perfectly. The problem arises when I upload it to the server. A lag occurs because the intro starts rolling before the initial mission loading screen ends. I have tried to solve it with a longer delay (sleep 20), but it does not seem to me to be a very accurate system. Can somebody help me?

Thank you.

  • Like 1

Share this post


Link to post
Share on other sites

Could you post the code? that usually makes it easier to spot any potential issues etc.
Cheers.

Share this post


Link to post
Share on other sites
//INTRO//

titleCut ["", "BLACK FADED", 9];
	[] Spawn {
	waitUntil{!(isNil "BIS_fnc_init")};
	sleep 15;
	playsound "intro";
	
	titleText ["","PLAIN DOWN"]; 
	titleFadeOut 6;
	sleep 0;

[
	format ["<img shadow='0.8' size='8' image='%1' />", "pics\image.jpg"],
	safeZoneX+0.71, safeZoneY+safeZoneH-1.6, 4, 4, 0, 889
] spawn bis_fnc_dynamicText;
	
	sleep 10;
	
[
	"<t  size = '0.8'>TEXT</t>",
	safeZoneX+0.71, safeZoneY+safeZoneH-1, 4, 4, 0, 890
] spawn bis_fnc_dynamicText;

	sleep 10;
	
[
	"<t  size = '0.8'>TEXT</t>",
	safeZoneX+0.71, safeZoneY+safeZoneH-1, 4, 4, 0, 890
] spawn bis_fnc_dynamicText;
	
	sleep 10;
	
	[
	"<t  size = '0.8'>TEXT</t>",
	safeZoneX+0.71, safeZoneY+safeZoneH-1, 4, 4, 0, 890
] spawn bis_fnc_dynamicText;
	
	sleep 10;
	
[
	"<t  size = '1.2'>TEXT</t>",
	safeZoneX+0.71, safeZoneY+safeZoneH-1, 4, 4, 0, 890
] spawn bis_fnc_dynamicText;	

	sleep 10;
	
[
	"<t  size = '0.8'>TEXT</t>",
	safeZoneX+0.71, safeZoneY+safeZoneH-1, 4, 4, 0, 890
] spawn bis_fnc_dynamicText;	

	sleep 10;
	"dynamicBlur" ppEffectEnable true;   
	"dynamicBlur" ppEffectAdjust [6];   
	"dynamicBlur" ppEffectCommit 0;     
	"dynamicBlur" ppEffectAdjust [0.0];  
	"dynamicBlur" ppEffectCommit 5;  
	
	titleCut ["", "BLACK IN", 10];
};



//DESCRIPTION//

class Header
{
gameType = COOP;       
minplayers=1;
maxplayers=20;       
};

respawn = "3";
respawnDelay = 10;
respawnDialog = true; 
showCompass=1;
showRadio=1;
showGPS=1;
showMap=1;
showBinocular=1;
showNotepad=1;
showWatch=1;

author = "TEXT";
onLoadName = "TEXT";
onLoadMission = "TEXT";
loadScreen = "pics\image.jpg";

class CfgSounds
 {

 class intro
 {
 name = "intro";
 sound[] = {\sounds\intro.ogg, 2.0, 1.0};
 titles[] = {0, ""};
   };
 };

This is the code for the Intro and the description.

Share this post


Link to post
Share on other sites

Quick thing, before diving into description.ext, have you tried enabling
-autoInit
and
persistent=1
in the servers startup parameters? this will allow the server to load the mission before players begin to join.

Share this post


Link to post
Share on other sites

I don't know how much stuff is loading in the mission or server that lags it during mission startup, but by enabling autoinit, the mission, mods, and whatever else can load when the server starts, then by the time you join, everything is already loaded (except ofc mission scripts that run on the player or with players as a condition) which would theoretically stop it from lagging when you then join.
Ofc

What do you have running? other then your description.ext?

Share this post


Link to post
Share on other sites

A few addons. But I think that is not relevant, because, what it is about is not to start the intro on each player until the loading process has been completed.

Share this post


Link to post
Share on other sites

Something like...

Spoiler



//initPlayerLocal.sqf

//Wait for briefing to finish ( Continue has been pressed )
waitUntil{ getClientStateNumber >= 10 /*"BRIEFING READ"*/ };

//A test loading screen lasting 20 seconds
//[] spawn {
//	[ "MyLoadingScreen" ] call BIS_fnc_startLoadingScreen;
//	uiSleep 20;
//	[ "MyLoadingScreen" ] call BIS_fnc_endLoadingScreen;
//};

//Wait unitl the mission display is initialised
waitUntil{ !isNull findDisplay 46 };

//Blackout screen
titleCut[ "", "BLACK FADED", 100 ];

//Wait for all loading screens to finish( this include BIs mission load as well )
waitUntil{ missionNamespace getVariable[ "BIS_fnc_startLoadingScreen_ids", [] ] isEqualTo [] };

//Do intro stuff

//playSound "intro";

{
	_x params[ "_txt", [ "_height", 1 ], [ "_layer", 890 ] ];

	[ _txt, safeZoneX+0.71, safeZoneY+safeZoneH-_height, 4, 4, 0, _layer ] spawn BIS_fnc_dynamicText;
	sleep 10;
}forEach[
	//[ format[ "<img shadow='0.8' size='8' image='%1' />", "pics\image.jpg" ], 1.6 ],
	[ "<t  size = '0.8'>TEXT1</t>" ],
	[ "<t  size = '0.8'>TEXT2</t>" ],
	[ "<t  size = '0.8'>TEXT3</t>" ],
	[ "<t  size = '1.2'>TEXT4</t>" ],
	[ "<t  size = '0.8'>TEXT5</t>" ]

];

"dynamicBlur" ppEffectEnable true;
"dynamicBlur" ppEffectAdjust[ 6 ];
"dynamicBlur" ppEffectCommit 0;
"dynamicBlur" ppEffectAdjust[ 0.0 ];
"dynamicBlur" ppEffectCommit 5;

//Intro finished, remove blackout
titleCut[ "", "BLACK IN", 10 ];

Uncomment lines with resources I do not have( intro sound and dynamic text image )

Untested, but done similar thing before.

  • Like 3

Share this post


Link to post
Share on other sites

Ok, tonight, after work, I'll give it a try. I keep you informed. Thank you.

Share this post


Link to post
Share on other sites

Did you put respawn on custom position under respawns? If you didnt the intro won't work

(Update, my unit places the intro under OnPlayerRespawn.sqf so maybe try that as well)

Share this post


Link to post
Share on other sites

With this code, the intro starts before the loading screen ends, even in the editor, which was not the case before. The first time I tried it, the music did not play. I have replaced this (// playSound "intro";) with this other (playSound "intro";) so that the music will be heard. I have not continued doing the tests on the server, seeing that it did not work locally. I am doing something wrong? I apologize, but you already know that I am of letters.

 

//Wait for briefing to finish ( Continue has been pressed )
waitUntil{ getClientStateNumber >= 10 /*"BRIEFING READ"*/ };

//A test loading screen lasting 20 seconds
//[] spawn {
//	[ "MyLoadingScreen" ] call BIS_fnc_startLoadingScreen;
//	uiSleep 20;
//	[ "MyLoadingScreen" ] call BIS_fnc_endLoadingScreen;
//};

//Wait unitl the mission display is initialised
waitUntil{ !isNull findDisplay 46 };

//Blackout screen
titleCut[ "", "BLACK FADED", 100 ];

//Wait for all loading screens to finish( this include BIs mission load as well )
waitUntil{ missionNamespace getVariable[ "BIS_fnc_startLoadingScreen_ids", [] ] isEqualTo [] };

//Do intro stuff

playSound "intro";

{
	_x params[ "_txt", [ "_height", 1 ], [ "_layer", 890 ] ];

	[ _txt, safeZoneX+0.71, safeZoneY+safeZoneH-_height, 4, 4, 0, _layer ] spawn BIS_fnc_dynamicText;
	sleep 10;
}forEach[
	//[ format[ "<img shadow='0.8' size='8' image='%1' />", "pics\image.jpg" ], 1.6 ],
	[ "<t  size = '0.8'>RESENTA:</t>" ],
	[ "<t  size = '0.8'>PARA LA COMUNIDAD HISPANA DE ARMA III</t>" ],
	[ "<t  size = '0.8'>EPISODIOS DE GUERRA VIRTUAL</t>" ],
	[ "<t  size = '1.2'>OPERATION KILLER WILDERNESS</t>" ],
	[ "<t  size = '0.8'>EDITADA POR LOBITO</t>" ]

];

"dynamicBlur" ppEffectEnable true;
"dynamicBlur" ppEffectAdjust[ 6 ];
"dynamicBlur" ppEffectCommit 0;
"dynamicBlur" ppEffectAdjust[ 0.0 ];
"dynamicBlur" ppEffectCommit 5;

//Intro finished, remove blackout
titleCut[ "", "BLACK IN", 10 ];

 

Share this post


Link to post
Share on other sites
//Wait unitl the mission display is initialised
waitUntil{ !isNull findDisplay 46 };

//Blackout screen
titleCut[ "", "BLACK FADED", 100 ];

//Wait for all loading screens to finish( this include BIs mission load as well )
waitUntil{ missionNamespace getVariable[ "BIS_fnc_startLoadingScreen_ids", [] ] isEqualTo [] };

//Do intro stuff

playSound "intro";

{
    _x params[ "_txt", [ "_height", 1 ], [ "_layer", 890 ] ];

    [ _txt, safeZoneX+0.71, safeZoneY+safeZoneH-_height, 4, 4, 0, _layer ] spawn BIS_fnc_dynamicText;
    sleep 10;
}forEach[
    [ format[ "<img shadow='0.8' size='8' image='%1' />", "pics\firma.jpg" ], 1.6 ],
    [ "<t  size = '0.8'>TEXT:</t>" ],
    [ "<t  size = '0.8'>TEXT</t>" ],
    [ "<t  size = '0.8'>TEXT</t>" ],
    [ "<t  size = '1.2'>TEXT</t>" ],
    [ "<t  size = '0.8'>TEXT</t>" ]

];

"dynamicBlur" ppEffectEnable true;
"dynamicBlur" ppEffectAdjust[ 6 ];
"dynamicBlur" ppEffectCommit 0;
"dynamicBlur" ppEffectAdjust[ 0.0 ];
"dynamicBlur" ppEffectCommit 5;

//Intro finished, remove blackout
titleCut[ "", "BLACK IN", 10 ];

Guys, with this intro in the editor it works perfectly, but the problem persists on the server. the intro starts before the loading screen ends, so the first item of the intro is not visible. Any ideas?

Share this post


Link to post
Share on other sites
4 minutes ago, Coladebote said:

the problem persists on the server. the intro starts before the loading screen ends

Do you know what the loading screen is from? Are you sure its the default loading screen and not one started by a script/mod? So doesn't use BIS_fnc_startLoadingScreen and so doesn't use ids to store a reference to it.

Share this post


Link to post
Share on other sites

Larrow, the idea is that on the server, when the initial screen is passed, where a small photo appears with the title of the mission and the name of the author, the mission starts with the intro. In the editor it works fine, but on the server, the intro starts while the small photo is still on the screen. I don't know if that way I am better understood.

 

It may be related to this topic: onPreloadFinished {TAG_ReceivingScreenDone = true};

 

Thank you.

Share this post


Link to post
Share on other sites
//A test loading screen lasting 20 seconds
[] spawn {
[ "MyLoadingScreen" ] call BIS_fnc_startLoadingScreen;
uiSleep 20;
[ "MyLoadingScreen" ] call BIS_fnc_endLoadingScreen;
};

//Wait for briefing to finish ( Continue has been pressed )
waitUntil{ getClientStateNumber >= 10 /*"BRIEFING READ"*/ };

//Wait unitl the mission display is initialised
waitUntil{ !isNull findDisplay 46 };

//Blackout screen
titleCut[ "", "BLACK FADED", 100 ];

//Wait for all loading screens to finish( this include BIs mission load as well )
waitUntil{ missionNamespace getVariable[ "BIS_fnc_startLoadingScreen_ids", [] ] isEqualTo [] };

//Do intro stuff
sleep 16;
playSound "intro";

{
	_x params[ "_txt", [ "_height", 1 ], [ "_layer", 890 ] ];

	[ _txt, safeZoneX+0.71, safeZoneY+safeZoneH-_height, 4, 4, 0, _layer ] spawn BIS_fnc_dynamicText;
	sleep 10;
}forEach[
	[ format[ "<img shadow='0.8' size='8' image='%1' />", "pics\firma.jpg" ], 1.6 ],
	[ "<t  size = '0.8'>TEXT</t>" ],
	[ "<t  size = '0.8'>TEXT</t>" ],
	[ "<t  size = '0.8'>TEXT</t>" ],
	[ "<t  size = '1.2'>TEXT</t>" ],
	[ "<t  size = '0.8'>TEXT</t>" ]

];

"dynamicBlur" ppEffectEnable true;
"dynamicBlur" ppEffectAdjust[ 6 ];
"dynamicBlur" ppEffectCommit 0;
"dynamicBlur" ppEffectAdjust[ 0.0 ];
"dynamicBlur" ppEffectCommit 5;

//Intro finished, remove blackout
titleCut[ "", "BLACK IN", 10 ];

Hi guys, with this code it works perfectly both in the editor and on the dedicated server.
This is the change I have made:
// Do intro stuff
sleep 16;
playSound "intro";

by changing the value of "sleep 16" i can make finer adjustments. It may not be the most orthodox solution, but it works, which is what it is all about.
Thanks everyone for your help.

  • Like 1

Share this post


Link to post
Share on other sites

Which file are you running it from?
I cannot recommend running it from OnPlayerRespawn.sqf as it will play the intro every time people respawn.

Share this post


Link to post
Share on other sites
3 hours ago, razzored said:

Which file are you running it from?
I cannot recommend running it from OnPlayerRespawn.sqf as it will play the intro every time people respawn.

initPlayerLocal.sqf

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×