Krixes - Self Bloodbag Script

Mine works for me, But almost everyone who logs in game says theres no option, you gotta scroll for like 20 minutes to see it appear, then it dissapears in a micro-second, gotta be lucky to catch it, Any known fixes this?
Ricki are you running anti Haxx and or any other scripts like it?
 
"You have way to many compiles going on pointing at many different fn_selfActions.sqf... I would pick one and modify it to include the changes from all the different ones and also pick one fn_selfActions.sqf and merge all the changes into it as well."

Im kinda new to all this. Would there be any chance u could help me clean up the script a little?
 
Krixes, can we get a write up for a countdown timer once you start the process?

If a countdown is difficult, how about just some cueText that says "You've started to heal yourself, the process will take XX to complete" where XX is the time you've set in the .sqf file?

Thanks!
 
The compiles.sqf is a .sqf file and should not be a text file. Another thing to watch for is to make sure the spelling is correct and the capitalization actually makes a difference.
Is any of these wrong or correct?

Code:
//Load in compiled functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";//Initilize the Variables (IMPORTANT: Must happen very early)
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";//Initilize the publicVariable event handlers
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";//Functions used by CLIENT for medical
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";//Compile regular functions
progressLoadingScreen 0.5;
call compile preprocessFileLineNumbers "server_traders.sqf";//Compile trader configs
call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile custom compiles
progressLoadingScreen 1.0

Please let me know if anything is wrong, and what is correct.
 
Please let me know if anything is wrong, and what is correct.
That looks correct bud, now just make sure your compiles.sqf is in the custom folder. Also make sure player_selfbloodbag.sqf and fn_selfActions.sqf is also in the custom folder. Also make sure since it looks like your using Epoch you use the fn_selfActions.sqf that came in the dayz_code.pbo that came with Epoch and just add my custom code to it, I don't believe just downloading my fn_selfActions.sqf will work with Epoch at all, you have to use the one that came with Epoch as it is different than the one I used.

Krixes, can we get a write up for a countdown timer once you start the process?

If a countdown is difficult, how about just some cueText that says "You've started to heal yourself, the process will take XX to complete" where XX is the time you've set in the .sqf file?

Thanks!
This is getting to be a pretty popular feature! I will do a write up for this in a little while. Beware though it may be a little complicated to write this to make you guys understand exactly how to do it, but I will give it a shot anyway.:)
 
Adding a timer to Self Bloodbag!
This is a little guide to add a countdown timer to the using of Self Bloodbag!​
Step 1:​
Line number 13 change it too...​
Code:
private ["_bloodAmount","_humanityBool","_infectionChance","_humanityNegBool","_humanityNegAmount","_humanityAmount","_infectedLifeLost","_infectedLifeBool","_lastBloodbag","_bloodbagLastUsedTime","_bloodbagTime","_bloodbagUseTime","_bloodbagUsageTime","_bloodbagTimer"];
Step 2:​
Modify this section starting at line 46 to look like this.......​
Code:
_bloodbagTime = time - lastBloodbag; // Variable used for easy reference in determining the self bloodbag cooldown
_bloodbagUsageTime = time;
_bloodbagTimer = _bloodbagUseTime; // This is our countdown timer variable
 
if(_bloodbagTime < _bloodbagLastUsedTime) exitWith { // If cooldown is not done then exit script
    cutText [format["You may not use Self Bloodbag this soon please wait %1!",(_bloodbagTime - _bloodbagLastUsedTime)], "PLAIN DOWN"]; //display text at bottom center of screen when players cooldown is not done
};

