Jump to content

[Release] Better Load Messages (WIP)


Zupa

Recommended Posts

Better Load Messages

 

Only recommended for more advanced server owners/scripters.

 

FIRST TEST THIS ON A TEST SERVER. 

 

If you dont like my name in there, look for "Zupa Info" in compiles.sqf And change that to whatever you want ( Server Info for example)

 

Bored of the loading messages which are simple plain "Authenticating" and " Character data". Now i made some simmple additions which allows servers ( defenatly handy for when the server is starting up) to have more messages showing, to actually show you whats going on with the server. 

 

It will also disable to timeout until the person actually starts pinging to login. 

 

Messages coming from server:

Getting Objects from Hive

Spawning 5683 objects and vehicles

Spawned 250 of 5683 objects

Loading trader data

Spawning 25 new vehicles

Finishing up the server

Server running

These messages will be completed with "& " + whatever the normal messages are ( Mostly "Authenticated user").

 

Players will know if they login takes longer because of server of because of himself.

 

I'm planning to even make this better in the future.

 

 

 

Instructions

 

In your compiles.sqf ( The client is ging to catch the publicVariable from the server, and after that he is going to show you the message)

THIS ALSO FIXES YOUR SERVER HANING ON BLACK SCREEN BUT HEARING SOUND.

 

Change the following code block:

//This is still needed but the fsm should terminate if any errors pop up.
	[] spawn {
        private["_timeOut","_display","_control1","_control2"];
        disableSerialization;
        _timeOut = 0;
        dayz_loadScreenMsg = "";
        diag_log "DEBUG: loadscreen guard started.";
        _display = uiNameSpace getVariable "BIS_loadingScreen";
        if (!isNil "_display") then {
                _control1 = _display displayctrl 8400;
                _control2 = _display displayctrl 102;
        };
		if (!isNil "dayz_DisplayGenderSelect") then {
			waitUntil {!dayz_DisplayGenderSelect};
		};

        // 120 sec timeout (12000 * 0.01)
        while { _timeOut < 12000 } do {
            if (dayz_clientPreload && dayz_authed) exitWith { diag_log "PLOGIN: Login loop completed!"; };
            if (!isNil "_display") then {
                if ( isNull _display ) then {
                        waitUntil { !dialog; };
                        startLoadingScreen ["","RscDisplayLoadCustom"];
                        _display = uiNameSpace getVariable "BIS_loadingScreen";
                        _control1 = _display displayctrl 8400;
                        _control2 = _display displayctrl 102;
                };

                if ( dayz_loadScreenMsg != "" ) then {
                        _control1 ctrlSetText dayz_loadScreenMsg;
                        dayz_loadScreenMsg = "";
                };

                _control2 ctrlSetText format["%1",round(_timeOut*0.01)];
            };

            _timeOut = _timeOut + 1;

            if (_timeOut >= 12000) then {
                1 cutText [localize "str_player_login_timeout", "PLAIN DOWN"];
                sleep 10;
                endLoadingScreen;
                endMission "END1";
            };

            sleep 0.01;
        };
	};

Into:

        Zupa_LoadingMessage = ["Loading up server."];	// innitial message before the server ever sends a message to the client.
	"PVDZE_Z_LoadMessage" addPublicVariableEventHandler {Zupa_LoadingMessage = _this select 1;};

	//This is still needed but the fsm should terminate if any errors pop up.
     [] spawn {
        private["_timeOut","_display","_control1","_control2"];
        disableSerialization;
        _timeOut = 0;
        dayz_loadScreenMsg = "";
        diag_log "DEBUG: loadscreen guard started.";
        _display = uiNameSpace getVariable "BIS_loadingScreen";
        if (!isNil "_display") then {
                _control1 = _display displayctrl 8400;
                _control2 = _display displayctrl 102;
        };
		if (!isNil "dayz_DisplayGenderSelect") then {
			waitUntil {!dayz_DisplayGenderSelect};
		};

        // 120 sec timeout (12000 * 0.01)
        while { _timeOut < 12000 } do {
            if (dayz_clientPreload && dayz_authed) exitWith { 
					diag_log "PLOGIN: Login loop completed!"; 
					endLoadingScreen;
				 };
            if (!isNil "_display") then {
                if ( isNull _display ) then {
                        waitUntil { !dialog; };
                        startLoadingScreen ["","RscDisplayLoadCustom"];
                        _display = uiNameSpace getVariable "BIS_loadingScreen";
                        _control1 = _display displayctrl 8400;
                        _control2 = _display displayctrl 102;
                };
                 _control1 ctrlSetText format["Zupa Info: %1 & %2.",Zupa_LoadingMessage select 0 ,dayz_loadScreenMsg];             
                 _control2 ctrlSetText format["%1",round(_timeOut*0.01)];
            };
			
	    if( Zupa_LoadingMessage select 0 != "Server running")then{
		    _timeOut = 0;
		}else{
                    _timeOut = _timeOut + 1;
	    };

            if (_timeOut >= 12000) then {
                1 cutText [localize "str_player_login_timeout", "PLAIN DOWN"];
                sleep 10;
                endLoadingScreen;
                endMission "END1";
            };

            sleep 0.01;
        };
     };

