Krixes - Self Bloodbag Script

yeah man... thats it... it works... =)
Im glad you got it working!
think i goofed. this was what i was supposed to send you, this works too.

Code:
// ------------------------------------------------------------------------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 && ( r_player_blood < 12000 ) ) then {
        if (s_player_selfBloodbag < 0) then {
            s_player_selfBloodbag = player addaction[("<t color=""#c70000"">" + ("Self Bloodbag") +"</t>"),"Selfblood\player_selfbloodbag.sqf","",5,false,true,"", ""];
        };
    } else {
        player removeAction s_player_selfBloodbag;
        s_player_selfBloodbag = -1;
    };
// -------------------------------------------------------------------------Krixes Self Bloodbag End--------------------------------------------------------------------------

That one i posted before was a failed test. SORRY!
This one is a way better. Good job. :)
It works on my server, but the animation for using a bloodbag on myself takes REALLY long time.
- The animation goes in loop for about 3-4 times before he stops and i've got full blood.

Havent tried the new script that Alkinda posted in #120
You can change most of the settings in the config area at the top of player_selfbloodbag.sqf
 
I'm still getting the option only when near a lootable object :(

Here's my code...

INIT.SQF

Code:
startLoadingScreen ["","DayZ_loadingScreen"];
enableSaving [false, false];
 
dayZ_instance = 7622;    //The instance
hiveInUse    =    true;
initialized = false;
dayz_previousID = 0;
 
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"; //Compile regular functions
progressLoadingScreen 1.0;
 
player setVariable ["BIS_noCoreConversations", true];
//enableRadio false;
 
"filmic" setToneMappingParams [0.153, 0.357, 0.231, 0.1573, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";
 
if (isServer) then {
    hiveInUse = true;
    _serverMonitor = [] execVM "\z\addons\dayz_server\system\server_monitor.sqf";
};
 
if (!isDedicated) then {[] execVM "Scripts\kh_actions.sqf";
    0 fadeSound 0;
    0 cutText [(localize "STR_AUTHENTICATING"), "BLACK FADED",60];
    _id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
    _playerMonitor =    [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
    "heliCrash" addPublicVariableEventHandler {
        _list = nearestObjects [_this select 1, ["CraterLong"], 100];
        {deleteVehicle _x;} foreach _list;
    };
 
};


INSIDE \FIXES:

compiles:
Code:
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 "fixes\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 System//TeeChange

selfactions:

Code:
if (!isNull _nearLight) then {
    if (_nearLight distance player < 4) then {
        _canPickLight = isNull (_nearLight getVariable ["owner",objNull]);
    };
};
_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>"),"fixes\player_selfbloodbag.sqf","",5,false,true,"", ""];
        };
    } else {
        player removeAction s_player_selfBloodbag;
        s_player_selfBloodbag = -1;
    };
// ---------------------------------------Krixes Self Bloodbag End------------------------------------
 
 
//Grab Flare
if (_canPickLight and !dayz_hasLight) then {
    if (s_player_grabflare < 0) then {

And the bloodbag script is inside the fixes folder..

I can't see where i'm going wrong, have removed all the other scripts from the server (apart from auto-refuel) but it is still buggy and not working!

A little help?!

thanks!
 
I'm still getting the option only when near a lootable object :(

A little help?!

thanks!
Can I see your dayz_mission.pbo.. if you do not wish to upload it to the public you may send me a private message including a download to it.

I don't see anything wrong here i this code.
 
Hi, I installed this mod on my main server a couple of days ago, but it seems that players can no longer cook meat. To be absolutely sure, I removed only this mod from my mission.pbo and uploaded it to my test server - now I can cook meat. Do you know what the issue might be? I would love to keep this on our public server.
 
Hi, I installed this mod on my main server a couple of days ago, but it seems that players can no longer cook meat. To be absolutely sure, I removed only this mod from my mission.pbo and uploaded it to my test server - now I can cook meat. Do you know what the issue might be? I would love to keep this on our public server.
This is extremely odd as my bloodbag script shouldn't have anything to do with cooking meat lol. Let me see your pbo's. :p
 
Here you go my good man. Just an FYI each of these has a different dayZ_instance in the init.sqf because they have been run on different servers. Same host, same everything else. One is just a test server.

http://speedy.sh/ddX34/dayz-mission-v107.pbo
http://speedy.sh/VVerw/dayz-mission-v107-noSelfBloodbag.pbo
K i think the issue has to do with Taviana. Extract the fn_selfactions.sqf that is in your original dayz taviana addons folder @taviana/addons/dayz_code.pbo/compile directory and follow the custom fn_selfactions.sqf installation. Believe this will fix the issue.
 
Hallo Krixes

Tolle Arbeit was du hier machst !

Leider gibt es Probleme mit Base Building.

Code:
call compile preprocessFileLineNumbers "dayz_code\init\compiles.sqf"; //Compile custom compiles

Sobald das in der init.sqf an ist, funktioniert dein Script leider nicht mehr.
Hast du eine ösung für mich ?

Mfg
 
Hallo Krixes

Tolle Arbeit was du hier machst !

Leider gibt es Probleme mit Base Building.

Sobald das in der init.sqf an ist, funktioniert dein Script leider nicht mehr.
Hast du eine ösung für mich ?

Mfg
Es ist, weil Base Building kommt mit seiner eigenen fn_selfactions.sqf

Öffnen Sie Ihre dayz_mission.pbo und gehen Sie zu "dayz_code \ compile \ fn_selfactions.sqf" und fügen Sie diese in seinem Inneren.
Code:
// ---------------------------------------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>"),"custom\player_selfbloodbag.sqf","",5,false,true,"", ""];
        };
    } else {
        player removeAction s_player_selfBloodbag;
        s_player_selfBloodbag = -1;
    };
