Treader Spawn tweaks

Better Trader distribution
-Added Trader Distance Check (depends on mapsize by default)
- Replaced Trader Buildings by scripted Check (by default)
This commit is contained in:
He-Man 2019-01-19 00:40:46 +01:00
parent 2094bff6de
commit e5bc567e67
34 changed files with 25 additions and 37 deletions

View File

@ -15,7 +15,7 @@
//[[[cog import generate_private_arrays ]]]
private [ "_serverSettingsConfig","_acceptableBlds","_agent","_aiClass","_aiTables","_buildingHome","_buildingWork","_buildings","_checkBuilding","_config","_endTime","_home",
"_homes","_markers","_objHiveKey","_pos","_position","_randomAIUniform","_return","_schedule","_slot","_spawnCount","_startTime","_traderHomes","_usedBuildings","_work",
"_WinterDeco","_HelloweenDeco","_buildingJammerRange","_TraderDeco"
"_WinterDeco","_HelloweenDeco","_buildingJammerRange","_TraderDeco","_TraderMinDistance","_traderblockblds","_Traderblocks"
];
//[[[end]]]
_serverSettingsConfig = configFile >> "CfgEpochServer";
@ -24,6 +24,14 @@ _spawnCount = count EPOCH_TraderSlots;
_config = (configFile >> "CfgEpoch" >> worldName);
_aiTables = getArray(_config >> "traderUniforms");
_acceptableBlds = getArray(_config >> "traderBlds");
_TraderMinDistance = getnumber(_config >> "TraderMinDistance");
if (_TraderMinDistance isEqualto 0) then {
_TraderMinDistance = worldsize / 12;
};
_traderblockblds = getArray(_config >> "traderblockblds");
if (_traderblockblds isEqualto []) then {
_traderblockblds = ["pier","bridge","fireescape","medevac_house","pillboxbunker"];
};
_traderHomes = getArray(_config >> "traderHomes");
_TraderDeco = [_serverSettingsConfig, "TraderDeco", true] call EPOCH_fnc_returnConfigEntry;
_buildingJammerRange = ["CfgEpochClient", "buildingJammerRange", 75] call EPOCH_fnc_returnConfigEntryV2;
@ -40,10 +48,19 @@ _checkBuilding = {
_return = !((_building buildingPos -1) isEqualTo []);
if !(_return) exitWith {_return};
_return = (_building nearEntities [_aiClass, 50]) isEqualTo [];
if !(_return) exitWith {_return};
_return = ({(tolower (typeOf _building) find _x) > -1} count _traderblockblds) < 1;
_return
};
_Traderblocks = [];
{
if (alive _x) then {
_Traderblocks pushback [getpos _x, _TraderMinDistance];
};
} foreach EPOCH_Traders;
for "_i" from 1 to _spawnCount do {
_position = [epoch_centerMarkerPosition, 0, EPOCH_dynamicVehicleArea, 20, 0, 4000, 0] call BIS_fnc_findSafePos;
_position = [epoch_centerMarkerPosition, 0, EPOCH_dynamicVehicleArea, 0, 0, 1000, 0, _Traderblocks] call BIS_fnc_findSafePos;
if (count _position == 2) then {
_randomAIUniform = selectRandom _aiTables;
_aiClass = "C_man_1";
@ -100,6 +117,7 @@ for "_i" from 1 to _spawnCount do {
_agent setVariable["MARKER_REF", _markers];
};
EPOCH_Traders pushback _agent;
_Traderblocks pushback [getpos _agent, _TraderMinDistance];
};
};
};

View File

@ -77,9 +77,11 @@ class CfgEpoch
};
// Traders
traderBlds[] = {"House", "Building"};
traderHomes[] = {"House", "Building"};
traderUniforms[] = {"U_OG_leader", "U_C_Poloshirt_stripped", "U_C_Poloshirt_blue", "U_C_Poloshirt_burgundy", "U_C_Poloshirt_tricolour", "U_C_Poloshirt_salmon", "U_C_Poloshirt_redwhite", "U_C_Poor_1", "U_C_WorkerCoveralls", "U_C_Journalist", "U_C_Scientist", "U_OrestesBody"};
traderBlds[] = {"Building"};
traderHomes[] = {"Building"};
traderUniforms[] = {"U_OG_leader", "U_C_Poloshirt_stripped", "U_C_Poloshirt_blue", "U_C_Poloshirt_burgundy", "U_C_Poloshirt_tricolour", "U_C_Poloshirt_salmon", "U_C_Poloshirt_redwhite", "U_C_Poor_1", "U_C_WorkerCoveralls", "U_C_Journalist", "U_C_Scientist", "U_OrestesBody", "U_Chav_EPOCH"};
// TraderMinDistance = 1500; // Min distance between Traders. If not defined, Server will calculate it by MapSize
traderblockblds[] = {"pier","bridge","fireescape","medevac_house","pillboxbunker"}; // If a building include this chars in the classname (tolower!!!) they will be blocked for Traders
// Debug Box
telePos[] = {};

