Jump to content
  • 0

[NEED HELP] Unable to display "restart in n minutes" in custom debug monitor


mgm

Question

Hi all,

 

I have been trying to fix this issue myself but unfortunately after about 30 restarts I give up -at least for a while!-. I wonder if any of the script gurus can take a look and fix this for me?

 

Here is the story: 

 

I had a custom debug monitor which worked fine. Let's call it "version 1"... Since I'm very now to all this, I just downloaded a working code from the forums, customized it by investing several hours, eventually it displayed exactly what I wanted. However in that version was missing two features... 

   #1: It was not toggleable. it simply stayed on, all the time, I assume some people won't like it, so I wanted improve this behaviour...

   #2: In my initial seach, I saw that some scripts displaying player's vehicle picture (or weapon picture if player is not in vehicle), and I thought it was a nice addon - wanted to have the same.

So keeping an open eye on such scripts, tonight on another forum I found a new code which fixes the issues above however this new one (version 2) broke one feature I loved (the "Restart in N minutes" countdown). 

 

In the light of the above summary, my help request is, could any gurus please take a look and tell me how to make the restart counter in version 2 work?

I am copying below both versions but as you can imagine simply copy & paste of restart counter from version 1 to version 2 did not work....

 

Thanks in advance!

 

 

 

 

 

VERSION 2 (I like this one better but the restart counter not working)

// Taken from the 2nd post here: http://opendayz.net/threads/simple-ish-debug-monitor-w-toggling-function-and-animation.12567/
// Modified as per our previous template


// File: <mission_dir>\custom\custom_monitor.sqf
// Summary: This file is called by <mission_dir>\init.sqf with the code below
//////    if (!isDedicated) then {
//////    // call custom debug monitor
//////    [] execVM "custom\custom_monitor.sqf";
    

dayz_spaceInterrupt = {
    private ["_dikCode", "_handled"];
    _dikCode = _this select 1;
    _handled = false;
 
    if (_dikCode == 0x44) then {
        if (debugMonitor) then {
            debugMonitor = false;
            hintSilent "";
        } else {[] spawn fnc_debug;};
    };
    _handled
};
 
fnc_debug = {
    debugMonitor = true;
    while {debugMonitor} do
    {
        _kills =        player getVariable["zombieKills",0];
        _killsH =        player getVariable["humanKills",0];
        _killsB =        player getVariable["banditKills",0];
        _humanity =        player getVariable["humanity",0];
        _headShots =    player getVariable["headShots",0];
        _zombies =              count entities "zZombie_Base";
        _zombiesA =    {alive _x} count entities "zZombie_Base";
        _banditCount = {(isPlayer _x) && ((_x getVariable ["humanity",0]) < 0)} count playableUnits;
        _heroCount  = {(isPlayer _x) && ((_x getVariable ["humanity",0]) >= 5000)} count playableUnits;
        _pic = (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle player) >> 'picture'));
            if (player == vehicle player) then
            {
                _pic = (gettext (configFile >> 'cfgWeapons' >> (currentWeapon player) >> 'picture'));
            }
                else
            {
                _pic = (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle player) >> 'picture'));
            };


	hintSilent parseText format ["
	<t size='1.25' font='Bitstream'align='center' color='#D60000'>Epoch Test Server</t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Players Online: </t><t size='1.15 'font='Bitstream' align='right'>%1</t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='1.15' font='Bitstream'align='center' color='#298A08'>%2</t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#5882FA'>Survived %3 Days</t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='0.75' font='Bitstream' align='left' color='#FFBF00'>Zombies Killed: </t><t size='0.95' font='Bitstream' align='right'>%4</t><br/>
	<t size='0.75' font='Bitstream' align='left' color='#FFBF00'>Headshots: </t><t size='0.95' font='Bitstream' align='right'>%5</t><br/>
	<t size='0.75' font='Bitstream' align='left' color='#FFBF00'>Murders: </t><t size='0.95' font='Bitstream' align='right'>%6</t><br/>
	<t size='0.75' font='Bitstream' align='left' color='#FFBF00'>Bandits Killed: </t><t size='0.95' font='Bitstream' align='right'>%7</t><br/>
	<t size='0.75' font='Bitstream' align='left' color='#FFBF00'>Humanity: </t><t size='0.95' font='Bitstream' align='right'>%8</t><br/>
    <t size='0.75' font='Bitstream' align='left' color='#FF0000'>Blood: </t><t size='0.95' font='Bitstream' align='right'>%9</t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='0.75'font='Bitstream'align='left' color='#104E8B' >Current Hero Count:</t><t size='1'font='Bitstream'align='right' color='#104E8B' >%10</t><br/>
	<t size='0.75'font='Bitstream'align='left' color='#104E8B' >Current Bandit Count:</t><t size='1'font='Bitstream'align='right' color='#104E8B' >%11</t><br/>
    <t size='0.75' font='Bitstream' align='left' color='#FFBF00'>FPS: </t><t size='0.95' font='Bitstream' align='right'>%12</t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='0.75' font='Bitstream'align='center' color='#D60000'>www.mydomain.com</t><br/>
	<t size='0.75' font='Bitstream'align='center' color='#D60000'>ts.mydomain.com</t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
    <t size='1'font='Bitstream'align='center' color='#104E8B'>Press F10 to toggle!</t><br/>
	<img size='3' image='%13'></img><br/>",
	count playableUnits,dayz_playerName,(dayz_Survived),_kills,_headShots,_killsH,_killsB,round _humanity,r_player_blood,_heroCount,_banditCount,(round diag_fps),_pic];
    sleep 1;
    };
};
 
