An idea for bandaging...

lazyink

Valued Member!
Staff member
Would it be possible to have the bandage action linked to the scroll menu?

eg. ifBleeding then {scrollmenu="Bandage Self"}

Just a thought!
 
Would it be possible to have the bandage action linked to the scroll menu?

eg. ifBleeding then {scrollmenu="Bandage Self"}

Just a thought!

If you tear apart dayzcode you can write and fn_selfactions requiring a bandage, then pointing towards your script that then removes the bandage, performs the medic animation, and then heals the player.
 
Just use the UMEC varible or however you spell it. if it = true then call the normal bandage script
 
Something like this?

Updated it to this:

Code:
   if ((player getVariable["USEC_injured",true]) && ("ItemBandage" in _mags) )then { 
isBleedingCheck = true;
} else { isBleedingCheck = false;};
 
if((speed player <= 1) && isBleedingCheck && _canDo) then {
if (s_player_scrollBandage < 0) then {
s_player_scrollBandage = player addaction[("<t color=""#c70000"">" + ("Bandage") +"</t>"),"fixes\player_scrollBandage.sqf","",6,false,true,"", ""];
};
} else {
player removeAction s_player_scrollBandage;
s_player_scrollBandage = -1;
};
 
Something like this?

Updated it to this:

Code:
  if ((player getVariable["USEC_injured",true]) && ("ItemBandage" in _mags) )then {
isBleedingCheck = true;
} else { isBleedingCheck = false;};
 
if((speed player <= 1) && isBleedingCheck && _canDo) then {
if (s_player_scrollBandage < 0) then {
s_player_scrollBandage = player addaction[("<t color=""#c70000"">" + ("Bandage") +"</t>"),"fixes\player_scrollBandage.sqf","",6,false,true,"", ""];
};
} else {
player removeAction s_player_scrollBandage;
s_player_scrollBandage = -1;
};

whats in your playerscrollBandage.sqf? Cause you would have to have player removeMagazine "ItemBandage"; or whatnot
 
Got this working. I'll probably do a release for it in the Releases forum, but for now if you want to install it do the following.

You will need a custom compiles & selfActions for this to work.

Create a folder named medical in your mission.pbo, and inside create player_scrollBandage.sqf and insert the following code:

Code:
player removeMagazine "ItemBandage";
 
call fnc_usec_medic_removeActions;
r_action = false;
 
if (vehicle player == player) then {
    player playActionNow "Medic";
};
 
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
[player,"bandage",0,false] call dayz_zombieSpeak;
while {r_doLoop} do {
    _animState = animationState player;
    _isMedic = ["medic",_animState] call fnc_inString;
    if (_isMedic) then {
        _started = true;
    };
    if (_started and !_isMedic) then {
        r_doLoop = false;
        _finished = true;
    };
    if (r_interrupt) then {
        r_doLoop = false;
    };
    sleep 0.1;
};
r_doLoop = false;
 
if (_finished) then {
 
    [] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
    dayz_sourceBleeding = objNull;
    call fnc_usec_resetWoundPoints;
 
} else {
    r_interrupt = false;
    [objNull, player, rSwitchMove,""] call RE;
    player playActionNow "stop";
    player addMagazine "ItemBandage";
};


Open up your custom fn_selfActions.sqf and below

_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);

insert:

Code:
    // START lazyinks Bandage via Scroll Function
    _mags = magazines player; //IMPORTANT. IF SELF-BLOODBAG IS INSTALLED, DELETE THIS LINE!
 
    if ((player getVariable["USEC_injured",true]) && ("ItemBandage" in _mags) )then {
        isBleedingCheck = true;
    } else { isBleedingCheck = false;};
 
    if((speed player <= 1) && isBleedingCheck && _canDo) then {
        if (s_player_scrollBandage < 0) then {
            s_player_scrollBandage = player addaction[("<t color=""#c70000"">" + ("Bandage Wounds") +"</t>"),"medical\player_scrollBandage.sqf","",6,false,true,"", ""];
        };
    } else {
        player removeAction s_player_scrollBandage;
        s_player_scrollBandage = -1;
    };
    // END lazyinks Bandage via Scroll Function

If you have self-bloodbag installed you will need to remove the line highlighted in the above code!

If you are using Anti-hacks, you will need to add s_player_scrollBandage to the exceptions.
 
Really? Let me try to fix that. I have been testing this on Overwatch and the UI is a tad buggy there.
 
Hey lazyink, gave this a try tonight. For whatever reason, adding this removed all zombie and loot item spawns. I'm running Epoch 1.0.1.5. Commented out the stuff in fn_selfActions and everything returned to normal.
 
after this part
Code:
if (_finished) then {
 
    [] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
    dayz_sourceBleeding = objNull;
    call fnc_usec_resetWoundPoints;

so it would be
Code:
if (_finished) then {
 
    [] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
    dayz_sourceBleeding = objNull;
    call fnc_usec_resetWoundPoints;
    r_player_injured = false;

haven't tested that, it was just a thought.
 
any 1 got this 100 % working ?:D i installed this by your way ZGreen Spectre and when i bandage myself i stop bleeding but i still see blood from my body :D
 
i added this here and it doesnt help :D any ideas ?:D

Code:
[] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
    dayz_sourceBleeding = objNull;
    call fnc_usec_resetWoundPoints;
    r_player_injured = false;
    _unit setVariable["medForceUpdate",true];
 
Back
Top