View File

@ -29,7 +29,6 @@ class Bootcamp_ACR : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = {"House", "Building"};
shipwreckLootEnabled = 0;
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -29,7 +29,6 @@ class Desert_E : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = {"House", "Building"};
shipwreckLootEnabled = 0;
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -15,7 +15,6 @@ class IslaDuala3 : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = {"House", "Building"};
shipwreckLootEnabled = 0;
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -15,7 +15,6 @@ class Kapaulio : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = {"House", "Building"};
shipwreckLootEnabled = 0;
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -24,7 +24,6 @@ class Malden : Default
{"NameCityCapital",4},
{"Airport",5}
};
traderBlds[] = { "Land_Kiosk_blueking_F", "Land_FuelStation_Build_F", "Land_CarService_F", "Land_i_Garage_V1_F", "Land_i_Shed_Ind_F", "Land_i_Shop_01_V1_F" };
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]
// S [-0.415527,-7.05298,-10.3098, 180]

View File

@ -29,7 +29,6 @@ class Mountains_ACR : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = {"House", "Building"};
shipwreckLootEnabled = 0;
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -29,7 +29,6 @@ class Napf : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = {"House", "Building"};
shipwreckLootEnabled = 0;
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -15,7 +15,6 @@ class Panthera3 : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = {"House", "Building"};
shipwreckLootEnabled = 0;
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -29,7 +29,6 @@ class Porto : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = {"House", "Building"};
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -30,7 +30,6 @@ class ProvingGrounds_PMC : Default
{"ViewPoint",1}
};
shipwreckLootEnabled = 0;
traderBlds[] = {"House", "Building"};
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -29,7 +29,6 @@ class Sara : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = {"House", "Building"};
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -29,7 +29,6 @@ class SaraLite : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = {"House", "Building"};
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -29,7 +29,6 @@ class Sara_dbe1 : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = {"House", "Building"};
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -30,7 +30,6 @@ class Shapur_BAF : Default
{"ViewPoint",1}
};
shipwreckLootEnabled = 0;
traderBlds[] = {"House", "Building"};
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -29,7 +29,6 @@ class Utes : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = {"House", "Building"};
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -15,7 +15,6 @@ class Winthera3 : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = {"House", "Building"};
shipwreckLootEnabled = 0;
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -29,7 +29,6 @@ class Woodland_ACR : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = {"House", "Building"};
shipwreckLootEnabled = 0;
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -15,7 +15,6 @@ class abramia : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = {"House", "Building"};
shipwreckLootEnabled = 0;
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -25,7 +25,6 @@ class Altis : Default
{"NameCityCapital",4},
{"Airport",5}
};
traderBlds[] = { "Land_Kiosk_blueking_F", "Land_FuelStation_Build_F", "Land_CarService_F", "Land_i_Garage_V1_F", "Land_i_Shed_Ind_F", "Land_i_Shop_01_V1_F" };
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]
// S [-0.415527,-7.05298,-10.3098, 180]

View File

@ -29,7 +29,6 @@ class Australia : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = { "Land_A_FuelStation_Build", "Land_A_GeneralStore_01", "Land_A_GeneralStore_01a", "Land_A_Office01", "Land_Ind_Garage01", "Land_Ind_Workshop01_04", "Land_Ind_Workshop01_L", "Land_Shed_Ind02", "Land_Tovarna2", "Land_sara_hasic_zbroj" };
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]
// S [-0.415527,-7.05298,-10.3098, 180]

View File

@ -29,7 +29,6 @@ class Bornholm : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = { "Land_bo_A_GeneralStore_01", "Land_FuelStation_Build_F", "Land_CarService_F", "Land_i_Garage_V1_F", "Land_i_Shed_Ind_F", "Land_i_Shop_01_V1_F" };
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]
// S [-0.415527,-7.05298,-10.3098, 180]

View File

