Jump to content

piX

Member
  • Posts

    24
  • Joined

  • Last visited

Posts posted by piX

  1. Is there any way to make this show no decimal places? I have taken out restart time and added stamina but it has like 10 decimal places in it and it makes the bar go off center or off screen for some people.

     

    waitUntil {!(isNull (findDisplay 46))};

    disableSerialization;

    /*

        File: fn_statusBar.sqf

        Author: Osef (Ported to EpochMod by piX)

        Edited by: [piX]

        Description: Puts a small bar in the bottom centre of screen to display in-game information

        

        PLEASE KEEP CREDITS - THEY ARE DUE TO THOSE WHO PUT IN THE EFFORT!

    */

    _rscLayer = "osefStatusBar" call BIS_fnc_rscLayer;

    _rscLayer cutRsc["osefStatusBar","PLAIN"];

    systemChat format["statusBar Loading player info...", _rscLayer];

    [] spawn {

        sleep 5;

        _counter = 180;

        _timeSinceLastUpdate = 0;

        while {true} do

        {

            sleep 1;

            _counter = _counter - 1;

            _time = (round(180-(serverTime)/60));  //edit the '240' (60*4=240) to change the countdown timer if your server restarts are shorter or longer than 4 hour intervals

            _hours = (floor(_time/60));

            _minutes = (_time - (_hours * 60));

            

            switch(_minutes) do

        {

            case 9: {_minutes = "09"};

            case 8: {_minutes = "08"};

            case 7: {_minutes = "07"};

            case 6: {_minutes = "06"};

            case 5: {_minutes = "05"};

            case 4: {_minutes = "04"};

            case 3: {_minutes = "03"};

            case 2: {_minutes = "02"};

            case 1: {_minutes = "01"};

            case 0: {_minutes = "00"};

        };

            

            ((uiNamespace getVariable "osefStatusBar")displayCtrl 1000)ctrlSetText format["FPS: %1 | PLAYERS: %2 | DAMAGE: %3 | KRYPTO: %4 | HUNGER: %5 | THIRST: %6 | STAMINA: %7 | GRIDREF: %8", round diag_fps, count playableUnits, damage player, EPOCH_playerCrypto, EPOCH_playerHunger, EPOCH_playerThirst, EPOCH_playerStamina, mapGridPosition player, _counter];

        };

    };

    As far as I know, No.

  2.  

    I can't seem to get the status bar to show up, is it not compatible anymore orrrrrr?

     

     

    It is still compatible, my friend. Have had no issues with it. Go through the Tutorial once more, make sure everything is done correctly. If you still cant get it to work, throw me a PM and I will help you out :)

  3. Restart time vanishes because the info is to wide for the bar :)

    Get your damage 0, # of players 1 and you'll see that restart time appears again.

    It needs a fix :)

    From what I can tell, Santa is correct. Nothing is preventing the statusBar from updating. So it is something to do with the text spacing etc.

     

    I suggest changing the Style from 2 to 0.

     

    So it should look like this:

                            size = 0.03;
    			type = 13;
    			style = 0; // change to zero
    			text="Loading statusBar...";
    
  4. i have added this line but the same thing happend

    I have added the provided filters to my Server - I have had absolutely no issues with BattlEye.

     Id suggest checking over the filters, making sure they are all spelt correctly/implemented in the correct part of the file.

     

    IF you have put the scripts in different folders within your mission file, then the BattlEye Filters will need to reflect that.

     

    i.e

    !="execVM \"\MPMissions\epoch.altis\(custom folder)\fn_statusBar.sqf\""
    
  5. ((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, EPOCH_playerCrypto, EPOCH_playerHunger, EPOCH_playerThirst, mapGridPosition player, _hours, _minutes, _counter];
    

    In this line. REMOVE the GRIDREF: %7 and mapGridPosition player. Replace the RESTART IN: %8:%9 with %7:%8. So it should look like this..

    ((uiNamespace getVariable "osefStatusBar")displayCtrl 1000)ctrlSetText format["FPS: %1 | PLAYERS: %2 | DAMAGE: %3 | KRYPTO: %4 | HUNGER: %5 | THIRST: %6 | RESTART IN: %7:%8", round diag_fps, count playableUnits, damage player, EPOCH_playerCrypto, EPOCH_playerHunger, EPOCH_playerThirst, _hours, _minutes, _counter];
    
  6. Sorry for the lack of response guys. Had a pretty big new years :P

     

    For some reason cannot get it to show up? My server files did not have a description.ext so I added the one provided. 

     It is in your mission files bud, not the server files. So, usually located in the mpmissions folder. Some providers customize the name of that folder to something else. Edit the init.sqf and description.ext in there ;)

     

     

    I apologize ahead of time as I am new to this that and in case my resolution seems obvious, that is why.

    As blckeagls pointed out to me(thanks for the help btw) depending on your hosting provider, you may need to deploy the mission and scripts a certain way.

    For us, on our dedicated server, we are running custom mission files (pbo's).  I had to package, the init.sqf, description.ext and scripts folder in with my mission.pbo file.

    Mission file looks like this:
    epoch.altis.pbo

     init.sqf

     description.ext
     mission.sqm
     scripts/fn_statusBar.sqf(scripts = a directory/folder containing fn_statusBar.sqf)

    Init.sql file:  As you can see [] execVM "scripts\fn_statusBar.sqf"; was added at the bottom.

    
    if(isDedicated)exitWith{}; //Everything below this line is only executed on the client (player or local host)
    
    //Wait until these variables are broadcasted to the client (usually happens before the init gets executed)
    waitUntil{!isNil {SEM_removeWeaponsFromDeadAI}};
    waitUntil{!isNil {SEM_removeMagazinesFromDeadAI}};
    //diag_log format["#SEM DEBUG: variables received: Weapons %1 - Magazines %2", SEM_removeWeaponsFromDeadAI, SEM_removeMagazinesFromDeadAI];
    
    
    fn_createMissionMarker = {	private["_create","_markerPos","_markerName","_marker"];
    	_create = _this select 0;
    	
    	if(!_create)then[{	//delete marker
    		if (getMarkerColor "MissionMarker" != "")then{	//Only delete existing Marker
    			deleteMarkerLocal "MissionMarker";
    		}; 
    	},{	//else create marker
    	_markerPos = _this select 1;
    	_markerName = _this select 2;
    	
    	_marker = createMarkerLocal ["MissionMarker", _markerPos];
    	_marker setMarkerPosLocal _markerPos;
    	_marker setMarkerTypeLocal "hd_destroy";  
    	_marker setMarkerTextLocal format["%1",_markerName];  
    	_marker setMarkerColorLocal "ColorRed";
    	_marker setMarkerDirLocal -37;
    	_marker setMarkerSizeLocal [0.8,0.8];
    	}];
    };
    
    fn_AIaddKilledEH = {
    	if(isPlayer _this || !local _this)exitWith{systemChat "NEIN!"};
    
    	call compile format["
    		_this addEventHandler ['Fired',{
    			if(_this select 2 in %1)then{
    				_this select 0 addMagazines [_this select 5, 1];
    			};
    		}];
    
    		_this addEventHandler ['Killed',{ private ['_unit','_z'];
    			_unit = _this select 0;
    			removeBackpackGlobal _unit;
    			{_unit removeWeaponGlobal _x}count (%1 + ['EpochRadio0','ItemMap','ItemRadio','ItemWatch','ItemCompass','ItemGPS']);
    			{if(_x in (magazines _unit))then{_unit removeMagazines _x}}count %2;
    			
    			_unit spawn{
    				sleep 1;
    				{
    				_z = _x;
    				if(_x in (getweaponcargo _z))then{deleteVehicle _z}count %1;
    				if(_x in (getmagazinecargo _z))then{deleteVehicle _z}count %2;
    				}forEach nearestObjects [(getPos _this), ['GroundWeaponHolder','WeaponHolderSimulated','WeaponHolder'], 12];
    			};
    		}];
    	", SEM_removeWeaponsFromDeadAI, SEM_removeMagazinesFromDeadAI];
    };
    
     /* DO NOT CALL "fn_animateAI" because the sleep commands will cause errors when used in a non-scheduled environment */
    fn_animateAI = {	private["_group","_pos","_checkPos","_firstLoop","_nearPlayers","_doMove","_dir","_dist","_posX","_posY","_oldPos","_newPos","_z"];
    	_group = _this select 0;
    	_pos = _this select 1;
    	_checkPos = _pos; _checkPos set [2,2];
    	
    	waitUntil{{owner _x == owner player}forEach units _group};	//Wait until the server gives You the ownership of the AI
    	diag_log format["#SEM: Client taking over AI ownership at Pos %1, Distance %2", _pos, (vehicle player) distance _pos];
    
    	{
    	_x call fn_AIaddKilledEH;
    	_x enableAI "AUTOTARGET";
    	//_x enableAI "TARGET";
    	_x enableAI "MOVE";
    	_x enableAI "ANIM";
    	_x enableAI "FSM";
    	_x stop false;
    	_x setUnitPos "Auto";
    	}count units _group;
    	_group setCombatMode "YELLOW";
    	_group setBehaviour "COMBAT"; //"AWARE";
    
    	//waitUntil{{alive _x}count units _group < 1 || ({owner _x != owner player}forEach units _group)};
    	
    	while{{alive _x}count units _group > 0 && ({owner _x == owner player}forEach units _group)}do{
    		_nearPlayers = _pos nearEntities [["Epoch_Man_base_F","Epoch_Female_base_F","Helicopter","Car","Motorcycle"], 1200];	//"Epoch_Man_base_F","Epoch_Female_base_F"
    		{if(alive _x && isPlayer _x)then{	if(!(terrainIntersect [_checkPos, [(getPosATL _x) select 0, (getPosATL _x) select 1, ((getPosATL _x) select 2) + 1]]))then{
    			_z = _x; _group reveal _z;
    			{if((secondaryWeapon _x) == "")then{
    				_x doWatch _z; _x doTarget _z;
    				_x commandFire _z; _x suppressFor 10;
    			}}count units _group;
    			UIsleep (10+(random 10));
    		}}}forEach _nearPlayers;
    	UIsleep 3;
    	};
    	
    	diag_log format["#SEM: AI ownership lost - Remaining AIs: %1", count units _group];
    };
    
    "GlobalHint" addPublicVariableEventHandler { private "_sound";
    	_sound = (_this select 1) select 0;
    	switch(_sound)do{
    		case 0:{playSound "UAV_05"}; //Mission start
    		case 1:{playSound "UAV_01"}; //Mission fail (object destroyed)
    		case 2:{playSound "UAV_04"}; //Mission fail (time out)
    		case 3:{playsound "UAV_03"}; //Mission success
    	};
    	hint parseText format["%1", (_this select 1) select 1]
    };
    
    if(!isNil "GlobalMissionMarker")then{GlobalMissionMarker call fn_createMissionMarker};
    "GlobalMissionMarker" addPublicVariableEventHandler {_this select 1 call fn_createMissionMarker};
    
    if(!isNil "takeAIownership")then{takeAIownership call fn_animateAI};
    "takeAIownership" addPublicVariableEventHandler {_this select 1 spawn fn_animateAI}; //DO NOT CALL!
    
    if(toLower worldName in ["chernarus","chernarus_summer"])then{
    	([4654.62,9593.63,0] nearestObject 145259) setDamage 1;
    	([4654.62,9593.63,0] nearestObject 145260) setDamage 1;
    };	//Fix for something, find out ;)
    
    
    [] execVM "scripts\fn_statusBar.sqf";
    

    description.ext:  Instead of referencing the file that holds the code for the status bar with #include "dialog\statusBar.hpp" I added the code in statusBar.hpp to the description.ext file.  See below.
     

    author = "Epoch Mod Team";
    class Header
    {
     gameType = Sandbox;
     minPlayers = 1;
     maxPlayers = 100;
    };
    respawn = "BASE";
    respawnDelay = 600;
    respawnDialog = 0;
    
    onLoadMission= "Epoch";
    OnLoadIntro = "Welcome to Epoch Mod";
    loadScreen = "\x\addons\a3_epoch_assets\pictures\loadScreen_ca.paa"; 
    OnLoadIntroTime = False;
    OnLoadMissionTime = False;
    onLoadName = "Epoch Mod";
    disabledAI = true;
    scriptedPlayer = 1;
    disableChannels[]={0,1,2,6};
    enableItemsDropping = 0;
    briefing = 0;
    debriefing = 0;
    enableDebugConsole = 0;
    joinUnassigned = 0;
    respawnOnStart = 0;
    forceRotorLibSimulation = 1;
    
    corpseManagerMode = 1;
    corpseLimit = 10;
    corpseRemovalMinTime = 1200;
    corpseRemovalMaxTime = 3600;
    
    wreckManagerMode = 1;
    wreckLimit = 2;
    wreckRemovalMinTime = 60;
    wreckRemovalMaxTime = 360;
    
    class CfgRemoteExecCommands {};
    class RscTitles
    {
    	#define ST_RIGHT 0x01
    
    	class osefStatusBar {
    		idd = -1;
    		onLoad = "uiNamespace setVariable ['osefStatusBar', _this select 0]";
    		onUnload = "uiNamespace setVariable ['osefStatusBar', objNull]";
    		onDestroy = "uiNamespace setVariable ['osefStatusBar', objNull]";
    		fadein = 0;
    		fadeout = 0;
    		duration = 10e10;
    		movingEnable = 0;
    		controlsBackground[] = {};
    		objects[] = {};
    		class controls {
    			class statusBarText {
    				idc = 1000;
    				x = safezoneX + safezoneW - 1.75;
    				y = safezoneY + safezoneH - 0.04;
    				w = 1;
    				h = 0.04;
    				shadow = 2;
    				colorBackground[] = { 1, 0.3, 0, 0.0 };  // uncomment and increase 4th number to have a background
    				font = "PuristaSemibold";
    				size = 0.03;
    				type = 13;
    				style = 2;
    				text="Loading statusBar...";
    				class Attributes {
    					align="right";
    					color = "#b20000";
    				};
    			};
    		};
    	};
    };
    

    Battle Eye Scripts.txt file:  I had to add the following for Script Restriction #20 and #17.  #17 can probably be revisited by someone with more experience with BE.  I just added the below to get past the error.  It seems to work though.

    #17

    16 7 showCommandingMenu
    17 7 assignAs
    18 7 playableunits !"{getplayeruid _x == _ownerVar} count playableunits" !="lbSetData[21500, _index, netId _x];\n} forEach(playableUnits - [player]); !="FPS: %1 | PLAYERS: %2 | DAMAGE: %3 | KRYPTO: %4 | HUNGER: %5 | THIRST: %6 | SOILED: %7 | GRIDREF: %8", round diag_fps, count playableUnits, damage player, EPOCH_playerCrypto, EPOCH_playerHunger, EPOCH_playerThirst, EPOCH_playerSoiled, mapGridPosition player, _counter""
    

    #20(this actually might not be needed anymore since I moved the fn_statusBar.sqf to the .pbo file.  I'll leave it just for the example).

    20 7 allowDamage !="player allowDamage true;vehicle player allowDamage true;"
    21 7 exec !="<execute expression=" !"RscDebugConsole_execute" !"execFSM" !"_executeStackedEventHandler" !"fn_execVM" !"fn_moduleExecute" !"fn_execRemote" !"fn_MPexec" !"bis_fnc_moduleExecute_activate" !"fn_tridentExecute" !"randomize_civ1" !"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\" !="execVM \"\MPMissions\epoch.altis\scripts\fn_statusBar.sqf\""
    

    Thanks,

     

    Izz

    Thanks for your input there my friend ;)

     

    The reason I added a separate file for the statusbar.hpp is to keep the description.ext tidier (I hate clutter). But your way works as well.

     

    Thank you also for the BE Filters, that's something I was going to sit down and do today, I will anyway, just to confirm your findings :)

     

    If my head isn't still pounding later tonight, I will edit the OP. Otherwise its a tomorrow morning job.

     

    Hope it works for you all :) Any issues - feel free to PM me :D

  7. CfTdH8B.jpg
     
    This will add a fairly simple statusBar to the bottom centre of the players' screen. The size, colour and position is easily customizable. The initial script is taken from midgetgrimms Altis 'statusbar' script. I have adapted it to suit Epoch. All Credits go the original Author of the script, I have just ported it for use in Epoch.
     
     
     
    INSTRUCTIONS
     
    1: Copy the 'dialogs' and 'scripts' folders into your ROOT mission Folder (with init.sqf and description.ext)
     
     
    2: Add this to your init.sqf
    [] execVM "scripts\fn_statusBar.sqf"; 
    
    3: Add this to the bottom of your description.ext
     
    class RscTitles
    {
    
    #include "dialog\statusBar.hpp"
    };
    

     

    4: BattlEye Filters -
     
    Scripts.txt
     
    16 7 showCommandingMenu
    17 7 assignAs
    18 7 playableunits !"{getplayeruid _x == _ownerVar} count playableunits" !="lbSetData[21500, _index, netId _x];\n} forEach(playableUnits - [player]); !="FPS: %1 | PLAYERS: %2 | DAMAGE: %3 | KRYPTO: %4 | HUNGER: %5 | THIRST: %6 | SOILED: %7 | GRIDREF: %8", round diag_fps, count playableUnits, damage player, EPOCH_playerCrypto, EPOCH_playerHunger, EPOCH_playerThirst, EPOCH_playerSoiled, mapGridPosition player, _counter""
    
    20 7 allowDamage !="player allowDamage true;vehicle player allowDamage true;"
    21 7 exec !="<execute expression=" !"RscDebugConsole_execute" !"execFSM" !"_executeStackedEventHandler" !"fn_execVM" !"fn_moduleExecute" !"fn_execRemote" !"fn_MPexec" !"bis_fnc_moduleExecute_activate" !"fn_tridentExecute" !"randomize_civ1" !"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\" !="execVM \"\MPMissions\epoch.altis\scripts\fn_statusBar.sqf\""
    
     
     
    Customization:
     
    statusBar.hpp: 
     
    x = safezoneX + safezoneW - 1.80; // changes movement along the X axis (centred by default)
    y = safezoneY + safezoneH - 0.04; // changes the movement along the Y axis
    
    size = 0.03; // changes the size of the text
    
    style = 0; // change to zero if the right-end text dissapears when player count is >9 or damage is taken.
    
    color = "#b20000"; // Changes the colour of the text

    statusBar.sqf:

    _time = (round(240-(serverTime)/60));  //edit the '240' (60*4=240) to change the countdown timer if your server restarts are shorter or longer than 4 hour intervals
     

    There ARE other options you can add to the statusBar which I will be happy to post/explain if needed.

     

    Thankyou to Izzer and Darth_Rogue for your Input.

     

    Enjoy :)

  8. Hey Guys, 

     

    I saw some people, somewhere along the line - asking about implementing a simple status bar at the bottom of the screen. I will show you how to do it, this is my first time ever explaining how to implement something like this, so forgive me if I do anything wrong/explain incorrectly. This is a very simple thing to implement, so I take no credit for being a pro :P

     

    There may be a better way to do this, I'm only posting what I've used, as it has worked fine.

     

    Secondly, all credits go where they are due - to the creator "LifeIsAJoke". I do not take any ownership or claim to have designed this script. I am simply showing how to set it up for Epoch.

     

    Step 1

     

    Download this .RAR archive that contains the "statusBar.hpp" and "statusBar.sqf". https://www.dropbox.com/s/5yytpxeofoz7r6v/statusBar.rar?dl=0

     

    Extract these files to your ROOT Mission Folder. (With init, description etc)

     

    Step 2

     

    Open your description.sqf. At the BOTTOM, add:

    class RscTitles
    {
    #include "statusBar.hpp"
    }
    

    Step 3

     

    Open your init.sqf. At the BOTTOM, add:

    [] execVM "statusBar.sqf";
    

    Step 4

     

    Battleye Filters

     

    In your scripts.txt, change the value for line 21 from 7 to 1.

    I will update this post ASAP with the correct filters. For now, this will just log the restriction rather than kick.

     

    Customization

     

    Changing the colour of the text:

     

    On line 30 of statusBar.hpp, you will see this:

    color = "#FFFFFF";
    

    change the #FFFFFF to whatever colour you would like, as a colour reference, use http://html-color-codes.info/.

  9.  

    Very first line, or very first line with 5 "" ?

    Needs to be on the end of the 5"" line as my file shows.

    //new
    5 "" !"PVDZE_" !"norrn" !"usec" !="remExField" !="remExFP" !="currentInvites" !="drn_AskServerDynamicWeatherEventArgs" !="norrinRAlie" !="BIS_effects_gepv" !="dayzPlayerLogin" !="dayzPlayerLogin2" !"PVAHR_" !="PVAH_AdminReq" !="PVAH_WriteLogReq" !="PVDZE_bank_Save" !="owner_B1" !="owner_B2" !="owner_B3" !="owner_H1" !="owner_H2" !="owner_H3" !="owner_SG" !="owner_LG" !="owner_KING" !="owner_SH" !="OriginsLockUnlock" !="PVOZ_adminSkin"
    
    5 "" !"PVDZE_" !"norrn" !"usec" !="remExField" !="remExFP" !="currentInvites" !="drn_AskServerDynamicWeatherEventArgs" !="norrinRAlie" !="BIS_effects_gepv" !="dayzPlayerLogin" !="dayzPlayerLogin2" !"PVAHR_" !="PVAH_AdminReq" !="PVAH_WriteLogReq" !"cad_pvar_s" !="PVOZ_adminSkin"
    

    That's what mine looks like. Same as yours I believe.

     

    Also, thanks for your helpful, contributing words there, raymix. People wouldn't ask for help if it were so simple. I've read through this thread multiple times and have tried what has been suggested yet I still cannot fix it. I generally like to resolve issues myself, but when one asks for help on a forum, usually an appropriate response would be somewhat helpful.

  10. I am also getting kicked for "PublicVariable Restriction #0"

     

    My publicvariable.log - 20.10.2014 06:37:10: piXm8 (88.88.88.888:8888) 888888888888888888888888888888888 - #0 "PVOZ_adminSkin" = [<NULL-object>,"gui\admin.jpg"]

     

    I have added the variable into the PublicVariable file on the first line, at the end with !="PVOZ_adminSkin"

     

    It still kicks me, Is there something I have missed?

×
×
  • Create New...