DX | Custom Debug Monitor

Did This Work For You?

  • Yes

    Votes: 17 63.0%
  • No

    Votes: 10 37.0%

  • Total voters
    27
ok help me out guyz i didnt get how to make it toggle

i dont have a custom compile.sqf file

i just have "scripts\debug\custom_monitor.sqf"

and i wanna keep it that way

heres my Code


if (isNil "custom_monitor") then {custom_monitor = true;} else {custom_monitor = !custom_monitor;};

while {custom_monitor} 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.2'font='Bitstream'color='#FF9900'align='center'>%1</t><br/>
<t size='1'font='Bitstream'align='center'color='#FF9900'>Survived:</t><t size='1'font='Bitstream'align='center'color='#FF9900'>%8 Days</t><br/>
<t size='1'font='Bitstream'align='left'color='#FF9900'>Blood:</t><t size='1' font='Bitstream'align='right'color='#FF9900'>%2</t><br/>
<t size='1'font='Bitstream'align='left'color='#FF9900'>Humanity:</t><t size='1'font='Bitstream'align='right'color='#FF9900'>%3</t><br/>
<t size='1'font='Bitstream'align='left'>Murders:</t><t size='1'font='Bitstream'align='right'>%4</t><br/>
<t size='1'font='Bitstream'align='left'>Bandits Killed:</t><t size='1'font='Bitstream'align='right'>%5</t><br/>
<t size='1'font='Bitstream'align='left'>Zombies Killed:</t><t size='1'font='Bitstream'align='right'>%6</t><br/>
<t size='1'font='Bitstream'align='left'color='#00CC00'>Headshots:</t><t size='1'font='Bitstream'align='right'color='#00CC00'>%7</t><br/>
<t size='1.2'font='Bitstream'align='center'color='#00CC00'>Testing server</t><br/>
<t size='1'font='Bitstream'align='center'color='#00CC00'>FPS:</t><t size='1'font='Bitstream'align='center'color='#00CC00'>%9</t><br/>


",dayz_playerName,r_player_blood,round _humanity,_killsH,_killsB,_kills,_headShots,(dayz_Survived),floor(diag_fps)];
sleep 1;
};


how do i add toggle to it that all i want to complete it
 
ok help me out guyz i didnt get how to make it toggle

i dont have a custom compile.sqf file

i just have "scripts\debug\custom_monitor.sqf"

and i wanna keep it that way

heres my Code





how do i add toggle to it that all i want to complete it

My repost with my debug has a ghetto ass toggle built in xD I completely redid it and added a ton of new stuff to it, hero/bandit counter etc. Can post entire code here if requested, though it is already on the forums somewhere
 
My repost with my debug has a ghetto ass toggle built in xD I completely redid it and added a ton of new stuff to it, hero/bandit counter etc. Can post entire code here if requested, though it is already on the forums somewhere

Sure i would appreciate that if you could post ur code :)
 
Code:
//Credit to Krixes for use of his code and also to AVendettaForYou for helping me figure some stuff out.
//Modified by Matt L
if (isNil "custom_monitor") then {custom_monitor = true;} else {custom_monitor = !custom_monitor;};
 
