Headshot Only Zombies

Saethkept

Well-Known Member
I spent quite a bit of time searching for a suitable method to make zombies invulnerable to all damage but headshots. So I thought I would share the solution I discovered.

Visit this topic: http://www.tunngle.net/community/to...l__+zombie++damage__fromsearch__1#entry927641

You want to grab the code from post #1, and follow the instructions for using it in post #18, along with the directions below:

- Grab all of the code from fn_damageHandlerZ.sqf (found in the DayZ Code/compile folder), and paste it into a new Notepad++ document, which you will name fn_damageHandlerZ.sqf . I saved mine to my server mission .pbo fixes folder.

- Now paste the code from post #1 in the link above into your newly created fn_damageHandlerZ.sqf as shown in post #18. Save the file.

- If you haven't done so already, move your compiles.sqf from the DayZ Code .pbo to your server mission .pbo. To do this, just copy the contents of the compiles.sqf into a new notepad++ document and save it into your fixes folder or wherever you prefer inside your server mission .pbo. Then open up your init.sqf and find the following:

Code:
call compile preprocessFileLineNumbers "\nst\ns_dayz\code\init\compiles.sqf"; //Compile regular functions
progressLoadingScreen 1.0;

You want it to look like this:

Code:
call compile preprocessFileLineNumbers "fixes\compiles.sqf"; //Compile regular functions
progressLoadingScreen 1.0;

- Open your newly created compiles.sqf and scroll down until you find a line that begins with this (should be line #392):

Code:
local_zombieDamage

- Make that line look like this:

Code:
local_zombieDamage =        compile preprocessFileLineNumbers "fixes\fn_damageHandlerZ.sqf";

- You're all finished. If you like, you can open your newly created fn_damageHandlerZ.sqf and adjust the damage values to your liking. By default, zombies still fall to broken legs, but can get back up. I like this because while a zombie can only die to a headshot or explosion, you can still slow them down by breaking their leg(s).
 
Ive been looking for this! Thank you! Only question at this point is: If you body shot a zed, will it still drop to the crawl position? I like the "head shot" is the only thing that can kill them, but can they still take damage?
 
Yes, the default way the above code works is that you can only kill zombies with either a headshot, grenade or explosive round or .50 cal and above, but you can still break their legs and make them crawl. You could make them immune to all damage but headshots if you wanted.
 
Thank you! No, I'm only interested if it can be that they can still be wounded but not killed without a headshot. A little more like in the movies and Walking Dead. Thanks!
 
Exactly. I have drastically increased zombie spawns on my server - and with the headshot kill only added in, it really lends DayZ the feel of a Dawn of the Dead or some other cult zombie movie.
 
That's another one I'm curious about. How do you increase the amount of Zeds and can it be done in the major cities while leaving the rural areas as is. I run a heavily modded DayZ.st server with Tavi 2.0. Thanks for your help!
 
Hmm, im not seeing damage handler anywhere? In my server PBO nor my mission PBO. Is this a Dayz.st thing or maybe a Taviana thing? Ive got about 10 scripts added already but never recall seeing this file anywhere.

Edit: Im an idiot. Ive got it.
 
New problem. I already have a compiles.sqf because I have Base Building 1.2. Problem is that the Base Buildings compile only has base building code. Im really not sure what I should do about this or if its possible. Any suggestions?
 
Post your mission .pbo if you like, and I will take a look at it - see if I can get this working for you.
 
Its too large to post here But THANK YOU FOR THE OFFER!!!! I havnt tested it yet but here is what ive done (not sure if it'll work...what do you think?)

1. I pulled compiles.sqf from Dayz_code and added it to fixes. Im not sure if or how this will affect the fact that I have a compiles.sqf also in a folder called dayz_code in the root of my mission folder for Base Building.
2. In fixes\compiles.sqf I changed what the instructions said to change and also changed the Fn_selfaction to
Code:
compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf";        //Checks which actions for self
I am unsure of this as the BaseBuilding compiles.sqf also calls for this. Maybe I should delete this from the compiles.sqf in the fixes folder?


Not sure. What do you think? Ill try to post the two compiles.sqf next and again...THANK YOU!
 
Post your mission .pbo if you like, and I will take a look at it - see if I can get this working for you.
hmm, for some reason I cannot upload any files to this thread as I have been able to do in other threads. Not sure why.
 
You're welcome. The only way I could get the altered fn_damageHandlerZ.sqf to exec properly was through the compiles.sqf. Someone with more knowledge than myself may know of another way.
 
Thanks again! I'll check it out. Let me know if you ever need help with any scripts as I have everything else available(almost) ;)
 
Update! It worked!

1. Because I already have a custom compiles for Base building, I simply added
Code:
local_zombieDamage =        compile preprocessFileLineNumbers "fixes\fn_damageHandlerZ.sqf";        //Generated by the client who created a zombie to track damage
to my existing compiles at the very end. Very simple. Thanks again!
 
Back
Top