Krixes - Self Bloodbag Script

oh and make this
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 "fixes\compiles.sqf";
fnc_usec_selfActions = compile preprocessFileLineNumbers "scripts\fn_selfActions.sqf";
progressLoadingScreen 1.0;
looks like
Code:
//Load in compiled functions
call compile preprocessFileLineNumbers "fixes\variables.sqf";                //Initilize the Variables (IMPORTANT: Must happen very early)
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "fixes\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 "fixes\compiles.sqf";
fnc_usec_selfActions = compile preprocessFileLineNumbers "WEREYOUPLACEYOURFILE\fn_selfActions.sqf";
progressLoadingScreen 1.0;
stream_locationCheck = {

Good Evening Wookie!

I watched your video and attempted the course of action(s) that you recommended, however I am not having any luck. I used all of the files you included within your youtube tutorial; including your compiles.sqf file, the fn_selfActions.sqf, the player_selfbloodbag.sqf and I also downloaded your fixes and extracted them into my fixes folder. I verified and made sure all the paths were correct before going any further.


I started up my server, logged into the game, gave it a whirl, and I discovered a handful of issues.
~ Zombies weren't not spawning at all (as you had indicated)
~ Loot was not spawning at all
~ I did see the red "SELF-BLOODBAG" option when using the scroll-wheel, but it did not do anything. I even tried a handful of times to be certain.


Then I saw what you had posted up in #898 (regarding the init.sqf), and I went ahead and made those changes as well. Copy and pasted it exactly, and I changed the path to the fn_selfActions file to scripts -- as that's the way mine's set up.

Then I started up my server and tried it again... Now I am unable to join the server... It is merely timing out when I try to join.

I just wanted to give you a heads up and let you know that I tried, and have failed once again.... =(
 
I don't recommend you to just change the init.sqf to that one, the init.sqf you have is created for DayZCC and has some functions in it that you won't get if you just replace it with that one.

The only reason your init.sqf looks like that is because they look like that when they are generated fresh HERE. A new vanilla init.sqf doesn't contain those "//Load in compiled functions" that's added later by users/creators, not needed if your running a vanilla server.

It looks different because it's made for CC and to save space in the mission file (didn't add stuff thats not needed), only thing you really need to do is add calls for the compiles.sqf and the fn_selfActions.sqg in the init.sqf and that should do it.

Or add the part:
Code:
//Load in compiled functions
call compile preprocessFileLineNumbers "fixes\variables.sqf";                //Initilize the Variables (IMPORTANT: Must happen very early)
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "fixes\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 "fixes\compiles.sqf";
fnc_usec_selfActions = compile preprocessFileLineNumbers "WEREYOUPLACEYOURFILE\fn_selfActions.sqf";
progressLoadingScreen 1.0;

To your already existing init.sqf
well i have to say i got it to work on dayzcc and dayz hive so i downloaded the merged mission files and the file i replaced was init.sqf
 
Good Evening Wookie!

I watched your video and attempted the course of action(s) that you recommended, however I am not having any luck. I used all of the files you included within your youtube tutorial; including your compiles.sqf file, the fn_selfActions.sqf, the player_selfbloodbag.sqf and I also downloaded your fixes and extracted them into my fixes folder. I verified and made sure all the paths were correct before going any further.


I started up my server, logged into the game, gave it a whirl, and I discovered a handful of issues.
~ Zombies weren't not spawning at all (as you had indicated)
~ Loot was not spawning at all
~ I did see the red "SELF-BLOODBAG" option when using the scroll-wheel, but it did not do anything. I even tried a handful of times to be certain.

Then I saw what you had posted up in #898 (regarding the init.sqf), and I went ahead and made those changes as well. Copy and pasted it exactly, and I changed the path to the fn_selfActions file to scripts -- as that's the way mine's set up.

Then I started up my server and tried it again... Now I am unable to join the server... It is merely timing out when I try to join.

I just wanted to give you a heads up and let you know that I tried, and have failed once again.... =(
that was happing to me at the first it might be something try installing BuildingLoot
 
I don't recommend you to just change the init.sqf to that one, the init.sqf you have is created for DayZCC and has some functions in it that you won't get if you just replace it with that one.

The only reason your init.sqf looks like that is because they look like that when they are generated fresh HERE. A new vanilla init.sqf doesn't contain those "//Load in compiled functions" that's added later by users/creators, not needed if your running a vanilla server.

It looks different because it's made for CC and to save space in the mission file (didn't add stuff thats not needed), only thing you really need to do is add calls for the compiles.sqf and the fn_selfActions.sqg in the init.sqf and that should do it.

Or add the part:
Code:
//Load in compiled functions
call compile preprocessFileLineNumbers "fixes\variables.sqf";                //Initilize the Variables (IMPORTANT: Must happen very early)
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "fixes\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 "fixes\compiles.sqf";
fnc_usec_selfActions = compile preprocessFileLineNumbers "WEREYOUPLACEYOURFILE\fn_selfActions.sqf";
progressLoadingScreen 1.0;

To your already existing init.sqf


Hi there Squadron! Thanks for not giving up on me... I do appreciate it. =)

