Jump to content

Recommended Posts

Hi

I'm making a loading screen for my mission and I am not starting the loading screen from beginning of init.sqf but after all the scripts have run because after the init.sqf is processed somethings are still loading. Which leads to my question, what is actually being loaded after all init scripts have ran? There should be nothing big loading anymore but after I end my loading screen the standard arma loading screen comes back again and loads about 5 seconds.

I don't know what's loading and how to make my loading screen stay until everything is finished loading.

 

Any ideas what to try are welcome

 

thx!

Share this post


Link to post
Share on other sites

Well there is a way that I am not saying I use (when I am actually) :thumbsup:

As a loading screen you can play a video. Check how much time your mission needs to load up and then play a loading video for the amount of seconds needed. That way even in an mp environment all players will be able to load up and there will be no loading chaos. Different pcs different loading times. It is a really cool way to keep things in order.

The above method I use in all campaign missions.

  • Like 2

Share this post


Link to post
Share on other sites
3 minutes ago, JohnKalo said:

Well there is a way that I am not saying I use (when I am actually) :thumbsup:

As a loading screen you can play a video. Check how much time your mission needs to load up and then play a loading video for the amount of seconds needed. That way even in an mp environment all players will be able to load up and there will be no loading chaos. Different pcs different loading times. It is a really cool way to keep things in order.

The above method I use in all campaign missions.

 

Sounds good, I actually tried to show the loading screen for x amounts of seconds but the mission didn't seem to load on background. Tried sleep and uisleep without good results. The couple problems with video is that I don't have any videos. And would rather not include video to the mission because it increases the mission size... Also I'm still hoping some one knew what's actually being loaded so we can get accurate loading time and not just estimation

  • Like 1

Share this post


Link to post
Share on other sites

Oh did not have one either but gladly youtube from which you can download videos with AVC (AnyVideoConverter) exists. You just have to be careful with copyright. Most people give their work for free and some do not even ask for credits but I anyways credit them. Super polite to give such content without copyright claims. 

 

Via a few seconds search I found a loading screen for scifi missions:

 

Or just search loading bars on youtube and it has quite a few:

 

https://www.youtube.com/results?search_query=loading+bar+animations

 

And in .ogv format the size of the mission is next to nothing. Anyways hope you find your answers too.

  • Thanks 2

Share this post


Link to post
Share on other sites

I was thinking there might be some event handler to let know when the mission is fully loaded?

 

It would also be great to be able to show the loadbar all the way to end... I tried with sleep and uiSleep before endLoadingScreen but it seems the mission wont be fully loaded until the loading screen has ended. Once I call endLoadingScreen it still loads a while no matter how long I keep the loading screen

Share this post


Link to post
Share on other sites

Any ideas on this one?

I think there should be some kind of loading state command to get the info on what arma is currently loading. Quite similar to getClientState but for server. Anyone know if such exist? If not maybe BIS could introduce such command, to help with the loading screens...

Share this post


Link to post
Share on other sites

I recently did a text intro to my mission. I started based on info and files from a youtube video by Alias (Script Intro). It contained a time script which I used with mine (the AL_intro\time_srv.sqf). What I ended up with was this: 

Spoiler

waitUntil {time > 0};

_jip_enable    = _this select 0;

[[_jip_enable],"AL_intro\time_srv.sqf"] remoteExec ["execVM"];
waitUntil {!isNil "curr_time"};

if (!hasInterface) exitWith {};

disableSerialization;

if ((!curr_time) or (_jip_enable<0)) then {


private ["_name"];


enableRadio false;
enableEnvironment false;
sleep 1;

hintSilent "Please Wait, Loading";

["newSkulls.jpg", [-0.1,-0.2,1.2,1.2], [7,7], 6, 16, [2,2], 1] spawn BIS_fnc_textTiles;

sleep 20;


[parseText "<t color='#FF0000' font='PuristaBold' size='13' align='center'>Warlords</t><br /><t color='#FFA500' font='PuristaSemibold' size='11' align='center'>Modified</t><br />by the Antiprotestant", [-0.1,-0.2,1.2,1.2],[7,7], 8, 2, 0.6] spawn BIS_fnc_textTiles;

sleep 12;


waitUntil {alive player};

_name=name player;


[0, 0] spawn BIS_fnc_cinemaBorder; ///this gives you the black top and bottom...

sleep 2;

1 cutRsc ["nggHUD","PLAIN"];

waitUntil {!isNull (uiNameSpace getVariable "nggHUD")};
    _display = uiNameSpace getVariable "nggHUD";
        _setText = _display displayCtrl 1001;
            
            if (playerSide == WEST) then {
            _setText ctrlSetStructuredText (parseText format ["Welcome %1!",_name]);
            _setText ctrlSetBackgroundColor [0,0,1,0.5];
            };
            if (playerSide == EAST) then {
            _setText ctrlSetStructuredText (parseText format ["Welcome %1!",_name]);
            _setText ctrlSetBackgroundColor [1,0,0,0.5];
            };
sleep 5;

            _setText ctrlSetStructuredText (parseText format ["%1: Please equip yourself at the nearest Equipment Crate.",_name]);
            _setText ctrlSetBackgroundColor [0,0,0,0.5];
sleep 5;

            _setText ctrlSetStructuredText (parseText format ["Role based loadouts are available during the respawn screen."]);
            _setText ctrlSetBackgroundColor [0,0,0,0.5];
sleep 5;

            _setText ctrlSetStructuredText (parseText format ["Equipment Crates can be relocated and used as F.O.B.s"]);
            _setText ctrlSetBackgroundColor [0,0,0,0.5];
sleep 5;

            _setText ctrlSetStructuredText (parseText format ["WARNING: Equipment Crates can also be stolen and / or destroyed!"]);
            _setText ctrlSetBackgroundColor [1,0,0,0.5];
        
sleep 3;
        
1 cutFadeOut 2;
        
sleep 1;
        
1 cutRsc ["default","PLAIN"];

enableEnvironment true;
enableRadio true;

sleep 2;

[1, 1] spawn BIS_fnc_cinemaBorder;    // cinema border off

};    


