mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-12 19:22:56 +03:00
Configure DZE_SafeZonePosArray by default
Zeds and loot should not spawn in trader cities by default, regardless
of whether the server uses safe zones.
For servers that do not use safezones, the only other things affected
are salvage and instant kill for vehicle explosions in trader cities.
Neither is a significant issue. Most servers use safezones anyway.
Following d750f57, changed to exitWith so the check is only called once
instead of multiple times. Also no need to call again in
zombie_generate, since that function is only called by
building_spawnZombies which already checks it.
This commit is contained in:
@@ -34,28 +34,30 @@ if (!isClass _config) exitWith {};
|
||||
|
||||
_lootChance = getNumber (_config >> "lootChance");
|
||||
|
||||
if (_lootChance <= 0) exitWith {};
|
||||
if (_lootChance <= 0 or ([_this] call DZE_SafeZonePosCheck)) exitWith {};
|
||||
|
||||
_lootPos = getArray (_config >> "lootPos");
|
||||
_lootGroup = Loot_GetGroup(getText(_config >> "lootGroup"));
|
||||
|
||||
if (!([_this] call DZE_SafeZonePosCheck)) then {
|
||||
{
|
||||
//Get the world position of the spawn position
|
||||
_worldPos = _this modelToWorld _x;
|
||||
_worldPos set [2, 0 max (_worldPos select 2)];
|
||||
|
||||
//Delete existing lootpiles within 1m of spawn location
|
||||
{
|
||||
//Get the world position of the spawn position
|
||||
_worldPos = _this modelToWorld _x;
|
||||
_worldPos set [2, 0 max (_worldPos select 2)];
|
||||
//Delete existing lootpiles within 1m of spawn location
|
||||
{
|
||||
deleteVehicle _x;
|
||||
dayz_currentWeaponHolders = dayz_currentWeaponHolders - 1;
|
||||
} foreach (_worldPos nearObjects ["ReammoBox", 1]);
|
||||
deleteVehicle _x;
|
||||
dayz_currentWeaponHolders = dayz_currentWeaponHolders - 1;
|
||||
}
|
||||
foreach (_worldPos nearObjects ["ReammoBox", 1]);
|
||||
|
||||
if (_lootChance > random 1 && {dayz_currentWeaponHolders < dayz_maxMaxWeaponHolders}) then
|
||||
{
|
||||
Loot_SpawnGroup(_lootGroup, _worldPos);
|
||||
};
|
||||
}
|
||||
foreach _lootPos;
|
||||
|
||||
if (_lootChance > random 1 && {dayz_currentWeaponHolders < dayz_maxMaxWeaponHolders}) then
|
||||
{
|
||||
Loot_SpawnGroup(_lootGroup, _worldPos);
|
||||
};
|
||||
} foreach _lootPos;
|
||||
};
|
||||
// EPOCH ADDITION
|
||||
// lootPosSmall are additional positions in lockers, on shelves, etc. for small objects only.
|
||||
// Example: soda cans, small ammo, pistols, bandage, etc.
|
||||
@@ -64,24 +66,22 @@ if (isArray (_config >> "lootPosSmall")) then {
|
||||
_lootPos = getArray (_config >> "lootPosSmall");
|
||||
_lootGroup = Loot_GetGroup((getText(_config >> "lootGroup")) + "Small");
|
||||
if (_lootGroup >= 1) then {
|
||||
if (!([_this] call DZE_SafeZonePosCheck)) then {
|
||||
{
|
||||
//Get the world position of the spawn position
|
||||
_worldPos = _this modelToWorld _x;
|
||||
_worldPos set [2, 0 max (_worldPos select 2)];
|
||||
//Delete existing lootpiles within 1m of spawn location
|
||||
{
|
||||
//Get the world position of the spawn position
|
||||
_worldPos = _this modelToWorld _x;
|
||||
_worldPos set [2, 0 max (_worldPos select 2)];
|
||||
//Delete existing lootpiles within 1m of spawn location
|
||||
{
|
||||
deleteVehicle _x;
|
||||
dayz_currentWeaponHolders = dayz_currentWeaponHolders - 1;
|
||||
} foreach (_worldPos nearObjects ["ReammoBox", 1]);
|
||||
deleteVehicle _x;
|
||||
dayz_currentWeaponHolders = dayz_currentWeaponHolders - 1;
|
||||
} foreach (_worldPos nearObjects ["ReammoBox", 1]);
|
||||
|
||||
if (_lootChance > random 1 && {dayz_currentWeaponHolders < dayz_maxMaxWeaponHolders}) then
|
||||
{
|
||||
Loot_SpawnGroup(_lootGroup, _worldPos);
|
||||
};
|
||||
} foreach _lootPos;
|
||||
};
|
||||
if (_lootChance > random 1 && {dayz_currentWeaponHolders < dayz_maxMaxWeaponHolders}) then
|
||||
{
|
||||
Loot_SpawnGroup(_lootGroup, _worldPos);
|
||||
};
|
||||
} foreach _lootPos;
|
||||
} else {
|
||||
diag_log format["Loot group small: %1 does not exist", ((getText(_config >> "lootGroup")) + "Small")];
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -23,7 +23,7 @@ if (r_player_divideinvehicle > 0) then {
|
||||
_maxControlledZombies = round(dayz_maxLocalZombies);
|
||||
_enabled = false;
|
||||
|
||||
if (_canLoot ) then {
|
||||
if (_canLoot && !([_originalPos] call DZE_SafeZonePosCheck)) then {
|
||||
//Get zombie class
|
||||
_unitTypes = getArray (_config >> "zombieClass");
|
||||
_min = getNumber (_config >> "minRoaming");
|
||||
@@ -33,13 +33,12 @@ if (_canLoot ) then {
|
||||
//Walking Zombies
|
||||
_num = (round(random _max)) max _min; // + round(_max / 3);
|
||||
//diag_log ("Class: " + _type + " / Zombies: " + str(_unitTypes) + " / Walking: " + str(_num));
|
||||
if (!([_originalPos] call DZE_SafeZonePosCheck)) then {
|
||||
for "_i" from 0 to _num do
|
||||
{
|
||||
//_iPos = _obj modelToWorld _originalPos;
|
||||
if ((_maxlocalspawned < _maxControlledZombies) and (dayz_CurrentNearByZombies < dayz_maxNearByZombies) and (dayz_currentGlobalZombies < dayz_maxGlobalZeds)) then {
|
||||
[_originalPos,true,_unitTypes,_wreck] call zombie_generate;
|
||||
};
|
||||
|
||||
for "_i" from 0 to _num do
|
||||
{
|
||||
//_iPos = _obj modelToWorld _originalPos;
|
||||
if ((_maxlocalspawned < _maxControlledZombies) and (dayz_CurrentNearByZombies < dayz_maxNearByZombies) and (dayz_currentGlobalZombies < dayz_maxGlobalZeds)) then {
|
||||
[_originalPos,true,_unitTypes,_wreck] call zombie_generate;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -52,7 +51,7 @@ if (_canLoot ) then {
|
||||
{
|
||||
_Pos = [_x select 0, _x select 1, 0];
|
||||
_rnd = random 1;
|
||||
if (_rnd < _zombieChance && {!([_Pos] call DZE_SafeZonePosCheck)}) then {
|
||||
if (_rnd < _zombieChance) then {
|
||||
_iPos = _obj modelToWorld _Pos;
|
||||
_nearByZed = {alive _x} count (_iPos nearEntities ["zZombie_Base",(((sizeOf _type) * 2) + 10)]) > 0;
|
||||
_nearByPlayer = ({isPlayer _x} count (_iPos nearEntities ["CAManBase",30])) > 0;
|
||||
|
||||
@@ -5,6 +5,7 @@ _amount = _this select 1;
|
||||
_counter = 0;
|
||||
_agent = objNull;
|
||||
|
||||
if ([_player] call DZE_SafeZonePosCheck) exitWith {};
|
||||
|
||||
while {_counter < _amount} do {
|
||||
|
||||
@@ -12,7 +13,7 @@ while {_counter < _amount} do {
|
||||
_type = "swarm_newBase"; //"_unitTypes call BIS_fnc_selectRandom;
|
||||
//_type = "Pastor";
|
||||
_position = [position _player,50,100,0] call fn_selectRandomLocation;
|
||||
if ([_position] call DZE_SafeZonePosCheck) exitWith {};
|
||||
|
||||
_agent = createAgent [_type, _position, [], 0, "NONE"];
|
||||
|
||||
_agent setVariable["agentObjectSwarm",_agent,true];
|
||||
@@ -39,4 +40,4 @@ while {_counter < _amount} do {
|
||||
|
||||
//Start behavior
|
||||
_id = [_position,_agent,player] execFSM "\z\AddOns\dayz_code\system\fn_swarmagent.fsm";
|
||||
};
|
||||
};
|
||||
@@ -66,7 +66,7 @@ if ((_maxlocalspawned < _maxControlledZombies) && (dayz_CurrentNearByZombies < d
|
||||
_skipFOV = true;
|
||||
_position = [_position,3,20,1] call fn_selectRandomLocation;
|
||||
};
|
||||
if ([_position] call DZE_SafeZonePosCheck) exitWith {};
|
||||
|
||||
if (surfaceIsWater _position) exitWith { diag_log "Location is in Water Abort"; };
|
||||
|
||||
if ((_skipFOV) or {([_position, 15, 10, 70] call _cantSee)}) then {
|
||||
|
||||
@@ -25,9 +25,8 @@ DZE_UI = "vanilla"; //"vanilla","epoch","dark" UI status icons style. Dark acco
|
||||
DZE_VanillaUICombatIcon = true; //Display or hide combat UI icon if using DZE_UI = "vanilla"; otherwise it has no affect.
|
||||
timezoneswitch = 0; // Changes murderMenu times with this offset in hours.
|
||||
DZE_NoVehicleExplosions = false; //Disable vehicle explosions to prevent damage to objects by ramming. Doesn't work with amphibious pook which should not be used due to FPS issues.
|
||||
DZE_SafeZonePosArray = []; //Prevent players in safeZones from being killed if their vehicle is destroyed. Format is [[[3D POS], RADIUS],[[3D POS], RADIUS]]; Ex. DZE_SafeZonePosArray = [[[6325.6772,7807.7412,0],150],[[4063.4226,11664.19,0],150]]; ALSO excludes positions from loot and zombie spawn, as well as salvage actions
|
||||
DZE_SafeZoneNoBuildItems = []; // Array of object class names not allowed to be built near the safe zones listed above. Can be nested arrays for custom distances. i.e ["VaultStorageLocked","LockboxStorageLocked",["Plastic_Pole_EP1_DZ",1300]] etc.
|
||||
DZE_SafeZoneNoBuildDistance = 150; // Distance from safe zones listed above to disallow building near.
|
||||
DZE_SafeZoneNoBuildItems = []; // Array of object class names not allowed to be built near the zones in DZE_SafeZonePosArray (see mission\init.sqf). Can be nested arrays for custom distances. i.e ["VaultStorageLocked","LockboxStorageLocked",["Plastic_Pole_EP1_DZ",1300]] etc.
|
||||
DZE_SafeZoneNoBuildDistance = 150; // Distance from zones in DZE_SafeZonePosArray (see mission\init.sqf) to disallow building near.
|
||||
DZE_NoBuildNear = []; //Array of object class names that are blacklisted to build near. i.e ["Land_Mil_ControlTower","Land_SS_hangar"] etc.
|
||||
DZE_NoBuildNearDistance = 150; // Distance from blacklisted objects to disallow building near.
|
||||
DZE_BuildHeightLimit = 0; // 0 = No building height limit | >0 = Height limit in meters | Changing this to 30 would limit the maximum built height to 30 meters.
|
||||
|
||||
Reference in New Issue
Block a user