Krixes - Self Bloodbag Script

It's like Bloodbag is covering up one of the menu options on the mouse scroll menu. If I have my handgun equipped, it gives me the option of Bloodbag or my rifle. I should also have the option to equip my melee which is in my secondary (carrying) slot.
The 1,2,3 keys aren't working at all. They bring up that menu you have to hit Backspace to get rid of.
 
It's like Bloodbag is covering up one of the menu options on the mouse scroll menu. If I have my handgun equipped, it gives me the option of Bloodbag or my rifle. I should also have the option to equip my melee which is in my secondary (carrying) slot.
The 1,2,3 keys aren't working at all. They bring up that menu you have to hit Backspace to get rid of.

You did use the 1.8.0.3 fn_selfActions yeah? If not then that would explain why melee weapon doesn't show up.

As for keybinds not working, I'll bet that's because of the custom debug monitor, I'm guessing it's got a key to toggle it on and off? If so you need to add it slightly differently in 1.8.
 
Pretty sure I unpacked the dayz_code.pbo from my @dayz folder and took it from that. Should I have downloaded it from the game server instead?

Yes, I have a toggle key for the debug monitor. Here's what I have for that...

Code:
dayz_spaceInterrupt = {
    private ["_dikCode", "_handled"];
    _dikCode = _this select 1;
    _handled = false;
 
    if (_dikCode == 0xC7) then {
        if (debugMonitor) then {
            debugMonitor = false;
            hintSilent "";
        } else {[] spawn fnc_debug;};
    };
    _handled
};
 
fnc_debug = {
    debugMonitor = true;
    while {debugMonitor} do
{
        _kills =            player getVariable ["zombieKills",0];
    _killsB =        player getVariable ["banditKills",0];
        _headShots =        player getVariable ["headShots",0];
        _humanity =        player getVariable ["humanity",0];
    _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'font='Bitstream'align='center'>%1</t><br/>
        <t size='1'font='Bitstream'align='left' color='#ff0000'>Blood:</t><t size='1' font='Bitstream'align='right'>%2</t><br/>
        <t size='1'font='Bitstream'align='left'>Zombies Killed:</t><t size='1'font='Bitstream'align='right'>%3</t><br/>
    <t size='1'font='Bitstream'align='left'>Bandits Killed:</t><t size='1'font='Bitstream'align='right'>%4</t><br/>
        <t size='1'font='Bitstream'align='left'>Headshots:</t><t size='1'font='Bitstream'align='right'>%5</t><br/>
        <t size='1'font='Bitstream'align='left'>Survived:</t><t size='1'font='Bitstream'align='right'>%6 Days</t><br/>
        <t size='1'font='Bitstream'align='left'>Humanity:</t><t size='1'font='Bitstream'align='right'>%7</t><br/>
        <t size='1'font='Bitstream'align='left'>Player Bandits:</t><t size='1'font='Bitstream'align='right'>%8</t><br/>
        <t size='1'font='Bitstream'align='left'>Player Heroes:</t><t size='1'font='Bitstream'align='right'>%9</t><br/>
        <t size='1'font='Bitstream'align='left'>FPS:</t><t size='1'font='Bitstream'align='right'>%10</t><br/>
    <img size='3' image='%11'/><br/>
    <t size='1'font='Bitstream'align='center' color='#104E8B' >Press Home key to toggle! </t><br/>
    <t size='1'font='Bitstream'align='center' color='#104E8B' >Welcome to CrayZ DayZ! </t><br/>
    <t size='1'font='Bitstream'align='center' color='#104E8B' >Server Restarts @ 6am EST </t><br/>
    ",dayz_playerName,r_player_blood,_kills,_killsB,_headShots,(dayz_Survived),round _humanity,_banditCount,_heroCount,floor(diag_fps),_pic];
    sleep 1;
    };
};
 
[] spawn fnc_debug;
 
No you were right to take it from the local file. I can't remember now if you only get the option for the pistol and the active weapon on your back now or not.

Ok yeah for the custom debug you're going to have to find @dayz\addons\dayz_code\init\compiles.sqf.

Find this section
Code:
dayz_spaceInterrupt = {
 
load of code inside
 
};

Copy the whole thing to your custom compiles.sqf in your mission folder and then find this part.
Code:
        if (!isNull _object and _dikCode in actionKeys "LeanRight") then {
            _dir = getDir _object + 3;
            _object setDir _dir;
            _handled = true;
        };