Now we going to the server_monitor.sqf ( server sided)

 

1)

Add

	PVDZE_Z_LoadMessage = ["Getting Objects from Hive"];
	publicVariable "PVDZE_Z_LoadMessage";

Above

	serverVehicleCounter = [];
	_hiveResponse = [];

2)

 

add

_ammountOfObject = count (_BuildingQueue + _objectQueue); 	
_theMessage = format ["Spawning %1 objects and vehicles", _ammountOfObject];
	PVDZE_Z_LoadMessage = [_theMessage];
	publicVariable "PVDZE_Z_LoadMessage";
        _currentCount = 0;
        _newMileStone = 50;

above

_totalvehicles = 0;
{
_idKey =  _x select 1;
_type = _x select 2;
_ownerID =  _x select 3;

3) 

add

if( _currentCount == _newMileStone)then{ // to reduce bandwith
    _newMileStone = _newMileStone + 50; // every 50 items loaded refresh message
    _theMessage = format ["Spawned %1 of %2 objects",_currentCount, _ammountOfObject];
    PVDZE_Z_LoadMessage = [_theMessage];
    publicVariable "PVDZE_Z_LoadMessage";
};
_currentCount = _currentCount + 1;

 above 

} count (_BuildingQueue + _objectQueue);
	// # END SPAWN OBJECTS # 

4)

add

_theMessage = "Loading trader data";
PVDZE_Z_LoadMessage = [_theMessage];
publicVariable "PVDZE_Z_LoadMessage";

AFTER

if !(DZE_ConfigTrader) then {

5) 

 

add 

_theMessage = format["Spawning %1 new vehicles", _vehLimit];
PVDZE_Z_LoadMessage = [_theMessage];
publicVariable "PVDZE_Z_LoadMessage";

 AFTER

//  spawn_vehicles
_vehLimit = MaxVehicleLimit - _totalvehicles;	

6) 

 

add

_theMessage = "Finishing up the server";
PVDZE_Z_LoadMessage = [_theMessage];
publicVariable "PVDZE_Z_LoadMessage";

BEFORE

	//  spawn_roadblocks
	diag_log ("HIVE: Spawning # of Debris: " + str(MaxDynamicDebris));
	for "_x" from 1 to MaxDynamicDebris do {
		[] spawn spawn_roadblocks;
	};

7 LAST)

 

add

		
_theMessage = format["Server running", _vehLimit];
PVDZE_Z_LoadMessage = [_theMessage];
publicVariable "PVDZE_Z_LoadMessage";

AFTER

diag_log format["Total Number of spawn locations %1", actualSpawnMarkerCount];

Link to comment
Share on other sites

clarification
like this

if !(DZE_ConfigTrader) then {
_theMessage = "Loading trader data";
PVDZE_Z_LoadMessage = [_theMessage];
publicVariable "PVDZE_Z_LoadMessage";

[...]

};

or like this :

 

if !(DZE_ConfigTrader) then {
    [...]
};

_theMessage = "Loading trader data";
PVDZE_Z_LoadMessage = [_theMessage];
publicVariable "PVDZE_Z_LoadMessage";

?

Link to comment
Share on other sites

clarification

like this

if !(DZE_ConfigTrader) then {
_theMessage = "Loading trader data";
PVDZE_Z_LoadMessage = [_theMessage];
publicVariable "PVDZE_Z_LoadMessage";

[...]

};

or like this :

 

if !(DZE_ConfigTrader) then {
    [...]
};

_theMessage = "Loading trader data";
PVDZE_Z_LoadMessage = [_theMessage];
publicVariable "PVDZE_Z_LoadMessage";

?

 

the first one

Link to comment
Share on other sites

Got this error 

15:24:44 Error in expression <at ["Spawning %1 objects and vehicles", _ammountOfObject];
PVDZE_Z_LoadMessage =>
15:24:44   Error position: <_ammountOfObject];
PVDZE_Z_LoadMessage =>
15:24:44   Error Undefined variable in expression: _ammountofobject
15:24:44 File z\addons\dayz_server\system\server_monitor.sqf, line 89
Link to comment
Share on other sites