// ---------------------------------------Krixes Self Bloodbag End------------------------------------
Kurz nach diesem Teil.
Code:
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
Sie gewohnt haben, um die compile.sqf, die mit meinem mod kommt zu verwenden. Verwenden Sie die eine, die mit BaseBuilding kommt. So stellen Sie sicher, dass Sie player_selfbloodbag.sqf in den richtigen Ordner.

Das sollte funktionieren. :)
 
Kurz nach diesem Teil.
Code:
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
Das sollte funktionieren. :)[/quote]



and in water, noticed that today.
 
Kurz nach diesem Teil.
Code:
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
Das sollte funktionieren. :)



and in water, noticed that today.
Unfortunately I did not add a catch for being in water, does it still work while in water or does swimming break the loop animation?
 
Hey Krixes. Having a problem with the infection. I have it to where no infections should occur, but it still happens. Anyway to get rid of this all together?
 
Hey Krixes. Having a problem with the infection. I have it to where no infections should occur, but it still happens. Anyway to get rid of this all together?
This is no easy task but it can be done.

You will need to remove this entire section...........
Code:
// check if infected
        if (random(_infectionChance) < 1) then {
            r_player_infected = true; //set players client to show infection
            player setVariable["USEC_infected",true,true]; //tell the server the player is infected
            cutText [format["You have used a bloodbag on yourself but the bloodbag was infected!"], "PLAIN DOWN"]; //display text at bottom center of screen if infected
         
            // check for if loosing life on infection is turned on
            if(_infectedLifeBool) then {
                r_player_blood = r_player_blood - _infectedLifeLost; //set players LOCAL blood to a certain ammount
                player setVariable["USEC_BloodQty",r_player_blood,true]; //save this blood ammount to the database
            } else { // if loosing life is turned off
                r_player_lowblood = false; //set lowblood setting to false
                10 fadeSound 1; //slowly fade their volume back to maximum
                "dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5; //disable post processing blur effect
                "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1],  [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5; //give them their colour back
                r_player_lowblood = false; //just double checking their blood isnt low
                player setVariable["USEC_BloodQty",r_player_blood,true]; //save this blood ammount to the database
            };
        } else { // if not infected
            r_player_lowblood = false; //set lowblood setting to false
            10 fadeSound 1; //slowly fade their volume back to maximum
            "dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5; //disable post processing blur effect
            "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1],  [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5; //give them their colour back
            r_player_lowblood = false; //just double checking their blood isnt low
            player setVariable["USEC_BloodQty",r_player_blood,true]; //save this blood ammount to the database
 
            cutText [format["You have used a bloodbag on yourself!"], "PLAIN DOWN"]; //display text at bottom center of screen on succesful self bloodbag
        };
and replace it with this........
Code:
            r_player_lowblood = false; //set lowblood setting to false
            10 fadeSound 1; //slowly fade their volume back to maximum
            "dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5; //disable post processing blur effect
            "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1],  [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5; //give them their colour back
            r_player_lowblood = false; //just double checking their blood isnt low
            player setVariable["USEC_BloodQty",r_player_blood,true]; //save this blood ammount to the database
   
            cutText [format["You have used a bloodbag on yourself!"], "PLAIN DOWN"]; //display text at bottom center of screen on succesful self bloodbag

Hope this helps. It can also be done by setting the infection chance really high, but there is that really really minute chance that it will happen anyway.
 
LMAO I have a self modified version of the smelting script running on my server that I called Crafting. Basicly right now until i get to add more to it, it allows you to make a bandage with 3 toilet paper and a crossbow quiver with 1 wood and 3? razors! Makes use of that trash loot! I have smelting running along side it so most of the trash loot becomes valuable!

I'm currently using W4rgo's smelting slightly modified... Although I'm curious as to what the "scrap pieces" are... And how I would go about disabling it, i assume its part of the default dayz_code.. but I was unable to find out where to comment it out in the compiles.sqf

Ideally I'd also be making various trash be used to make items based off of W4rgo's awesome work, any simple way of modifying it to incorporate new material types & outcomes?

Also W4rgo's smelting seems to be spammable in the actions menu... kinda allowing duplicating stuff. Would there possibly be a way to disable the actions menu while smelting?
 
Back
Top