Right after that, add the bit for your debug monitor toggle
Code:
        if (_dikCode == 0x44) then {
        if (debugMonitor) then {
            debugMonitor = false;
            hintSilent "";
        } else {[] spawn fnc_debug;};
        };

Now in the custom_monitor file delete this
Code:
dayz_spaceInterrupt = {
    private ["_dikCode", "_handled"];
    _dikCode = _this select 1;
    _handled = false;
 
    if (_dikCode == 0xC7) then {
        if (debugMonitor) then {
            debugMonitor = false;
            hintSilent "";
        } else {[] spawn fnc_debug;};
    };
    _handled
};

That should get the debug working and stop it from interfering with the other 1.8 keybinds. :)
 
I don't see anything in the compiles.sqf like what you show.
Here's what I copied over...


Code:
dayz_spaceInterrupt = {
        private ["_dikCode", "_handled","_displayg"];
        _dikCode = _this select 1;
        _handled = false;
        if (_dikCode in (actionKeys "GetOver")) then {
            if (!r_fracture_legs and (time - dayz_lastCheckBit > 4)) then {
                _inBuilding = [player] call fnc_isInsideBuilding;
                _nearbyObjects = nearestObjects[getPosATL player, ["TentStorage", "Hedgehog_DZ", "Sandbag1_DZ","TrapBear","Wire_cat1"], 8];
                if (!_inBuilding and (count _nearbyObjects == 0)) then {
                    dayz_lastCheckBit = time;
                    call player_CombatRoll;
                };
            };
        };
        //if (_dikCode == 57) then {_handled = true}; // space
        //if (_dikCode in actionKeys 'MoveForward' or _dikCode in actionKeys 'MoveBack') then {r_interrupt = true};
        /*
        if (_dikCode == 210) then //insert Key
        {
            _nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
        };
        */
        //Prevent exploit of drag body
        if ((_dikCode in actionKeys "Prone") and r_drag_sqf) then { force_dropBody = true; };
        if ((_dikCode in actionKeys "Crouch") and r_drag_sqf) then { force_dropBody = true; };
 
        if (_dikCode in actionKeys "MoveLeft") then {r_interrupt = true};
        if (_dikCode in actionKeys "MoveRight") then {r_interrupt = true};
        if (_dikCode in actionKeys "MoveForward") then {r_interrupt = true};
        if (_dikCode in actionKeys "MoveBack") then {r_interrupt = true};
        if (_dikCode in actionKeys "ForceCommandingMode") then {_handled = true};
        if (_dikCode in actionKeys "PushToTalk" and (time - dayz_lastCheckBit > 10)) then {
            dayz_lastCheckBit = time;
            [player,15,true,(getPosATL player)] spawn player_alertZombies;
        };
        if (_dikCode in actionKeys "VoiceOverNet" and (time - dayz_lastCheckBit > 10)) then {
            dayz_lastCheckBit = time;
            [player,15,true,(getPosATL player)] spawn player_alertZombies;
        };
        if (_dikCode in actionKeys "PushToTalkDirect" and (time - dayz_lastCheckBit > 10)) then {
            dayz_lastCheckBit = time;
            [player,5,false,(getPosATL player)] spawn player_alertZombies;
        };
        if (_dikCode in actionKeys "Chat" and (time - dayz_lastCheckBit > 10)) then {
            dayz_lastCheckBit = time;
            [player,15,false,(getPosATL player)] spawn player_alertZombies;
        };
        if (_dikCode in actionKeys "User20" and (time - dayz_lastCheckBit > 5)) then {
            dayz_lastCheckBit = time;
            _nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
        };
        if ((_dikCode == 0x3E or _dikCode == 0x0F or _dikCode == 0xD3) and (time - dayz_lastCheckBit > 10)) then {
            dayz_lastCheckBit = time;
            call dayz_forceSave;
        };
        if (_dikCode == 0xB8 or _dikCode == 0x38 or _dikCode == 0x3E or _dikCode == 0x2A or _dikCode == 0x36 or _dikCode == 0x01) then {
            _displayg = findDisplay 106;
            if (!isNull _displayg) then {
            call player_gearSync;
            call dayz_forceSave;
            } else {
                if (dialog) then {
                    call player_gearSync;
                    call dayz_forceSave;
                };
            };
        };
        /*
        if (_dikCode in actionKeys "IngamePause") then {
            waitUntil {
                _display = findDisplay 49;
                !isNull _display;
            };
            _btnRespawn = _display displayCtrl 1010;
            _btnAbort = _display displayCtrl 104;
            _btnRespawn ctrlEnable false;
            _btnAbort ctrlEnable false;
        };
        */
        _handled
    };
 