[] spawn fnc_debug;

 

 

 

 

 

 

 

 

 

 

VERSION 1 (restart counter working fine - but it doesn't show pic or is not toggleable so I want to leave this behind!)

// File: <mission_dir>\custom\custom_monitor.sqf
// Summary: This file is called by <mission_dir>\init.sqf with the code below
//////	if (!isDedicated) then {
//////	// call custom debug monitor
//////	[] execVM "custom\custom_monitor.sqf";
	
waitUntil {alive player};

while {true} do
{
	_kills = 		player getVariable["zombieKills",0];
	_killsH = 		player getVariable["humanKills",0];
	_killsB = 		player getVariable["banditKills",0];
	_humanity =		player getVariable["humanity",0];
	_headShots =    player getVariable["headShots",0];
	
	hintSilent parseText format ["
	<t size='1.25' font='Bitstream'align='center' color='#D60000'>Epoch Test Server</t><br/>
	<t size='1.15' font='Bitstream' align='left' color='#FFBF00'>Players Online: </t><t size='1.15 'font='Bitstream' align='right'>%1</t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='1.15' font='Bitstream'align='center' color='#298A08'>%2</t><br/>
	<t size='1.15' font='Bitstream'align='center' color='#5882FA'>Survived %3 Days</t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Zombies Killed: </t><t size='0.95' font='Bitstream' align='right'>%4</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Headshots: </t><t size='0.95' font='Bitstream' align='right'>%5</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Murders: </t><t size='0.95' font='Bitstream' align='right'>%6</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Bandits Killed: </t><t size='0.95' font='Bitstream' align='right'>%7</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Humanity: </t><t size='0.95' font='Bitstream' align='right'>%8</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FF0000'>Blood: </t><t size='0.95' font='Bitstream' align='right'>%9</t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#D60000'></t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>FPS: </t><t size='0.95' font='Bitstream' align='right'>%10</t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='1.15' font='Bitstream'align='center' color='#5882FA'>Restart in %11 Minutes</t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#D60000'>www.mydomain.com</t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#D60000'>ts.mydomain.com</t><br/>",

	(count playableUnits),dayz_playerName,(dayz_Survived),_kills,_headShots,_killsH,_killsB,round _humanity,r_player_blood,(round diag_fps),(round(180-(serverTime) / 60))
	];
sleep 1;
};
Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

Here ya go..  Try this one:

 

// Taken from the 2nd post here: http://opendayz.net/threads/simple-ish-debug-monitor-w-toggling-function-and-animation.12567/
// Modified as per our previous template


// File: <mission_dir>\custom\custom_monitor.sqf
// Summary: This file is called by <mission_dir>\init.sqf with the code below
//////    if (!isDedicated) then {
//////    // call custom debug monitor
//////    [] execVM "custom\custom_monitor.sqf";
    

dayz_spaceInterrupt = {
    private ["_dikCode", "_handled"];
    _dikCode = _this select 1;
    _handled = false;
 
    if (_dikCode == 0x44) then {
        if (debugMonitor) then {
            debugMonitor = false;
            hintSilent "";
        } else {[] spawn fnc_debug;};
    };
    _handled
};
 
fnc_debug = {
    debugMonitor = true;
    while {debugMonitor} do
    {
        _kills =        player getVariable["zombieKills",0];
        _killsH =        player getVariable["humanKills",0];
        _killsB =        player getVariable["banditKills",0];
        _humanity =        player getVariable["humanity",0];
        _headShots =    player getVariable["headShots",0];
        _zombies =              count entities "zZombie_Base";
        _zombiesA =    {alive _x} count entities "zZombie_Base";
        _banditCount = {(isPlayer _x) && ((_x getVariable ["humanity",0]) < 0)} count playableUnits;
        _heroCount  = {(isPlayer _x) && ((_x getVariable ["humanity",0]) >= 5000)} count playableUnits;
        _pic = (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle player) >> 'picture'));
            if (player == vehicle player) then
            {
                _pic = (gettext (configFile >> 'cfgWeapons' >> (currentWeapon player) >> 'picture'));
            }
                else
            {
                _pic = (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle player) >> 'picture'));
            };


	hintSilent parseText format ["
	<t size='1.25' font='Bitstream'align='center' color='#D60000'>Epoch Test Server</t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Players Online: </t><t size='1.15 'font='Bitstream' align='right'>%1</t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='1.15' font='Bitstream'align='center' color='#298A08'>%2</t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#5882FA'>Survived %3 Days</t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='0.75' font='Bitstream' align='left' color='#FFBF00'>Zombies Killed: </t><t size='0.95' font='Bitstream' align='right'>%4</t><br/>
	<t size='0.75' font='Bitstream' align='left' color='#FFBF00'>Headshots: </t><t size='0.95' font='Bitstream' align='right'>%5</t><br/>
	<t size='0.75' font='Bitstream' align='left' color='#FFBF00'>Murders: </t><t size='0.95' font='Bitstream' align='right'>%6</t><br/>
	<t size='0.75' font='Bitstream' align='left' color='#FFBF00'>Bandits Killed: </t><t size='0.95' font='Bitstream' align='right'>%7</t><br/>
	<t size='0.75' font='Bitstream' align='left' color='#FFBF00'>Humanity: </t><t size='0.95' font='Bitstream' align='right'>%8</t><br/>
    <t size='0.75' font='Bitstream' align='left' color='#FF0000'>Blood: </t><t size='0.95' font='Bitstream' align='right'>%9</t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='0.75'font='Bitstream'align='left' color='#104E8B' >Current Hero Count:</t><t size='1'font='Bitstream'align='right' color='#104E8B' >%10</t><br/>
	<t size='0.75'font='Bitstream'align='left' color='#104E8B' >Current Bandit Count:</t><t size='1'font='Bitstream'align='right' color='#104E8B' >%11</t><br/>
    <t size='0.75' font='Bitstream' align='left' color='#FFBF00'>FPS: </t><t size='0.95' font='Bitstream' align='right'>%12</t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='1.15' font='Bitstream'align='center' color='#5882FA'>Restart in %14 Minutes</t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='0.75' font='Bitstream'align='center' color='#D60000'>www.mydomain.com</t><br/>
	<t size='0.75' font='Bitstream'align='center' color='#D60000'>ts.mydomain.com</t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
    <t size='1'font='Bitstream'align='center' color='#104E8B'>Press F10 to toggle!</t><br/>
	<img size='3' image='%13'></img><br/>",
	count playableUnits,dayz_playerName,(dayz_Survived),_kills,_headShots,_killsH,_killsB,round _humanity,r_player_blood,_heroCount,_banditCount,(round diag_fps),_pic,(round(180-(serverTime) / 60)];
    sleep 1;
    };
};
 