while {custom_monitor} 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;
    hintSilent parseText format ["
    <t size='1'font='Bitstream'align='center' color='#EE0000' >%1</t><br/>
    <t size='1'font='Bitstream'align='left' color='#EE0000' >Midochlorians Left:</t><t size='1.5' font='Bitstream'align='right' color='#EE0000' >%2</t><br/>
    <t size='1'font='Bitstream'align='left' color='#104E8B' >Humanity:</t><t size='1.5'font='Bitstream'align='right' color='#104E8B' >%3</t><br/>
    <t size='1'font='Bitstream'align='left' color='#EEC900' >Noobs Killed:</t><t size='1.5'font='Bitstream'align='right' color='#EEC900' >%4</t><br/>
    <t size='1'font='Bitstream'align='left' color='#EEC900' >Assholes Killed:</t><t size='1.5'font='Bitstream'align='right' color='#EEC900' >%5</t><br/>
    <t size='1'font='Bitstream'align='left' color='#EEC900' >Zombitches Killed:</t><t size='1.5'font='Bitstream'align='right' color='#EEC900' >%6</t><br/>
    <t size='1'font='Bitstream'align='left' color='#EEC900' >Dome Shots:</t><t size='1.5'font='Bitstream'align='right' color='#EEC900' >%7</t><br/>
    <t size='1' font='Bitstream' align='left' color='#EEC900' >Zombitches (alive/total): </t><t size='1' font='Bitstream' align='right' color='#EEC900' >%9/%8</t><br/>
    <t size='1'font='Bitstream'align='left' color='#104E8B' >Current Asshole Count:</t><t size='1.5'font='Bitstream'align='right' color='#104E8B' >%11</t><br/>
    <t size='1'font='Bitstream'align='left' color='#104E8B' >Current NiceGuy Count:</t><t size='1.5'font='Bitstream'align='right' color='#104E8B' >%12</t><br/>
    <t size='1' font='Bitstream' align='left' color='#104E8B' >FPS: </t><t size='1' font='Bitstream' align='right' color='#104E8B' >%10</t><br/>
    <t size='1'font='Bitstream'align='center' color='#104E8B' >Welcome to the Apocalypse! </t><br/>
 
    ",dayz_playerName,r_player_blood,round _humanity,_killsH,_killsB,_kills,_headShots,count entities "zZombie_Base",{alive _x} count entities "zZombie_Base",diag_fps,_banditCount,_heroCount];
sleep 1;
};
 
 
private ["_toggleUseTime","_toggleLastUsedTime","_lastToggle","_toggleUseTime","_toggleOn","_toggleOff"];
 
_toggleUseTime = 1; // Amount of time it takes in second for the player to toggle custom debug
_toggleLastUsedTime = 8; // Amount of time in seconds before player can toggle custom debug again
_toggleTime = time - lastToggle; // Variable used for easy reference in determining the cooldown
_toggleOn = s_player_toggle;
_toggleOff = s_player_toggle;
 
if (dayz_combat == 1) then { // Check if in combat
    cutText [format["You are in Combat and cannot toggle debug"], "PLAIN DOWN"]; //display text at bottom center of screen when in combat
} else {
 
    player removeAction s_player_toggle; //remove the action from users scroll menu
   
    player playActionNow "Medic"; //play animation
   
    r_interrupt = false; // public interuppt variable
    _animState = animationState player; // get the animation state of the player
    r_doLoop = true; // while true sets whether to continue
    _started = false; // this starts as false as a check
    _finished = false; // this starts as false
    while {r_doLoop} do {
        _animState = animationState player; // keep checking to make sure player is in correct animation
        _isMedic = ["medic",_animState] call fnc_inString; // checking to make sure the animstate is the medic animation still
        if (_isMedic) then {
            _started = true; // this is a check to make sure everything is still ok
        };
        if(!_isMedic && !r_interrupt && (time) < _toggleUseTime) then {
            player playActionNow "Medic"; //play animation
            _isMedic = true;
        };
        if (_started && !_isMedic && (time) > _toggleUseTime) then {
            r_doLoop = false; // turns off the loop
            _finished = true; // set finished to true
            lastToggle = time; // the last toggle time
        };
        if (r_interrupt) then {
            r_doLoop = false; // if interuppted turns loop off early so _finished is never true
        };
        sleep 0.1;
    };
    r_doLoop = false; // make sure loop is off
   
    if (_finished) then {
        // this is for handling if interrupted
        r_interrupt = false;
        player switchMove "";
        player playActionNow "stop";
        cutText [format["You have disabled your debug monitor!"], "PLAIN DOWN"]; //display text at bottom center of screen on interrupt
        hintSilent "";
    };
};
in your overridden fn_selfActions.sqf add :
Code:
if((speed player <= 1) && _canDo) then {   
    if (s_player_toggle < 0) then {
        s_player_toggle = player addaction[("<t color=""#DAA520"">" + ("Toggle Debug") +"</t>"),"custom_monitor.sqf","",5,false,true,"",""];
    };
} else {
    player removeAction s_player_toggle;
    s_player_toggle = -1;
};
under
Code:
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
 