That is not the 1.8 dayz_spaceInterrupt section. Have you updated your local files to 1.8? Explains why your 1,2,3 keys weren't doing anything haha.
 
It should be dayz 1.8.0.3
I derived it from my dayz_code.pbo dated 10/15/2013. Yet the compiles.sqf is dated 3/13/2013. Hmm.
 
Hmmm... strange, those are the same modified dates that my files have, but the 1.8 dayz_spaceInterrupt section should look like this
Code:
dayz_spaceInterrupt = {
        private "_handled";
        _dikCode = _this select 1;
        _shiftState = _this select 2;
        _ctrlState = _this select 3;
        _altState = _this select 4;
        _handled = false;
 
        // Disable ESC after death (not sure if needed but it's here to make sure)
        if (_dikCode == 0x01 && r_player_dead) then {
            _handled = true;
        };
 
        switch (_dikCode) do {
            case 0x02: {
                ["rifle"] spawn player_switchWeapon;
                _handled = true;
            };
            case 0x03: {
                ["pistol"] spawn player_switchWeapon;
                _handled = true;
            };
            case 0x04: {
                ["melee"] spawn player_switchWeapon;
                _handled = true;
            };
            default {
                if (_dikCode in [0x58,0x57,0x44,0x43,0x42,0x41,0x40,0x3F,0x3E,0x3D,0x3C,0x3B,0x0B,0x0A,0x09,0x08,0x07,0x06,0x05]) then {
                    _handled = true;
                };
            };
        };
 
        if ((_dikCode in actionKeys "Gear") and (vehicle player != player) and !_shiftState and !_ctrlState and !_altState && !dialog) then {
            createGearDialog [player, "RscDisplayGear"];
            _handled = true;
        };
 
        //if (_dikCode in actionKeys 'MoveForward' or _dikCode in actionKeys 'MoveBack') then {r_interrupt = true};
        //Prevent exploit of drag body
        if ((_dikCode in actionKeys "Prone") and r_drag_sqf) then { force_dropBody = true; };
        if ((_dikCode in actionKeys "Crouch") and r_drag_sqf) then { force_dropBody = true; };
 
        if (_dikCode in actionKeys "MoveLeft") then {r_interrupt = true};
        if (_dikCode in actionKeys "MoveRight") then {r_interrupt = true};
        if (_dikCode in actionKeys "MoveForward") then {r_interrupt = true};
        if (_dikCode in actionKeys "MoveBack") then {r_interrupt = true};
        if (_dikCode in actionKeys "ForceCommandingMode") then {_handled = true};
        if (_dikCode in actionKeys "PushToTalk" and (time - dayz_lastCheckBit > 10)) then {
            dayz_lastCheckBit = time;
            [player,15,true,(getPosATL player)] call player_alertZombies;
        };
        if (_dikCode in actionKeys "VoiceOverNet" and (time - dayz_lastCheckBit > 10)) then {
            dayz_lastCheckBit = time;
            [player,15,true,(getPosATL player)] call player_alertZombies;
        };
        if (_dikCode in actionKeys "PushToTalkDirect" and (time - dayz_lastCheckBit > 10)) then {
            dayz_lastCheckBit = time;
            [player,5,false,(getPosATL player)] call player_alertZombies;
        };
        if (_dikCode in actionKeys "Chat" and (time - dayz_lastCheckBit > 10)) then {
            dayz_lastCheckBit = time;
            [player,15,false,(getPosATL player)] call player_alertZombies;
        };
        if (_dikCode in actionKeys "User20" or _dikCode in actionKeys "NetworkStats") then {
            if (!dayz_isSwimming and !dialog) then {
                [player,4,true,(getPosATL player)] call player_alertZombies;
                createDialog "horde_journal_front_cover";
            };
            _handled = true;
        };
        if ((_dikCode in [0x3E,0x0F,0xD3]) and (time - dayz_lastCheckBit > 10)) then {
            dayz_lastCheckBit = time;
            call player_forceSave;
        };
        if (_dikCode in [0xB8,0x38,0x3E,0x2A,0x36,0x01]) then {
            _displayg = findDisplay 106;
            if (!isNull _displayg) then {
            call player_forceSave;
            } else {
                if (dialog) then {
                    call player_forceSave;
                };
            };
        };
        _object = player getVariable ["constructionObject", objNull];
        if (!isNull _object and _dikCode in actionKeys "LeanLeft") then {
            _dir = getDir _object - 3;
            _object setDir _dir;
            _handled = true;
        };
        if (!isNull _object and _dikCode in actionKeys "LeanRight") then {
            _dir = getDir _object + 3;
            _object setDir _dir;
            _handled = true;
        };
        _handled
    };