Today I tried Wookie's approach (above), but it didn't work... I will try again tomorrow using your approach. I'll be sure to post my results here in the forum. Thanks again for you time.... and you cooperation...
 
Good Evening Wookie!

I watched your video and attempted the course of action(s) that you recommended, however I am not having any luck. I used all of the files you included within your youtube tutorial; including your compiles.sqf file, the fn_selfActions.sqf, the player_selfbloodbag.sqf and I also downloaded your fixes and extracted them into my fixes folder. I verified and made sure all the paths were correct before going any further.


I started up my server, logged into the game, gave it a whirl, and I discovered a handful of issues.
~ Zombies weren't not spawning at all (as you had indicated)
~ Loot was not spawning at all
~ I did see the red "SELF-BLOODBAG" option when using the scroll-wheel, but it did not do anything. I even tried a handful of times to be certain.

Then I saw what you had posted up in #898 (regarding the init.sqf), and I went ahead and made those changes as well. Copy and pasted it exactly, and I changed the path to the fn_selfActions file to scripts -- as that's the way mine's set up.

Then I started up my server and tried it again... Now I am unable to join the server... It is merely timing out when I try to join.

I just wanted to give you a heads up and let you know that I tried, and have failed once again.... =(


BELOW ARE THE FILES/CHANGES THAT WERE MADE
:

1.) init.sqf
Code:
//Load in compiled functions
call compile preprocessFileLineNumbers "fixes\variables.sqf";                //Initilize the Variables (IMPORTANT: Must happen very early)
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "fixes\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 "fixes\compiles.sqf";
fnc_usec_selfActions = compile preprocessFileLineNumbers "scripts\fn_selfActions.sqf";
progressLoadingScreen 1.0;
stream_locationCheck = {

2.) compiles.sqf
Code:
//Player only

if (!isDedicated) then {
    "filmic" setToneMappingParams [0.07, 0.31, 0.23, 0.37, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";

    player_onSide =  compile preprocessFileLineNumbers "fixes\player_onSide.sqf";   //Anti-Voice on Side Chat Addon
    BIS_Effects_Burn = compile preprocessFile "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf";
    player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";    //Run on a players computer, checks if the player is near a zombie
    player_zombieAttack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieAttack.sqf";    //Run on a players computer, causes a nearby zombie to attack them
    fnc_usec_damageActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageActions.sqf";        //Checks which actions for nearby casualty
    fnc_inAngleSector = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inAngleSector.sqf";        //Checks which actions for nearby casualty
    fnc_usec_selfActions =        compile preprocessFileLineNumbers "scripts\fn_selfActions.sqf";        //Checks which actions for self
    fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
    player_temp_calculation = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_temperatur.sqf";        //Temperatur

3.) fn_selfActions.sqf
Code:
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);

// ---------------------------------------Krixes Self Bloodbag Start------------------------------------
    _mags = magazines player;

    // Krixes Self Bloodbag
    if ("ItemBloodbag" in _mags) then {
        hasBagItem = true;
    } else { hasBagItem = false;};
    if((speed player <= 1) && hasBagItem && _canDo) then {
        if (s_player_selfBloodbag < 0) then {
            s_player_selfBloodbag = player addaction[("<t color=""#c70000"">" + ("Self Bloodbag") +"</t>"),"scripts\player_selfbloodbag.sqf","",5,false,true,"", ""];
        };
    } else {
        player removeAction s_player_selfBloodbag;
        s_player_selfBloodbag = -1;
    };
// ---------------------------------------Krixes Self Bloodbag End-----------------

//Grab Flare

4.) player_selfbloodbag.sqf
Code:
//////////////////////////////////////////////////////////////////////////////////////////////
// Script writen by Krixes //
// Infection chance and some comments added by Player2 //
// Combat check added by istealth //
// //
// Version 1.4 //
// //
// Change Log: //
// 1: Added bloodbag use timer //
// 2: Added a timer for the amount of time before player can use self bloodbag again //
//////////////////////////////////////////////////////////////////////////////////////////////

