Jump to content
  • 0

[HELP] Bug in custom debug monitor script - can you help fix it?


mgm

Question

Hey Guys,
 
After hours of testing I have pinpointed to the one script causing the issue, I don't know how to fix it though so can anyone please help me to fix the no-gear-access-in-vehicle bug in custom debug monitor version 2.0 below?
 
 
 
This below is version 1.0. It works. It does not have toggle On/Off option, hence this version was left behind.
 

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'>SERVERNAME</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'>http://WEBSITE</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;
};

 

 

 

 

This is version 2.0. It is improved and is now user toggleable.
It works (i.e.: displays custom debug monitor on player screen) however it disables gear access in vehicle in Driver/Gunner seats (gear access in back seat works).
 

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'>SERVERNAME</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://WEBSITE</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),
(name player),
(dayz_Survived),
_kills,_headShots,
_killsH,
_killsB,
round _humanity,
r_player_blood,
(round diag_fps),
(round(180-(serverTime) / 60))
];
sleep 1;
};
};

[] spawn fnc_debug;

 
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0
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
};

I saw someone else post in one of your other threads, that there is your problem, it will also prevent building and cause other vehicle issues.

Link to comment
Share on other sites

  • 0
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
};

I saw someone else post in one of your other threads, that there is your problem, it will also prevent building and cause other vehicle issues.

 

Thanks for your response. I used WinMerge to compare the code you posted - it is the same one what I have above so I guess you are pointing out the faulty section?

I don't know how to fix it, can you provide the solution perhaps?

 

I keep trying different things but no luck so far.

If I understand correctly the issue here is:some variables such as "(dayz_Survived)" are not available within a function hence they throw an error (Error Undefined variable in expression: dayz_survived).

 

How to access them from within a function? I have no idea on that...

Link to comment
Share on other sites

  • 0

look in dayz_spaceInterrupt.sqf and either add your button or modify the default to work with your debug monitor

Thank you for the pointer, I managed to resolve this issue exactly in the same place just a few hours ago but didn't get a chance to update it here yet...

 

 

For anyone else that might require this, the pointer above is in the right direction and step by step instructions are http://epochmod.com/forum/index.php?/topic/973-custom-debug-monitor/?p=45230 on this forum. Unfortunately I couldn't find that post within the last two weeks and eventually reverse engineered from a popular server (which gave me the pointer to spaceInterrupt.sqf just like Halvhjearne's tip above).

 

Finally all urgent issues resolved I can now go play lol

Link to comment
Share on other sites

Create an account or sign in to comment

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

Create an account

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

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...