Jump to content

[Tutorial] How to change (Blood,Hunger,Thirst,Temp) GUI


Recommended Posts

This tutorial will teach you how to change the "logos" of the Blood,Hunger,Thirst,Temp, Bare in mind this is my first tutorial soo might not be as good as you think, Lets get to the point ...

 

First you'll need player_updateGui.sqf which you can get from here:

@DayZ_Epoch\addons\dayz_code\compile\player_updateGui.sqf

Copy&Paste it into your mission.pbo(Anywhere)

 

(If you already have custom compiles.sqf setup)

Go into your compiles.sqf and add this line under the default one and comment the original out like soo:

//	player_updateGui =			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_updateGui.sqf";
	player_updateGui =			compile preprocessFileLineNumbers "fixes\player_updateGui.sqf";

(If you dont have custom compiles.sqf setup)

Go into your @DayZ_Epoch\addons\dayz_code\init\compiles.sqf

Copy&Paste it into your mission.pbo(Anywhere)

Open up init.sqf and add this:

call compile preprocessFileLineNumbers "Scripts\compiles.sqf"; //Compile custom compiles

Right under this:

call compile preprocessFileLineNumbers "server_traders.sqf";				//Compile trader configs

Then in compiles.sqf search for (player_updateGui) and comment the line out and insert the following under it like soo:

//	player_updateGui =			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_updateGui.sqf";
	player_updateGui =			compile preprocessFileLineNumbers "fixes\player_updateGui.sqf";

In @DayZ_Epoch\addons\dayz_code\gui\ find what you want to edit and Copy&Paste it into your mission.pbo(Anywhere)

EXAMPLE: mission.pbo\additions\status_blood_inside_1_ca.paa

 

Note: You need all of the (status_blood_inside_X_ca.paa's) if you want it to look good, Or else it will switch between your edit and normal epoch/dayz GUI's.

 

In player_updateGui.sqf find:

if (_bloodLvl <= 0) then { 
	_blood = "\z\addons\dayz_code\gui\status_blood_inside_1_ca.paa";
	} else {
	_blood = "\z\addons\dayz_code\gui\status_blood_inside_" + str(_bloodLvl) + "_ca.paa";
	};

And replace it with:

if (_bloodLvl <= 0) then { 
	_blood = "fixes\status_blood_inside_1_ca.paa";
	} else {
	_blood = "fixes\status_blood_inside_" + str(_bloodLvl) + "_ca.paa";
	};

That should be it, Hope this works, Leave a comment if you like this or if you've got questions :).

Link to comment
Share on other sites

 

If i move the gui folder in the dayz_server.pbo,

how come this doesnt work ?

_blood = "\z\addons\dayz_server\gui\status_blood_inside_1_ca.paa";

Why are there more and more people all over the forums trying to move clientside files to the server.pbo.

If tutorial creators tell you to move them to the mission folder, there is a specific cause for this and still people try and move it anywhere else EXCEPT the mission itself.

 

Its a clientside file that is by default run from the @DayZ_Epoch client folder that everyone has. The @Epoch_Server folder is, as the name might suggest, server only and not available for the clients connecting.

So how the crap should a client get the correct picture file from a source he doest not have access too?

 

Your error logs (e.g. ArmA2oa.rpt in AppData\Arma2oa folder) will tell you that as well if you take the time to have a look at these.

 

So please do the good people that take their time to write up a tut a favor and either do as they ask, or come up with your own way but try to think about it first.

 

> No rant, Im just seeing more and more people every day that try to move obviously client side needed files to the server and then ask all around why it doesnt work at all for them.

Link to comment
Share on other sites

Putting them in server pbo protects (a bit) against someone coming along and taking your specific files.

 

Sure it does, but not for files that are needed clientside and that cant be remotely executed via a script.

Theres a few other methods for protecting your local missionfile but still, you cant truly protect yourself against someone intending to steal your scripts, just make it harder for them.

 

I just have the impression that nowadays or since a few weeks especially, everyone tries to move everything to the server.pbo, while obviously it doesnt make sense or is not possible at all and ends up just causing questions over questions for things that have clearly been stated in the tutorial.

Link to comment
Share on other sites

Sure it does, but not for files that are needed clientside and that cant be remotely executed via a script.

Theres a few other methods for protecting your local missionfile but still, you cant truly protect yourself against someone intending to steal your scripts, just make it harder for them.

 

I just have the impression that nowadays or since a few weeks especially, everyone tries to move everything to the server.pbo, while obviously it doesnt make sense or is not possible at all and ends up just causing questions over questions for things that have clearly been stated in the tutorial.

 

 

I apologize to the 'guru' of epoch for taking his precious time to bless us with his answer.

I heard the same wise words from someone on opendayz when they told me i couldnt just land a chopper on a LHD ... a week later i made it...no additions to the mission.pbo

I heard the same wise words from another guru saying you cant spawn loot above water.....2 weeks later i was spawning loot above water....

so forgive me mr copy/paster if i am asking a silly question for you....since you are so wise and kind to fill the internet with tutorials with your wisdom,,,,i'll just browse through them and learn something oh wise one.

 

 

Anyways...good job on the custom GUI man.

I was trying to do the same with inventory GUI when 1.8.3 came out, but in the end i quit, thinking that epoch will eventually add it.

Good job figuring it out :)

Link to comment
Share on other sites

I apologize to the 'guru' of epoch for taking his precious time to bless us with his answer.

