No death from infection script

snarf

Member
Hello,

I would like to know how to disable death from infection. It seems like it should be a fairly simple procedure. I don't mind the infection symptoms, but I'd like to disable death caused by infection. Does anyone know how I could do this? Thanks for any help.

Joe
 
It seems when looking at the fn_damageHandler.sqf (and with my limited experience) that maybe death is caused by whatever function determines how fast a player bleeds out. There must be a way to re-route this so that a bleed-out caused by infection is made to be a much(much) slower blood loss variable. Or to even to stop blood loss from infection when blood level reaches like 1% or something. I don't know. Any thoughts?
 
Add a wait in it then stop the bleeding. Give it enough time to bleed 1/3. That way any player with more than 1/3 health will survive (or whatever you want)
 
Cool, thanks for the reply. Can I do that from fn_damageHandler.sqf ? Here is the file:

http://pastebin.com/dWLC1tDx

Where would I add the "wait"? And, if you have the time, what code would I add to get the desired result? Are there other files that I would need to edit?

Thanks again.
 
If you wanted to be cheap about it, you could have it spawn antibiotics on the player if they get infected xD

fn_damageHandler around line 167 :
Code:
if (_hitInfection) then {
    r_player_infected = true;
    player setVariable["USEC_infected",true,true];
    _unit addMagazine "ItemAntibiotic";
};

Not sure if this will work, but since that code falls under and if statement containing
Code:
if (_unit == player) then {
I think it might. This is, of course, the lazy way of doing things :D
 
Haha. I like that. I see that you help install scripts for cash. If you can help me with this "No death on infection" script, I can do pay pal or something.
What I want is a script that allows infection and related symptoms, e.g. blood loss, blurred vision, passing out, etc... but blood loss stops at very minimal life so as to prevent death.

p.s. I have DayZ 1.7.7.1
 
Haha. I like that. I see that you help install scripts for cash. If you can help me with this "No death on infection" script, I can do pay pal or something.
What I want is a script that allows infection and related symptoms, e.g. blood loss, blurred vision, passing out, etc... but blood loss stops at very minimal life so as to prevent death.

p.s. I have DayZ 1.7.7.1

To where infection is removed at say...2000 blood?
 
I'd rather the infection isn't removed. I still want the coughing, passing out, contagious, etc... Just want the blood loss to stop just before death. Is that possible?
 
I'd rather the infection isn't removed. I still want the coughing, passing out, contagious, etc... Just want the blood loss to stop just before death. Is that possible?

No, i'd have to say not possible. I'm not the best at this sort of thing but being infected (coughing and all that) entails blood loss. I messaged you a simple version of it removing around 2000 blood, i'm sure someone (who is probably much better and not as tired as I) can write a loop or something that will (if the player is infected) continuously set their blood to say...2000. That way, they can only die from massive trauma such as a gunshot or crash. Hope someone can help you get as close as possible to your ideal script mang :) off to bed now ~ night
 
No, i'd have to say not possible. I'm not the best at this sort of thing but being infected (coughing and all that) entails blood loss. I messaged you a simple version of it removing around 2000 blood, i'm sure someone (who is probably much better and not as tired as I) can write a loop or something that will (if the player is infected) continuously set their blood to say...2000. That way, they can only die from massive trauma such as a gunshot or crash. Hope someone can help you get as close as possible to your ideal script mang :) off to bed now ~ night
You could just remove the infection status after the player is below 2000 and then just set the infection variable to nil.
 
You could just remove the infection status after the player is below 2000 and then just set the infection variable to nil.

Thanks for your input, Commander. If the script was modified in the way you suggested, would the player still be technically "infected" however not die from the infection?

I'm having technical difficulties with the dayz_code.pbo. I'm trying to edit the script in the way that Matt suggested, but when I repack the pbo and upload it to my server, I get this "z/addons/dayz_code/init/variables.sqf not found" error. As I documented in this thread:

http://opendayz.net/threads/dayz_code-init-variables-sqf-not-found.13775/

I hope this does not count as a double post. I also found it necessary to post this problem here because it is directly related to this topic.
 
UPDATE:

I tried downloading the original dayz_code.pbo from the server, extracting it with PBO Manager and without making any changes to any file, I repacked it with PBO Manager and uploaded it the server. I get the same error

"z/addons/dayz_code/init/variables.sqf not found"

I'm sure I'm not the only person that has run into this type of problem. Is there a more efficient way to download/upload files to the server? Perhaps, some kind of ftp/myphp route that I don't know about? I'm going to search the forum for topics that might address this issue, but I'd really appreciate it if someone could direct me to those resources if they exist. Thank you.
 
Why are you packing/unpacking. You just copy over the necessary files and place them in your mission.pbo if you make any changes to default dayz_code.pbo it will glitch up
 
Why are you packing/unpacking. You just copy over the necessary files and place them in your mission.pbo if you make any changes to default dayz_code.pbo it will glitch up


Matt! How's it going?
How do I do that? How do I copy over an .sqf without opening the pbo? That may sound silly, but this is my first venture with dayz_code.pbo.
When I add mods (e.g. auto refuel, etc... ) to my dayz_1.chernarus.pbo, I always extract/pack it and upload.
You mean to tell me there's a better way? o_O
 
Matt! How's it going?
How do I do that? How do I copy over an .sqf without opening the pbo? That may sound silly, but this is my first venture with dayz_code.pbo.​
When I add mods (e.g. auto refuel, etc... ) to my dayz_1.chernarus.pbo, I always extract/pack it and upload.​
You mean to tell me there's a better way? o_O

if you are using pboviewer you can just unpack it into a folder (I assume that's what you're doing) but with pboviewer you can also just OPEN day_zcode and click on the sqf you want, there should be a function for copying. No editing necessary to dayz_code, just take compiles or variables or w/e one is calling on the damage handler and overwrite it.
 
if you are using pboviewer you can just unpack it into a folder (I assume that's what you're doing) but with pboviewer you can also just OPEN day_zcode and click on the sqf you want, there should be a function for copying. No editing necessary to dayz_code, just take compiles or variables or w/e one is calling on the damage handler and overwrite it.

Holy shnikes. You're losing me, Matt. Sorry for my ignorance. I just downloaded PBO View and opened dayz_code.pbo (no extract) and I located the .sqf I want to overwrite. Can I just overwrite the fn_damageHandler.sqf with my modified one and close the pbo? Then upload the pbo to my server and voila?
 
Holy shnikes. You're losing me, Matt. Sorry for my ignorance. I just downloaded PBO View and opened dayz_code.pbo (no extract) and I located the .sqf I want to overwrite. Can I just overwrite the fn_damageHandler.sqf with my modified one and close the pbo? Then upload the pbo to my server and voila?

lolno. You'll break dayz. Each client uses it's own dayz_code so it wouldn't affect anything anyways.
 
lolno. You'll break dayz. Each client uses it's own dayz_code so it wouldn't affect anything anyways.

... :confused:
Well, this is what I have so far:

I've copied the fn_damageHandler.sqf and added the piece of code you suggested. So now I have a modified fn_damageHandler.sqf.

What do I do now? In noob terms, please.

I hate to keep pestering you, but help from other people has been virtually non-existent.
 
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
 
Back
Top