private ["_bloodAmount","_humanityBool","_infectionChance","_humanityNegBool","_humanityNegAmount","_humanityAmount","_infectedLifeLost","_infectedLifeBool","_lastBloodbag","_bloodbagLastUsedTime","_bloodbagTime","_bloodbagUseTime","_bloodbagUsageTime"];



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Config Start-----------------------------------------------------------------------------------------------------------------------//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

_bloodAmount = 6000; // Amount of blood to give to player
_bloodbagUseTime = 45; // Amount of time it takes in second for the player to use the self bloodbag
_bloodbagLastUsedTime = 60; // Amount of time in seconds before player can use self bloodbag again after a succesful use

_infectionChance = 10; // Percent chance of player infection on self bloodbag (10 = 10% | 2 = 50% | 1 = 100%)
_infectedLifeBool = true; // Whether the player can loose life if infected (True = On | False = off)
_infectedLifeLost = 1000; // Amount of life to loose in becomes infected

_humanityBool = false; // Whether the player can get humanity from giving self a bloodbag (True = On | False = off)
_humanityAmount = 50; // Amount of humanity to give player if _humanityBool is true (250 is default for normal bloodbags)

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Config End-------------------------------------------------------------------------------------------------------------------------//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

BELOW IS A LIST OF MY FILE PATHS:
1.) C:\...\Steam\SteamApps\common\Arma 2 Operation Arrowhead\MPMissions\dayz_1.chernarus\init.sqf
2.) C:\...\Steam\SteamApps\common\Arma 2 Operation Arrowhead\MPMissions\dayz_1.chernarus\fixes\compiles.sqf*
3.) C:\...\Steam\SteamApps\common\Arma 2 Operation Arrowhead\MPMissions\dayz_1.chernarus\scripts\fn_selfActions.sqf
4.) C:\...\Steam\SteamApps\common\Arma 2 Operation Arrowhead\MPMissions\dayz_1.chernarus\scripts\player_selfbloodbag.sqf


Do you see anything wrong with my files and/or paths?
 
Will this building loot script allow me to get back into my server? For some reason, I can't login anymore. It keeps timing out. Ever since I made that 2nd batch of changes to my init.sqf file, I haven't been able to log in. =(
do you have visa skype send me a pm ill add you
 
BELOW ARE THE FILES/CHANGES THAT WERE MADE:

1.) init.sqf
Code:
//Load in compiled functions
call compile preprocessFileLineNumbers "fixes\variables.sqf";                //Initilize the Variables (IMPORTANT: Must happen very early)
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "fixes\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 "fixes\compiles.sqf";
fnc_usec_selfActions = compile preprocessFileLineNumbers "scripts\fn_selfActions.sqf";
progressLoadingScreen 1.0;
stream_locationCheck = {

2.) compiles.sqf
Code:
//Player only

if (!isDedicated) then {
    "filmic" setToneMappingParams [0.07, 0.31, 0.23, 0.37, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";

    player_onSide =  compile preprocessFileLineNumbers "fixes\player_onSide.sqf";   //Anti-Voice on Side Chat Addon
    BIS_Effects_Burn = compile preprocessFile "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf";
    player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";    //Run on a players computer, checks if the player is near a zombie
    player_zombieAttack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieAttack.sqf";    //Run on a players computer, causes a nearby zombie to attack them
    fnc_usec_damageActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageActions.sqf";        //Checks which actions for nearby casualty
    fnc_inAngleSector = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inAngleSector.sqf";        //Checks which actions for nearby casualty
    fnc_usec_selfActions =        compile preprocessFileLineNumbers "scripts\fn_selfActions.sqf";        //Checks which actions for self
    fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
    player_temp_calculation = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_temperatur.sqf";        //Temperatur

3.) fn_selfActions.sqf
Code:
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);

// ---------------------------------------Krixes Self Bloodbag Start------------------------------------
    _mags = magazines player;

    // Krixes Self Bloodbag
    if ("ItemBloodbag" in _mags) then {
        hasBagItem = true;
    } else { hasBagItem = false;};
    if((speed player <= 1) && hasBagItem && _canDo) then {
        if (s_player_selfBloodbag < 0) then {
            s_player_selfBloodbag = player addaction[("<t color=""#c70000"">" + ("Self Bloodbag") +"</t>"),"scripts\player_selfbloodbag.sqf","",5,false,true,"", ""];
        };
    } else {
        player removeAction s_player_selfBloodbag;
        s_player_selfBloodbag = -1;
    };
// ---------------------------------------Krixes Self Bloodbag End-----------------

//Grab Flare

4.) player_selfbloodbag.sqf
Code:
//////////////////////////////////////////////////////////////////////////////////////////////
// Script writen by Krixes //
// Infection chance and some comments added by Player2 //
// Combat check added by istealth //
// //
// Version 1.4 //
// //
// Change Log: //
// 1: Added bloodbag use timer //
// 2: Added a timer for the amount of time before player can use self bloodbag again //
//////////////////////////////////////////////////////////////////////////////////////////////