I heard the same wise words from someone on opendayz when they told me i couldnt just land a chopper on a LHD ... a week later i made it...no additions to the mission.pbo

I heard the same wise words from another guru saying you cant spawn loot above water.....2 weeks later i was spawning loot above water....

so forgive me mr copy/paster if i am asking a silly question for you....since you are so wise and kind to fill the internet with tutorials with your wisdom,,,,i'll just browse through them and learn something oh wise one.

 

 

Anyways...good job on the custom GUI man.

I was trying to do the same with inventory GUI when 1.8.3 came out, but in the end i quit, thinking that epoch will eventually add it.

Good job figuring it out :)

Thanks :), I've actually thought about it for a long time and couldnt really find anything anywhere showing how to do it, Soo i figured i'd make a tutorial ^^, And i've tried to search for the execution of the bleeding gui but havnt found anything, Its like it is just within the game, And not in/editable on DayZ :P.

Link to comment
Share on other sites

Thanks :), I've actually thought about it for a long time and couldnt really find anything anywhere showing how to do it, Soo i figured i'd make a tutorial ^^, And i've tried to search for the execution of the bleeding gui but havnt found anything, Its like it is just within the game, And not in/editable on DayZ :P.

 

Crap, thats what i was mainly trying to change right before i quit, lol....i should have started with hunger icons :P

Link to comment
Share on other sites

I apologize to the 'guru' of epoch for taking his precious time to bless us with his answer.

I heard the same wise words from someone on opendayz when they told me i couldnt just land a chopper on a LHD ... a week later i made it...no additions to the mission.pbo

I heard the same wise words from another guru saying you cant spawn loot above water.....2 weeks later i was spawning loot above water....

so forgive me mr copy/paster if i am asking a silly question for you....since you are so wise and kind to fill the internet with tutorials with your wisdom,,,,i'll just browse through them and learn something oh wise one.

 

 

Anyways...good job on the custom GUI man.

I was trying to do the same with inventory GUI when 1.8.3 came out, but in the end i quit, thinking that epoch will eventually add it.

Good job figuring it out :)

After over 200 posts in this forum and 5 months of membership you clearly should know the difference between clientside and serverside files. It ain't no rocket science...

Oh and stop being a douche. People are just trying to show you the right direction.

Link to comment
Share on other sites

After over 200 posts in this forum and 5 months of membership you clearly should know the difference between clientside and serverside files. It ain't no rocket science...

Oh and stop being a douche. People are just trying to show you the right direction.

 

He could have said it in a better way....its not my fault if he is PMSing....especially if he has 0 contribution to this forum.

"Slap" now gtfo....oh i am sorry...was i been rude...i was just pointing you to the door......see what i mean ?

Link to comment
Share on other sites

Hey, some idea how i could resize the icons? The GUI works fine, but the icons are to small. Looks like a half size of orginal icons. greeting Joe

Im not sure if its possible, Try to just make the size bigger in photoshop and then turn it into a .paa file via texview2, Again not sure if this works :P.

 

Any chance of a screenshot?

Day_ZRE_GUI.png

Link to comment
Share on other sites

  • 1 month later...

Got the new dayz stats up but no boarders any one know how to add it in?

I looked at the code for normal dayz to epoch.

In the player player_updateGui,sqf 

 

​Epoch has it a little bit different 

Has the player tag system.

Plz help me add the boarders

Link to comment
Share on other sites

  • 3 weeks later...

Got the new dayz stats up but no boarders any one know how to add it in?

I looked at the code for normal dayz to epoch.

In the player player_updateGui,sqf 

 

​Epoch has it a little bit different 

Has the player tag system.

Plz help me add the boarders

 

- extract class playerStatusGUI from config.cpp (dayz_code.pbo) and make a .hpp file

- rename the classname

- edit in it, what you want...

- include the file in description.ext

- change the methode/function calls in ui_changeDisplay.sqf (dayz_code\compiles\..) & playermonitor.fsm (dayz_code\system\..) to fit with your new classname!

 

now you have all u need to add your border-definitions (border-graphics are not included in DZE! - try to get them from other dayz-mod's or make your own)

hint - class ControlsBackground & class Controls

 

to show your new classes u need to extend player_updateGui.sqf like that...

 

private["ctrlBlahBorder","_blahText"]; //declare your used variables

_ctrlBlahBorder = _display displayCtrl 1212; //<< your displayelement definied in your playerStatusGUI classes

_ctrlBlahBorder ctrlSetTextColor [1,1,1,1]; // border white no alphablending (RGBA)

_ctrlBlahBorder ctrlShow true; // put it on the screen

 

_blahText = "\z\addons\dayz_code\gui\status_blood_border_CA.paa";

_ctrlBlahBorderctrlSetText _blahText; //update/change with text/gfx

 

maybe it helps - cheers

 

btw. the class playerStatusGUI is a good place to add own graphics like serverlogo, weight-gfx etc. pp :)

 

screenshot

Link to comment
Share on other sites

- extract class playerStatusGUI from config.cpp (dayz_code.pbo) and make a .hpp file

- rename the classname

- edit in it, what you want...

- include the file in description.ext

- change the methode/function calls in ui_changeDisplay.sqf (dayz_code\compiles\..) & playermonitor.fsm (dayz_code\system\..) to fit with your new classname!

 

