Jump to content

Zombie-Free Bases


Recommended Posts

I also have a question, I am trying to make a static object emit this technique. So I have placed a Warfare radar tower in the middle of a town, and am trying to have it teleport the zeds away, but not just if there is a player near by the tower (although that would make for some strategy), but if there is zeds near the tower.  I have gotten it to work, but again, only if a player is near the tower.

//---------------------------------------------------------------------
// Epoch Base Safe Area
// By MadMartyr
// Modified from generic ZombieShield code by felixberndt and meat
//Modified by Karp for static usage on "objects"
//---------------------------------------------------------------------
diag_log("[KarpCode]: AntiZombie Tower Radiating");

while {true} do {
  sleep 1;

  // No Zeds near Radar Tower
  //_playerPos = getPos player;
  _nearPole = nearestObject ["6063.2568, 931.34308"];//X,Y pos of object
  if (!isNull _nearPole) then {
    _pos2 = getPos _nearPole;
    _zombies2 = _pos2 nearEntities ["zZombie_Base", dayz_towerSafeArea];//dayz_towerSafeArea radius defined in init.sqf
    _count2 = count _zombies2;
    for "_i" from 0 to (_count2 -1) do
    {
      _zombie2 = _zombies2 select _i;
      _zombie2 setpos [-3367.739,-120.84577,-8247.0625];
    };
  };
};
Link to comment
Share on other sites

  • 4 weeks later...

Sorry I'm new to this... What you mean by sarge??

Also I don't think your solution will work for what I want as "black listed areas" sounds like fixed areas... I want it so AI bandits/survivors don't enter your base (after all that's what your walls are for) and zombies don't come near lights.... Making lights useful :-) (and more work to keep base safe)

Link to comment
Share on other sites

There is probably a way of keeping zeds out of the range of certain things that visually seems much more natural.

 

Dayz zeds have two states of operation in zombie_agent.fsm.  One is "chase" based on a target finding algorithm and one is "loiter" when they have no target.  When they are running and yelling they are in "chase" and when they are slowly shuffling around or standing still they are in "loiter".

If we change the target algorithm so that they are not allowed to target anything within a "safe zone" and make a similar change to loitering, then they will behave (theoretically) as they do when they cannot see players, and they will not accidentally wander into the safe zone.

 

Then we could also change the spawn system so that zeds do not spawn (and for play balance loot will not spawn) within a "safe zone".

 

This is actually probably something that should be done for areas around traders anyway, not just an optional feature for admins who want it.

 

If you are interested, let me know and I will work on it and post some code changes and/or submit to the Epoch github code base.

Link to comment
Share on other sites

  • 4 weeks later...

Sorry I'm new to this... What you mean by sarge??

Also I don't think your solution will work for what I want as "black listed areas" sounds like fixed areas... I want it so AI bandits/survivors don't enter your base (after all that's what your walls are for) and zombies don't come near lights.... Making lights useful :-) (and more work to keep base safe)

generate a list of plot poles on the server and add those locations to the array which holds the blacklisted locations.(sorry i dont use AI this way)

Link to comment
Share on other sites

  • 3 weeks later...

since this thread is still alive. I am curious if anyone has come up with a solution to dzai walking through your walls and lighting your ass up when you least expect it.  I really don't want to pull the static spawns out, maybe I can add them to the nearentities list and have them get beamed out along with the zeds?

Link to comment
Share on other sites

  • 1 month later...

To everyone asking about the AI:

Blacklisting areas is NOT the same as creating static spawns! It is the complete opposite! What someone suggested was to search your database for all your plotpoles and create a blacklist around that area. AI will NOT spawn inside a blacklist zone. They will spawn randomly everywhere else. I am not 100% certain if they can wander into blacklist areas, but I know they won't be able to just appear behind you when you're busy. I'd start with a 50m blacklist circle around my base and increase the size if I had trouble with AI. The good thing is that the script will find areas on it's own to spawn them. All the big AI scripts have blacklists; Sarge, DZMS, WAI, DZAI... Give it a shot.

 

Thank you so much for posting this script! As we have a PvE server we have a lot of players that spend most of their time building elaborate bases. I removed the need for plotpoles a long time ago because of the restraints. This will give people a reason to buy them now! =]

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...
  • 6 months later...
while {true} do {
  sleep 5;


  // No attacking Zeds near Plot Poles

  _thePlayer = player;
  _playerPos = getPos _thePlayer;

  if (true) then {

    _inZone	= count (_playerPos nearObjects ["Plastic_Pole_EP1_DZ",20]);

	
	if (_inZone > 0) then {
		player_zombieCheck = {};
	} else {	
		if (canBuild) then {player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";};		
	};



  };
};

What about to make zeds will not dissappear or be killed but only they don't attack you in your base?

Link to comment
Share on other sites

Here use this it's better

  	if (USE_POSITIONS) then
	{
		{
			_z = _x select 0;
			_r = _x select 1;
			if ((vehicle player) distance _z < _r) then {_state = true;};
		}
	};
  if (!isNull _nearPole) then {
		if (!isNull _x) then
			{
				if !(isPlayer _nearPole) then
				{
					deletevehicle _x;
				};
			};
        }((vehicle player) nearEntities ['zZombie_Base',50]);	
    };	
Link to comment
Share on other sites

  • 2 weeks later...

I get this error in client rpt ..I have plot for life 2.4 , think this is the prob but not 100% sure , and infristar , overpoch  
Any ideas ???

 

 

 

Error in expression <2 = _pos2 nearEntities ["zZombie_Base", dayz_poleSafeArea];
_count2 = count _zom>
  Error position: <dayz_poleSafeArea];
_count2 = count _zom>
  Error Undefined variable in expression: dayz_polesafearea
File mpmissions\__CUR_MP.Napf\safebases\base_SafeArea.sqf, line 18
Client: Object 3:12 (type Type_99) not found.
Client: Object 2:7015 (type Type_99) not found.
Client: Object 3:12 (type Type_98) not found.
Client: Object 3:12 (type Type_99) not found.
Client: Object 2:7015 (type Type_99) not found.
Client: Object 2:7015 (type Type_98) not found.
Client: Object 2:7015 (type Type_124) not found.
Client: Object 3:12 (type Type_124) not found.
Client: Object 3:12 (type Type_99) not found.
Client: Object 2:7015 (type Type_99) not found.
Client: Object 3:12 (type Type_99) not found.
Client: Object 2:7015 (type Type_99) not found.
Client: Object 3:12 (type Type_98) not found.
Client: Object 2:7015 (type Type_124) not found.
Client: Object 2:7015 (type Type_98) not found.
Client: Object 6:109 (type Type_69) not found.
Client: Object 6:109 (type Type_70) not found.
Client: Object 3:12 (type Type_99) not found.
Client: Object 3:12 (type Type_124) not found.
Client: Object 2:7015 (type Type_99) not found.
Link to comment
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
  • Advertisement
  • Discord

×
×
  • Create New...