[] spawn fnc_debug;
Link to comment
Share on other sites

  • 0

The reason you probably did not get it to work, was likely that you copied and kept the %11 from the first version, not realizing that the 11th variable is no longer the server time in the array.

am I right?

 

I simply added the time counter from the array of version 1, copied the actual display line from version 1 and changed the array number in it to be the last one " %14 ".

Link to comment
Share on other sites

  • 0

 

Here ya go..  Try this one:

 

// Taken from the 2nd post here: http://opendayz.net/threads/simple-ish-debug-monitor-w-toggling-function-and-animation.12567/
// Modified as per our previous template


// File: <mission_dir>\custom\custom_monitor.sqf
// Summary: This file is called by <mission_dir>\init.sqf with the code below
//////    if (!isDedicated) then {
//////    // call custom debug monitor
//////    [] execVM "custom\custom_monitor.sqf";
    

dayz_spaceInterrupt = {
    private ["_dikCode", "_handled"];
    _dikCode = _this select 1;
    _handled = false;
 
    if (_dikCode == 0x44) then {
        if (debugMonitor) then {
            debugMonitor = false;
            hintSilent "";
        } else {[] spawn fnc_debug;};
    };
    _handled
};
 
fnc_debug = {
    debugMonitor = true;
    while {debugMonitor} do
    {
        _kills =        player getVariable["zombieKills",0];
        _killsH =        player getVariable["humanKills",0];
        _killsB =        player getVariable["banditKills",0];
        _humanity =        player getVariable["humanity",0];
        _headShots =    player getVariable["headShots",0];
        _zombies =              count entities "zZombie_Base";
        _zombiesA =    {alive _x} count entities "zZombie_Base";
        _banditCount = {(isPlayer _x) && ((_x getVariable ["humanity",0]) < 0)} count playableUnits;
        _heroCount  = {(isPlayer _x) && ((_x getVariable ["humanity",0]) >= 5000)} count playableUnits;
        _pic = (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle player) >> 'picture'));
            if (player == vehicle player) then
            {
                _pic = (gettext (configFile >> 'cfgWeapons' >> (currentWeapon player) >> 'picture'));
            }
                else
            {
                _pic = (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle player) >> 'picture'));
            };


	hintSilent parseText format ["
	<t size='1.25' font='Bitstream'align='center' color='#D60000'>Epoch Test Server</t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Players Online: </t><t size='1.15 'font='Bitstream' align='right'>%1</t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='1.15' font='Bitstream'align='center' color='#298A08'>%2</t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#5882FA'>Survived %3 Days</t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='0.75' font='Bitstream' align='left' color='#FFBF00'>Zombies Killed: </t><t size='0.95' font='Bitstream' align='right'>%4</t><br/>
	<t size='0.75' font='Bitstream' align='left' color='#FFBF00'>Headshots: </t><t size='0.95' font='Bitstream' align='right'>%5</t><br/>
	<t size='0.75' font='Bitstream' align='left' color='#FFBF00'>Murders: </t><t size='0.95' font='Bitstream' align='right'>%6</t><br/>
	<t size='0.75' font='Bitstream' align='left' color='#FFBF00'>Bandits Killed: </t><t size='0.95' font='Bitstream' align='right'>%7</t><br/>
	<t size='0.75' font='Bitstream' align='left' color='#FFBF00'>Humanity: </t><t size='0.95' font='Bitstream' align='right'>%8</t><br/>
    <t size='0.75' font='Bitstream' align='left' color='#FF0000'>Blood: </t><t size='0.95' font='Bitstream' align='right'>%9</t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='0.75'font='Bitstream'align='left' color='#104E8B' >Current Hero Count:</t><t size='1'font='Bitstream'align='right' color='#104E8B' >%10</t><br/>
	<t size='0.75'font='Bitstream'align='left' color='#104E8B' >Current Bandit Count:</t><t size='1'font='Bitstream'align='right' color='#104E8B' >%11</t><br/>
    <t size='0.75' font='Bitstream' align='left' color='#FFBF00'>FPS: </t><t size='0.95' font='Bitstream' align='right'>%12</t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='1.15' font='Bitstream'align='center' color='#5882FA'>Restart in %14 Minutes</t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='0.75' font='Bitstream'align='center' color='#D60000'>www.mydomain.com</t><br/>
	<t size='0.75' font='Bitstream'align='center' color='#D60000'>ts.mydomain.com</t><br/>
	<t size='0.35' font='Bitstream'align='center' color='#D60000'></t><br/>
    <t size='1'font='Bitstream'align='center' color='#104E8B'>Press F10 to toggle!</t><br/>
	<img size='3' image='%13'></img><br/>",
	count playableUnits,dayz_playerName,(dayz_Survived),_kills,_headShots,_killsH,_killsB,round _humanity,r_player_blood,_heroCount,_banditCount,(round diag_fps),_pic,(round(180-(serverTime) / 60)];
    sleep 1;
    };
};
 