now you have all u need to add your border-definitions (border-graphics are not included in DZE! - try to get them from other dayz-mod's or make your own)

hint - class ControlsBackground & class Controls

 

to show your new classes u need to extend player_updateGui.sqf like that...

 

private["ctrlBlahBorder","_blahText"]; //declare your used variables

_ctrlBlahBorder = _display displayCtrl 1212; //<< your displayelement definied in your playerStatusGUI classes

_ctrlBlahBorder ctrlSetTextColor [1,1,1,1]; // border white no alphablending (RGBA)

_ctrlBlahBorder ctrlShow true; // put it on the screen

 

_blahText = "\z\addons\dayz_code\gui\status_blood_border_CA.paa";

_ctrlBlahBorderctrlSetText _blahText; //update/change with text/gfx

 

maybe it helps - cheers

 

btw. the class playerStatusGUI is a good place to add own graphics like serverlogo, weight-gfx etc. pp :)

 

screenshot

can you send your sqf file with out the logo plz

Link to comment
Share on other sites

Hi,

 

If anyone manages to get the new GUI icons working for EPOCH would you mind sharing please

 

I really want to add these new icons to my server, but my scripting know how is way too low

at the moment (I have only been scripting for a few months)

 

So please if you get this working could you share ?!?

 

thanks

 

Sp00neY

Link to comment
Share on other sites

I was able to get this to work very easily.  The image files you need for the updated icons are already in the dayz_code.pbo, so everyone already has them.  There is no need to copy them to the mission file.  All you have to do is pull 'player_UpdateGUI.sqf' from "dayz_code\compiles" and place it in your mission file in a folder called "fixes".  Then edit your compiles.sqf to point to the player_updateGUI.sqf from the fixes folder.  See below.

player_lockVault =			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_lockVault.sqf";
	// control_zombieAgent = 		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\control_zombieAgent.sqf";
	//player_updateGui =			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_updateGui.sqf";
	player_updateGui =			compile preprocessFileLineNumbers "fixes\player_updateGui.sqf";

Pay close attention to the paths in the code below referencing the .paa files and you will see that they are being called now from the "status" folder in dayz_code.  You can either edit the paths to your liking as I have, or you can copy and paste the entire contents of the file into yours.  The code below is the complete player_updategui.sqf file.

private ["_display","_ctrlBlood","_ctrlBleed","_bloodVal","_ctrlFood","_ctrlThirst","_thirstVal","_foodVal","_ctrlTemp","_tempVal","_combatVal","_array","_ctrlEar","_ctrlEye","_ctrlCombat","_ctrlFracture","_visualText","_visual","_audibleText","_audible","_blood","_thirstLvl","_foodLvl","_tempImg","_thirst","_food","_temp","_bloodLvl","_tempLvl","_color","_string","_humanity","_size","_friendlies","_charID","_rcharID","_rfriendlies","_rfriendlyTo","_distance","_targetControl","_humanityTarget"];
disableSerialization;

_foodVal = 		1 - (dayz_hunger / SleepFood);
_thirstVal = 	1 - (dayz_thirst / SleepWater);
_tempVal 	= 	1 - ((dayz_temperatur - dayz_temperaturmin)/(dayz_temperaturmax - dayz_temperaturmin));	// Normalise to [0,1]
_combatVal =	1 - dayz_combat; // May change later to be a range of red/green to loosely indicate 'time left in combat'

if (uiNamespace getVariable ['DZ_displayUI', 0] == 1) exitWith {
	_array = [_foodVal,_thirstVal];
	_array
};

_display = uiNamespace getVariable 'DAYZ_GUI_display';

_ctrlBlood = 	_display displayCtrl 1300;
_ctrlBleed = 	_display displayCtrl 1303;
_bloodVal =		r_player_blood / r_player_bloodTotal;
_ctrlFood = 	_display displayCtrl 1301;
_ctrlThirst = 	_display displayCtrl 1302;
_ctrlTemp 	= 	_display displayCtrl 1306;					//TeeChange
_ctrlEar = 		_display displayCtrl 1304;
_ctrlEye = 		_display displayCtrl 1305;
//_ctrlHumanity = _display displayCtrl 1207;
_ctrlCombat = _display displayCtrl 1307;
_ctrlFracture = 	_display displayCtrl 1203;

//Food/Water/Blood
_ctrlBlood ctrlSetTextColor 	[(Dayz_GUI_R + (0.3 * (1-_bloodVal))),(Dayz_GUI_G * _bloodVal),(Dayz_GUI_B * _bloodVal), 0.5];
_ctrlFood ctrlSetTextColor 		[(Dayz_GUI_R + (0.3 * (1-_foodVal))),(Dayz_GUI_G * _foodVal),(Dayz_GUI_B * _foodVal), 0.5];
_ctrlThirst ctrlSetTextColor 	[(Dayz_GUI_R + (0.3 * (1-_thirstVal))),(Dayz_GUI_G * _thirstVal),(Dayz_GUI_B * _thirstVal), 0.5];
_ctrlTemp ctrlSetTextColor 		[(Dayz_GUI_R + (0.3 * (1-_tempVal))), (Dayz_GUI_G * _tempVal), _tempVal, 0.5];	// Color ranges from iceblue (cold) to red (hot)
_ctrlCombat ctrlSetTextColor		[(Dayz_GUI_R + (0.3 * (1-_combatVal))),(Dayz_GUI_G * _combatVal),(Dayz_GUI_B * _combatVal), 0.5];

/*
	Blood: round((r_player_blood / 2) / 1000) = _bloodLvl (6 = full, 1 = empty)
	Thirst: round(_thirstVal / 0.25) = _thirstLvl (4 = full, 0 = empty)
	Hunger: round(_foodVal / 0.25) = _foodLvl (4 = full, 0 = empty)
	Temp: round(dayz_temperatur) = tempLvl (>= 36 = full <= 28 = empty)
*/

