Freaking Fred
OpenDayZ Rockstar!
Fred's Zombie Bait
Created By Freaking Fred
InfoFred's Zombie Bait allows players to combine Raw Beef and Bloodbags to create Zombie Bait that can be placed on the ground. In my testing, I have found the bait to be very effective at keeping the zombies attention away from the player.
Versions
v 1.1.0 - Added Exploding Zombie Bait. Requires M67 Frag Grenade.
v 1.0.0 - Initial release.
Tutorials
Custom dayz_code files. (compiles.sqf and fn_selfActions.sqf)
Open the spoiler for the tutorial.
Step 1:Go to your arma 2 operation arrowhead installation folder on your PC and find your @DayZ folder.
Step 2: In your @DayZ folder, go into the addons folder and find the dayz_code.pbo. Make a copy of dayz_code.pbo on your desktop.
Step 3: Unpack the dayz_code.pbo that you have placed on your desktop. Inside the dayz_code folder find the compile folder.
Step 4: Inside the compile folder you will find the fn_selfActions.sqf. Make a copy of that and place it on your desktop.
Step 5: Back out to the main dayz_code folder and find the init folder. Inside the init folder you will find compiles.sqf. Make a copy of that and place it on your desktop.
Step 6: In your server's mission folder, create a fixes folder, if you don't already have one. Move the fn_selfActions.sqf and compiles.sqf from your desktop into this folder.
Step 7: In your compiles.sqf find the following line.
Change it to
Step 8: In your init.sqf find the following line.
Change it to
Step 2: In your @DayZ folder, go into the addons folder and find the dayz_code.pbo. Make a copy of dayz_code.pbo on your desktop.
Step 3: Unpack the dayz_code.pbo that you have placed on your desktop. Inside the dayz_code folder find the compile folder.
Step 4: Inside the compile folder you will find the fn_selfActions.sqf. Make a copy of that and place it on your desktop.
Step 5: Back out to the main dayz_code folder and find the init folder. Inside the init folder you will find compiles.sqf. Make a copy of that and place it on your desktop.
Step 6: In your server's mission folder, create a fixes folder, if you don't already have one. Move the fn_selfActions.sqf and compiles.sqf from your desktop into this folder.
Step 7: In your compiles.sqf find the following line.
Code:
fnc_usec_selfActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selfActions.sqf"; //Checks which actions for self
Code:
fnc_usec_selfActions = compile preprocessFileLineNumbers "fixes\fn_selfActions.sqf"; //Checks which actions for self
Step 8: In your init.sqf find the following line.
Code:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf"; //Compile regular functions
Code:
call compile preprocessFileLineNumbers "fixes\compiles.sqf"; //Compile regular functions
Installation
Update to v1.1.0
Open the spoiler for installation.
Step 1: In your scripts\zombiebait folder, create a new text document and name it zombiebomb.sqf.
Step 2: Copy and paste the following code into zombiebomb.sqf.
Step 3: Open your fn_selfActions.sqf and replace your original zombie bait section with
Step 2: Copy and paste the following code into zombiebomb.sqf.
Code:
player playActionNow "Medic";
sleep 1;
titleText ["You have placed Explosive Zombie Bait. You should run.","PLAIN DOWN"]; titleFadeOut 5;
_mypos = getposATL player;
_dir = getdir player;
_mypos = [(_mypos select 0)+2*sin(_dir),(_mypos select 1)+2*cos(_dir), (_mypos select 2)];
_createBait = createVehicle ["Land_Bucket_EP1", _mypos, [], 0, "CAN_COLLIDE"];
_createBait setDir _dir;
_createBait setposATL _mypos;
sleep 1;
player removeMagazine "ItemBloodbag";
player removeMagazine "FoodbeefRaw";
player removeMagazine "HandGrenade_West";
sleep 10;
_i = 0;
_bait = nearestObject [player, "Land_Bucket_EP1"];
_setBait = (getPosATL _bait) nearEntities ["zZombie_Base",50];
{
_group = group _x;
if (isNull group _x) then {
_group = _x;
};
_x reveal [_bait,4];
_targets = _group getVariable ["targets",[]];
if (!(_bait in _targets)) then {
_targets set [count _targets,_bait];
_group setVariable ["targets",_targets,true];
};
_i = _i + 1;
} forEach _setBait;
sleep 10;
titleText ["You're Explosive Zombie Bait will detonate in 2 minutes.","PLAIN DOWN"]; titleFadeOut 5;
sleep 60;
titleText ["You're Explosive Zombie Bait will detonate in 1 minute.","PLAIN DOWN"]; titleFadeOut 5;
sleep 30;
titleText ["You're Explosive Zombie Bait will detonate in 30 seconds.","PLAIN DOWN"]; titleFadeOut 5;
sleep 20;
titleText ["You're Explosive Zombie Bait will detonate in 10 seconds.","PLAIN DOWN"]; titleFadeOut 5;
sleep 10;
_zombieBomb = createVehicle ["grenade",position _createBait, [], 0, "NONE"];
sleep 1;
deleteVehicle _createBait;
Step 3: Open your fn_selfActions.sqf and replace your original zombie bait section with
Code:
// Zombie Bait
if (("ItemBloodbag" in magazines player) && ("FoodbeefRaw" in magazines player)) then {
hasBait = true;
} else {
hasBait = false;
};
if (hasBait) then {
if (zombieBait < 0) then {
zombieBait = player addAction [("<t color=""#c30000"">" + ("Place Zombie Bait") +"</t>"),"scripts\zombiebait\zombiebait.sqf","",5,false,true,"",""];
};
} else {
player removeAction zombieBait;
zombieBait = -1;
};
// Exploding Zombie Bait
if ((hasBait) && ("HandGrenade_West" in magazines player)) then {
if (zombieBomb < 0) then {
zombieBomb = player addAction [("<t color=""#c30000"">" + ("Place Exploding Bait") +"</t>"),"scripts\zombiebait\zombiebomb.sqf","",5,false,true,"",""];
};
} else {
player removeAction zombieBomb;
zombieBomb = -1;
};
Full Installation instructions start on post #2.