No death from infection script

Paste it into a fixes folder or whatever, copy over the compiles.sqf from dayz_code.pbo and find
Code:
fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";        //Event handler run on damage
change that to
Code:
    //fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";        //Event handler run on damage
    fnc_usec_damageHandler = compile preprocessFileLineNumbers "fixes\fn_damageHandler.sqf";        //Event handler run on damage
then in your init.sqf (mission.pbo one) find
Code:
progressLoadingScreen 0.4;
(near the top) and change the line UNDERNEATH that to look like
Code:
call compile preprocessFileLineNumbers "fixes\compiles.sqf";
and then place compiles.sqf in the fixes folder

Whoa...
You just taught me a lot there, dude. Much appreciated.

I do have a question about part of the code that you gave me, though:

Code:
if(r_player_blood > 2000)

I'm wondering if you meant it to say: blood < 2000

It would make sense that I want the infection to end when the player's blood < 2000 rather than blood > 2000

Hey, I'm thankful that you took the time to help. Now I gotta go over this process several times in my head so that it all soaks in.
 
Whoa...
You just taught me a lot there, dude. Much appreciated.

I do have a question about part of the code that you gave me, though:

Code:
if(r_player_blood > 2000)

I'm wondering if you meant it to say: blood < 2000

It would make sense that I want the infection to end when the player's blood < 2000 rather than blood > 2000

Hey, I'm thankful that you took the time to help. Now I gotta go over this process several times in my head so that it all soaks in.

< 2000 means below 2000
<= 2000 equal to or below 2000
> 2000 more than 2000
=> 2000 equal or more than 2000
 
< 2000 means below 2000
<= 2000 equal to or below 2000
> 2000 more than 2000
=> 2000 equal or more than 2000

Ok, then the code follows the basic rules of math then. I'm finding never to take things for granted with this stuff, though. Had to ask. Thanks, Commander.
 
Paste it into a fixes folder or whatever, copy over the compiles.sqf from dayz_code.pbo and find
Code:
fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";        //Event handler run on damage
change that to
Code:
    //fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";        //Event handler run on damage
    fnc_usec_damageHandler = compile preprocessFileLineNumbers "fixes\fn_damageHandler.sqf";        //Event handler run on damage
then in your init.sqf (mission.pbo one) find
Code:
progressLoadingScreen 0.4;
(near the top) and change the line UNDERNEATH that to look like
Code:
call compile preprocessFileLineNumbers "fixes\compiles.sqf";
and then place compiles.sqf in the fixes folder

Ok, I just went in game and tested this. I purposefully got myself infected and waited to see if the infection would stop if my blood loss reached < 2000. It didn't. I died. There must be some other function that needs editing. I'm gonna dig around in fn_damageHandler.sqf and see if there's something that looks relevant. Haha.
 
No worries

Ok, I'm wondering if you know where the static player status check is located. That probably didn't make any sense. Let me try to rephrase...

I'm looking for the line of code that does a constant check for player status. For instance, checks to see if a player is infected. That way I can try and work in a way to check for "status infected" and do an "if" thing with it. Something like:


Code:
if    (r_player_infected) then {
 
                            if (r_player_blood < 2000) then {
 
                                r_player_infected = false;
                                player setVariable["USEC_infected",false,true];
 
                                };
 
                      };

Please don't laugh too hard. I'm not even remotely sure what I'm doing yet. Also, what is the difference between "r_player_blood" and "r_player_bloodTotal"?
 
Ok, I'm wondering if you know where the static player status check is located. That probably didn't make any sense. Let me try to rephrase...

I'm looking for the line of code that does a constant check for player status. For instance, checks to see if a player is infected. That way I can try and work in a way to check for "status infected" and do an "if" thing with it. Something like:


Code:
if    (r_player_infected) then {
 
                            if (r_player_blood < 2000) then {
 
                                r_player_infected = false;
                                player setVariable["USEC_infected",false,true];
 
                                };
 
                      };

Please don't laugh too hard. I'm not even remotely sure what I'm doing yet. Also, what is the difference between "r_player_blood" and "r_player_bloodTotal"?


Whoa, that code turned out really f'd up.
 
<removed by Retra, - no racism>

I tried everything I could think of. Every combination of ifs, whiles, thens, dos, gotos, blah blah blah. My brain feels like mush. I beat the crap out of fn_damageHandler.sqf and setup_functions_med.sqf and the sunnuvahguns wouldn't submit. I gave up literally 10 mins ago. Been at it all afternoon (and night - it's now 2:30 am). Reading code examples and function definitions and then tackling this script again and again.

I'm determined that the solution is somewhere in one of those two files or a combination of both.

I'm just too limited in experience to F with it anymore. I'll fork over $20 paypal to the code wizard that can put this together (in probably 10 mins.) Anybody?
 
Ok, I settled on a simple modification of "setup_functions_med.sqf" to combat the easily-infected-extremely-rare-antibiotics problem with 1.7.7.1.

I could just up the drop rate of antibiotics, but that wouldn't make me feel any better about the small amount of time the player sometimes has before death by infection. I just edited this line in setup_functions_med.sfq:

if (r_player_infected) then { _bloodLossPerSec = _bloodLossPerSec + 3 };

You can change the + value (default is +3) to whatever value you want to edit the speed at which the player bleeds-out from infection. Thanks.
 
Code:
_minBlood = r_player_blood <= 2000;
then
Code:
if (r_player_infected and !_minBlood) then { _bloodLossPerSec = _bloodLossPerSec + 3 };
Untested.
 
I am pretty knowledgeable about everything medical related thanks to my revive script, I spent about 2 weeks pouring over all the codes and modifying various things. Let me know EXACLTY what you want to accomplish, not just what would be acceptable and I'll see if I can help you. It's easily possible to keep a players blood at even as low as 5 while infected and still be susceptible to death from anything else. I believe it would be possible to be infected without blood loss as well although that would require modification of a few files rather than just one. Like I said there are a lot of options here, so just let me know EXACTLY how you want it to work. never settle man :) with arma 2 just about anything is possible so always try to make things exactly how you want them. If you are going to get into scripting the bistudio wiki is a great resource.http://community.bistudio.com/wiki/Main_Page
 
Also to answer you earlier question about the player status check, that is located in a variety of files. Most things in DayZ aren't handled by one script alone I've come to find out, to make matters worse a lot of medical functions are handled by a part of code that you can't change without requiring players to download a mod. There are ways to work around this however, which is where it gets annoyingly complicated.
 
Back
Top