Step 3:
Modify the entire while loop section starting at line 68 to look like this....
Code:
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 - _bloodbagUsageTime) < _bloodbagUseTime) then {
        player playActionNow "Medic"; //play bloodbag animation
        _isMedic = true;
    };
    if (_started && !_isMedic && (time - _bloodbagUsageTime) > _bloodbagUseTime) then {
        r_doLoop = false; // turns off the loop
        _finished = true; // set finished to true to finish the self bloodbag and give player health/humanity
        lastBloodbag = time; // the last self bloodbag time
    };
    if (r_interrupt) then {
        r_doLoop = false; // if interuppted turns loop off early so _finished is never true
    };
    _bloodbagTimer = _bloodbagTimer - 1; // Minus 1 second per tick to display time remaining
    cutText [format["You are using Self Bloodbag. %1 seconds remaining!", _bloodbagTimer], "PLAIN DOWN"]; //Display text at bottom center of screen when using bloodbag to display countdown timer
    sleep 1;
};


This should do the trick, I didn't have time to check this to make sure it worked so if someone could try it out and get back to me it would be appreciated!

I am pretty sure this should work just fine though.
 
That looks correct bud, now just make sure your compiles.sqf is in the custom folder. Also make sure player_selfbloodbag.sqf and fn_selfActions.sqf is also in the custom folder. Also make sure since it looks like your using Epoch you use the fn_selfActions.sqf that came in the dayz_code.pbo that came with Epoch and just add my custom code to it, I don't believe just downloading my fn_selfActions.sqf will work with Epoch at all, you have to use the one that came with Epoch as it is different than the one I used.
Ok thanks.

However, if I am going back to say normal Chernarus, I don't need to edit anything (in the bloodbag thingy)?

Also, the new file I need to make (compiles.sqf), is it named compiles or compiles.sqf? Just to be sure. :)
 
Tried the countdown timer but it only moves 1 second for every animation that it does. So really it's 60 seconds, but only counts down to 50 seconds, since every 1 second that it counts down is really closer to 10 seconds because of the animation.
 
Ok thanks.

However, if I am going back to say normal Chernarus, I don't need to edit anything (in the bloodbag thingy)?

Also, the new file I need to make (compiles.sqf), is it named compiles or compiles.sqf? Just to be sure. :)
It's name is compiles and its extension is .sqf :) Also if you are using regular chernarus you wont have to change anything and can use everything included here. :)

Tried the countdown timer but it only moves 1 second for every animation that it does. So really it's 60 seconds, but only counts down to 50 seconds, since every 1 second that it counts down is really closer to 10 seconds because of the animation.
Oh jesus I shouldn't write code when im on pain medication lol... let me rewrite that to be more efficient! :p

When you get the chance go back to the post and redo step #3 as I have modified it and this should work better.
 
Im desperatly trying to do this script, I run Dayz offline.
I don't have the "Dayz_mission.pbo" file.

Somebody who can give me some advice.

Thanks!
 
Thank you, using -6 has put it at the bottom of every context menu list I've encountered. :)
Awesome! :)

Im desperatly trying to do this script, I run Dayz offline.
I don't have the "Dayz_mission.pbo" file.

Somebody who can give me some advice.

Thanks!
I have never played with DayZ Single Player so I wouldn't have the slightest clue as to how to tell you to add it without seeing it. What does the mission file look like for single player?
 
have just tried the count down timer, have it set to take 10 seconds to do self blood bad. When i do it the counter gets to -6 before it finishes the self blood bag
 
Yes just tested that as well, looks like it has to finish the animation before it completes so mine counted down to -5 lol.
 
nope that dont solve it either :(

16 sec blood bag brings the timer to -1 when it ends
17 sec blood bag brings the timer to -5 roughly.

Im gona stick with the 16 sec (-1) for now as its almost there
 
nope that dont solve it either :(

16 sec blood bag brings the timer to -1 when it ends
17 sec blood bag brings the timer to -5 roughly.

Im gona stick with the 16 sec (-1) for now as its almost there

I think the animation takes roughly 5 seconds to complete. Maybe instead of using a -1 one the timer try using a -5.

This is the portion to modify.....
Code:
_bloodbagTimer = _bloodbagTimer - 1;
 
Back
Top