Jump to content

[HOWTO] Adding a player statusBar


piX

Recommended Posts

EPOCH_playerCrypto

 

gives me a value of 'any'  when i have krypto on my player.

 

Anyone else experiencing this?

((uiNamespace getVariable "osefStatusBar")displayCtrl 1000)ctrlSetText format["DAMAGE: %1 | STAMINA: %2 | HUNGER: %3 | THIRST: %4 | KRYPTO: %5 | ", damage player, EPOCH_playerStamina, EPOCH_playerHunger, EPOCH_playerThirst, EPOCH_playerCrypto];
Link to comment
Share on other sites

Is there a way you can take out the restart time on the bar??

Yes, remove the text and remove the variable that defines it

 

 

EPOCH_playerCrypto

 

gives me a value of 'any'  when i have krypto on my player.

 

Anyone else experiencing this?

((uiNamespace getVariable "osefStatusBar")displayCtrl 1000)ctrlSetText format["DAMAGE: %1 | STAMINA: %2 | HUNGER: %3 | THIRST: %4 | KRYPTO: %5 | ", damage player, EPOCH_playerStamina, EPOCH_playerHunger, EPOCH_playerThirst, EPOCH_playerCrypto];

Weird, share your whole file... but that should be fine. How does it look in your debug menu? Does it display or is it the same?

 

 

The OP's version is retarded and broken, good luck

Link to comment
Share on other sites

19.01.2015 00:46:29: PLAYERNAME (IP:PORT) GUID - #20 "4654.62,9593.63,0] nearestObject 145260) setDamage 1;
}; 


[] execVM "scripts\fn_statusBar.sqf";"

I keep getting this and I have added the exception on line 21:

7 exec !="<execute expression=" !"RscDebugConsole_execute" !"execFSM" !"_executeStackedEventHandler" !"fn_execVM" !"fn_moduleExecute" !"fn_execRemote" !"fn_MPexec" !"bis_fnc_moduleExecute_activate" !"fn_tridentExecute" !"randomize" !"executed from" !"EPOCH_DebugGUI_exec" !"_handle = [_display] execVM _script;" !"execVM \"\A3\Structures_F\scripts" !="execVM \"\A3\Structures_F_EPC\Civ\PlayGround\scripts\Carousel_spin.sqf\"" !"if (isServer) then {[] execVM 'run.sqf';};" !"preprocessfilelinenumbers \"A3\ui_f\scripts\initDisplay.sqf\";execVM \"\x\addons\a3_epoch_code\system\dummy.sqf\"},{[\"onUnload\",_t" !="(_this select 0) execVM \"\A3\Soft_F_Bootcamp\Offroad_01\scripts\repair_init.sqf\"" !="fn_Exec" !="execVM \"\MPMissions\epoch.Altis\scripts\fn_statusBar.sqf\""

Not sure what is wrong... Help is greatly appreciated

Link to comment
Share on other sites

19.01.2015 00:46:29: PLAYERNAME (IP:PORT) GUID - #20 "4654.62,9593.63,0] nearestObject 145260) setDamage 1;
}; 


[] execVM "scripts\fn_statusBar.sqf";"

I keep getting this and I have added the exception on line 21:

7 exec !="<execute expression=" !"RscDebugConsole_execute" !"execFSM" !"_executeStackedEventHandler" !"fn_execVM" !"fn_moduleExecute" !"fn_execRemote" !"fn_MPexec" !"bis_fnc_moduleExecute_activate" !"fn_tridentExecute" !"randomize" !"executed from" !"EPOCH_DebugGUI_exec" !"_handle = [_display] execVM _script;" !"execVM \"\A3\Structures_F\scripts" !="execVM \"\A3\Structures_F_EPC\Civ\PlayGround\scripts\Carousel_spin.sqf\"" !"if (isServer) then {[] execVM 'run.sqf';};" !"preprocessfilelinenumbers \"A3\ui_f\scripts\initDisplay.sqf\";execVM \"\x\addons\a3_epoch_code\system\dummy.sqf\"},{[\"onUnload\",_t" !="(_this select 0) execVM \"\A3\Soft_F_Bootcamp\Offroad_01\scripts\repair_init.sqf\"" !="fn_Exec" !="execVM \"\MPMissions\epoch.Altis\scripts\fn_statusBar.sqf\""

Not sure what is wrong... Help is greatly appreciated

 

 

Is you server Altis?

Link to comment
Share on other sites

Just tried and EPOCH_playerBank returns a value of "any". Tried interacting (deposit/withdrawal) with an ATM to see if that would trigger an update, but no luck.

 

EPOCH_bankBalance works for me.  It will show "0" until you interact with the ATM, then it will show your bank balance.

Link to comment
Share on other sites

EPOCH_bankBalance works for me.  It will show "0" until you interact with the ATM, then it will show your bank balance.

 

I think I tried EPOCH_bankBalance after EPOCH_playerBank. Guess I forgot to interact with an ATM then. Probably saw the 0 and was lazy and decided to drop it. Good to know though  :)

Link to comment
Share on other sites

 

I would like to move this to the top of the screen how would you do that


Darth has a good explanation here:

 

In statusBar.hpp play with these values:

class statusBarText {
			idc = 1000;
			x = safezoneX + safezoneW - 2.0;
			y = safezoneY + safezoneH - 0.04;
			w = 1.25;
			h = 0.04;

the x value is left and right.  A higher value moves it all further to the left

 

the w value is how wide the bar is.  A higher value will give you more room to add stuff

 

When you change the width you will also have to change the left/right values to keep it centered.  You'll just have to play with it until you get it how you want.

Link to comment
Share on other sites

Just a quick Question I want to add a percent sign on the end of the Hunger Thirst and Damage but i cant figure out how to add the %   Here is what I have and the math works but yeah....

((uiNamespace getVariable "osefStatusBar")displayCtrl 1000) ctrlSetText format["FPS: %1 | PLAYERS: %2 | DAMAGE: %3 | KRYPTO: %4 | HUNGER: %5 | THIRST: %6 | GRIDREF: %7 | RESTART IN: %8:%9", round diag_fps, count playableUnits, ((damage player - 1) * -100), EPOCH_playerCrypto, (EPOCH_playerHunger / 5000 * 100), (EPOCH_playerThirst / 2500 * 100), mapGridPosition player, _hours, _minutes, _counter];

Thanks! 

Link to comment
Share on other sites

I dont know if this kind of math works, but try 

((EPOCH_playerHunger / 5000( * 100), ((EPOCH_playerThirst / 2500) * 100),

Just an idea

Greez

 

Well the math isnt the problem i just cant get the percent sign after it to show up... like using % or "%" ...etc... not sure if i have to use a code or something for it

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...