Jump to content
juandayz

[Update]Fred's Zombie Bait && Bomb

Recommended Posts

9 hours ago, salival said:

You need to get into the habit of initializing all these scripts that you make in a custom variables.sqf otherwise they will error out on startup.

As per this code block: https://github.com/EpochModTeam/DayZ-Epoch/blob/master/SQF/dayz_code/init/variables.sqf#L163-L252

this not giveme errors for me, i guess is why was added at the bottom of fn_Selfactions and is not into

} else {
	//Engineering


	player removeAction s_player_plot_boundary;
	s_player_plot_boundary = -1;
	player removeAction s_player_plot_take_ownership;
	s_player_plot_take_ownership = -1;
	player removeAction s_player_plotManagement;
	s_player_plotManagement = -1;

dont know

Share this post


Link to post
Share on other sites
6 hours ago, juandayz said:

this not giveme errors for me, i guess is why was added at the bottom of fn_Selfactions and is not into

} else {
	//Engineering


	player removeAction s_player_plot_boundary;
	s_player_plot_boundary = -1;
	player removeAction s_player_plot_take_ownership;
	s_player_plot_take_ownership = -1;
	player removeAction s_player_plotManagement;
	s_player_plotManagement = -1;

dont know

Well, it will be definitely showing an error since the variable is not initialized.

I've fixed a lot of peoples mission folders (when they cant install mods or similar) and a lot of the problems come from not initializing your variables

Share this post


Link to post
Share on other sites
2 minutes ago, salival said:

Well, it will be definitely showing an error since the variable is not initialized.

I've fixed a lot of peoples mission folders (when they cant install mods or similar) and a lot of the problems come from not initializing your variables

any way i cannot understand for example why i dont have errors about undefined variables when i not add the player add action into this part

} else {
	//Engineering

anytime that i add a selfactions code at very bottom , not need add the playeraddaction here:

} else {
	//Engineering

 

cuz the option flashes.

But if i add the code in someother place in selfaction then yes.. i need add the playeraddaction into

} else {
	//Engineering

and define it in variables.sqf  as you said.

But anyway your right i have the bad habit to not tell everyone ... add the s_player.....-1; in variables.sqf..

but in this case i dont do it.. cuz i think is not fully needed. (but this not mean im right.. just i dont have this rpt spam)

Share this post


Link to post
Share on other sites
2 minutes ago, juandayz said:

any way i cannot understand for example why i dont have errors about undefined variables when i not add the player add action into this part

} else {
	//Engineering

anytime that i add a selfactions code at very bottom , not need add the playeraddaction here:

} else {
	//Engineering

 

cuz the option flashes.

But if i add the code in someother place in selfaction then yes.. i need add the playeraddaction into

} else {
	//Engineering

and define it in variables.sqf  as you said.

But anyway your right i have the bad habit to not tell everyone ... add the s_player.....-1; in variables.sqf..

but in this case i dont do it.. cuz i think is not fully needed. (but this not mean im right.. just i dont have this rpt spam)

Are you running with the command line option -showScriptErrors (you should be)

It is definitely the right way to do it since it re-initalizes all the variables for the fn_selfActions on startup

For an example:

ZSC: https://github.com/oiad/ZSC/blob/master/dayz_code/init/variables.sqf#L102-L104

VKC: https://github.com/oiad/vkc/blob/master/dayz_code/init/variables.sqf#L92-L93

BuryBodies: https://github.com/oiad/buryBodies/blob/master/dayz_code/init/variables.sqf#L93-L94

Share this post


Link to post
Share on other sites

yup know it.. for example in my update of walk amongst i know is needed see cuz i got de add/remove actions in this place

} else {
	//Engineering

below add:_

player removeAction s_player_zhide2;
s_player_zhide2 = -1;
player removeAction s_player_zhide3;
s_player_zhide3 = -1;

4-custom Variables.sqf

  Hide contents

Find:

//Player self-action handles
dayz_resetSelfActions = {

below paste

 s_player_zhide2 = -1;
s_player_zhide3 = -1;

but in this case of zombie bait.. not have the rpt error.  Anyway your point is more than right. so tnks for the advice

Share this post


Link to post
Share on other sites
13 minutes ago, Hooty said:

What lines in blue?

remove the selectDelay from

selectDelay = 25;

_maxSeconds = selecDelay;

and change by

_maxSeconds = 25;

in others words, remove the define of selectDelay

and change the define of _maxsecond variable by 25;(seconds)

Spoiler

player playActionNow "PutDown";

_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_Vase_loam_EP1", _mypos, [], 0, "CAN_COLLIDE"];
_createBait2 = createVehicle ["Blood_Trail_DZ", _mypos, [], 0, "CAN_COLLIDE"];
_createBait setDir _dir;
_createBait setposATL _mypos;
systemChat("You have placed Explosive Zombie Bait. You should run.");

_target = nearestObject [player, "Land_Vase_loam_EP1"];
_positionobj = getPosATL _target;


bomb = {

_bomb = ["HelicopterExploSmall","HelicopterExploBig"] call BIS_fnc_selectRandom;
_dabomb = objNull;
if (true) then
{
  _this = createVehicle [_bomb,_positionobj, [], 2, "CAN_COLLIDE"];
  _dabomb = _this;
};
};
 

 

player removeMagazine "ItemBloodbag";
if ("HandGrenade_West" in magazines player) then {
player removeMagazine "HandGrenade_West";
};
if ("HandGrenade_East" in magazines player) then {
player removeMagazine "HandGrenade_East";
};

 


 
_i = 0;
_bait = nearestObject [player, "Land_Vase_loam_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 ["localtargets",[]];
    
    if (!(_bait in _targets)) then {
        _targets set [count _targets,_bait];
        _group setVariable ["localtargets",_targets,true];
    };
    _i = _i + 1;
} forEach _setBait;
 


/////COUNTDOWN AREA//////////////

_countdown = true;
_maxSeconds = 25;
_seconds = 0;
while {true} do {
if(_countdown) then {
    systemChat format["COUNTDOWN: %1",_maxSeconds - _seconds]; //countdown in chat
  };
////EXIT FROM LOOP AREA////
if (_seconds >= _maxSeconds) exitWith {
call bomb;
{
if ((isPlayer _x) && (_x distance _createBait < 15)) then {                                                                                                                                                                                        
_x setDamage 1;
};
} count playableUnits;    
deleteVehicle _createBait;
deleteVehicle _createBait2;
    };
/////////////////////

_seconds = _seconds + 1;
  sleep 1;
};

 

Share this post


Link to post
Share on other sites
9 minutes ago, Hooty said:

Only thing I see since I got it working is players can set zed bombs in safe zones killing players and destroying vehicles.

nice spot!

use the lotery safezones

zedbomb.sqf

Spoiler
player playActionNow "PutDown";

_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_Vase_loam_EP1", _mypos, [], 0, "CAN_COLLIDE"];
_createBait2 = createVehicle ["Blood_Trail_DZ", _mypos, [], 0, "CAN_COLLIDE"];
_createBait setDir _dir;
_createBait setposATL _mypos;
systemChat("You have placed Explosive Zombie Bait. You should run.");

_target = nearestObject [player, "Land_Vase_loam_EP1"];
_positionobj = getPosATL _target;

_safezones = [[4752.1084,6262.083,0],[9397.9385,11651.784,0],[11597.153,6657.4219,0],[11786.9, 12695.4,0],[12420.614,9797.9814,0],[1929.9883,9122.0342,0]];    
_safezonesRad = 150;
_inSafezone = false;
{
if (player distance _x < _safezonesRad) then {
_inSafezone = true;

};
} forEach _safezones; 

if (_inSafezone) exitWith {systemchat ("not in safezones");};


bomb = {

_bomb = ["HelicopterExploSmall","HelicopterExploBig"] call BIS_fnc_selectRandom;
_dabomb = objNull;
if (true) then
{
  _this = createVehicle [_bomb,_positionobj, [], 2, "CAN_COLLIDE"];
  _dabomb = _this;
};
};
 



player removeMagazine "ItemBloodbag";
if ("HandGrenade_West" in magazines player) then { 
player removeMagazine "HandGrenade_West";
};
if ("HandGrenade_East" in magazines player) then { 
player removeMagazine "HandGrenade_East";
};




 
_i = 0;
_bait = nearestObject [player, "Land_Vase_loam_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 ["localtargets",[]];
	
    if (!(_bait in _targets)) then {
        _targets set [count _targets,_bait];
        _group setVariable ["localtargets",_targets,true];
    };
    _i = _i + 1;
} forEach _setBait;
 


/////COUNTDOWN AREA//////////////

_countdown = true;
_maxSeconds = 25;
_seconds = 0;
while {true} do {
if(_countdown) then {
    systemChat format["COUNTDOWN: %1",_maxSeconds - _seconds]; //countdown in chat
  };
////EXIT FROM LOOP AREA//// 
if (_seconds >= _maxSeconds) exitWith { 
call bomb;
{
if ((isPlayer _x) && (_x distance _createBait < 15)) then {																																														
_x setDamage 1;
};
} count playableUnits;	
deleteVehicle _createBait;
deleteVehicle _createBait2;
	};
/////////////////////

_seconds = _seconds + 1;
  sleep 1;
}; 

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By Tricks
      We are back! Ranked 7th overall in 2014! Classic DayZ Epoch PvP Server!! No stupid start bonus, no heavy military. Just classic Epoch gameplay with new updates!

       
      - Top of the Line Hardware - Overclocked 8700k servers with SSDs. Super high FPS!!

      - XP System & XP Trader - Acquire handy Perks, Skills, and Permits with our XP system!

      - Custom Traders - Totally custom traders unique to this server!

      - Military Bases - High Loot areas perfect for gearing up.

      - Custom Map Content - Aircraft Carriers, Secret Military Bases, New Towns, and more!

      - All The Major Mods - All the major mods like Coin System, Heli Evac, Hide from Zeds, and many more.

      - Lots of AI Missions - Challenging AI missions color-coded by difficulty.

      - Custom AI Missions for Groups - Static missions with super high difficulty and major loot rewards!

      - Realistic Loot Spawns - You wont find high-powered weapons while hunting for loot, realistic loot spawns.

      - No Heavy Weapons, Tanks, Attack Choppers, Jets - Just the classic Epoch vehicles with a few new additions!

      - Lots of Vehicles - Lots of vehicles scattered around the map. Some are ready to go, others need to be fixed first!

      - Base Building - Fully modular base building system with unique build items and crafting recipes.

      - Full Day/Night Cycle - Realistic day and night cycle, no stupid 24 hours daylight!!

      - Full Weather System - Rain, thunderstorms and snow in the winter!!

      - Destructible Base/Garage Doors - Base raiding without losing your whole base! Just the doors are destructible.

      - Abandoned Safes/Lockboxes - Abandoned bases will have their safes unlocked for you to raid!!

      - Fresh Server, All The Best Base Locations Still Available! - No more wipes, server is done and all progress will be saved.

      - Regular Updates/Suggestions Considered - Pass along ideas to the admin staff. We consider all changes.

      - Admin Events - Events with High Loot and great times! See pic below.

      - Active Admin Staff - Find us on Discord anytime or by email!





      Connect to us on DayZ Launcher or directly:

      [SHG]ClassicEpoch|XPSystem|CustomTraders|CustomAImissions|Coins|FPS++

      144.217.62.76:2302

      Discord: http://xn--discrd-zxa.com/join.php?v=OXHD95

      Email: [email protected]

      Website: Under construction


    • By Tricks
      I have been browsing the forums looking for unique mods to add to my server. I noticed Juandayz deleted a lot of his mods before leaving the community. Just curious if anyone has them all and would possibly repost them giving him full credit? I am particularly interested in his "Admin Skin" and "Debug" mods.
       
      Thanks community, here's hoping someone will step up!
    • By victorks
      my first work in editin :) https://uploaddeimagens.com.br/imagens/20180307202515_1-jpg https://uploaddeimagens.com.br/imagens/20180307202245_1-jpg DOWNLOAD: https://www.dropbox.com/s/oq97j7x59362kqe/CASTLEai.sqf?dl=0 AI M2 NEED WAI: https://pastebin.com/GJMnPvZP ON THE MAP: https://pastebin.com/cyqH9rNV  
       
      https://www.dropbox.com/s/oq97j7x59362kqe/CASTLEai.sqf?dl=0
       
       
       
       
       
       
       
       
       
    • By juandayz
      VIDEO:
      If (You dont have a custom compiles.sqf or a custom keyboard.sqf) exitWith { step1;}else{ proceed with step 2; } forEach user; 1-Making a custom compiles.sqf and custom keyboard.sqf
       
       
      2-In your CUSTOM!!! keyboard.sqf at bottom but before the last "_handled" paste:
      3-Create remote_key.sqf  (mpmissions\your instance\scripts\ )
       
  • Advertisement
  • Advertisement
  • Supporters
  • Advertisement
  • Discord

×