This looks amazing!! I just had a quick question though. I use a custom compiles.sqf on our hosted server as I don't have access to edit the dayz_code.pbo. Here is the compiles.sqf:

 

if (!isDedicated) then {
        fnc_usec_damageActions        =            compile preprocessFileLineNumbers "Scripts\PlotForLifev2\fn_damageActions.sqf";
        player_packTent               =            compile preprocessFileLineNumbers "Scripts\PlotForLifev2\player_packTent.sqf";
        player_packVault              =            compile preprocessFileLineNumbers "Scripts\PlotForLifev2\player_packVault.sqf";
        player_unlockVault            =            compile preprocessFileLineNumbers "Scripts\PlotForLifev2\player_unlockVault.sqf";
        player_removeObject           =            compile preprocessFileLineNumbers "Scripts\PlotForLifev2\remove.sqf";
        player_lockVault              =            compile preprocessFileLineNumbers "Scripts\PlotForLifev2\player_lockVault.sqf";
        player_updateGui              =            compile preprocessFileLineNumbers "Scripts\PlotForLifev2\player_updateGui.sqf";
        player_tentPitch              =            compile preprocessFileLineNumbers "Scripts\PlotForLifev2\tent_pitch.sqf";
        player_vaultPitch             =            compile preprocessFileLineNumbers "Scripts\PlotForLifev2\vault_pitch.sqf";
        player_build                  =            compile preprocessFileLineNumbers "Scripts\snap_pro\player_build.sqf";
	snap_build                    =            compile preprocessFileLineNumbers "Scripts\snap_pro\snap_build.sqf";
	dayz_spaceInterrupt           =            compile preprocessFileLineNumbers "Scripts\snap_pro\dayz_spaceInterrupt.sqf";
        fnc_usec_selfActions          =            compile preprocessFileLineNumbers "Functions\fn_selfActions.sqf";
        easy_currency_combine         =            compile preprocessFileLineNumbers "Scripts\combineCurrency\combineCurrency.sqf";
        player_selectSlot             =            compile preprocessFileLineNumbers "Functions\ui_selectSlot.sqf";
        player_useMeds                =            compile preprocessFileLineNumbers "Scripts\SelfBB\player_useMeds.sqf";
        mv22_pack                     =            compile preprocessFileLineNumbers "\ca\air2\mv22\scripts\pack.sqf";
        fnc_usec_damageVehicle        =            compile preprocessFileLineNumbers "Scripts\Vehicles\fn_damageHandlerVehicle.sqf";
};

/*Plot*/
        PlotGetFriends                =            compile preprocessFileLineNumbers "Scripts\plotManagement\plotGetFriends.sqf";
        PlotNearbyHumans              =            compile preprocessFileLineNumbers "Scripts\plotManagement\plotNearbyHumans.sqf";
        PlotAddFriend                 =            compile preprocessFileLineNumbers "Scripts\plotManagement\plotAddFriend.sqf";
        PlotRemoveFriend              =            compile preprocessFileLineNumbers "Scripts\plotManagement\plotRemoveFriend.sqf";
        MaintainPlot    	      =            compile preprocessFileLineNumbers "Scripts\plotManagement\maintain_area.sqf";
        PlotPreview    		      =            compile preprocessFileLineNumbers "Scripts\plotManagement\plotToggleMarkers.sqf";
/*Plot End*/

        vehicle_handleDamage          =            compile preprocessFileLineNumbers "Scripts\Vehicles\vehicle_handleDamage.sqf"; 

  

