Jump to content
Sign in to follow this  
Guest

Delay Briefing for 10 seconds?

Recommended Posts

Guest

Basically, when players enter the briefing screen, it freezes for about ten seconds. I think happens because of some scripts that are taking to long to load.

Anyways, the reason I want to delay the briefing screen is because when it freezes, it shows all the markers etc and ruins the mission as people already will know where everything is.

So is there a way to delay the briefing screen or maybe something similar that will sort out this problem?

Cheers:)

Share this post


Link to post
Share on other sites

You can use startLoadingScreen in the init file, then endLoadingScreen once all your init scripts have finished. These two commands need to be run for all players (if multiplayer) otherwise you may have people stuck with a black screen.

A simple example, if all your scripts are server side is to have a variable set once the mission is loaded:

missionReady = true;
publicVariable "missionReady";

Then on the client end of things:

waitUntil {missionReady};
endLoadingScreen;

Share this post


Link to post
Share on other sites
Guest

Thank you for the suggestion. Does the above fully work with JIP?

Share this post


Link to post
Share on other sites

It should, as long as the client code above gets triggered at some point by one of your init files.

Share this post


Link to post
Share on other sites
Guest

Is there an example mission or a webpage that has more info on how to use this? I'm a bit confused as to where everything goes if I'm honest.

Sorry for being a pain:o

Share this post


Link to post
Share on other sites

BIS' "Hike in the Hills" works as a decent example (in missions_e.pbo), the loading screen starts in init.sqf - and finishes at the end of initJIPcompatible.sqf.

Don't worry about all their mess inbetween. The idea was that you set missionReady to true once all your markers are hidden, then let the players into the briefing.

I have no idea what else is in your mission so I can only guess here. The simplest example, using only init.sqf:

startLoadingScreen ["Loading..."];

// Players will skip past this whole section ------
if (isServer) then {
   // whatever is happening with your markers
   // etc, plus any other stuff you need to do

   missionReady = true;
   publicVariable "missionReady";
}
// --------------

waitUntil {missionReady};
endLoadingScreen;

Share this post


Link to post
Share on other sites
Guest

Thank you for continuing to help.

This is what I have in init.sqf:

[color="Red"]startLoadingScreen ["Loading Scripts"];[/color]
//begin init.sqf
// JIP fix - why does ArmA execute init.sqf for JIP players, if 'player' is not sync'd yet
if ((!isServer) && (player != player)) then
{
 waitUntil {player == player};
};

if (isServer) then
{
//Init UPSMON script
call compile preprocessFileLineNumbers "scripts\Init_UPSMON.sqf";
};
[color="Red"]if (isServer) then {[/color]
[color="Lime"]execVM "hidemarkers.sqf";[/color]
//server execVM "revive_init.sqf";
n=[] execVM "default_c.sqf";
//null=[] execVM "noncachedunits.sqf";
//0 = [800] execVM "modules\CEP_Caching\main.sqf";
n=[] execVM "Markers.sqf";
execVM "intro.sqf";
[color="Red"]progressLoadingScreen 0.5;[/color]
hpath1 = compile preprocessfile "helipath1.sqf";
hpath2 = compile preprocessfile "helipath2.sqf";
onMapSingleClick "player setpos _pos";

[color="Red"]progressLoadingScreen 1;[/color]

   [color="Red"]missionReady = true;
   publicVariable "missionReady";
}
// --------------

waitUntil {missionReady};
endLoadingScreen;[/color]
////////////////////////////////////////BRIEFING//////////////////////////////////////////////////
//briefings:
[[
 ["Task1","Rescue Reporter","Search for the <marker name='tsk1mkr1'>reporter</marker> who is being held captive near the villa. Once you have found him and the area is clear, an extraction chopper will be inbound to pick him up.",true,[],"assigned"]
],[
 ["Notes1","Needs Completing..."],
 ["Notes2","Needs Completing..."],
 ["Credits","Needs Completing..."]
]] execvm "shk_taskmaster.sqf";

//Process statements stored using setVehicleInit
processInitCommands;

//Finish world initialization before mission is launched. 
finishMissionInit;

if(true) exitWith {};

With the above I am getting an error stating that there is a missing ";" at the end of waitUntil {missionReady}; but it already has one and I can't see anything else wrong..?

Just so you know, my hidemarkers.sqf just contains this:

"markername1" setMarkerAlphaLocal 0;
"markername2" setMarkerAlphaLocal 0;
"markername3" setMarkerAlphaLocal 0;
etc...

Edited by Guest

Share this post


Link to post
Share on other sites

you are missing the semi-colon here (marked red):

progressLoadingScreen 1;

   missionReady = true;
   publicVariable "missionReady";
}[color="Red"];[/color]
// --------------

Share this post


Link to post
Share on other sites

An easier solution:

Create a game logic and in its init line type:

call compile preprocessFile "hidemarkers.sqf";

And then create a script with the same name and in that script hide all the markers (using setMarkerAlpha command). Those markers will be then hidden before the briefing screen shows.

Another way is to not even place the markers in the editor, and then create them locally for each player after mission initialization is actually complete, using the createMarkerLocal command and all the related commands to set the marker's type/shape/size/color/text.

Share this post


Link to post
Share on other sites
Guest

@ [KH]Jman

Thanks, I didn't spot that:)

@ Mr. Charles

Yes it should be after the briefing, thanks for pointing it out:)

@ galzohar

I'll try out your game logic suggestion as I have the loading screen fully working now but I'm still having the same problem with freezing/markers showing.

I'll report back, cheers guys.

---------- Post added at 12:45 PM ---------- Previous post was at 12:29 PM ----------

Well the game logic soloution solved half of the problem. The markers are now hidden straight away when briefing has started which is sweet but there is still a 10 second freezing issue.

The marker problem was the most important issue though so I'm glad thats sorted:)

If anyone has any other ideas that may solve the freezing issue in the briefing, let me know.

Thanks for all the input guys:)

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
Sign in to follow this  

×