I worry that if that's wrong for you, perhaps other files could be too.
 
Ok, I downloaded the dayz_code.pbo from the server. The compiles.sqf looks like what you have. Appears the dayz_code.pbo I grabbed originally might have been from the daiyz folder I have in there, lol. Looks like I have an old fn_selfActions.sqf, argh.
Guess I'll get back to ya later, I have some work to do, lol.
 
Any ideas why zombies won't spawn? I reverted my mission file back to stock, so it has something to do with that.
 
If you're running stock, then I haven't got a clue. I haven't had any issues with zombies not spawning unless I've been adding in custom loot tables and missed a line somewhere.
 
Hello guys! I have a problem when I usee the self blood bag (which is a great script and works great) that for some reason I can't fix the vehicles the menu for that doesnt pop up! I would like some help :D Thank you in advance and thanks for such a great forum and colabs!
 
Ok, figured it out. I had put an old variables.sqf in as well. That's all fixed now.

Strange problem I have now is, I decided to test out the spawn selection. Appears that's not working even though I have it set to 1 in my init.sqf

Any ideas of anything else I have to do to get the spawn selection screen to come up?
 
Hello guys! I have a problem when I usee the self blood bag (which is a great script and works great) that for some reason I can't fix the vehicles the menu for that doesnt pop up! I would like some help :D Thank you in advance and thanks for such a great forum and colabs!

You're using the wrong fn_selfActions.sqf. The one on Krixes' post is only to show you where to put the self blood section it's not to be used. Take your fn_selfActions from
@yourdayzmod\addons\dayz_code\compiles\

Ok, figured it out. I had put an old variables.sqf in as well. That's all fixed now.

Strange problem I have now is, I decided to test out the spawn selection. Appears that's not working even though I have it set to 1 in my init.sqf

Any ideas of anything else I have to do to get the spawn selection screen to come up?

I think I read somewhere that the spawn selection only works on the default hive and not with Reality. I could be mistaken though as I haven't actually tried enabling it on my server.
 
You're using the wrong fn_selfActions.sqf. The one on Krixes' post is only to show you where to put the self blood section it's not to be used. Take your fn_selfActions from
@yourdayzmod\addons\dayz_code\compiles\

So I should Edit that fn_selfActions.sqf and add the lines that is on Krixes?
 
After changing out the fn_selfActions.sqf the 1,2,3 weapon selection now works. However, now the Self Bloodbag shows up on the mouse scroll menu, but when you click it, nothing happens.
 
Ok, for those who have a Reality server such as HFB, and you want the Spawn Select screen when you first join or die on your server, you need to download a new HiveExt.dll file and replace the one in your @realitychenarus folder.
Worked for me. :)
 
Hey all. Just started hosting a dayz epoch 1.0.2.4 on an ST server. I have copied and done as suggested by Krixes and a load of other fixes fore BB etc. However when I run in the server blood bagging works brilliant but I cant get into any of the locked vehicles or even scroll on them. I am guessing the same would be true for not being able to salvage vehicles. Any help would be appreciated.

I am also pretty new to scripting etc know more then some and a lot less then most. :).

A bit more info is that the Epoch PBO's (from the server) do not have a few of the files in them eg. fn_selfactions.sqf. Would this be better as an add on in the ARMA AO folders instead of it being on the server , meaning that all players would need to modify their own files?


EDIT: Thanx below I found it in the original AO files also read on a few pages back that someone had the same problems followed the suggestions there works :)
 
Back
Top