Do I need to add:

 

  Zupa_LoadingMessage = ["Loading up server."];	// innitial message before the server ever sends a message to the client.
	"PVDZE_Z_LoadMessage" addPublicVariableEventHandler {Zupa_LoadingMessage = _this select 1;};

	//This is still needed but the fsm should terminate if any errors pop up.
     [] spawn {
        private["_timeOut","_display","_control1","_control2"];
        disableSerialization;
        _timeOut = 0;
        dayz_loadScreenMsg = "";
        diag_log "DEBUG: loadscreen guard started.";
        _display = uiNameSpace getVariable "BIS_loadingScreen";
        if (!isNil "_display") then {
                _control1 = _display displayctrl 8400;
                _control2 = _display displayctrl 102;
        };
		if (!isNil "dayz_DisplayGenderSelect") then {
			waitUntil {!dayz_DisplayGenderSelect};
		};

        // 120 sec timeout (12000 * 0.01)
        while { _timeOut < 12000 } do {
            if (dayz_clientPreload && dayz_authed) exitWith { 
					diag_log "PLOGIN: Login loop completed!"; 
					endLoadingScreen;
				 };
            if (!isNil "_display") then {
                if ( isNull _display ) then {
                        waitUntil { !dialog; };
                        startLoadingScreen ["","RscDisplayLoadCustom"];
                        _display = uiNameSpace getVariable "BIS_loadingScreen";
                        _control1 = _display displayctrl 8400;
                        _control2 = _display displayctrl 102;
                };
                 _control1 ctrlSetText format["Zupa Info: %1 & %2.",Zupa_LoadingMessage select 0 ,dayz_loadScreenMsg];             
                 _control2 ctrlSetText format["%1",round(_timeOut*0.01)];
            };
			
	    if( Zupa_LoadingMessage select 0 != "Server running")then{
		    _timeOut = 0;
		}else{
                    _timeOut = _timeOut + 1;
	    };

            if (_timeOut >= 12000) then {
                1 cutText [localize "str_player_login_timeout", "PLAIN DOWN"];
                sleep 10;
                endLoadingScreen;
                endMission "END1";
            };

            sleep 0.01;
        };
     };

 

To my custom compiles.sqf or create a new one with the entire code from dayz_code.pbo?

 

Thanks!

Link to comment
Share on other sites

This looks amazing!! I just had a quick question though. I use a custom compiles.sqf on our hosted server as I don't have access to edit the dayz_code.pbo. Here is the compiles.sqf:

 

if (!isDedicated) then {
        fnc_usec_damageActions        =            compile preprocessFileLineNumbers "Scripts\PlotForLifev2\fn_damageActions.sqf";
        player_packTent               =            compile preprocessFileLineNumbers "Scripts\PlotForLifev2\player_packTent.sqf";
        player_packVault              =            compile preprocessFileLineNumbers "Scripts\PlotForLifev2\player_packVault.sqf";
        player_unlockVault            =            compile preprocessFileLineNumbers "Scripts\PlotForLifev2\player_unlockVault.sqf";
        player_removeObject           =            compile preprocessFileLineNumbers "Scripts\PlotForLifev2\remove.sqf";
        player_lockVault              =            compile preprocessFileLineNumbers "Scripts\PlotForLifev2\player_lockVault.sqf";
        player_updateGui              =            compile preprocessFileLineNumbers "Scripts\PlotForLifev2\player_updateGui.sqf";
        player_tentPitch              =            compile preprocessFileLineNumbers "Scripts\PlotForLifev2\tent_pitch.sqf";
        player_vaultPitch             =            compile preprocessFileLineNumbers "Scripts\PlotForLifev2\vault_pitch.sqf";
        player_build                  =            compile preprocessFileLineNumbers "Scripts\snap_pro\player_build.sqf";
	snap_build                    =            compile preprocessFileLineNumbers "Scripts\snap_pro\snap_build.sqf";
	dayz_spaceInterrupt           =            compile preprocessFileLineNumbers "Scripts\snap_pro\dayz_spaceInterrupt.sqf";
        fnc_usec_selfActions          =            compile preprocessFileLineNumbers "Functions\fn_selfActions.sqf";
        easy_currency_combine         =            compile preprocessFileLineNumbers "Scripts\combineCurrency\combineCurrency.sqf";
        player_selectSlot             =            compile preprocessFileLineNumbers "Functions\ui_selectSlot.sqf";
        player_useMeds                =            compile preprocessFileLineNumbers "Scripts\SelfBB\player_useMeds.sqf";
        mv22_pack                     =            compile preprocessFileLineNumbers "\ca\air2\mv22\scripts\pack.sqf";
        fnc_usec_damageVehicle        =            compile preprocessFileLineNumbers "Scripts\Vehicles\fn_damageHandlerVehicle.sqf";
};

/*Plot*/
        PlotGetFriends                =            compile preprocessFileLineNumbers "Scripts\plotManagement\plotGetFriends.sqf";
        PlotNearbyHumans              =            compile preprocessFileLineNumbers "Scripts\plotManagement\plotNearbyHumans.sqf";
        PlotAddFriend                 =            compile preprocessFileLineNumbers "Scripts\plotManagement\plotAddFriend.sqf";
        PlotRemoveFriend              =            compile preprocessFileLineNumbers "Scripts\plotManagement\plotRemoveFriend.sqf";
        MaintainPlot    	      =            compile preprocessFileLineNumbers "Scripts\plotManagement\maintain_area.sqf";
        PlotPreview    		      =            compile preprocessFileLineNumbers "Scripts\plotManagement\plotToggleMarkers.sqf";