_blood = "";
_thirst = "";
_food = "";
_temp = "";
_tempImg = 0;
_bloodLvl = round((r_player_blood / 2) / 1000);
_thirstLvl = round(_thirstVal / 0.25);
_foodLvl = round(_foodVal / 0.25);
_tempLvl = round(dayz_temperatur);

/*
diag_log format["DEBUG: bloodlvl: %1 r_player_blood: %2 bloodval: %3",_bloodLvl, r_player_blood, _bloodVal];
diag_log format["DEBUG: thirstlvl: %1 dayz_thirst: %2 thirstval: %3",_thirstLvl, dayz_thirst, _thirstVal];
diag_log format["DEBUG: foodlvl: %1 dayz_hunger: %2 foodval: %3",_foodLvl, dayz_hunger, _foodVal];
diag_log format["DEBUG: templvl: %1 dayz_temperatur: %2 tempval: %3",_tempLvl, dayz_temperatur, _tempVal];
*/

if (_bloodLvl <= 0) then { 
	//_blood = "\z\addons\dayz_code\gui\status_blood_inside_1_ca.paa";
	_blood = "\z\addons\dayz_code\gui\status\status_blood_inside_1_ca.paa";
	} else {
	//_blood = "\z\addons\dayz_code\gui\status_blood_inside_" + str(_bloodLvl) + "_ca.paa";
	_blood = "\z\addons\dayz_code\gui\status\status_blood_inside_" + str(_bloodLvl) + "_ca.paa";
	};

if (_thirstLvl < 0) then { _thirstLvl = 0 };
//_thirst = "\z\addons\dayz_code\gui\status_thirst_inside_" + str(_thirstLvl) + "_ca.paa";
_thirst = "\z\addons\dayz_code\gui\status\status_thirst_inside_" + str(_thirstLvl) + "_ca.paa";

if (_foodLvl < 0) then { _foodLvl = 0 };
//_food = "\z\addons\dayz_code\gui\status_food_inside_" + str(_foodLvl) + "_ca.paa";
_food = "\z\addons\dayz_code\gui\status\status_food_inside_" + str(_foodLvl) + "_ca.paa";

if ( _tempLvl >= 36 )							then { _tempImg = 4 };
if ( _tempLvl > 33 and _tempLvl < 36 )			then { _tempImg = 3 };
if ( _tempLvl >= 30 and _tempLvl <= 33 )		then { _tempImg = 2 };
if ( _tempLvl > 28 and _tempLvl < 30 )			then { _tempImg = 1 };
if ( _tempLvl <= 28 )							then { _tempImg = 0 };

//_temp = "\z\addons\dayz_code\gui\status_temp_" + str(_tempImg) + "_ca.paa";
_temp = "\z\addons\dayz_code\gui\status\status_temp_" + str(_tempImg) + "_ca.paa";

_ctrlBlood ctrlSetText _blood;
_ctrlThirst ctrlSetText _thirst;
_ctrlFood ctrlSetText _food;
_ctrlTemp ctrlSetText _temp;

/*
	Visual:
*/
_visualtext = "";
    _visual = (round((dayz_disVisual / 100) * 4)) min 5;
//if (_visual > 0) then {_visualtext = "\z\addons\dayz_code\gui\val_" + str(_visual) + "_ca.paa"};
if (_visual > 0) then {_visualtext = "\z\addons\dayz_code\gui\status\val_" + str(_visual) + "_ca.paa"};
_ctrlEye ctrlSetText _visualtext;

/*
	Audible:
*/
_audibletext = "";
    _audible = (round((dayz_disAudial / 50) * 4)) min 5;
//if (_audible > 0) then {_audibletext = "\z\addons\dayz_code\gui\val_" + str(_audible) + "_ca.paa"};
if (_audible > 0) then {_audibletext = "\z\addons\dayz_code\gui\status\val_" + str(_audible) + "_ca.paa"};
_ctrlEar ctrlSetText _audibletext;

/*
	Fracture:
*/
if (!canStand player) then {
	if (!(ctrlShown _ctrlFracture)) then {
		r_fracture_legs = true;
		_ctrlFracture ctrlShow true;
	};
};

/*
	Flashing:
*/
if (_combatVal == 0) then {
	_ctrlCombat call player_guiControlFlash;
};

if (_bloodVal < 0.2) then {
	_ctrlBlood call player_guiControlFlash;
};

if (_thirstVal < 0.2) then {
	_ctrlThirst call player_guiControlFlash;
};

if (_foodVal < 0.2) then {
	_ctrlFood call player_guiControlFlash;
};

if (_tempVal > 0.8) then {	//TeeChange
	_ctrlTemp call player_guiControlFlash;
} else {
	_ctrlTemp ctrlShow true;
};

if (r_player_injured) then {
	_ctrlBleed call player_guiControlFlash;
};