[] spawn fnc_debug;

 

Glenn,

Thank you for taking the time to investigate and respond. I have tried it, unfortunately it did not work (custom debug monitor completely missing from the screen).

Looking forward to any other versions you might suggest...

Link to comment
Share on other sites

  • 0

The reason you probably did not get it to work, was likely that you copied and kept the %11 from the first version, not realizing that the 11th variable is no longer the server time in the array.

am I right?

 

I simply added the time counter from the array of version 1, copied the actual display line from version 1 and changed the array number in it to be the last one " %14 ".

Sorry, I missed this post somehow - it's past midnight here. I don't think that's the reason (even if it is indeed broken above) because I literally tested this 30 times trying different things and at least half of these trials had the correct variable IDs. I kept multiple versions so I'll check this tomorrow. The latest one I pasted (above) might be missed due to mental exhaustion but I tried with good ones before. It must be something else but I don't know what. Do you think it's the (( )) characters around server restart counter calculation bit?
 
In some of the tests, custom debug monitor worked fine when I excluded that part and got completely broken when I reintroduced that bit.
 
 

Hmm..  Do you have an RPT log from the latest restart?

Sure, here it is. I couldn't see anything related but maybe it's just me?

Link to comment
Share on other sites

  • 0

 

Sure, here it is. I couldn't see anything related but maybe it's just me?

 