nggPreview=[
        [
            ["Necessary Genocide Presents:","<t shadow='1' align='center' valign='top' size='2'>%1</t><br/>", 9],
            ["An adaptation of Warlords by Bohemia Interactive®","<t align = 'center' shadow = '1' size = '0.8'>%1</t><br/>", 9],
            ["Edited by the Antiprotestant","<t align = 'center' shadow = '1' size = '0.7'>%1</t><br/>", 6]
        ]
    ] spawn BIS_fnc_typeText;

 

Mine starts with the textTiles and image on the map selection screen (do to my setting RespawnOnStart =1 in description.ext), and the other text will not begin until after unit spawns in. Hopefully something in here helps you.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

@Trenchcoat Thanks for the code, probably something there I can learn from... But my main question still is how do we know what the engine is loading and how long it takes. So we can display those loading texts until it's finished

Share this post


Link to post
Share on other sites
On 6/8/2019 at 1:22 PM, gc8 said:

what is actually being loaded after all init scripts have ran? There should be nothing big loading anymore but after I end my loading screen the standard arma loading screen comes back again and loads about 5 seconds. 

Any mod/script could do that. startLoadingScreen/endLoadingScreen commands. You cannot know when everything is done, as you cannot possibly know every script.

 

If you wanna know when Arma load stuff is done, use postInit script.

You could check via script when the loading screen displays are gone, but that doesn't mean that a new one won't appear shortly after.

Share this post


Link to post
Share on other sites
44 minutes ago, Dedmen said:

If you wanna know when Arma load stuff is done, use postInit script.

 

Sounds like a good idea but when testing this stuff in editor/multiplayer the post init gets called before init.sqf

 

44 minutes ago, Dedmen said:

You could check via script when the loading screen displays are gone, but that doesn't mean that a new one won't appear shortly after.

 

Already did this but like you said they come back

Share this post


Link to post
Share on other sites

Just tested post init but it wont work because post init happens before player clicks continue from the briefing screen. And after that arma still loads something.... This is where I'd like to have my loading screen but not sure if it's possible

Share this post


Link to post
Share on other sites

Well I have tried overriding the last loading screen after user continue click but I think it's not possible and BIS made it that way. I used "bis_fnc_initRespawn" call BIS_fnc_endLoadingScreen; to get rid of the current screen and started my own but it just wont show up.

So I'm out of ideas =/

Share this post


Link to post
Share on other sites
40 minutes ago, Dedmen said:

CBA has a loading done eventhandler.
https://github.com/CBATeam/CBA_A3/blob/80a6155ddc62733aacf670fd2a876fd89ff9a7a6/addons/xeh/fnc_preInit.sqf#L179

It just waits for "expected loading screens" but.. any mod might still open a new one later which you cannot know about.

 

I thought arma is loading some internal stuff such as initializing objects created by scripts and you can't effect the loading screen displayed at this time.

 

I'd wish not to make the mission CBA dependent.

Share this post


Link to post
Share on other sites

Was Searching through the Interwebs and came across this. Have you tried the eventHandlers "PreloadStarted" and "preloadFinished" Perhaps it will allow the additional processes to complete before loading if you break them up? I don't know if that is what you are looking for, but I am just trying to be of assistance.

  • Like 1

Share this post


Link to post
Share on other sites

@Trenchcoat I have to thank you. This was just what I needed. With that EH I can fully control what loading screens are displayed and show my own instead. I haven't yet tested on dedicated though

  • 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

×