/*
Opt-in tag system with friend tagging
*/
_targetControl = _display displayCtrl 1199;
_string = "";
_humanityTarget = cursorTarget;
if (!isNull _humanityTarget and isPlayer _humanityTarget and alive _humanityTarget) then {

	_distance = (player distance _humanityTarget);

	if (_distance < DZE_HumanityTargetDistance) then {
		
		_size = (1-(floor(_distance/5)*0.1)) max 0.1;

		// Display name if player opt-in or if friend
		_friendlies = player getVariable ["friendlies", []];
		_charID = player getVariable ["CharacterID", "0"];

		_rcharID = _humanityTarget getVariable ["CharacterID", "0"];
		_rfriendlies = _humanityTarget getVariable ["friendlies", []];
		_rfriendlyTo = _humanityTarget getVariable ["friendlyTo", []];
			
		if ((_rcharID in _friendlies) and (_charID in _rfriendlies)) then {

			if (!(_charID in _rfriendlyTo)) then {

				// diag_log format["IS FRIENDLY: %1", _player];
				_rfriendlyTo set [count _rfriendlyTo, _charID];
				_humanityTarget setVariable ["friendlyTo", _rfriendlyTo, true];
				
				// titleText [format[(localize "STR_EPOCH_ACTIONS_17"), (name _humanityTarget)], "PLAIN DOWN"];

			};
	
			// <br /><t %2 align='center' size='0.7'>Humanity: %3</t>

			_color = "color='#339933'";
			_string = format["<t %2 align='center' size='%3'>%1</t>",(name _humanityTarget),_color,_size];
		
		} else {

			// Humanity checks
			_humanity = _humanityTarget getVariable ["humanity",0];

			_color = "color='#ffffff'";
			if(_humanity < -5000) then {
				_color = "color='#ff0000'";
			} else {
				if(_humanity > 5000) then {
					_color = "color='#3333ff'";
				};
			};
			if(_humanityTarget getVariable ["DZE_display_name", false]) then {
				_string = format["<t %2 align='center' size='%3'>%1</t>",(name _humanityTarget),_color,_size];
			};
		};
	};
};

// update gui if changed
if (dayz_humanitytarget != _string) then {
	_targetControl ctrlSetStructuredText (parseText _string);
	dayz_humanitytarget = _string;
};

_array = [_foodVal,_thirstVal];
_array

The only thing I don't like is how small they appear now.  I will work on finding a way to increase their size to increase visibility and post an update once I'm successful.

 

Enjoy!  :)

Link to comment
Share on other sites

@mdswish

Thanks for the player_updateGUI.sqf  bud, that has saved me some work lol

 

This displays the new GUI icons fine, but there is no background behind them,

(also located in the pbo are the backgrounds, basically a dark background to sit behind the icons)

And try as I might I can not get these background images to appear correctly,

Also it seems that the borders do not appear, again these are located in the pbo

 

So one step closer, now we just need to find out where the backgrounds and borders should be called

and we are good to go.

 

I thank everyone for the help with this, and I hope that between us we can get this done.

 

Sp00neY

Link to comment
Share on other sites

/* bloodloss & bloodgain not implemented yet! */
/* cheers...  jOoPs */

private ["_display","_uiNumber","_ctrlWeight","_bloodText","_ctrlCombatBorder","_ctrlCombatBorder2","_ctrlBloodOuter","_ctrlFoodBorder","_ctrlThirstBorder","_ctrlTempBorder","_ctrlBlood","_ctrlBleed","_bloodVal","_ctrlFood","_ctrlThirst","_thirstVal","_foodVal","_ctrlTemp","_tempVal","_combatVal","_array","_ctrlEar","_ctrlEye","_ctrlCombat","_ctrlFracture","_visualText","_visual","_audibleText","_audible","_blood","_thirstLvl","_foodLvl","_tempImg","_thirst","_food","_temp","_bloodLvl","_tempLvl","_color","_string","_humanity","_size","_friendlies","_charID","_rcharID","_rfriendlies","_rfriendlyTo","_distance","_targetControl","_humanityTarget"];
disableSerialization;

_foodVal = 		1 - (dayz_hunger / SleepFood);
_thirstVal = 	1 - (dayz_thirst / SleepWater);
_tempVal 	= 	1 - ((dayz_temperatur - dayz_temperaturmin)/(dayz_temperaturmax - dayz_temperaturmin));	// Normalise to [0,1]
_combatVal =	1 - dayz_combat; // May change later to be a range of red/green to loosely indicate 'time left in combat'

if (uiNamespace getVariable ['DZ_displayUI', 0] == 1) exitWith {
	_array = [_foodVal,_thirstVal];
	_array
};

_display = uiNamespace getVariable 'DAYZ_GUI_display';

_ctrlBloodOuter = _display displayCtrl 1200;
_ctrlFoodBorder = _display displayCtrl 1201;
_ctrlThirstBorder = _display displayCtrl 1202;
_ctrlTempBorder = _display displayCtrl 1208;
_ctrlCombatBorder = _display displayCtrl 1207; 
_ctrlCombatBorder2 = _display displayCtrl 1211; 


//Border white
_ctrlBloodOuter ctrlSetTextColor [1,1,1,1];
_ctrlFoodBorder ctrlSetTextColor [1,1,1,1];
_ctrlThirstBorder ctrlSetTextColor [1,1,1,1];
_ctrlTempBorder ctrlSetTextColor [1,1,1,1];
_ctrlCombatBorder ctrlSetTextColor [1,1,1,1]; 
_ctrlCombatBorder2 ctrlSetTextColor [1,1,1,1]; 

_ctrlBlood = 	_display displayCtrl 1300;
_ctrlBleed = 	_display displayCtrl 1303;
_bloodVal =		r_player_blood / r_player_bloodTotal;
_ctrlFood = 	_display displayCtrl 1301;
_ctrlThirst = 	_display displayCtrl 1302;
_ctrlTemp 	= 	_display displayCtrl 1306;					//TeeChange
_ctrlEar = 		_display displayCtrl 1304;
_ctrlEye = 		_display displayCtrl 1305;
//_ctrlHumanity = _display displayCtrl 1207;
_ctrlCombat = _display displayCtrl 1307;
_ctrlFracture = 	_display displayCtrl 1203;