Hmm...  no - nothing really there.

 

Oh well - I'll tinker at it and see if there is something I can  find, until someone smarter comes along and solves it. :)

Link to comment
Share on other sites

  • 0
dayz_spaceInterrupt = {
    private ["_dikCode", "_handled"];
    _dikCode = _this select 1;
    _handled = false;
 
    if (_dikCode == 0x44) then {
        if (debugMonitor) then {
            debugMonitor = false;
            hintSilent "";
        } else {[] spawn fnc_debug;};
    };
    _handled
};

 

this part will overwrite the default dayz_spaceInterrupt in epoch and disable the custom keys (ex. building keys and more).

 

you should rather add a custom part to the one already in epoch then change it to read the custom dayz_spaceInterrupt from mission file

Link to comment
Share on other sites

  • 0

this part will overwrite the default dayz_spaceInterrupt in epoch and disable the custom keys (ex. building keys and more).

 

you should rather add a custom part to the one already in epoch then change it to read the custom dayz_spaceInterrupt from mission file

Halvhjearne,

Thanks for explaining the methodology that should be used but I'm afraid I'm not able to code it, so far I'm only able to modify existing code so unless someone writes the code I can't come up with a working implementation based on your idea...

 

 

 

_stime = 0;
if(serverTime > 36000)then{_stime = time;}else{_stime = serverTime;};
_optime = _stime - (180*60);
if (_optime < 0) then {_optime = _optime * -1;};
_hours = (_optime/60/60);
_hours = toArray (str _hours);
_hours resize 1;
_hours = toString _hours;
_hours = compile _hours;
_hours = call  _hours;
_minutes = floor(_optime/60);
_minutes2 = ((_minutes - (_hours*60)) min 60) max 0;if (_minutes2 < 10) then {_minutes2 = format ['0%1',_minutes2];};
 
<t size='0.95' font='Bitstream' align='left' color='#CC0000'>Restart in: </t><t size='0.95' font='Bitstream' align='right'>%5h %6m</t><br/>

%5 should be _hours

%6 should be _minutes2

 

I modeled it after infiSTAR's uptime for his debug. This is setup to should the time until restart for a 3 hour interval. (Restart time interval can be changed here (_optime = _stime - (180*60) ;) Just replace the 180 with the number of hours times 60)

 

BuddyRole,

Thanks for the working code -- any guidance on how to use this will be much appreciated!

 

Do I just put this code block anywhere in the file (say under "fnc_debug = {" code block),

and then add the matching HTML line in the appropriate location? or do I need to make any other changes?
 
I wouldn't mind trial & error method to find out normally but for this particular file I've had too many trials already so would be great if you can clear it up for me...
Link to comment
Share on other sites

  • 0

UPDATE: After spending several hours on this, below I'm sharing the lessons learned and the final code.

 

 

 

 

 

 

  1. Finding #1: I discovered at about line 13 the last lines of the code start breaking.
    What section exactly is breaking? I'm not sure, my suspicion is that the following has a size limit >> "hintSilent parseText format [" text here "]; "
    What I previously thought (code error) is apparently wrong.When I removed top 5 lines the faulty code started functioning. When I added line1, line2, line3 and so on lines, after hitting about line 13, my functional code started breaking too.
     
  2. Finding #2: Using pictures don't seem to be a good idea any more.
    I was in this primarily to have cool pictures but even 'makarov' picture doesn't work and prints an error box on player's screen. God knows how many other vehicle/weapons have the same issue. 
    One possibly can go and upload pictures one  by one but that'd be too much work for my taste.

 

