cannibalism

If you are running 1.7.6.1 there are food "groups". You have to add the player class (ie Survivor2_DZ etc) as an edible meat. Its kinda creepy once is scripted out :)


EDIT:

dayz_code.pbo>>init>>variables.sqf

ADD the food type of your choice to the cooking section. ie FoodZombieRaw or whatever.

Then in dayz_cod.pbo>>config.cpp you have to define a class for the Zombies and Man. Sort like this.

Code:
        class zZombie_base: Default {
            yield = 1;
            rawfoodtype = "FoodZombieRaw";
        };
      class z_policeman: zZombie_base {};
etc etc.

If you follow how they did it for the other food types (mutton etc) you can figure it out. I did this a while ago so Im a little rusty on it. This should get you in the right direction.

Legend thanks mate I will take a look now and share later :)
 
just realized that I cant change config.cpp without requiring client downloads D:

Is that something thats possible to work around?
 
I am trying to replace the spawn LocalgutObject code with something that will work without modification of clientside files. The gathering of the meat I can deal with, having looked at a couple of other scripts, adding it to players inventory after gutting rather than the corpse. What I can't figure out is how I am going to make it so another player or the same player can't just gut the body again farming humanity.

I thought about maybe hiding the body after the first gutting, but I would rather find a way of making it so the body can only be gutted once.

Can anyone give me any advice?
 
Do the meats have to be defined in config? As it stands with Cen's code does everything work ok?
 
We did it in 2017 first. All the code is in my repo. I am little bit busy to do a how too, but you can ask questions if you get stuck and I will do my best to answer:

https://github.com/shinkicker/DayZ-2017-Main


Have been finding your files very useful, I have managed to put something together but at the moment it is spawning in meat on the body, briefly before it disappears. I think this is because I don't have a server_gutHuman.sqf file in my dayz_server pbo currently?

I did try changing the dayz-2017 one slightly but I got a crash to desktop as soon as I started gutting so in the end I put this together from two of your files

Code:
nm working code below

Any advice on how I can make the meat stay in game, I'm assuming it is the server pbo I need to make changes to now I have the above in my mission?

Any help would be really appreciated all I want to do is get around having to add new meat types.
 
I got there in the end :D

I'm sure it's not the cleanest solution but it runs from my mission file and allows me to eat people so I am happy :D I didn't have to change the server pbo (unless I forgot to revert a change from when I was testing) and it works without needing to add any new meat classes.

Thanks shinkicker and the 2017 guys you did all the work

Code:
full tutorial in my next post

I just need to drop the excess meat around the body when the players inventory is full, going to work on that tomorrow. Also think I can also see a way to add the meat to the dead player from looking at the code for the remove clothes mod.
 
Code:
private["_hasKnife","_qty","_item","_text","_string","_type","_loop","_meat","_timer"];
_item = _this select 3;
_hasKnife =    "ItemKnife" in items player;
_type = typeOf _item;
_hasHarvested = _item getVariable["meatHarvested",false];
 
player removeAction s_player_butcher;
s_player_butcher = -1;
 
if (_hasKnife and !_hasHarvested) then {
 
    _loop = true;
    _rnd = random 1;
 
    player playActionNow "Medic";
    [player,"gut",0,false] call dayz_zombieSpeak;
    _item setVariable["meatHarvested",true,true];
 
    if (_rnd < 0.1) then {
        r_player_inpain = true;
        player setVariable["USEC_inPain",true,true];
        r_player_blood = r_player_blood - 1000;
        cutText ["You feel the knife slice your finger.", "PLAIN DOWN"];
    };
 
    _qty = (random 3);
 
    _id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
 
    dayzHumanity = [player,-500];
    _id = dayzHumanity spawn player_humanityChange;
 
    _array = [_item,_qty];
    _meat = "FoodSteakRaw";
 
        for "_x" from 1 to _qty do {
                _item addMagazine "FoodSteakRaw";
                _result = [player,_meat] call BIS_fnc_invAdd;
                if (_result) then {
 
                } else {
                    cutText ["You didn't have enough room to store the meat :(", "PLAIN DOWN"];
                    _x = _qty;
                }
 
        };
 
    sleep 8;
    cutText ["You have gutted a human your hands are covered with blood, you feel your humanity lower.", "PLAIN DOWN"];
};
Save this code as gather_meat_Human.sqf inside your fixes folder in your mission file

In your fn_selfActions.sqf file you need to add the following code somewhere after the the entire //Repairing Vehicles section.

Code:
    //####    Gut fools ####
    if (!_isAlive and !_isZombie and !_isAnimal and !_isHarvested and _isMan and _hasKnife and _canDo) then {
        if (s_player_butcher_human < 0) then {
            s_player_butcher_human = player addAction [format["<t color='#42426F'>Gut Human%1</t>"], "fixes\gather_meat_human.sqf",cursorTarget, 3, true, true, "", ""];
        };
    } else {
        player removeAction s_player_butcher_human;
        s_player_butcher_human = -1;
    };
 
    //##############################

Lower down the file find

Code:
player removeAction s_player_flipveh;

and below it add
Code:
//Gut Human
player removeAction s_player_butcher_human;
s_player_butcher_human = -1;

If you aren't calling your fn_selfActions.sqf file already you need to do that somewhere, usually in the init file

Code:
fnc_usec_selfActions = compile preprocessFileLineNumbers "fixes\fn_selfActions.sqf";

You also need to call the variables.sqf file from your init.sqf:

Code:
call compile preprocessFileLineNumbers "fixes\variables.sqf";

Inside the variables.sqf file at the end you need to add the following code:

after dayzState = -1; add this:

Code:
s_player_butcher_human = -1;

If you don't have a variables.sqf or fn_selfactions.sqf to edit in your mission yet you will need to add these from the clientside pbos.
 
Tahank, I wil
Thanks, I will now do the changes, but the

fnc_usec_selfActions = compile preprocessFileLineNumbers "fixes\fn_selfActions.sqf";

is not in the compiles file instead of the init?

thanks

I already had that file changed from basebuilding and other mods but I believe you can change it in either compiles.sqf or your init.sqf
 
all ok but u lost me in this, because I have //dogs and //Engineering further down...

Further down that file you will see an else statement where playerAction's are removed add these to the list so it looks somewhat like this

} else {
//Gut Human
player removeAction s_player_butcher_human;
s_player_butcher_human = -1;
 
all ok but u lost me in this, because I have //dogs and //Engineering further down...

Further down that file you will see an else statement where playerAction's are removed add these to the list so it looks somewhat like this

} else {
//Gut Human
player removeAction s_player_butcher_human;
s_player_butcher_human = -1;

It will vary depending on my mods try looking for this line

Code:
player removeAction s_player_flipveh;

and Add
Code:
//Gut Human
player removeAction s_player_butcher_human;
s_player_butcher_human = -1;
 
I need to do something if I have a custom anticheat in my server?

I can gut and all the jazz but, there is not meat LOL
 
If you run the mod to remove clothes from dead bodies I have a small change to prevent players gutting a body twice, pm me for details.

Will work on dropping meat that can't fit in inventories on the floor soon when I have more free time.
 
Back
Top