Does an animation when you go to turn it off, but thats partially how I ghetto rigged it. I added a forced interruption which forces the animation to stop awkwardly then debug goes buh bye till you turn it on again.
 
Also i had improvised and tried to put a flag of the country where the sever is hosted or belongs to

added a code for image

<t size='1'font='Bitstream'align='left'color='#00CC00'>Headshots:</t><t size='1'font='Bitstream'align='right'color='#00CC00'>%7</t><br/>
<t size='1'font='Bitstream'align='center'color='#00CC00'>Restart in %10 minutes!</t><br/>
<t size='1.2'font='Bitstream'align='left'color='#00CC00'>Testing server</t><br/>
<img image='scripts\debug\indian.jpg'size='2'align='center'/><br />
<t size='1'font='Bitstream'align='left'shadow='true'color='#00CC00'>FPS:</t><t size='1'font='Bitstream'align='left'color='#00CC00'>%9</t><br/>

but its giving me an error "image
MPMissions\dayz_1.chernarus\scripts\debug\indian.jpg
dimensions 41x27 not 2^n"
 
Also i had improvised and tried to put a flag of the country where the sever is hosted or belongs to

added a code for image



but its giving me an error "image
MPMissions\dayz_1.chernarus\scripts\debug\indian.jpg
dimensions 41x27 not 2^n"

Make it a 2x1 ratio then try it. 1024x512 works best imo
 
well its not giving me the error now but the image isnt showing up in there aswell lol dont know if i'm doing someting wrong

<t size='1'font='Bitstream'align='left'color='#00CC00'>Headshots:</t><t size='1'font='Bitstream'align='right'color='#00CC00'>%7</t><br/>
<br/>
<t size='1'font='Bitstream'align='left'color='#00CC00'>Restart in %10 minutes!</t><br/>
<t size='1.2'font='Bitstream'align='left'color='#00CC00'>Testing server</t><br/>
<img image='scripts\debug\indian.jpg' size='1'align='center'/><br />
<t size='1'font='Bitstream'align='left'shadow='true'color='#00CC00'>FPS:</t><t size='1'font='Bitstream'align='left'color='#00CC00'>%9</t><br/>



",dayz_playerName,r_player_blood,round _humanity,_killsH,_killsB,_kills,_headShots,(dayz_Survived),floor(diag_fps),(300-(round(serverTime/60)))];
sleep 1;
};

i think every thing is right there its just the image isnt showing up :s

Image size = 5.1kb
size = 111x57x24b jpeg
 
interesting, now it gives me the error back on 2x1

size 120x60

Error = image
MPMissions\dayz_1.chernarus\scripts\debug\indian.jpg
dimensions 120x60 not 2^n"
 
interesting, now it gives me the error back on 2x1

size 120x60

Error = image
MPMissions\dayz_1.chernarus\scripts\debug\indian.jpg
dimensions 120x60 not 2^n"

The smallest size it's allowed to be is like 512 x 256 or something like that...can't remember exactly
 
ok i tried ur script it didnt gave me any error but i dont know i was unable to use the toggle option maybe i missed something

so in my Mpmission\dayz_1.chernarus\
theres no fn_selfActions.sqf

but there was one fn_selfactions.sqf in Mpmission\dayz_1.origins.tavi\Debug

so i took that file made a directory in
Mpmission\dayz_1.chernarus\debug
placed the file there

edited as u said
the code
Code:
if((speed player <= 1) && _canDo) then {
    if (s_player_toggle < 0) then {
        s_player_toggle = player addaction[("<t color=""#DAA520"">" + ("Toggle Debug") +"</t>"),"custom_monitor.sqf","",5,false,true,"",""];
    };
} else {
    player removeAction s_player_toggle;
    s_player_toggle = -1;
};

below
Code:
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);

added this to my init.sqf

Code:
call compile preprocessFileLineNumbers "debug\fn_selfActions.sqf";                //Compile self action functions
progressLoadingScreen 0.8;

just below

Code:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";                //Compile regular functions
progressLoadingScreen 0.6;

didnt had any errors but i was unable to toggle the debug menu
 
Back
Top