[Release] Fred's Zombie Bait (WIP)

SmokeyMeadow

Well-Known Member
This script is lots of fun. On my chernarus server, I changed it to require FoodSteakRaw (I also run the cannibalism script). Now zeds can only be baited with "human" meat.
 

Darrell Foster

New Member
Awsome Addon !! Finally got it Working on Taviana 2.0 Using your 1.1.0 Full install, All i had to do was change the meat from Beaf to Steak "FoodSteakRaw" in fn_selfactions, Scripts/zombiebait/zombiebait.sqf and zombiebomb.sqf
I did however have to drop raw meat and bloodbag on ground and pick them up. after the first time doing this. i no longer had to drop on ground to create another feed bucket. Thank you for an Awsome addition. Keep up the Good Work!!
 

Sandbird

Valued Member!
Getting an error when i place the bait.



And also when i am alone in the server....no problem....but when there are other team mates around me when the bucket is down there is extreme lag on the server.

My zombie_findtarget file:

Code:
private["_agent","_target","_targets","_targetDis","_c","_man","_manDis","_targets","_agent","_agentheight","_nearEnts","_rnd","_assigned","_range","_objects"];
_agent = _this;
_target = objNull;
/*
_local = [];
_remote = [];
*/
_targets = [];
_targetDis = [];
_range = 120;
_manDis = 0;
_refobj = vehicle player;
 
/*
_local =    _agent getVariable ["target",[]];
//diag_log ("Local is: " + str(_local));
_remote =    _agent getVariable ["targets",[]];
//diag_log ("Remote is: " + str(_remote));
 
if (count _remote == 0) then
{
    _targets = _local;
    //diag_log ("Targets is: " + str(_targets));
}
else
{
    _targets = _local + _remote;
    //diag_log ("Local + Remote targets is: " + str(_targets));
};
*/
 
_targets = _agent getVariable ["targets",[]];
 
if (isNil "_targets") exitWith {};
//Search for objects
if (count _targets == 0) then
{
    _objects = nearestObjects [_agent,["ThrownObjects","GrenadeHandTimedWest","SmokeShell","Land_Bucket_EP1"],500];
    {
        private["_dis"];
        if (!(_x in _targets)) then
        {
            _targets set [count _targets,_x];
            _targetDis set [count _targetDis,_dis];
        _move = "ZombieFeed";
        [objNull, _objects,rPlayMove, _move] call RE;
        };
    } forEach _objects;
};
 
//Find best target
if (count _targets > 0) then
{
    _man = _targets select 0;
    _manDis = _man distance _agent;
    {
        private["_dis"];
        _dis =  _x distance _agent;
        if (_dis < _manDis) then
        {
            _man = _x;
            _manDis = _dis;
        };
        if (_dis > _range) then
        {
            _targets = _targets - [_x];
        };
        if (_x isKindOf "SmokeShell") then
        {
            _man = _x;
            _manDis = _dis;
        };
    } forEach _targets;
 
    _target = _man;
};
 
//Check if too far
if (_manDis > _range) then
{
    _targets = _targets - [_target];
    _target = objNull;
};
 
_target
using: Dayz Origins 1.7.1
 

Jinete182

Member
Getting an error when i place the bait.



And also when i am alone in the server....no problem....but when there are other team mates around me when the bucket is down there is extreme lag on the server.

My zombie_findtarget file:

Code:
private["_agent","_target","_targets","_targetDis","_c","_man","_manDis","_targets","_agent","_agentheight","_nearEnts","_rnd","_assigned","_range","_objects"];
_agent = _this;
_target = objNull;
/*
_local = [];
_remote = [];
*/
_targets = [];
_targetDis = [];
_range = 120;
_manDis = 0;
_refobj = vehicle player;

/*
_local =    _agent getVariable ["target",[]];
//diag_log ("Local is: " + str(_local));
_remote =    _agent getVariable ["targets",[]];
//diag_log ("Remote is: " + str(_remote));

if (count _remote == 0) then
{
    _targets = _local;
    //diag_log ("Targets is: " + str(_targets));
}
else
{
    _targets = _local + _remote;
    //diag_log ("Local + Remote targets is: " + str(_targets));
};
*/

_targets = _agent getVariable ["targets",[]];

if (isNil "_targets") exitWith {};
//Search for objects
if (count _targets == 0) then
{
    _objects = nearestObjects [_agent,["ThrownObjects","GrenadeHandTimedWest","SmokeShell","Land_Bucket_EP1"],500];
    {
        private["_dis"];
        if (!(_x in _targets)) then
        {
            _targets set [count _targets,_x];
            _targetDis set [count _targetDis,_dis];
        _move = "ZombieFeed";
        [objNull, _objects,rPlayMove, _move] call RE;
        };
    } forEach _objects;
};

//Find best target
if (count _targets > 0) then
{
    _man = _targets select 0;
    _manDis = _man distance _agent;
    {
        private["_dis"];
        _dis =  _x distance _agent;
        if (_dis < _manDis) then
        {
            _man = _x;
            _manDis = _dis;
        };
        if (_dis > _range) then
        {
            _targets = _targets - [_x];
        };
        if (_x isKindOf "SmokeShell") then
        {
            _man = _x;
            _manDis = _dis;
        };
    } forEach _targets;

    _target = _man;
};

//Check if too far
if (_manDis > _range) then
{
    _targets = _targets - [_target];
    _target = objNull;
};

_target
using: Dayz Origins 1.7.1
How could buildings zombies remove a particular area of the map? With remove i say dont appear in this area of the map when players enter in this area.
 

Rexxenexx

Member
You should have a custom zombie_findTargetAgent.sqf in your mission files and make sure compiles points to it. Edit the Search for objects line "_objects = nearestObjects [_agent,["ThrownObjects","Grenade hand..." It goes on and on w class names of objects. Add the classname "Land_Bucket_EP1" to the array. Save and you're done.

Hope that helps.
 

Rexxenexx

Member
Well that's odd. They should be only controlled by that script. Something else must be overriding it. Look at what else is being called after that sqf in compiles that modifies the zombie behavior.
 

RichyM92

Well-Known Member
Exactly what I was thinking, but i can't seem to find anything that's making them do that. I do still call both compiles in the init.sqf http://prntscr.com/30z2z5 so I'll try disabling that see how that goes.

Edit: That done the trick, appears it was calling both zombie target in both compiles. Thanks for the help anyway mate
 
Last edited:
Top