//only show the weight-icon if R3F-weight-system is running ;)
if (DZE_R3F_WEIGHT) then {
	_ctrlWeight = 	_display displayCtrl 1210;
};

//Food/Water/Blood
_ctrlBlood ctrlSetTextColor [(Dayz_GUI_R + (0.3 * (1-_bloodVal))),(Dayz_GUI_G * _bloodVal),(Dayz_GUI_B * _bloodVal), 1];
_ctrlFood ctrlSetTextColor [(Dayz_GUI_R + (0.3 * (1-_foodVal))),(Dayz_GUI_G * _foodVal),(Dayz_GUI_B * _foodVal), 1];
_ctrlThirst ctrlSetTextColor [(Dayz_GUI_R + (0.3 * (1-_thirstVal))),(Dayz_GUI_G * _thirstVal),(Dayz_GUI_B * _thirstVal), 1];
_ctrlTemp ctrlSetTextColor [(Dayz_GUI_R + (0.3 * (1-_tempVal))), (Dayz_GUI_G * _tempVal), _tempVal, 1];	// Color ranges from iceblue (cold) to red (hot) // << Already Done :)
_ctrlCombat ctrlSetTextColor		[(Dayz_GUI_R + (0.3 * (1-_combatVal))),(Dayz_GUI_G * _combatVal),(Dayz_GUI_B * _combatVal), 0.5];

/*
	Blood: round((r_player_blood / 2) / 1000) = _bloodLvl (6 = full, 1 = empty)
	Thirst: round(_thirstVal / 0.25) = _thirstLvl (4 = full, 0 = empty)
	Hunger: round(_foodVal / 0.25) = _foodLvl (4 = full, 0 = empty)
	Temp: round(dayz_temperatur) = tempLvl (>= 36 = full <= 28 = empty)
*/

_blood = "";
_thirst = "";
_food = "";
_temp = "";
_tempImg = 0;
_bloodLvl = round((r_player_blood / 2) / 1000);
_thirstLvl = round(_thirstVal / 0.25);
_foodLvl = round(_foodVal / 0.25);
_tempLvl = round(dayz_temperatur);

_bloodText = "\z\addons\dayz_code\gui\status\status_blood_border";
if (r_player_infected) then { _bloodText = _bloodText + "_sick_ca.paa"; }
else { _bloodText = _bloodText + "_CA.paa"; };
_ctrlBloodOuter ctrlSetText _bloodText;


if (_bloodLvl <= 0) then {
	_blood = "\z\addons\dayz_code\gui\status\status_blood_inside_1_ca.paa";
} else {
	_blood = "\z\addons\dayz_code\gui\status\status_blood_inside_" + str(_bloodLvl) + "_ca.paa";
};

if (_thirstLvl < 0) then { _thirstLvl = 0 };
_thirst = "\z\addons\dayz_code\gui\status\status_thirst_inside_" + str(_thirstLvl) + "_ca.paa";

if (_foodLvl < 0) then { _foodLvl = 0 };
_food = "\z\addons\dayz_code\gui\status\status_food_inside_" + str(_foodLvl) + "_ca.paa";

switch true do {
	case (_tempLvl >= 36): { _tempImg = 4 };
	case (_tempLvl > 33 and _tempLvl < 36): { _tempImg = 3 };
	case (_tempLvl >= 30 and _tempLvl <= 33): { _tempImg = 2 };
	case (_tempLvl > 28 and _tempLvl < 30): { _tempImg = 1 };
	default { _tempImg = 0 };
};


_temp = "\z\addons\dayz_code\gui\status\status_temp_" + str(_tempImg) + "_ca.paa";

_ctrlBlood ctrlSetText _blood;
_ctrlThirst ctrlSetText _thirst;
_ctrlFood ctrlSetText _food;
_ctrlTemp ctrlSetText _temp;

// Visual:
_visual = (dayz_disVisual / 185) min 1;
if (_visual < 0.2) then {_visual = 0.2;};
_ctrlEye  ctrlSetTextColor [1, 1, 1, _visual];

// Audible
_audible = (dayz_disAudial / 40) min 1;
if (_audible < 0.2) then {_audible = 0.2;};
_ctrlEar ctrlSetTextColor [1, 1, 1, _audible];

//Fracture
if (!canStand player) then {
	if (!(ctrlShown _ctrlFracture)) then {
		r_fracture_legs = true;
		_ctrlFracture ctrlShow true;
	};
};

//	Flashing
if (_combatVal == 0) then { _ctrlCombat call player_guiControlFlash; };
if (_bloodVal < 0.2) then { _ctrlBlood call player_guiControlFlash; };
if (_thirstVal < 0.2) then { _ctrlThirst call player_guiControlFlash; };
if (_foodVal < 0.2) then { _ctrlFood call player_guiControlFlash; };
if (_tempVal > 0.8) then { _ctrlTemp call player_guiControlFlash; } else { _ctrlTemp ctrlShow true; };
if (r_player_injured) then { _ctrlBleed call player_guiControlFlash; };