/*Plot End*/

        vehicle_handleDamage          =            compile preprocessFileLineNumbers "Scripts\Vehicles\vehicle_handleDamage.sqf"; 

  

Do I need to add:

 

  Zupa_LoadingMessage = ["Loading up server."];	// innitial message before the server ever sends a message to the client.
	"PVDZE_Z_LoadMessage" addPublicVariableEventHandler {Zupa_LoadingMessage = _this select 1;};

	//This is still needed but the fsm should terminate if any errors pop up.
     [] spawn {
        private["_timeOut","_display","_control1","_control2"];
        disableSerialization;
        _timeOut = 0;
        dayz_loadScreenMsg = "";
        diag_log "DEBUG: loadscreen guard started.";
        _display = uiNameSpace getVariable "BIS_loadingScreen";
        if (!isNil "_display") then {
                _control1 = _display displayctrl 8400;
                _control2 = _display displayctrl 102;
        };
		if (!isNil "dayz_DisplayGenderSelect") then {
			waitUntil {!dayz_DisplayGenderSelect};
		};

        // 120 sec timeout (12000 * 0.01)
        while { _timeOut < 12000 } do {
            if (dayz_clientPreload && dayz_authed) exitWith { 
					diag_log "PLOGIN: Login loop completed!"; 
					endLoadingScreen;
				 };
            if (!isNil "_display") then {
                if ( isNull _display ) then {
                        waitUntil { !dialog; };
                        startLoadingScreen ["","RscDisplayLoadCustom"];
                        _display = uiNameSpace getVariable "BIS_loadingScreen";
                        _control1 = _display displayctrl 8400;
                        _control2 = _display displayctrl 102;
                };
                 _control1 ctrlSetText format["Zupa Info: %1 & %2.",Zupa_LoadingMessage select 0 ,dayz_loadScreenMsg];             
                 _control2 ctrlSetText format["%1",round(_timeOut*0.01)];
            };
			
	    if( Zupa_LoadingMessage select 0 != "Server running")then{
		    _timeOut = 0;
		}else{
                    _timeOut = _timeOut + 1;
	    };

            if (_timeOut >= 12000) then {
                1 cutText [localize "str_player_login_timeout", "PLAIN DOWN"];
                sleep 10;
                endLoadingScreen;
                endMission "END1";
            };

            sleep 0.01;
        };
     };

 

To my custom compiles.sqf or create a new one with the entire code from dayz_code.pbo?

 

Thanks!

 

This doesn't require to touch the dayz_code.pbo

 

dayz_code.pbo is client side you can find it @DayZ_Epoch\addons

Link to comment
Share on other sites

This looks amazing!! I just had a quick question though. I use a custom compiles.sqf on our hosted server as I don't have access to edit the dayz_code.pbo. Here is the compiles.sqf:

You dont need access to that file, also you already have that file on your computer, all you need to do is to unpbo the file and you can just plug the compiles.sqf outta there.

Though to have an additional compiles.sqf certainly has its pro's.

Link to comment
Share on other sites

I am aware that I can access it, it is just a large file that I would like to keep out of my growing mission folder if possible. But I guess to implement this I will have to bring it over to the mission side.

Edited by Tricks
Link to comment
Share on other sites

I am aware that I can access it, it is just a large file that I would like to keep out of my growing mission folder if possible. But I guess to implement this I will have to bring it over to the mission side.

I know that feel, my missionfile is already at about 2mb ... 20-30kb more will not really make much of a difference.

Tho it would be nice to know if that works without having to get the compiles into the mission folder.

Link to comment
Share on other sites

while { _timeOut < 12000 } do {
if (dayz_clientPreload && dayz_authed) exitW>
21:13:20   Error position: <dayz_clientPreload && dayz_authed) exitW>
21:13:20   Error Undefined variable in expression: dayz_clientpreload
21:13:20 File mpmissions\DN_Opoch.Chernarus\DamiMods\compiles.sqf, line 71
Link to comment
Share on other sites

Hey dude nice job yet again. :D

Been poking around and trying to find a way to move the text down a little.

 

The loading text currently sits infront of some text on the loadscreen and just for OCD I want it flush above the load bar.

I have messed with the safezones for some of the RSC groups inside the description.ext but cant get it to move.

Any ideas ?

 

Cheers

Link to comment
Share on other sites

Hey dude nice job yet again. :D

Been poking around and trying to find a way to move the text down a little.

 

The loading text currently sits infront of some text on the loadscreen and just for OCD I want it flush above the load bar.

I have messed with the safezones for some of the RSC groups inside the description.ext but cant get it to move.

Any ideas ?

 

Cheers

 

Where did u find the config of the 8400 id?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...