Jump to content
gle353

[Release] No zombies in base 1.0.6.2

Recommended Posts

Ever tired of zombies in your base glitching trouth the walls and hit you while building?
Ever tried to stay safe for a short pipi-break at your base, come back and got eaten alive?

Stop it now, Here is the solution!

1. Open Init.sqf, serach for 

 

if (DZE_R3F_WEIGHT) then {execVM "\z\addons\dayz_code\external\R3F_Realism\R3F_Realism_Init.sqf";};

and post below:

 

	[] execVM "custom\base_SafeArea.sqf";

Save and close Init.sqf. Now create a folder called "custom" if you dont have one. Now create a new SQF-File called "base_SafeArea.sqf".
Open it and insert following code in it:
 

//---------------------------------------------------------------------
// Epoch Base Safe Area
// By MadMartyr
// Modified from generic ZombieShield code by felixberndt and meat
// http://opendayz.net/threads/prevent-zombie-spawning.8799/#post-32461
//---------------------------------------------------------------------

dayz_poleSafeArea = 40; //range of your plotpole safespace
while {true} do {
  sleep 5;


  // No Zeds near Plot Poles
  _playerPos = getPos player;
  _nearPole = nearestObject [_playerPos, "Plastic_Pole_EP1_DZ"]; //You can replace the Plastic_Pole by any other item. Usefull for gemcrating
  if (!isNull _nearPole) then {
    _pos2 = getPos _nearPole;
    _zombies2 = _pos2 nearEntities ["zZombie_Base", dayz_poleSafeArea];
    _count2 = count _zombies2;
    for "_i" from 0 to (_count2 -1) do
    {
      _zombie2 = _zombies2 select _i;
      deleteVehicle _zombie2;
    };
  };
};


You can change the Range by edit the dayz_poleSafeArea.
If you use Alchemical Crafting, you can change the "Plastic_Pole_EP1_DZ" in any other placeable.





All creadits goes to @MadMartyr for posting his code and @ebayShopper for adding the deleteVehicle idea, instead of porting away.

Original Post:
 

 

Share this post


Link to post
Share on other sites
12 hours ago, SKS.Goliath said:

you can also use this script for
no zombies at the trader
???

Of course. You just need to define the position of the trader and create a loop that checks the radius around it instead of the plot pole object.

But why would you need that? Nearly all safezone scripts have that included already.

Share this post


Link to post
Share on other sites
On 7/17/2018 at 11:59 AM, SKS.Goliath said:

you can also use this script for
no zombies at the trader
???

Just as Relentless say:

Any Safezonescript can handle this. And if you have custom traderzones, you can normaly add them very easy.

But if you want to do so, place a Plotpole in the traderzones via "Mission.SQM". So players cant destroy them (intend or not) and if the plotpole got run over, it is repaired after restart.

 

Share this post


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

Just as Relentless say:

Any Safezonescript can handle this. And if you have custom traderzones, you can normaly add them very easy.

But if you want to do so, place a Plotpole in the traderzones via "Mission.SQM". So players cant destroy them (intend or not) and if the plotpole got run over, it is repaired after restart.

 

Wow, that's way too complicated. He sent me a message and I modified the script for him so no worries. I guess it's solved.

Share this post


Link to post
Share on other sites
15 hours ago, inneedofhelp said:

any way to work this to remove AI from bases ? they tend to walk threw walls a lot lol

_poleRadius = 50;		//Radius (meters) the player has to be in (center is the plot pole)
_removeRadius = 50;		//Radius (meters) in which AI should be removed around the player

while {true} do {
	sleep 5;

	_object = "Plastic_Pole_EP1_DZ";
	_inRadius = player distance _object <= _poleRadius;

	if (_inRadius) then {
		{
			if ((!isNull group _x) && (getPlayerUID _x == '')) then {
				deleteVehicle _x;
			};
		} forEach (player nearEntities['Man', _removeRadius]);
	};
};

 

Share this post


Link to post
Share on other sites
44 minutes ago, Relentless said:
_poleRadius = 50;		//Radius (meters) the player has to be in (center is the plot pole)
_removeRadius = 50;		//Radius (meters) in which AI should be removed around the player

while {true} do {
	sleep 5;

	_object = "Plastic_Pole_EP1_DZ";
	_inRadius = player distance _object <= _poleRadius;

	if (_inRadius) then {
		{
			if ((!isNull group _x) && (getPlayerUID _x == '')) then {
				deleteVehicle _x;
			};
		} forEach (player nearEntities['Man', _removeRadius]);
	};
};

 

Do not use deleteVehicle, WAI can't count deleted units as dead unit.

on_kill.sqf