//only show the weight-icon if R3F-weight-system is running ;)
if (DZE_R3F_WEIGHT) then {
	if (R3F_Weight < 125) then {
		_ctrlWeight ctrlShow false;
	} else {
		if (R3F_Weight > 250) then {
			_ctrlWeight call player_guiControlFlash;
		} else {
			_ctrlWeight ctrlShow true;
		};
	};
};

/*
Opt-in tag system with friend tagging
*/
_targetControl = _display displayCtrl 1199;
_string = "";
_humanityTarget = cursorTarget;
if (!isNull _humanityTarget and isPlayer _humanityTarget and alive _humanityTarget) then {

	_distance = (player distance _humanityTarget);

	if (_distance < DZE_HumanityTargetDistance) then {
		
		_size = (1-(floor(_distance/5)*0.1)) max 0.1;

		// Display name if player opt-in or if friend
		_friendlies = player getVariable ["friendlies", []];
		_charID = player getVariable ["CharacterID", "0"];

		_rcharID = _humanityTarget getVariable ["CharacterID", "0"];
		_rfriendlies = _humanityTarget getVariable ["friendlies", []];
		_rfriendlyTo = _humanityTarget getVariable ["friendlyTo", []];
			
		if ((_rcharID in _friendlies) and (_charID in _rfriendlies)) then {

			if (!(_charID in _rfriendlyTo)) then {

				// diag_log format["IS FRIENDLY: %1", _player];
				_rfriendlyTo set [count _rfriendlyTo, _charID];
				_humanityTarget setVariable ["friendlyTo", _rfriendlyTo, true];
				
				// titleText [format[(localize "STR_EPOCH_ACTIONS_17"), (name _humanityTarget)], "PLAIN DOWN"];

			};
	
			// <br /><t %2 align='center' size='0.7'>Humanity: %3</t>

			_color = "color='#339933'";
			_string = format["<t %2 align='center' size='%3'>%1</t>",(name _humanityTarget),_color,_size];
		
		} else {

			// Humanity checks
			_humanity = _humanityTarget getVariable ["humanity",0];

			_color = "color='#ffffff'";
			if(_humanity < -5000) then {
				_color = "color='#ff0000'";
			} else {
				if(_humanity > 5000) then {
					_color = "color='#3333ff'";
				};
			};
			if(_humanityTarget getVariable ["DZE_display_name", false]) then {
				_string = format["<t %2 align='center' size='%3'>%1</t>",(name _humanityTarget),_color,_size];
			};
		};
	};
};

// update gui if changed
if (dayz_humanitytarget != _string) then {
	_targetControl ctrlSetStructuredText (parseText _string);
	dayz_humanitytarget = _string;
};

_array = [_foodVal,_thirstVal];
_array

^^ dayz_code\compile\player_updateGui.sqf

 

-------

 