private ["_bloodAmount","_humanityBool","_infectionChance","_humanityNegBool","_humanityNegAmount","_humanityAmount","_infectedLifeLost","_infectedLifeBool","_lastBloodbag","_bloodbagLastUsedTime","_bloodbagTime","_bloodbagUseTime","_bloodbagUsageTime"];



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Config Start-----------------------------------------------------------------------------------------------------------------------//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

_bloodAmount = 6000; // Amount of blood to give to player
_bloodbagUseTime = 45; // Amount of time it takes in second for the player to use the self bloodbag
_bloodbagLastUsedTime = 60; // Amount of time in seconds before player can use self bloodbag again after a succesful use

_infectionChance = 10; // Percent chance of player infection on self bloodbag (10 = 10% | 2 = 50% | 1 = 100%)
_infectedLifeBool = true; // Whether the player can loose life if infected (True = On | False = off)
_infectedLifeLost = 1000; // Amount of life to loose in becomes infected

_humanityBool = false; // Whether the player can get humanity from giving self a bloodbag (True = On | False = off)
_humanityAmount = 50; // Amount of humanity to give player if _humanityBool is true (250 is default for normal bloodbags)

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Config End-------------------------------------------------------------------------------------------------------------------------//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

BELOW IS A LIST OF MY FILE PATHS:
1.) C:\...\Steam\SteamApps\common\Arma 2 Operation Arrowhead\MPMissions\dayz_1.chernarus\init.sqf
2.) C:\...\Steam\SteamApps\common\Arma 2 Operation Arrowhead\MPMissions\dayz_1.chernarus\fixes\compiles.sqf*
3.) C:\...\Steam\SteamApps\common\Arma 2 Operation Arrowhead\MPMissions\dayz_1.chernarus\scripts\fn_selfActions.sqf
4.) C:\...\Steam\SteamApps\common\Arma 2 Operation Arrowhead\MPMissions\dayz_1.chernarus\scripts\player_selfbloodbag.sqf


Do you see anything wrong with my files and/or paths?


I RECOMEND makeing a folder on your desktop saying dayz server and drag both arma 2 and arma 2 oa director in it
 
try this https://dl.dropboxusercontent.com/u/73434581/dayz_5.chernarus.rar if it does work i hope it does and if it does not im sorry

Oh wow! I hope it works. Unfortunately, I wont be able to find out until tomorrow.

It looks like you've got Sarge-AI, Strip Vehicles, Custom Debug Monitor, Suicide, Streetlights, Dynamic Weather, and some other add-ons that I'm not even familiar with. What is SHK_pos and UPSMON, btw? The only other things I'd add (on my personal server) would be smelting, base building, and possibly the strip clothes script and the spawn selection menu. Looks like you've got a nice package going there... I look forward to trying it out. I'll give it a whirl tomorrow and let you know. ;)

Thanks again Wookie! Thanks for your all your time and your efforts. =)
 
Oh wow! I hope it works. Unfortunately, I wont be able to find out until tomorrow.

It looks like you've got Sarge-AI, Strip Vehicles, Custom Debug Monitor, Suicide, Streetlights, Dynamic Weather, and some other add-ons that I'm not even familiar with. What is SHK_pos and UPSMON, btw? The only other things I'd add (on my personal server) would be smelting, base building, and possibly the strip clothes script and the spawn selection menu. Looks like you've got a nice package going there... I look forward to trying it out. I'll give it a whirl tomorrow and let you know. ;)

Thanks again Wookie! Thanks for your all your time and your efforts. =)
i want to help everyone xD
 
well i have to say i got it to work on dayzcc and dayz hive so i downloaded the merged mission files and the file i replaced was init.sqf

Sure it will work but if you just replace tje init.sqf you will loose aome stuff to. For example you won't be able to use gcam-admintool. You will have to merge the files.
 
try this https://dl.dropboxusercontent.com/u/73434581/dayz_5.chernarus.rar if it does work i hope it does and if it does not im sorry

Well... I deleted everything that was in my /dayz_1.chernarus/ folder, extracted your files into my folder, and gave it a whirl. Still no luck. Now I'm getting an error message regarding the loadscreen.jpg (no being found). Even with the missing loadscreen, it appears that it still tries to load, but unfortunately it keeps timing out on me.

I'm discouraged now... I thought that was gonna work...
 
Just downloading and extracting those files will not work. Theres more scripts in that mission and some of the scripts require changes to be made in the dayz_server.pbo
 
Back
Top