Multi-Map Support

Make Epoch compatible to all Maps with some fallback configs
This commit is contained in:
He-Man 2019-06-21 22:45:01 +02:00
parent 8536aa2162
commit 340dcef7bf
9 changed files with 6147 additions and 5 deletions

View File

@ -16,3 +16,8 @@ http://www.bistudio.com/community/licenses/arma-public-license-share-alike
Credits:
=====
https://github.com/EpochModTeam/Epoch/blob/release/CREDITS.md
Instructions:
=====
- Server Install: https://epochmod.com/forum/topic/44751-dec2017-arma-3-epochmod-server-installation-and-setup/
- If your wanted Map is currently not supported, use the "epoch._ChangeMe.pbo" and rename it to "epoch.MapName.pbo" to use a fallback config

View File

@ -138,6 +138,12 @@ if (!isNull _player) then {
// normal respawn location
_location = getMarkerPos "respawn_west";
_location set[2, 0];
if (_location isEqualTo [0,0,0]) then {
_location set [2, 10];
if (surfaceiswater _location) then {
_location = asltoatl _location;
};
};
if (_newLocation isEqualType [] && {(count _newLocation) == 3}) then {
_CheckLocation = _newLocation;
if (surfaceiswater _newLocation) then {
@ -177,8 +183,16 @@ if (!isNull _player) then {
if (isNull _group) then {
_group = createGroup [west, true];
};
_newPlyr = _group createUnit[_class, getMarkerPos "respawn_west", [], 0, "CAN_COLLIDE"];
_spawnpos = getMarkerPos "respawn_west";
_spawnpos set[2, 0];
if (_spawnpos isEqualTo [0,0,0]) then {
_spawnpos set [2, 10];
if (surfaceiswater _spawnpos) then {
_spawnpos = asltoatl _spawnpos;
};
};
_newPlyr = _group createUnit[_class, _spawnpos, [], 0, "CAN_COLLIDE"];
_newPlyr setposatl _spawnpos;
_newPlyr hideobjectglobal true;
if !(isNull _newPlyr) then {

View File

@ -47,15 +47,28 @@ _loadBaseTemplateConfig = {
// load map config
_config = configFile >> "CfgEpoch";
_configWorld = _config >> worldname;
if !(isclass _configWorld) then {
_configWorld = _config >> "Default";
};
_debugBox = getText(_configWorld >> "debugBoxClass"); // debugBoxClass = "" to disable
if !(_debugBox isEqualTo "") then {
_debugLocation = getMarkerPos "respawn_west";
_debugLocation set[2, 0];
if (_debugLocation isEqualTo [0,0,0]) then {
_debugLocation set [2, 10];
};
_debug = createVehicle[_debugBox, _debugLocation, [], 0, "CAN_COLLIDE"];
_debug setposATL _debugLocation;
_protection = createVehicle["ProtectionZone_Invisible_F", _debugLocation, [], 0, "CAN_COLLIDE"];
_protection setposATL _debugLocation;
if (_debugLocation distance2d [0,0,0] < 10) then {
_debug setvectorup [0,0,1];
if (surfaceiswater _debugLocation) then {
_debug setposASL _debugLocation;
_protection setposASL _debugLocation;
};
};
_cloneClasses = getArray(_configWorld >> "cloneClasses");
if !(_cloneClasses isEqualTo []) then {
for "_i" from 1 to 4 do {
@ -132,6 +145,20 @@ if !(_debugBox isEqualTo "") then {
if (_pos isEqualType "") then {
_markerName = _pos;
_pos = getMarkerPos _markerName;
if (_pos isEqualTo [0,0,0]) then {
for "_i" from 0 to 10 do {
_pos = switch _markerName do {
case "north": {[epoch_centerMarkerPosition vectorAdd [0,worldsize/3,0], 0, worldsize/8, 5, 0, 0.1] call BIS_fnc_findSafePos};
case "south": {[epoch_centerMarkerPosition vectorAdd [0,-worldsize/3,0], 0, worldsize/8, 5, 0, 0.1] call BIS_fnc_findSafePos};
case "east": {[epoch_centerMarkerPosition vectorAdd [worldsize/3,0,0], 0, worldsize/8, 5, 0, 0.1] call BIS_fnc_findSafePos};
case "west": {[epoch_centerMarkerPosition vectorAdd [-worldsize/3,0,0], 0, worldsize/8, 5, 0, 0.1] call BIS_fnc_findSafePos};
default {[epoch_centerMarkerPosition, 0, worldsize/8, 5, 0, 0.1] call BIS_fnc_findSafePos};
};
if (count _pos == 2) exitwith {
_pos pushback 0;
};
};
};
["ProtectionZone_Invisible_F",_markerName,_pos,_class] call _loadBaseTemplateConfig;
} else {
_pro2 = createVehicle ["ProtectionZone_Invisible_F", _pos, [], 0, "CAN_COLLIDE"];

View File

@ -24,6 +24,9 @@ params [["_maxTraderLimit",0]];
_staticTradersArray = +EPOCH_staticNPCTraderPos;
EPOCH_staticNPCTraderPos = nil;
_config = (configFile >> "CfgEpoch" >> worldName);
if !(isclass _config) then {
_config = (configFile >> "CfgEpoch" >> "Default");
};
_staticTradersArray append getArray(_config >> "staticNpcPos");
_staticTradersArrCount = count _staticTradersArray;
_aiTables = getArray(_config >> "traderUniforms");

View File

@ -22,6 +22,9 @@ _serverSettingsConfig = configFile >> "CfgEpochServer";
_TraderGodMode = [_serverSettingsConfig, "TraderGodMode", false] call EPOCH_fnc_returnConfigEntry;
_spawnCount = count EPOCH_TraderSlots;
_config = (configFile >> "CfgEpoch" >> worldName);
if !(isclass _config) then {
_config = (configFile >> "CfgEpoch" >> "Default");
};
_aiTables = getArray(_config >> "traderUniforms");
_acceptableBlds = getArray(_config >> "traderBlds");
_TraderMinDistance = getnumber(_config >> "TraderMinDistance");

View File

@ -154,7 +154,8 @@ if (isClass _epochWorldPath) then {
};
epoch_centerMarkerPosition = getMarkerPos "center";
if (epoch_centerMarkerPosition isEqualTo [0,0,0]) then {
diag_log "Epoch: Error cannot find center marker!";
diag_log "Epoch: Error cannot find center marker! - default used instead";
epoch_centerMarkerPosition = [worldSize / 2, worldsize / 2, 0];
};
EPOCH_dynamicVehicleArea = _worldSize / 2;

View File

@ -51,7 +51,7 @@ class CfgEpoch
{
class Default
{
worldSize = 12000;
// worldSize = 12000;
vehicleSpawnTypes[] = {
{"FlatAreaCity",1},
{"FlatAreaCitySmall",1},
@ -84,7 +84,16 @@ class CfgEpoch
traderblockblds[] = {"pier","bridge","fireescape","medevac_house","pillboxbunker","containerine"}; // If a building include this chars in the classname (tolower!!!) they will be blocked for Traders
// Debug Box
telePos[] = {};
telePos[] = {
// N [-0.286865,8.17383,-10.3098, 0]
// S [-0.415527,-7.05298,-10.3098, 180]
// E [13.5127,0.410156,-10.3098, 90]
// W [-14.4316,0.112793,-10.3098, -90]
{ "TP_Booth_n_EPOCH", { -0.286865,8.17383,-10.3098, 0}, "", "north" }, // Trader city 1
{ "TP_Booth_s_EPOCH", { -0.415527,-7.05298,-10.3098, 180}, "", "south" }, // Trader city 2
{ "TP_Booth_w_EPOCH", { -14.4316, 0.112793, -10.3098, -90}, "", "west" }, // Trader city 3
{ "TP_Booth_e_EPOCH", { 13.5127, 0.410156, -10.3098, 90}, "", "east" } // Trader city 4
};
lightPos[] = {
{-16.623,-8.50195,-10.5417},
{15.0352,-9.08594,-10.5417}

File diff suppressed because it is too large Load Diff

Binary file not shown.