/* modified for private usage */
/* cheers... jOoPs */
	class playerStatusGUIcustom {
		idd = 6900;
		movingEnable = 0;
		duration = 100000;
		name = "statusBorder";
		onLoad = "uiNamespace setVariable ['DAYZ_GUI_display', _this select 0];";
		class ControlsBackground {
                       class RscStructuredText_1199: RscStructuredText
                       {
                                idc = 1199;
                                text = "";
                                x = 0.250001;
                                y = 0.350001;
                                w = 0.5;
                                h = 0.1;
                        };
			class RscPicture_1901: RscPictureGUI
			{
				idc = 1901;
				text = "\z\addons\dayz_code\gui\status\status_bg.paa";
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.79 * safezoneH + safezoneY;//2
				w = 0.075;
				h = 0.10;
			};
			class RscPicture_1201: RscPictureGUI
			{
				idc = 1201;
				text = "\z\addons\dayz_code\gui\status\status_thirst_border_ca.paa";
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.79 * safezoneH + safezoneY;//2
				w = 0.075;
				h = 0.10;
			};

			class RscPicture_1900: RscPictureGUI
			{
				idc = 1900;
				text = "\z\addons\dayz_code\gui\status\status_bg.paa";
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.86 * safezoneH + safezoneY; //3
				w = 0.075;
				h = 0.10;
			};
			class RscPicture_1200: RscPictureGUI
			{
				idc = 1200;
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.86 * safezoneH + safezoneY; //3
				w = 0.075;
				h = 0.10;
			};

			class RscPicture_1902: RscPictureGUI
			{
				idc = 1902;
				text = "\z\addons\dayz_code\gui\status\status_bg.paa";
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.93 * safezoneH + safezoneY; //1
				w = 0.075;
				h = 0.10;
			};
			class RscPicture_1202: RscPictureGUI
			{
				idc = 1202;
				text = "\z\addons\dayz_code\gui\status\status_food_border_ca.paa";
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.93 * safezoneH + safezoneY; //1
				w = 0.075;
				h = 0.10;
			};

			class RscPicture_1908: RscPictureGUI
			{
				idc = 1908;
				text = "\z\addons\dayz_code\gui\status\status_bg.paa";
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.72 * safezoneH + safezoneY; //3
				w = 0.075;
				h = 0.10;
			};
			class RscPicture_1208: RscPictureGUI
			{
				idc = 1208;
				text = "\z\addons\dayz_code\gui\status\status_temp_outside_ca.paa";
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.72 * safezoneH + safezoneY; //3
				w = 0.075;
				h = 0.10;
			};
		
			class RscPicture_1203: RscPictureGUI
			{
				idc = 1203;
				text = "\z\addons\dayz_code\gui\status\status_effect_brokenleg.paa";
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.58 * safezoneH + safezoneY;
				w = 0.075;
				h = 0.10;
				colorText[] = {1,1,1,1};
			};

			class RscPicture_1204: RscPictureGUI
			{
				idc = 1204;
				text = "\z\addons\dayz_code\gui\status\status_connection_ca.paa";
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.44 * safezoneH + safezoneY;
				w = 0.075;
				h = 0.10;
				colorText[] = {1,1,1,1};
			};

			class RscPicture_1205: RscPictureGUI
			{
				idc = 1205;
				text = "\z\addons\dayz_code\gui\status\status_bg.paa";
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.30 * safezoneH + safezoneY;
				w = 0.075;
				h = 0.10;
			};
			class RscPicture_1206: RscPictureGUI
			{
				idc = 1206;
				text = "\z\addons\dayz_code\gui\status\status_bg.paa";
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.37 * safezoneH + safezoneY;
				w = 0.075;
				h = 0.10;
			};
			class RscPicture_1207: RscPictureGUI
			{
				idc = 1207;
				text = "\z\addons\dayz_code\gui\status\status_bg.paa";
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.65 * safezoneH + safezoneY;
				w = 0.075;
				h = 0.10;
			};

			class RscPicture_1210: RscPictureGUI
			{
				idc = 1210;
				text = "\z\addons\dayz_code\gui\status\status_effect_weight.paa";
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.51 * safezoneH + safezoneY;
				w = 0.075;
				h = 0.10;
				colorText[] = {1,1,1,1};
			};

			class RscPicture_1211: RscPictureGUI
			{
				idc = 1211;
				text = "\z\addons\dayz_code\gui\status\status_combat_border_CA.paa";
				x = 0.956813 * safezoneW + safezoneX;
				y = 0.6502 * safezoneH + safezoneY;
				w = 0.06;
				h = 0.08;
			};
		};

		class Controls {
			class RscPicture_1301: RscPictureGUI
			{
				idc = 1301;
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.93 * safezoneH + safezoneY;
				w = 0.075;
				h = 0.10;
			};
			class RscPicture_1300: RscPictureGUI
			{
				idc = 1300;
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.86 * safezoneH + safezoneY;
				w = 0.075;
				h = 0.10;
			};
			class RscPicture_1302: RscPictureGUI
			{
				idc = 1302;
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.79 * safezoneH + safezoneY;
				w = 0.075;
				h = 0.10;
			};
			class RscPicture_1306: RscPictureGUI
			{
				idc = 1306;
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.72 * safezoneH + safezoneY;
				w = 0.075;
				h = 0.10;
			};
			class RscPicture_1307: RscPictureGUI
			{
				idc = 1307;
				text = "\z\addons\dayz_code\gui\status\status_combat_inside_ca.paa";
				x = 0.956813 * safezoneW + safezoneX;
				y = 0.6502 * safezoneH + safezoneY;
				w = 0.06;
				h = 0.08;
			};
			class RscPicture_1303: RscPictureGUI
			{
				idc = 1303;
				text = "\z\addons\dayz_code\gui\status\status_bleeding_ca.paa";
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.86 * safezoneH + safezoneY;
				w = 0.075;
				h = 0.10;
				colorText[] = {1,1,1,0.5};
			};
			class RscPicture_1304: RscPictureGUI
			{
				idc = 1304;
				text = "\z\addons\dayz_code\gui\status\status_noise.paa";
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.30 * safezoneH + safezoneY;
				w = 0.075;
				h = 0.10;
			};
			class RscPicture_1305: RscPictureGUI
			{
				idc = 1305;
				text = "\z\addons\dayz_code\gui\status\status_visible.paa";
				x = 0.955313 * safezoneW + safezoneX;
				y = 0.37 * safezoneH + safezoneY;
				w = 0.075;
				h = 0.10;
			};
		};
	};

 

^^ RscPlayerUI.hpp (include it your description.ext) (new classname now: "playerStatusGUIcustom")

 

----

 

private["_state"];
disableSerialization;
_state = uiNamespace getVariable ['DZ_displayUI', 0];

// Hard code the GUI on and the Debug Monitor off
if (dayzState != 0) then {
	3 cutRsc ["playerStatusGUIcustom", "PLAIN",0];
	//Update GUI
	call player_updateGui;
	call ui_initDisplay;
	hintSilent "";
};
dayzDebug = false;

/*
switch (_state) do {
	case 0: {
		if (dayzState != 0) then {
			3 cutRsc ["playerStatusGUI", "PLAIN",0];
			//Update GUI
			call player_updateGui;
			call ui_initDisplay;
			hintSilent "";
		};
		dayzDebug = false;
	};
	case 1: {
		if (dayzState != 1) then {
			3 cutRsc ["playerStatusGUI", "PLAIN",0];
			//Update GUI
			call player_updateGui;
			call ui_initDisplay;
		};
		dayzDebug = true;
	};
	case 2: {
		if (dayzState != 2) then {
			3 cutRsc ["default", "PLAIN",0];
			hintSilent "";
		};
		dayzDebug = false;
	};
};
dayzState = _state;
*/

 

^^ dayz_code\compile\ui_changeDisplay.sqf

 

----

 

in "dayz_code\system\player_monitor.fsm" search for "playerStatusGUI" and replace it with "playerStatusGUIcustom"

 

now change the pathes of "ui_changeDisplay.sqf" and "player_updateGui.sqf" in your custom-"compiles.sqf"

in your mission init.sqf change the path to your modified "player_monitor.fsm"

 

cheers

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
  • Advertisement
×
×
  • Create New...