At the end of the trial & error session, I have decided on the template below in the spoiler - the corresponding code can be found in the second spoiler.

nYGbQWA.png

 

Which is available below for anyone interested.

dayz_spaceInterrupt = {
    private ["_dikCode", "_handled"];
    _dikCode = _this select 1;
    _handled = false;
 
    if (_dikCode == 0xD2) then {
        if (debugMonitor) then {
            debugMonitor = false;
            hintSilent "";
        } else {[] spawn fnc_debug;};
    };
    _handled
};


fnc_debug = {
    debugMonitor = true;
    while {debugMonitor} do
    {
////////////////////////////////////////////////
	_kills = 		player getVariable["zombieKills",0];
	_killsH = 		player getVariable["humanKills",0];
	_killsB = 		player getVariable["banditKills",0];
	_humanity =		player getVariable["humanity",0];
	_headShots =    player getVariable["headShots",0];
	
	hintSilent parseText format ["
	<t size='1.25' font='Bitstream'align='center' color='#D60000'>SERVER-NAME-GOES-HERE</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Players Online: </t><t size='1.15 'font='Bitstream' align='right'>%1</t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='1.15' font='Bitstream'align='center' color='#298A08'>%2</t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#5882FA'>Survived %3 Days</t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Zombies Killed: </t><t size='0.95' font='Bitstream' align='right'>%4</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Headshots: </t><t size='0.95' font='Bitstream' align='right'>%5</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Murders: </t><t size='0.95' font='Bitstream' align='right'>%6</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Bandits Killed: </t><t size='0.95' font='Bitstream' align='right'>%7</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Humanity: </t><t size='0.95' font='Bitstream' align='right'>%8</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FF0000'>Blood: </t><t size='0.95' font='Bitstream' align='right'>%9</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>FPS: </t><t size='0.95' font='Bitstream' align='right'>%10</t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='1.15' font='Bitstream'align='center' color='#5882FA'>Restart in %11 Minutes</t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#D60000'>http://YOUR-URL-GOES-HERE</t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#FFBF00'>Press INS to toggle</t>
	",

	(count playableUnits),
	dayz_playerName,
	(dayz_Survived),
	_kills,_headShots,
	_killsH,
	_killsB,
	round _humanity,
	r_player_blood,
	(round diag_fps),
	(round(180-(serverTime) / 60))
	];
    sleep 1;
    };
};
 
[] spawn fnc_debug;

 

 

The following variables were in some version at least but didn't make it into my final custom debug monitor but if anyone wishes to modify here they are.

        _zombies =              count entities "zZombie_Base";
        _zombiesA =    {alive _x} count entities "zZombie_Base";
        _banditCount = {(isPlayer _x) && ((_x getVariable ["humanity",0]) < 0)} count playableUnits;
        _heroCount  = {(isPlayer _x) && ((_x getVariable ["humanity",0]) >= 5000)} count playableUnits;
        _pic = (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle player) >> 'picture'));
            if (player == vehicle player) then
            {
                _pic = (gettext (configFile >> 'cfgWeapons' >> (currentWeapon player) >> 'picture'));
            }
                else
            {
                _pic = (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle player) >> 'picture'));
            };
 

 

 

BuddyRole's code (posted above) is good and I might switch to it at a future date, here it is once again:

 

		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		_stime = 0;
		if (serverTime > 36000) then {
			_stime = time;
			} else { _stime = serverTime;
			};
		_optime = _stime - (180*60);
		if (_optime < 0) then {_optime = _optime * -1;};
		_hours = (_optime/60/60);
		_hours = toArray (str _hours);
		_hours resize 1;
		_hours = toString _hours;
		_hours = compile _hours;
		_hours = call  _hours;
		_minutes = floor(_optime/60);
		_minutes2 = ((_minutes - (_hours*60)) min 60) max 0;if (_minutes2 < 10) then {_minutes2 = format ['0%1',_minutes2];};
		
		// %5 should be _hours
		// %6 should be _minutes2
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

 

EDIT: The full code above, in the second spoiler is ON by default and it is user toggleable using INS key.

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
  • Discord

×
×
  • Create New...