@ -29,7 +29,6 @@ class Chernarus : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = { "Land_A_FuelStation_Build", "Land_A_GeneralStore_01", "Land_A_GeneralStore_01a", "Land_A_Office01", "Land_Ind_Garage01", "Land_Ind_Workshop01_04", "Land_Ind_Workshop01_L", "Land_Shed_Ind02", "Land_Tovarna2", "Land_sara_hasic_zbroj" };
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]
// S [-0.415527,-7.05298,-10.3098, 180]

View File

@ -29,7 +29,6 @@ class Chernarus_Summer : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = { "Land_A_FuelStation_Build", "Land_A_GeneralStore_01", "Land_A_GeneralStore_01a", "Land_A_Office01", "Land_Ind_Garage01", "Land_Ind_Workshop01_04", "Land_Ind_Workshop01_L", "Land_Shed_Ind02", "Land_Tovarna2", "Land_sara_hasic_zbroj" };
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]
// S [-0.415527,-7.05298,-10.3098, 180]

View File

@ -29,7 +29,6 @@ class ChernarusRedux : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = { "Land_A_FuelStation_Build", "Land_A_GeneralStore_01", "Land_A_GeneralStore_01a", "Land_A_Office01", "Land_Ind_Garage01", "Land_Ind_Workshop01_04", "Land_Ind_Workshop01_L", "Land_Shed_Ind02", "Land_Tovarna2", "Land_sara_hasic_zbroj" };
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]
// S [-0.415527,-7.05298,-10.3098, 180]

View File

@ -15,7 +15,6 @@ class dingor : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = {"House", "Building"};
shipwreckLootEnabled = 0;
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -29,7 +29,6 @@ class Esseker : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = { "Land_i_House_Big_02_V3_dam_F", "Land_A_GeneralStore_01", "Land_A_GeneralStore_01a", "Land_sara_domek_zluty", "Land_Tovarna2", "Land_Shed_Ind02", "Land_i_House_Big_01_V3_dam_F", "Land_HouseV2_02_Interier", "Land_i_House_Small_01_V3_dam_F", "Land_HouseV_1I4", "Land_dum_rasovna", "Land_FuelStation_Build_F", "Land_CarService_F", "Land_u_House_Small_02_V1_F", "Land_i_Stone_HouseSmall_V1_F", "Land_i_Stone_Shed_V1_F"};
shipwreckLootEnabled = 0;
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -15,7 +15,6 @@ class lingor3 : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = {"House", "Building"};
shipwreckLootEnabled = 0;
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -165,7 +165,6 @@ class Stratis : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = { "Land_Kiosk_blueking_F", "Land_FuelStation_Build_F", "Land_CarService_F", "Land_i_Garage_V1_F", "Land_i_Shed_Ind_F", "Land_i_Shop_01_V1_F" };
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]
// S [-0.415527,-7.05298,-10.3098, 180]

View File

@ -29,7 +29,6 @@ class Takistan : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = { "Land_Kiosk_blueking_F", "Land_FuelStation_Build_F", "Land_CarService_F", "Land_i_Garage_V1_F", "Land_i_Shed_Ind_F", "Land_i_Shop_01_V1_F" };
shipwreckLootEnabled = 0;
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -190,7 +190,6 @@ class Tanoa : Default
{"B_T_VTOL_01_infantry_F",1},
{"B_T_VTOL_01_vehicle_F",1}
};
traderBlds[] = { "Land_Kiosk_blueking_F", "Land_FuelStation_Build_F", "Land_CarService_F", "Land_i_Garage_V1_F", "Land_i_Shed_Ind_F", "Land_i_Shop_01_V1_F" };
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]
// S [-0.415527,-7.05298,-10.3098, 180]

View File

@ -20,7 +20,6 @@ class VR : Default
radioactiveLocations[] = {};
radioactiveLocationsCount = 0;
allowedVehiclesList[] = {};
traderBlds[] = { "Land_Kiosk_blueking_F", "Land_FuelStation_Build_F", "Land_CarService_F", "Land_i_Garage_V1_F", "Land_i_Shed_Ind_F", "Land_i_Shop_01_V1_F" };
shipwreckLootEnabled = 0;
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]

View File

@ -29,7 +29,6 @@ class Zargabad : Default
{"VegetationFir",1},
{"ViewPoint",1}
};
traderBlds[] = { "Land_Kiosk_blueking_F", "Land_FuelStation_Build_F", "Land_CarService_F", "Land_i_Garage_V1_F", "Land_i_Shed_Ind_F", "Land_i_Shop_01_V1_F" };
shipwreckLootEnabled = 0;
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]