Quote

//////

    
if (!isNil "_mission") then {
    if (typeName(wai_mission_data select _mission) == "ARRAY") then {
        wai_mission_data select _mission set [0, ((wai_mission_data select _mission) select 0) - 1];
    };
} else {
    wai_static_data set [0, ((wai_static_data select 0) - 1)];
};
 

/////////

functions.sqf

Quote

/////

wai_completion_check = {
    private ["_completionType","_complete","_position","_mission","_killpercent","_objectivetarget"];
    
    _mission = _this select 0;
    _completionType = _this select 1;
    _killpercent = _this select 2;
    _position = _this select 3;
    _complete = false;
    
    call
    {
        // If you have killed enough AI, then the mission will complete when you get within 20 meters of the mission center
        if (_completionType select 0 == "crate") exitWith {

            if(wai_kill_percent == 0) then {
                _complete = [_position,20] call isNearPlayer;
            } else {
                if(((wai_mission_data select _mission) select 0) <= _killpercent) then {
                    _complete = [_position,20] call isNearPlayer;
                };
            };
        };
        


    
//////

 

I think, "_x setDamage 1;" can solve it...If I'm not wrong

Share this post


Link to post
Share on other sites

This script should not be running all the time. While loops are quite performance intensive so you should add the option to toggle that feature and start it from the fn_selfaction when the player is looking at the plot pole.

Share this post


Link to post
Share on other sites
On 7/23/2018 at 8:49 AM, Relentless said:
_poleRadius = 50;		//Radius (meters) the player has to be in (center is the plot pole)
_removeRadius = 50;		//Radius (meters) in which AI should be removed around the player

while {true} do {
	sleep 5;

	_object = "Plastic_Pole_EP1_DZ";
	_inRadius = player distance _object <= _poleRadius;

	if (_inRadius) then {
		{
			if ((!isNull group _x) && (getPlayerUID _x == '')) then {
				deleteVehicle _x;
			};
		} forEach (player nearEntities['Man', _removeRadius]);
	};
};

 

Is this called from init ? or dose it have to be placed inside a AI script ? got it in a file called airemover and called from init but noticed still got roaming AI in peoples plot areas

Share this post


Link to post
Share on other sites

You need to run it in a new thread so the loop doesn't interrupt. You can do that by execVM it or spawn it with an empty array.

Keep in mind that the AI will only be removed within the defined radius if a player is within the set radius of the plot pole.

Share this post


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

You need to run it in a new thread so the loop doesn't interrupt. You can do that by execVM it or spawn it with an empty array.

Keep in mind that the AI will only be removed within the defined radius if a player is within the set radius of the plot pole.

I call it form my init near the bottom using this line [] execVM "airemove.sqf"; but have noticed ai are still getting inside some bases when players are there . Had a guy get killed inside his base earlier, AI walked with in 30 m of him 

Dose it need to be called higher up in the init ? in is dedicated or is server on anything ?

Share this post


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

Hmm weird...
Maybe the deleteVehicle option isn't working. Try what Schalldampfer said. Use setDamage 1.

Like this ?

 

_poleRadius = 50;        //Radius (meters) the player has to be in (center is the plot pole)
_removeRadius = 100;        //Radius (meters) in which AI should be removed around the player

while {true} do {
    sleep 5;

    _object = "Plastic_Pole_EP1_DZ";
    _inRadius = player distance _object <= _poleRadius;

    if (_inRadius) then {
        {
            if ((!isNull group _x) && (getPlayerUID _x == '')) then {
                _x setDamage 1;
            };
        } forEach (player nearEntities['Man', _removeRadius]);
    };
};

Share this post


Link to post
Share on other sites

Hmm maybe the group is also a problem. Depends on what AI system you use.
Replace the whole file with:

_poleRadius = 50;		//Radius (meters) the player has to be in (center is the plot pole)
_removeRadius = 50;		//Radius (meters) in which AI should be removed around the player

_object = "Plastic_Pole_EP1_DZ";

while {true} do {
	sleep 5;
	_inRadius = player distance _object <= _poleRadius;

	if (_inRadius) then {
		{
			if ((getPlayerUID _x == '') && !(_x in playableUnits)) then {
				_x setDamage 1;
			};
		} forEach (player nearEntities['Man', _removeRadius]);
	};
};

Call it with execVM in your init.sqf at the bottom outside of the server or dedicated code block.

Share this post


Link to post
Share on other sites

The script is likely failing because you cannot take a distance from a classname.

I have written up a quick script for this below, please try it out and let me know how it works :)

private ["_noAI", "_noZeds"];

_noAI = true; // Remove AI within plot radius (true = enabled, false = disabled).
_noZeds = true; // Remove zombies within plot radius (true = enabled, false = disabled).

while {69 == 69} do {
	private "_plots";

	_plots = player nearEntities ["Plastic_Pole_EP1_DZ", DZE_PlotPole select 0];

	if (count _plots > 0) then {
		private "_plot";

		_plot = _plots select 0;

		if (_noZeds) then {
			{deleteVehicle _x} count (_plot nearEntities ["zZombie_Base", DZE_PlotPole select 0]);
		};

		if (_noAI) then {
			{
				if (!isPlayer _x && {_x distance _plot <= (DZE_PlotPole select 0)}) then {_x setDamage 1};
			} count allUnits;
		};
	};
	uiSleep 5;
};

Just name it whatever you would like, then call it from the !isDedicated section of the init.sqf, down at the bottom:

if (!isDedicated) then {
    // CODE FROM INIT HERE
    execVM "FILENAMEHERE.sqf";
};

 

Share this post


Link to post
Share on other sites
1 hour ago, Relentless said:

@BigEgg You should do setDamage on the AI anyways for the AI system so it recognizes them as killed. I don't know if it works with just deleting them.

Changed

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 Cherdenko
      Edit: Credit to @BigEgg for base script
       
      Hello guys, today i came up  with a little script that gives players Money based on their time on the server.
      there is a multiplicator included that gives you more money every time, until the 4th time is reached. this is the highest possible Tier
      needs to be initialized with :
      [] execVM "YOUR_PATH_TO\paycheck.sqf"; in the if (!isDedicated) Section in the init.sqf
      Base Script without any multiplicator:
      @NateDayZ there you go.
      edited this on my smartphone so sry if it looks a bit bad
      original script by @BigEgg:
      as allways have fun :)
    • By icomrade
      Hello all,
      We are pleased to announce the release of ArmA 2 DayZ Epoch 1.0.6, available for download at: http://epochmod.com/a2dayzepoch.php
      This release introduces the integration of some of the most common Epoch community modifications from prior epoch release, DayZ Mod 1.8.8, and a new group system that persists in the database.  Most of the highlights can be found in the change log below, which is fairly comprehensive, but by no means exhaustive.
      Please note that community addons/expansions for previous Epoch release WILL NOT work on Epoch 1.0.6, be sure to review the change log for which mods are now included. In addition, the loot table format has completely changed, you must base your loot table modifications on the new format, which can be found by evaluating the stock loot tables: https://github.com/EpochModTeam/DayZ-Epoch/tree/Release_1.0.6/SQF/dayz_code/Configs/CfgLoot
      1.0.5.1 and older Single Currency scripts are NOT compatible with 1.0.6, there is no included single currency script in this release. However, because we are so wonderful, we have chosen to integrate single currency saving to the DB, so a third-party HiveEXT is not necessary and the SQF is all that needs to be written/updated.
       
    • By vbawol
      Solar Generator / Energy capacity system:
      Solar Generator base item can be crafted from items found in the world. When placed gives passive power within (75m Default). Energy capacity system controls how much power is available based on the type of energy source and number of players in area. Personal solar generators have 10 charge rate at day and reduced charge capacity of 5 at night. Wind towers and large solar farms have 100 charge rate. Each player will equally share the energy charge capacity up to the max charge rate of 5 per tick. More solar generators can be built to increase total charge capacity for larger groups. Wood Towers
      Can be crafted using a Wood Floor Kit and 4x lumber. First test of the new building upgrade system gives you the ability to use 2x lumber to add a windowed wall to the side you are standing. Walls can be removed and refund one lumber pack. Wood Walls / Upgrade in Place
      New upgrade in place options and 4 new plywood walls Building upgrade system now supports multiple options and has new basic UI. Wood Ladder
      Can be crafted from 4x lumber. Base Building
      Removed base object "Move" in 3d option in favor of a more refined "ghost" snap mode. Can now disable base building by pressing Esc or 'gear' menu. Angle of snapping was incorrect when building on angles. Can now press '2' to disable building snap mode and 1 to re-enable. Normalized snap memory points for wood tower and stairs should make snapping more accurate Issue that caused shifting of some base objects after restart. Only maintain damaged objects and object health is repaired on maintain. Looting
      New loot/crafting items: (Solar Panels, Wire Cables, Battery Box). Air Drop loot has been Increased. Pumpkin harvesting on Chernarus should work, "Trash" loot now has separate configs. Antagonists
      Cultist's make a triumfant return, as cultist spawning is now fixed. Vehicles
      Fixed JetSki sinking like a rock.  
      Technical
      [Changed] Moved client gamemode and CfgFunctions init to mission file. [Changed] Base building upgrade recipes and remove payouts now have dedicated config "CfgBaseBuilding" and code supports over-loading via description.ext. [Changed] Server side database functions renamed and now use cfgFunctions via a new pbo "epoch_server_core". [Changed] Make use of new command getAllHitPointsDamage in A3 1.50 to increase performance of hitpoint data storage. [Changed] Use new A3 command setHitIndex instead of setHitPointDamage so we can use all hitpoints regardless of name. [Changed] Change BIS_fnc_distance2D usage over to distance2D command that was added with A3 1.50 for better performance. [Fixed] Loot code for "CfgBuildingLootPos" now uses EPOCH_returnConfig to allow over-loading via description.ext. [Fixed] Error in rpt "No geometry and no visual shape" with Poppy and Goldenseal plants models. [Fixed] CfgEpochClient missionConfigFile version check was incorrectly using configFile. [Fixed] Loot object "Blue Tarp" weaponholder proxy position was in the wrong position. [Fixed] Reduce base hunger/thirst loss rate by half if players stamina is above 100. Base rate now can be changed with "baseHTLoss" variable in CfgEpochClient. [Info] Requres Arma 3 1.50 or higher. [ServerInfo] CfgEpochClient removed from description.ext as it can be simply added again from our configs as needed. [ServerInfo] Removed old .bikey and added new one for 0330.  
      Server Admins see files that have changed here: https://github.com/EpochModTeam/Epoch/commit/24bcfafe60e0ea043700cf82a2e0b2f6d96e1bbd
       
    • By Jacen
      Description:
      This trader is completely pre-configured and well working. It goes along with Zupa's currency system which allows traders to trade for money, you may also use this on servers without currency by changing a simple line of code. The safe zone coordinates have been given, and everything's perfect. Have fun with the system and let me know what you think. The trader uses all traders except blackmarket and helicopter traders, there is no banker as I used the storage script with Zupa's system. There is a helicopter landing pad, a wide car-park. It also includes map markers, e.g the black markers on the map when searching for a trader. I hope you enjoy my work and I'll be releasing more soon!
       
      Image of the full trader:
      http://cloud-4.steamusercontent.com/ugc/37489965390073538/F3019F5D803021C13D9DD426C2B5E7C8DD94A60D/
       
      Not Sure!
      I wasn't sure if this was supposed to be placed in the Epoch Bases section, as it's also a tutorial for installing traders, it isn't just the base. So if this has been released in the wrong place, please make sure you let me know and I'll see if I can get it moved. Also, it would be really nice if you guys could drop a comment on the homepage of my website!
       
       

    • By AllenFromStacysmom
      2 Bandit WAI customized missions 
      --- Denny's Farm
      --- Troop's Supply
       
       
      Mission Plot:
      --- Denny is giving out some supplies at his farm.
      --- The local troop just received their supply.
       
      Screenshots:
      https://www.dropbox.com/sh/k9txqxw6q4qx71t/AADTvplz45CXdSrW8Pyo5W8Fa?dl=0
       
      Requirement:
      -PBO to pack mission file
      -WAI
       
      Installation:
      ---Download and install WAI to your server.pbo
      Link :   
      ---Create  farmer_give.sqf and troop_supply.sqf files in dayz_server\WAI\missions\bandits
      In farmer_give.sqf
      Copy and paste



      In troop_supply.sqf, copy and paste:



      ---Edit the config.sqf :
      find 
      wai_bandit_missions = [ ["armed_vehicle",10], ["black_hawk_crash",10], ["captured_mv22",10], ["broken_down_ural",10], ["hero_base",10], ["ikea_convoy",10], ["medi_camp",10], ["presidents_mansion",10], ["sniper_extraction",10], ["weapon_cache",10], ];  the missions you have may be different from me, and the number after the mission name is the chance of the mission will happen
      Example:  ["mission_name",chance in %]
      ---Add in farmer_give and troop_supply
      so it would look like this 
      wai_bandit_missions = [ ["armed_vehicle",10], ["black_hawk_crash",10], ["captured_mv22",10], ["broken_down_ural",10], ["hero_base",10], ["ikea_convoy",10], ["medi_camp",4], ["presidents_mansion",10], ["sniper_extraction",10], ["weapon_cache",4], ["farmer_give",6], ["troop_supply",6] ];   Make sure the number add up to 100. You can change the chance of the mission happen by change the number in % to whatever you want.
       
      Now you are done!
      Repack your server.pbo to try out the missions  :D
       
      Let me know if there is any problem with the mission.
  • Advertisement
  • Advertisement
  • Supporters
  • Advertisement
  • Discord

×