Move HeliCrash and CarePackage area variables to markers

This allows finer grained control of crashsite, carepackage and infected
camp spawn positions and radii (further north, south, east, west, etc.).

Also removed some hardcoded checks for Chernarus, since
dayz_townGenerator should always be off on other maps for now. Someone
may add town generator coordinates for other maps later.

Related vanilla commits:

b20b402bf0

7c8b69eb82

7dfd3ef9cf
This commit is contained in:
ebaydayz
2016-09-11 14:45:39 -04:00
parent 48334e76d4
commit 16e4dc7b30
65 changed files with 579 additions and 253 deletions

View File

@@ -62,7 +62,7 @@ _insideloop = {
};
for "_i" from 1 to 2048 do {
if (!dayz_townGenerator or {toLower worldName != "chernarus"}) exitWith {};
if (!dayz_townGenerator) exitWith {};
_pos = _a call psrnd;
_pos call _insideloop;
if (_plantcount >= dayz_maxGlobalPlants) exitWith {};

View File

@@ -8,8 +8,8 @@ dayz_matchboxCount = false; // Enable match stick count. After five uses matches
dayz_toolBreaking = false; //Sledgehammer, crowbar and pickaxe have a chance to break when used.
dayz_waterBottleBreaking = false; // Water bottles have a chance to break when boiling and require duct tape to fix
dayz_tameDogs = false; // Allow taming dogs with raw meat
dayz_townGenerator = false; // Spawn vanilla map junk in addition to Epoch DynamicDebris. Only works on Chernarus.
dayz_townGeneratorBlackList = [[4053,11668,0],[11463,11349,0],[6344,7806,0],[1606,7803,0],[12944,12766,0],[5075,9733,0],[12060,12638,0]]; // Town generator will not spawn junk within 150m of these positions.
dayz_townGenerator = false; // Spawn vanilla map junk in addition to Epoch DynamicDebris. Currently only compatible with Chernarus. Need to add coordinates for other maps.
dayz_townGeneratorBlackList = []; // Town generator will not spawn junk within 150m of these positions. Example for Chernarus trader cities: [[4053,11668,0],[11463,11349,0],[6344,7806,0],[1606,7803,0],[12944,12766,0],[5075,9733,0],[12060,12638,0]]
DynamicVehicleDamageLow = 0; // Min damage random vehicles can spawn with
DynamicVehicleDamageHigh = 100; // Max damage random vehicles can spawn with

View File

@@ -18,7 +18,7 @@
"PVDZE_veh_Init" addPublicVariableEventHandler {(_this select 1) call fnc_veh_ResetEH};
"PVDZE_obj_Remove" addPublicVariableEventHandler {_pos = (_this select 1); _obj = nearestObjects [_pos, DZE_isWreckBuilding, 5]; if (count _obj > 0) then {deleteVehicle (_obj select 0);};};
if (toLower worldName == "chernarus") then {
if (toLower worldName == "chernarus") then { //need to add building coordinates for other maps
{
private ["_building","_fckingcode"];

View File

@@ -131,7 +131,6 @@ pickupInit = false;
mouseOverCarry = false; //for carry slot since determining mouse pos doesn't work right
dayZ_partClasses = ["PartFueltank","PartWheel","PartEngine"]; //No need to add PartGeneric, it is default for everything
dayZ_explosiveParts = ["palivo","motor"];
dayz_centerMarker = getMarkerPos "center";
//Survival Variables
SleepFood = 2160; //minutes (48 hours)
@@ -421,6 +420,12 @@ if(isNil "dayz_ForcefullmoonNights") then {
if(isNil "dayz_randomMaxFuelAmount") then {
dayz_randomMaxFuelAmount = 500; //Puts a random amount of fuel in all fuel stations.
};
if(isNil "dayz_townGenerator") then {
dayz_townGenerator = true; // Spawn map junk. Currently only compatible with Chernarus. Need to add coordinates for other maps.
};
if(isNil "dayz_townGeneratorBlackList") then {
dayz_townGeneratorBlackList = []; // Town generator will not spawn junk within 150m of these positions.
};
//Replace server individual settings with ranked settings
if(isNil "dayz_presets") then { dayz_presets = "Vanilla"; };
@@ -480,6 +485,14 @@ switch (dayz_presets) do {
};
};
switch (toLower worldName) do {
case "napf";
case "sauerland" : {dayz_minpos = -1000; dayz_maxpos = 26000;};
case "tavi" : {dayz_minpos = -26000; dayz_maxpos = 26000;};
case "chernarus" : {dayz_minpos = -1; dayz_maxpos = 16000;};
case default {dayz_minpos = -20000; dayz_maxpos = 20000;};
};
//start achievements_init
//call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\achievements_init.sqf";
@@ -543,14 +556,6 @@ if (isNil "DZE_PlotPole") then {DZE_PlotPole = [30,45];};
DZE_maintainRange = ((DZE_PlotPole select 0)+20);
if (isNil "DZE_slowZombies") then {DZE_slowZombies = false;};
switch (toLower worldName) do {
case "napf";
case "sauerland" : {dayz_minpos = -1000; dayz_maxpos = 26000;};
case "tavi" : {dayz_minpos = -26000; dayz_maxpos = 26000;};
case "chernarus" : {dayz_minpos = -1; dayz_maxpos = 16000;};
case default {dayz_minpos = -20000; dayz_maxpos = 20000;};
};
if (isServer) then {
dead_bodyCleanup = [];
needUpdate_objects = [];
@@ -573,9 +578,6 @@ if (isServer) then {
DZE_safeVehicle = ["ParachuteWest","ParachuteC"];
if (isNil "EpochUseEvents") then {EpochUseEvents = false;};
if (isNil "EpochEvents") then {EpochEvents = [];};
if (isNil "dayz_MapArea") then {dayz_MapArea = 10000;};
if (isNil "DynamicVehicleArea") then {DynamicVehicleArea = dayz_MapArea / 2;};
if (isNil "HeliCrashArea") then {HeliCrashArea = dayz_MapArea / 2;};
if (isNil "MaxDynamicDebris") then {MaxDynamicDebris = 100;};
if (isNil "MaxVehicleLimit") then {MaxVehicleLimit = 50;};
if (isNil "spawnArea") then {spawnArea = 1400;};

View File

@@ -9,7 +9,7 @@ inGameUISetEventHandler ["Action","false"];
// thanks to Tansien the great
// run only once per character life
{
_plant = _x createVehicleLocal dayz_centerMarker;
_plant = _x createVehicleLocal (getMarkerPos "center");
uiSleep 0.1;
if (sizeOf _x == 0) exitWith {
PVDZ_sec_atp = toArray ("Plants texture hack for type " + _x);

View File

@@ -14,7 +14,6 @@ poi_processObject = {
_o setVariable ["", true]; // prevent network SV by loot/zeds spawner
};
if (toLower worldName == "chernarus") then {
if (toLower worldName == "chernarus") then { //need to add building coordinates for other maps
call compile preprocessFileLineNumbers ("\z\addons\dayz_code\system\mission\chernarus\security\antiwallhack.sqf");
};
};

View File

@@ -159,10 +159,10 @@ sched_townGenerator = {
_x = _cell select _i;
//sched_tg_newSpawned = sched_tg_newSpawned + 1;
if ("" != (_x select 1)) then {
_blocked = if (!dayz_townGenerator or {toLower worldName != "chernarus"}) then {true} else {false};
_position = _x select 2;
_blocked = false;
{if (_position distance _x < 150) exitWith {_blocked = true;};} forEach dayz_townGeneratorBlackList;
if (!_blocked) then {
if (!_blocked && dayz_townGenerator) then {
_object = (_x select 1) createVehicleLocal [0,0,0];
_object setDir (_x select 3);
_object setPos [_position select 0,_position select 1,0];

View File

@@ -179,7 +179,7 @@ if (count _stats > 0) then {
if (_randomSpot) then {
private ["_counter","_position","_isNear","_isZero","_mkr"];
if (!isDedicated) then {endLoadingScreen;};
_IslandMap = if (toLower worldName in ["caribou","cmr_ovaron","dingor","fallujah","fapovo","fdf_isle1_a","isladuala","lingor","mbg_celle2","namalsk","napf","oring","panthera2","sara","sauerland","smd_sahrani_a2","tavi","trinity","utes"]) then {true} else {false};
_IslandMap = if (toLower worldName in ["caribou","cmr_ovaron","dayznogova","dingor","dzhg","fallujah","fapovo","fdf_isle1_a","isladuala","lingor","mbg_celle2","namalsk","napf","oring","panthera2","sara","sauerland","smd_sahrani_a2","tasmania2010","tavi","trinity","utes"]) then {true} else {false};
//spawn into random
_findSpot = true;

View File

@@ -15,8 +15,8 @@ Author:
//Number of care packages to spawn
#define SPAWN_NUM 6
#define SEARCH_CENTER dayz_centerMarker
#define SEARCH_RADIUS HeliCrashArea
#define SEARCH_CENTER getMarkerPos "carepackages"
#define SEARCH_RADIUS (getMarkerSize "carepackages") select 0
#define SEARCH_DIST_MIN 30
#define SEARCH_SLOPE_MAX 1000
#define SEARCH_BLACKLIST [[[12923,3643],[14275,2601]]]

View File

@@ -21,8 +21,8 @@ Author:
#define SPAWN_CHANCE 0.75
//Parameters for finding a suitable position to spawn the crash site
#define SEARCH_CENTER dayz_centerMarker
#define SEARCH_RADIUS HeliCrashArea
#define SEARCH_CENTER getMarkerPos "crashsites"
#define SEARCH_RADIUS (getMarkerSize "crashsites") select 0
#define SEARCH_DIST_MIN 20
#define SEARCH_SLOPE_MAX 2
#define SEARCH_BLACKLIST [[[2092,14167],[10558,12505]]]

View File

@@ -29,8 +29,8 @@ Author:
#define OBJECT_RADIUS_MIN 8
#define OBJECT_RADIUS_MAX 13
#define SEARCH_CENTER dayz_centerMarker
#define SEARCH_RADIUS HeliCrashArea
#define SEARCH_CENTER getMarkerPos "center"
#define SEARCH_RADIUS (getMarkerSize "center") select 0
#define SEARCH_EXPRESSION "(5 * forest) + (4 * trees) + (3 * meadow) - (20 * houses) - (30 * sea)" //+ (3 * meadow) - (20 * houses) - (30 * sea)
#define SEARCH_PRECISION 30
#define SEARCH_ATTEMPTS 10

View File

@@ -1,6 +1,6 @@
private ["_position","_veh","_istoomany","_spawnveh","_positions"];
_position = [dayz_centerMarker,0,(HeliCrashArea*0.75),10,0,2000,0] call BIS_fnc_findSafePos;
_position = [getMarkerPos "center",0,(((getMarkerSize "center") select 1)*0.75),10,0,2000,0] call BIS_fnc_findSafePos;
if ((count _position) == 2) then {
_positions = selectBestPlaces [_position, 500, "(1 + forest) * (1 + hills) * (1 - houses) * (1 - sea)", 10, 5];

View File

@@ -34,11 +34,11 @@ if (count AllowedVehiclesList == 0) then {
if (_isShip or _isAir) then {
if (_isShip) then {
// Spawn anywhere on coast on water
_position = [dayz_centerMarker,0,DynamicVehicleArea,10,1,2000,1] call BIS_fnc_findSafePos;
_position = [getMarkerPos "center",0,((getMarkerSize "center") select 1),10,1,2000,1] call BIS_fnc_findSafePos;
//diag_log("DEBUG: spawning boat near coast " + str(_position));
} else {
// Spawn air anywhere that is flat
_position = [dayz_centerMarker,0,DynamicVehicleArea,10,0,2000,0] call BIS_fnc_findSafePos;
_position = [getMarkerPos "center",0,((getMarkerSize "center") select 1),10,0,2000,0] call BIS_fnc_findSafePos;
//diag_log("DEBUG: spawning air anywhere flat " + str(_position));
};
} else {

View File

@@ -16,7 +16,7 @@ while {_counter < _amount} do {
//_radius = 0;
_method = "CAN_COLLIDE";
_position = [dayz_centerMarker,1,6500,1] call fn_selectRandomLocation;
_position = [getMarkerPos "center",1,6500,1] call fn_selectRandomLocation;
//Create Zed
_agent = createAgent [_type, _position, [], 1, _method];

View File

@@ -1,4 +1,4 @@
// Sample Drop Bomb
private ["_position"];
_position = [dayz_centerMarker,0,DynamicVehicleArea,10,0,2000,0] call BIS_fnc_findSafePos;
_position = [getMarkerPos "center",0,((getMarkerSize "center") select 1),10,0,2000,0] call BIS_fnc_findSafePos;
bomb = createVehicle ["Bo_GBU12_LGB", [(_position select 0),(_position select 1), 1000], [], 0, "CAN_COLLIDE"];

View File

@@ -114,7 +114,7 @@ AllowedVehiclesList = [
["VWGolf",_Ratio3]
];
if (toLower worldName in ["caribou","chernarus","cmr_ovaron","dingor","fallujah","fapovo","fdf_isle1_a","isladuala","lingor","mbg_celle2","namalsk","napf","oring","panthera2","sara","sauerland","smd_sahrani_a2","tavi","trinity","utes"]) then {
if (toLower worldName in ["caribou","chernarus","cmr_ovaron","dayznogova","dingor","dzhg","fallujah","fapovo","fdf_isle1_a","isladuala","lingor","mbg_celle2","namalsk","napf","oring","panthera2","sara","sauerland","smd_sahrani_a2","tasmania2010","tavi","trinity","utes"]) then {
// water map, add boats
AllowedVehiclesList = AllowedVehiclesList + [

View File

@@ -5,8 +5,8 @@ private ["_blocked","_flame","_position"];
_position = _x;
{if (_position distance _x < 150) exitWith {_blocked = true;};} forEach dayz_townGeneratorBlackList;
if (!_blocked && (random 1 < 0.33)) then {
//_flame = createVehicle [ "flamable_DZ", _x, [], 0, "CAN_COLLIDE"];
_flame = "flamable_DZ" createVehicle _x;
_flame = "flamable_DZ" createVehicle [0,0,0]; //200x faster https://community.bistudio.com/wiki/Code_Optimisation#createVehicle.28Local.29
_flame setPosATL _x;
_flame inflame true;
_flame setVariable ["permaLoot",true]; // = won't be removed by the cleaner, cf. sched_lootpiles.sqf
};
@@ -29,4 +29,4 @@ private ["_blocked","_flame","_position"];
[6754.5,2780.37,0.597929], [6760.03,2727.7,0.597929], [6789.35,2692.69,0.597929], [6796.09,2726.09,0.597929], [6810.51,2499.86,0.597929],
[6822.79,2482.01,0.597929], [6832.25,2500.24,0.597929], [6833.6,3176.97,0.59797], [6835.19,2694.23,0.597929], [6847.45,2360.25,0.597929],
[6856.71,2522.75,0.597929], [6864.41,2464.66,0.597929], [7065.12,2622.94,0.597929], [7095.99,2740.68,0.597929]
];
];

View File

@@ -393,7 +393,7 @@ publicVariable "sm_done";
[] execVM "\z\addons\dayz_server\compile\server_spawnCarePackages.sqf";
[] execVM "\z\addons\dayz_server\compile\server_spawnCrashSites.sqf";
if (dayz_townGenerator && {toLower worldName == "chernarus"}) then {execVM "\z\addons\dayz_server\system\lit_fireplaces.sqf";};
if (dayz_townGenerator) then {execVM "\z\addons\dayz_server\system\lit_fireplaces.sqf";};
"PVDZ_sec_atp" addPublicVariableEventHandler {
_x = _this select 1;
@@ -461,8 +461,8 @@ if (_hiveLoaded) then {
if (isClass (_cfgLootFile >> typeOf _x)) then {
_buildingList set [count _buildingList,_x];
};
} count (dayz_centerMarker nearObjects ["building",DynamicVehicleArea]);
_roadList = dayz_centerMarker nearRoads DynamicVehicleArea;
} count (getMarkerPos "center" nearObjects ["building",((getMarkerSize "center") select 1)]);
_roadList = getMarkerPos "center" nearRoads ((getMarkerSize "center") select 1);
_vehLimit = MaxVehicleLimit - (count _serverVehicleCounter);
if (_vehLimit > 0) then {