Jump to content
  • 0

Overpoch Origins Taviana, Sector B Zombie Free


Thug

Question

I have been checking out some of the script that have to do with Zombie Free Zones. Its not what im looking for.

What I would like to do is on our Taviana Server is Make Sector B Zombie Free.

We have AI already setup. If someone could point me in the right direction.

Any help I thank you in advance

 

Thug

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

How about a modification of safebases by MadMartyr?

//---------------------------------------------------------------------
// 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
//---------------------------------------------------------------------


while {true} do {
  sleep 10;


  // No Zeds near Plot Poles
  _playerPos = getPos player;
  _nearPole = nearestObject [_playerPos, "Plastic_Pole_EP1_DZ"];
  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;
      _zombie2 setpos [-3367.739,-120.84577,-8247.0625];
	  //kill zed after moving it
	  _zombie2 setdamage 1;
    };
  };
};
Link to comment
Share on other sites

  • 0

I have not tested this extensively, but it seems to work, I just hope I have put all the bits here for you.

Into your mission.sqm, class sensors section for example:
 

class Sensors
{
items=40; //change this at add one more sensor. 40 items is 0-39 class items
class Item0 ...etc

Remember to change the top 'items=40;' number and change the 'class Item10' number to the right number for the sequence.

here is the sensor code:

class Item10
{
position[]={22614.5, 0, 19667.8};
a=100;
b=100;
activationBy="WEST";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="sectorb";
expCond="(player distance sectorb) < 2500;";
expActiv="canbuild = false; secb = true; clearzeds = [] execVM ""custom\clearzedsb.sqf"";";
expDesactiv="canbuild = true; secb = false; terminate clearzeds;";
class Effects
{
};
};

Then you'll need to open notepad++ or whatever and create a file called clearzedsb.sqf.
Put this code into it :

if (isNil "canbuild") then {
canbuild = true;
};

while {!canbuild} do {
_entity_array = (getPos player) nearEntities ["CAManBase",1000];
{
if (_x isKindof "zZombie_Base") then {
deletevehicle _x;
};
} forEach _entity_array;
uiSleep 4;
};

Save that file into custom/clearzedsb.sqf
That should be it. I can't see any other files that might be needed, but I could be wrong.
I hope this is of some help.

Link to comment
Share on other sites

  • 0
if (isNil "canbuild") then {
canbuild = true;
};

while {!canbuild} do {
_entity_array = (getPos player) nearEntities ["CAManBase",1000];
{
if (_x isKindof "zZombie_Base") then {
deletevehicle _x;
};
} forEach _entity_array;
uiSleep 4;
};

 

it is a very bad idea to base something like that on canbuild, as it will trigger on/off from all kinds of things then, not to mention the fact that the script will end if it switches off and you would need to exit the zone and reenter to activate it again.

Link to comment
Share on other sites

  • 0
What I did was create a sensor covering the area. Switching a boolean variable "on" when entering the area and "off" when leaving. Then in playerspawncheck i added the check so that the zombies wouldn't spawn.
 
In mission sqm add this sensor:
class Item??                                     //Last Item number plus 1,  Dont forget to add 1 up to the items=
         {
             position[]={16992.0,0.016,17596.1};                              //You'll have to edit this, i am not sure if this is the Center of Sector B 
             activationBy="WEST";
             repeating=1;
             interruptable=1;
             age="UNKNOWN";
             name="SectorB";
             expCond="(player distance SectorB) < 2000;";             //Radius of areacircle in meters
             expActiv="TitleText[""SectorB Entered."",""PLAIN DOWN""];  zedshield = true;";
             expDesactiv="TitleText["""",""PLAIN DOWN""];  zedshield = false;";
             class Effects
             {
             };
};
 
In player_spawnCheck.sqf look for the following lines and add && !zedshield. You can find this file in: dayz_code\compile (You'll have to add/change references to this file in a custom compiles.sqf file as well)
_nearby = _position nearObjects ["building",_radius];
_nearbyCount = count _nearby;
if (_nearbyCount < 1) exitwith
{
if ((dayz_spawnZombies < _maxWildZombies) && !_inVehicle && !zedshield)  then {
[_position] call wild_spawnZombies;
};
};
Same for this add && !zedshield
// do not spawn zeds if player is moving faster then 10kmh
if (!_onTheMove && !zedshield) then {
 
To prevent errors add in variables.sqf somehwere near canbuild = true;
zedshield = false;
 
Now this is working on an overpoch installation. Not sure if origins does something different.
 
Cheers,
 
Red
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
  • Discord

×
×
  • Create New...