V40 Changes
This commit is contained in:
parent
94dd74e9d3
commit
ea9064414a
@ -1,3 +1,12 @@
|
|||||||
|
=================================================================================
|
||||||
|
V40 (12-05-2016)
|
||||||
|
=================================================================================
|
||||||
|
Added SC_ropeAttach variable to the config.sqf to allow/disallow airlifting of lootcrates
|
||||||
|
Renamed and altered folder structure for functions and some eventhandlers
|
||||||
|
Map markers on occupationPlaces and now get removed when the AI are all killed
|
||||||
|
Tweaked the land vehicle repair event handler
|
||||||
|
Added SC_blackListedAreas to allow blacklisting of areas of the map
|
||||||
|
|
||||||
=================================================================================
|
=================================================================================
|
||||||
V39 (08-05-2016)
|
V39 (08-05-2016)
|
||||||
=================================================================================
|
=================================================================================
|
||||||
@ -8,8 +17,6 @@ Removed the use dependency on DMS_fnc_findSafePos as the format is changing in t
|
|||||||
test version of DMS, I will switch back to using it once it has been rolled out and
|
test version of DMS, I will switch back to using it once it has been rolled out and
|
||||||
everyone is using it
|
everyone is using it
|
||||||
|
|
||||||
Renamed and reorganised eventhandlers
|
|
||||||
|
|
||||||
=================================================================================
|
=================================================================================
|
||||||
V38 (08-05-2016)
|
V38 (08-05-2016)
|
||||||
=================================================================================
|
=================================================================================
|
||||||
|
27
config.sqf
27
config.sqf
@ -21,7 +21,7 @@ SC_mapMarkers = false; // Place map markers at the occupied areas (o
|
|||||||
SC_minFPS = 5; // any lower than minFPS on the server and additional AI won't spawn
|
SC_minFPS = 5; // any lower than minFPS on the server and additional AI won't spawn
|
||||||
SC_scaleAI = 10; // any more than _scaleAI players on the server and _maxAIcount is reduced for each extra player
|
SC_scaleAI = 10; // any more than _scaleAI players on the server and _maxAIcount is reduced for each extra player
|
||||||
|
|
||||||
SC_removeUserMapMarkers = true; // true to delete map markers place by players every 10 seconds
|
SC_removeUserMapMarkers = true; // true to delete map markers placed by players every 10 seconds
|
||||||
|
|
||||||
SC_fastNights = true; // true if you want night time to go faster than daytime
|
SC_fastNights = true; // true if you want night time to go faster than daytime
|
||||||
SC_fastNightsStarts = 18; // Start fast nights at this hour (24 hour clock) eg. 18 for 6pm
|
SC_fastNightsStarts = 18; // Start fast nights at this hour (24 hour clock) eg. 18 for 6pm
|
||||||
@ -115,9 +115,13 @@ SC_buildings = [ "Land_TentHangar_V1_F","Land_Hangar_F",
|
|||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
SC_occupyStatic = true; // true if you want to add AI in specific locations
|
SC_occupyStatic = false; // true if you want to add AI in specific locations
|
||||||
SC_staticBandits = [ ]; //[[pos],ai count,radius,search buildings]
|
SC_staticBandits = [ //[[pos],ai count,radius,search buildings]
|
||||||
SC_staticSurvivors = [ [[3770,8791,0],8,600,true] ]; //[[pos],ai count,radius,search buildings]
|
|
||||||
|
];
|
||||||
|
SC_staticSurvivors = [ //[[pos],ai count,radius,search buildings]
|
||||||
|
[[3770,8791,0],8,250,true]
|
||||||
|
];
|
||||||
|
|
||||||
SC_occupySky = true; // true if you want to have roaming AI helis
|
SC_occupySky = true; // true if you want to have roaming AI helis
|
||||||
SC_occupySea = false; // true if you want to have roaming AI boats
|
SC_occupySea = false; // true if you want to have roaming AI boats
|
||||||
@ -133,6 +137,8 @@ SC_LootCrateGuards = 4; // number of AI to spawn at
|
|||||||
SC_LootCrateGuardsRandomize = true; // Use a random number of guards up to a maximum = SC_numberofGuards (so between 1 and SC_numberofGuards)
|
SC_LootCrateGuardsRandomize = true; // Use a random number of guards up to a maximum = SC_numberofGuards (so between 1 and SC_numberofGuards)
|
||||||
SC_occupyLootCratesMarkers = true; // true if you want to have markers on the loot crate spawns
|
SC_occupyLootCratesMarkers = true; // true if you want to have markers on the loot crate spawns
|
||||||
|
|
||||||
|
SC_ropeAttach = false; // Allow lootcrates to be airlifted (for SC_occupyLootCrates and SC_occupyHeliCrashes)
|
||||||
|
|
||||||
// Array of possible common items to go in loot crates ["classname",fixed amount,random amount]
|
// Array of possible common items to go in loot crates ["classname",fixed amount,random amount]
|
||||||
// ["Exile_Item_Matches",1,2] this example would add between 1 and 3 Exile_Item_Matches to the crate (1 + 0 to 2 more)
|
// ["Exile_Item_Matches",1,2] this example would add between 1 and 3 Exile_Item_Matches to the crate (1 + 0 to 2 more)
|
||||||
// to add a fixed amount make the second number 0
|
// to add a fixed amount make the second number 0
|
||||||
@ -252,16 +258,19 @@ if (SC_debug) then
|
|||||||
{
|
{
|
||||||
SC_extendedLogging = true;
|
SC_extendedLogging = true;
|
||||||
SC_mapMarkers = true;
|
SC_mapMarkers = true;
|
||||||
SC_occupyPlaces = false;
|
SC_occupyPlaces = true;
|
||||||
SC_occupyVehicle = true;
|
SC_occupyVehicle = true;
|
||||||
SC_occupyMilitary = false;
|
SC_occupyMilitary = true;
|
||||||
SC_occupyStatic = false;
|
SC_occupyStatic = true;
|
||||||
SC_occupySky = true;
|
SC_occupySky = true;
|
||||||
SC_occupySea = false;
|
SC_occupySea = true;
|
||||||
SC_occupyTransport = true;
|
SC_occupyTransport = true;
|
||||||
SC_occupyLootCrates = true;
|
SC_occupyLootCrates = true;
|
||||||
SC_occupyHeliCrashes = true;
|
SC_occupyHeliCrashes = true;
|
||||||
SC_maxNumberofVehicles = 15;
|
SC_maxNumberofVehicles = 4;
|
||||||
|
SC_maxNumberofBoats = 1;
|
||||||
|
SC_maxNumberofHelis = 1;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -48,14 +48,16 @@ SC_occupationVersion = "v39 (09-05-2016)";
|
|||||||
SC_fnc_getIn = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\eventHandlers\getIn.sqf";
|
SC_fnc_getIn = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\eventHandlers\getIn.sqf";
|
||||||
SC_fnc_getOut = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\eventHandlers\getOut.sqf";
|
SC_fnc_getOut = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\eventHandlers\getOut.sqf";
|
||||||
|
|
||||||
|
SC_fnc_getOffBus = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\eventHandlers\getOffBus.sqf";
|
||||||
|
SC_fnc_getOnBus = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\eventHandlers\getOnBus.sqf";
|
||||||
|
SC_fnc_locationUnitMPKilled = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\eventHandlers\locationUnitMPKilled.sqf";
|
||||||
|
SC_fnc_staticUnitMPKilled = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\eventHandlers\staticUnitMPKilled.sqf";
|
||||||
SC_fnc_unitMPHit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\eventHandlers\unitMPHit.sqf";
|
SC_fnc_unitMPHit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\eventHandlers\unitMPHit.sqf";
|
||||||
SC_fnc_unitMPKilled = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\eventHandlers\unitMPKilled.sqf";
|
SC_fnc_unitMPKilled = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\eventHandlers\unitMPKilled.sqf";
|
||||||
SC_fnc_staticUnitMPKilled = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\eventHandlers\staticUnitMPKilled.sqf";
|
|
||||||
SC_fnc_getOnBus = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\eventHandlers\getOnBus.sqf";
|
|
||||||
SC_fnc_getOffBus = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\eventHandlers\getOffBus.sqf";
|
|
||||||
|
|
||||||
SC_fnc_addMarker = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\functions\fnc_addMarker.sqf";
|
SC_fnc_addMarker = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\functions\fnc_addMarker.sqf";
|
||||||
SC_fnc_findsafePos = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\functions\fnc_findsafePos.sqf";
|
SC_fnc_findsafePos = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\functions\fnc_findsafePos.sqf";
|
||||||
|
SC_fnc_isSafePos = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\functions\fnc_isSafePos.sqf";
|
||||||
SC_fnc_selectGear = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\functions\fnc_selectGear.sqf";
|
SC_fnc_selectGear = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\functions\fnc_selectGear.sqf";
|
||||||
SC_fnc_selectName = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\functions\fnc_selectName.sqf";
|
SC_fnc_selectName = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\functions\fnc_selectName.sqf";
|
||||||
SC_fnc_spawnstatics = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\functions\fnc_spawnStatics.sqf";
|
SC_fnc_spawnstatics = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\functions\fnc_spawnStatics.sqf";
|
||||||
|
43
scripts/eventHandlers/locationUnitMPKilled.sqf
Normal file
43
scripts/eventHandlers/locationUnitMPKilled.sqf
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
// Get the variables from the event handler
|
||||||
|
_unit = _this select 0;
|
||||||
|
_side = _unit getVariable "SC_unitSide";
|
||||||
|
_locationName = _unit getVariable "SC_unitLocationName";
|
||||||
|
_pos = _unit getVariable "SC_unitLocationPosition";
|
||||||
|
|
||||||
|
_unit removeAllMPEventHandlers "mphit";
|
||||||
|
|
||||||
|
if(SC_mapMarkers) then
|
||||||
|
{
|
||||||
|
deleteMarker format ["%1", _locationName];
|
||||||
|
_nearBanditAI = { side _x == SC_BanditSide AND (_x getVariable "SC_unitLocationName" == _locationName) AND alive _x } count allUnits;
|
||||||
|
_nearSurvivorAI = { side _x == SC_SurvivorSide AND (_x getVariable "SC_unitLocationName" == _locationName) AND alive _x } count allUnits;
|
||||||
|
|
||||||
|
_logDetail = format ["[OCCUPATION:locationUnitMPKilled]:: unit: %1 side: %2 location: %3 nearbandits: %4 nearsurvivors: %5",_unit,_side,_locationName,_nearBanditAI,_nearSurvivorAI];
|
||||||
|
[_logDetail] call SC_fnc_log;
|
||||||
|
|
||||||
|
_markerName = "Bandits";
|
||||||
|
_markerColour = "ColorRed";
|
||||||
|
|
||||||
|
if(_nearBanditAI == 0 && _nearSurvivorAI == 0) exitWith {};
|
||||||
|
|
||||||
|
if(_nearBanditAI > 0 && _nearSurvivorAI > 0) then
|
||||||
|
{
|
||||||
|
_markerName = "Survivors and Bandits";
|
||||||
|
_markerColour = "ColorOrange";
|
||||||
|
};
|
||||||
|
if(_nearBanditAI == 0 && _nearSurvivorAI > 0) then
|
||||||
|
{
|
||||||
|
_markerName = "Survivors";
|
||||||
|
_markerColour = "ColorGreen";
|
||||||
|
};
|
||||||
|
|
||||||
|
_marker = createMarker [format ["%1", _locationName],_pos];
|
||||||
|
_marker setMarkerShape "Icon";
|
||||||
|
_marker setMarkerSize [3,3];
|
||||||
|
_marker setMarkerType "mil_dot";
|
||||||
|
_marker setMarkerBrush "Solid";
|
||||||
|
_marker setMarkerText _markerName;
|
||||||
|
_marker setMarkerColor _markerColour;
|
||||||
|
_marker setMarkerAlpha 0.5;
|
||||||
|
|
||||||
|
};
|
@ -10,4 +10,8 @@ _group = group _unit;
|
|||||||
if((count (units _group)) == 0) then
|
if((count (units _group)) == 0) then
|
||||||
{
|
{
|
||||||
SC_liveStaticGroups = SC_liveStaticGroups - [_staticUID,_spawnPosition];
|
SC_liveStaticGroups = SC_liveStaticGroups - [_staticUID,_spawnPosition];
|
||||||
|
if(SC_mapMarkers) then
|
||||||
|
{
|
||||||
|
deleteMarker format ["%1", _staticUID];
|
||||||
|
};
|
||||||
};
|
};
|
@ -52,55 +52,10 @@ while{!_validspot} do
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// Check if position is near a blacklisted area
|
if(_validspot) then
|
||||||
{
|
{
|
||||||
_blacklistPos = _x select 0;
|
_validspot = [ _position ] call SC_fnc_isSafePos;
|
||||||
_blacklistRadius = _x select 1;
|
|
||||||
_blacklistMap = _x select 2;
|
|
||||||
if(isNil "_blacklistPos" OR isNil "_blacklistRadius" OR isNil "_blacklistMap") exitWith
|
|
||||||
{
|
|
||||||
_logDetail = format["[OCCUPATION]:: Invalid blacklist position supplied check SC_blackListedAreas in your config.sqf"];
|
|
||||||
[_logDetail] call SC_fnc_log;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
if (worldName == _blacklistMap) then
|
|
||||||
{
|
|
||||||
if(_position distance _blacklistPos < _blacklistRadius) exitWith
|
|
||||||
{
|
|
||||||
_validspot = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
}forEach SC_blackListedAreas;
|
|
||||||
|
|
||||||
//Check if near player base
|
|
||||||
_nearBase = (nearestObjects [_position,["Exile_Construction_Flag_Static"],500]) select 0;
|
|
||||||
if (!isNil "_nearBase") then { _validspot = false; };
|
|
||||||
|
|
||||||
// Don't spawn AI near traders and spawn zones
|
|
||||||
{
|
|
||||||
switch (getMarkerType _x) do
|
|
||||||
{
|
|
||||||
case "ExileSpawnZone":
|
|
||||||
{
|
|
||||||
if(_position distance (getMarkerPos _x) < SC_minDistanceToSpawnZones) exitWith
|
|
||||||
{
|
|
||||||
_validspot = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
case "ExileTraderZone":
|
|
||||||
{
|
|
||||||
if(_position distance (getMarkerPos _x) < SC_minDistanceToTraders) exitWith
|
|
||||||
{
|
|
||||||
_validspot = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
forEach allMapMarkers;
|
|
||||||
|
|
||||||
// Don't spawn additional AI if there are players in range
|
|
||||||
if([_position, 250] call ExileClient_util_world_isAlivePlayerInRange) exitwith { _validspot = false; };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
_position
|
_position
|
54
scripts/functions/fnc_isSafePos.sqf
Normal file
54
scripts/functions/fnc_isSafePos.sqf
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
_position = _this select 0;
|
||||||
|
_validspot = true;
|
||||||
|
|
||||||
|
// Check if position is near a blacklisted area
|
||||||
|
{
|
||||||
|
_blacklistPos = _x select 0;
|
||||||
|
_blacklistRadius = _x select 1;
|
||||||
|
_blacklistMap = _x select 2;
|
||||||
|
if(isNil "_blacklistPos" OR isNil "_blacklistRadius" OR isNil "_blacklistMap") exitWith
|
||||||
|
{
|
||||||
|
_logDetail = format["[OCCUPATION]:: Invalid blacklist position supplied check SC_blackListedAreas in your config.sqf"];
|
||||||
|
[_logDetail] call SC_fnc_log;
|
||||||
|
|
||||||
|
};
|
||||||
|
if (worldName == _blacklistMap) then
|
||||||
|
{
|
||||||
|
if(_position distance _blacklistPos < _blacklistRadius) exitWith
|
||||||
|
{
|
||||||
|
_validspot = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}forEach SC_blackListedAreas;
|
||||||
|
|
||||||
|
//Check if near player base
|
||||||
|
_nearBase = (nearestObjects [_position,["Exile_Construction_Flag_Static"],500]) select 0;
|
||||||
|
if (!isNil "_nearBase") then { _validspot = false; };
|
||||||
|
|
||||||
|
// Don't spawn AI near traders and spawn zones
|
||||||
|
{
|
||||||
|
switch (getMarkerType _x) do
|
||||||
|
{
|
||||||
|
case "ExileSpawnZone":
|
||||||
|
{
|
||||||
|
if(_position distance (getMarkerPos _x) < SC_minDistanceToSpawnZones) exitWith
|
||||||
|
{
|
||||||
|
_validspot = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
case "ExileTraderZone":
|
||||||
|
{
|
||||||
|
if(_position distance (getMarkerPos _x) < SC_minDistanceToTraders) exitWith
|
||||||
|
{
|
||||||
|
_validspot = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
forEach allMapMarkers;
|
||||||
|
|
||||||
|
// Don't spawn additional AI if there are players in range
|
||||||
|
if([_position, 250] call ExileClient_util_world_isAlivePlayerInRange) exitwith { _validspot = false; };
|
||||||
|
|
||||||
|
|
||||||
|
_validspot
|
@ -149,7 +149,7 @@ if(_side == "survivor") then { _currentSide = SC_SurvivorSide };
|
|||||||
|
|
||||||
if(SC_mapMarkers && !isNil "_foundBuilding") then
|
if(SC_mapMarkers && !isNil "_foundBuilding") then
|
||||||
{
|
{
|
||||||
_marker = createMarker [format ["%1", _foundBuilding],_spawnPosition];
|
_marker = createMarker [format ["%1", _staticUID],_spawnPosition];
|
||||||
_marker setMarkerShape "Icon";
|
_marker setMarkerShape "Icon";
|
||||||
_marker setMarkerSize [3,3];
|
_marker setMarkerSize [3,3];
|
||||||
_marker setMarkerType "mil_dot";
|
_marker setMarkerType "mil_dot";
|
||||||
|
@ -60,7 +60,7 @@ if(count(crew _vehicle) > 0)then
|
|||||||
_group setBehaviour "AWARE";
|
_group setBehaviour "AWARE";
|
||||||
_group setCombatMode "RED";
|
_group setCombatMode "RED";
|
||||||
|
|
||||||
_logDetail = format ["[OCCUPATION:Unstuck]:: %1 was stuck and was moved from %2 to %3 @ %4",_vehicleType,_curPos,_newPos, time];
|
_logDetail = format ["[OCCUPATION:Unstuck]:: %1 was stuck and was moved from %2 to %3 resetting patrol around point %5 @ %4",_vehicleType,_curPos,_newPos, time,_originalSpawnLocation];
|
||||||
[_logDetail] call SC_fnc_log;
|
[_logDetail] call SC_fnc_log;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -44,7 +44,7 @@ for "_i" from 1 to SC_numberofHeliCrashes do
|
|||||||
clearMagazineCargoGlobal _box;
|
clearMagazineCargoGlobal _box;
|
||||||
clearWeaponCargoGlobal _box;
|
clearWeaponCargoGlobal _box;
|
||||||
clearItemCargoGlobal _box;
|
clearItemCargoGlobal _box;
|
||||||
_box enableRopeAttach false;
|
_box enableRopeAttach SC_ropeAttach;
|
||||||
_box setVariable ["permaLoot",true];
|
_box setVariable ["permaLoot",true];
|
||||||
_box allowDamage false;
|
_box allowDamage false;
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ for "_i" from 1 to SC_numberofLootCrates do
|
|||||||
clearWeaponCargoGlobal _box;
|
clearWeaponCargoGlobal _box;
|
||||||
clearItemCargoGlobal _box;
|
clearItemCargoGlobal _box;
|
||||||
|
|
||||||
_box enableRopeAttach false; // Stop people airlifting the crate
|
_box enableRopeAttach SC_ropeAttach; // Stop people airlifting the crate
|
||||||
_box setVariable ["permaLoot",true]; // Crate stays until next server restart
|
_box setVariable ["permaLoot",true]; // Crate stays until next server restart
|
||||||
_box allowDamage false; // Stop crates taking damage
|
_box allowDamage false; // Stop crates taking damage
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ if(diag_fps < _minFPS) exitWith
|
|||||||
[_logDetail] call SC_fnc_log;
|
[_logDetail] call SC_fnc_log;
|
||||||
};
|
};
|
||||||
|
|
||||||
_aiActive = {alive _x && (side _x == SC_BanditSide OR side _x == SC_SurvivorSide)} count allUnits;
|
_aiActive = { !isPlayer _x } count allunits;
|
||||||
|
|
||||||
if(_aiActive > _maxAIcount) exitWith
|
if(_aiActive > _maxAIcount) exitWith
|
||||||
{
|
{
|
||||||
@ -142,7 +142,7 @@ _areaToScan = [ false, false ] call SC_fnc_findsafePos;
|
|||||||
{
|
{
|
||||||
DMS_ai_use_launchers = false;
|
DMS_ai_use_launchers = false;
|
||||||
_group = [_spawnPosition, _aiCount, _difficulty, "random", "bandit"] call DMS_fnc_SpawnAIGroup;
|
_group = [_spawnPosition, _aiCount, _difficulty, "random", "bandit"] call DMS_fnc_SpawnAIGroup;
|
||||||
DMS_ai_use_launchers = true;
|
DMS_ai_use_launchers = _useLaunchers;
|
||||||
|
|
||||||
{
|
{
|
||||||
_unit = _x;
|
_unit = _x;
|
||||||
@ -166,7 +166,7 @@ _areaToScan = [ false, false ] call SC_fnc_findsafePos;
|
|||||||
|
|
||||||
DMS_ai_use_launchers = false;
|
DMS_ai_use_launchers = false;
|
||||||
_group = [_spawnPosition, _aiCount, _difficulty, "random", "bandit"] call DMS_fnc_SpawnAIGroup;
|
_group = [_spawnPosition, _aiCount, _difficulty, "random", "bandit"] call DMS_fnc_SpawnAIGroup;
|
||||||
DMS_ai_use_launchers = true;
|
DMS_ai_use_launchers = _useLaunchers;
|
||||||
|
|
||||||
{
|
{
|
||||||
_unit = _x;
|
_unit = _x;
|
||||||
|
@ -38,7 +38,8 @@ if(diag_fps < _minFPS) exitWith
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
_aiActive = {alive _x && (side _x == SC_BanditSide OR side _x == SC_SurvivorSide)} count allUnits;
|
_aiActive = { !isPlayer _x } count allunits;
|
||||||
|
|
||||||
if(_aiActive > _maxAIcount) exitWith
|
if(_aiActive > _maxAIcount) exitWith
|
||||||
{
|
{
|
||||||
if(SC_extendedLogging) then
|
if(SC_extendedLogging) then
|
||||||
@ -56,6 +57,7 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi
|
|||||||
_locationType = type _x;
|
_locationType = type _x;
|
||||||
_pos = [_temppos select 0, _temppos select 1, 0];
|
_pos = [_temppos select 0, _temppos select 1, 0];
|
||||||
|
|
||||||
|
|
||||||
if(SC_extendedLogging) then
|
if(SC_extendedLogging) then
|
||||||
{
|
{
|
||||||
_logDetail = format ["[OCCUPATION:Places]:: Testing location name: %1 position: %2",_locationName,_pos];
|
_logDetail = format ["[OCCUPATION:Places]:: Testing location name: %1 position: %2",_locationName,_pos];
|
||||||
@ -76,60 +78,7 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// Don't spawn if too near a player base
|
_okToSpawn = [ _pos ] call SC_fnc_isSafePos;
|
||||||
_nearBase = (nearestObjects [_pos,["Exile_Construction_Flag_Static"],500]) select 0;
|
|
||||||
if (!isNil "_nearBase") exitwith
|
|
||||||
{
|
|
||||||
_okToSpawn = false;
|
|
||||||
if(SC_extendedLogging) then
|
|
||||||
{
|
|
||||||
_logDetail = format ["[OCCUPATION:Places]:: %1 is too close to player base",_locationName];
|
|
||||||
[_logDetail] call SC_fnc_log;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
// Don't spawn AI near traders and spawn zones
|
|
||||||
{
|
|
||||||
switch (getMarkerType _x) do
|
|
||||||
{
|
|
||||||
case "ExileSpawnZone":
|
|
||||||
{
|
|
||||||
if(_pos distance (getMarkerPos _x) < SC_minDistanceToSpawnZones) exitWith
|
|
||||||
{
|
|
||||||
_okToSpawn = false;
|
|
||||||
if(SC_extendedLogging) then
|
|
||||||
{
|
|
||||||
_logDetail = format ["[OCCUPATION:Places]:: %1 is too close to a Spawn Zone",_locationName];
|
|
||||||
[_logDetail] call SC_fnc_log;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
case "ExileTraderZone":
|
|
||||||
{
|
|
||||||
if(_pos distance (getMarkerPos _x) < SC_minDistanceToTraders) exitWith
|
|
||||||
{
|
|
||||||
_okToSpawn = false;
|
|
||||||
if(SC_extendedLogging) then
|
|
||||||
{
|
|
||||||
_logDetail = format ["[OCCUPATION:Places]:: %1 is too close to a Trader Zone",_locationName];
|
|
||||||
[_logDetail] call SC_fnc_log;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
forEach allMapMarkers;
|
|
||||||
|
|
||||||
// Don't spawn additional AI if there are players in range
|
|
||||||
if([_pos, 250] call ExileClient_util_world_isAlivePlayerInRange) exitwith
|
|
||||||
{
|
|
||||||
_okToSpawn = false;
|
|
||||||
if(SC_extendedLogging) then
|
|
||||||
{
|
|
||||||
_logDetail = format ["[OCCUPATION:Places]:: %1 has players too close",_locationName];
|
|
||||||
[_logDetail] call SC_fnc_log;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
// Don't spawn additional AI if there are already AI in range
|
// Don't spawn additional AI if there are already AI in range
|
||||||
_nearBanditAI = { side _x == SC_BanditSide AND _x distance _pos < 500 } count allUnits;
|
_nearBanditAI = { side _x == SC_BanditSide AND _x distance _pos < 500 } count allUnits;
|
||||||
@ -197,6 +146,10 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi
|
|||||||
_loadOut = [_side] call SC_fnc_selectGear;
|
_loadOut = [_side] call SC_fnc_selectGear;
|
||||||
_unit = [_group,_spawnPosition,"custom","random",_side,"soldier",_loadOut] call DMS_fnc_SpawnAISoldier;
|
_unit = [_group,_spawnPosition,"custom","random",_side,"soldier",_loadOut] call DMS_fnc_SpawnAISoldier;
|
||||||
_unitName = [_side] call SC_fnc_selectName;
|
_unitName = [_side] call SC_fnc_selectName;
|
||||||
|
_unit setVariable ["SC_unitLocationName", _locationName,true];
|
||||||
|
_unit setVariable ["SC_unitLocationPosition", _pos,true];
|
||||||
|
_unit setVariable ["SC_unitSide", _side,true];
|
||||||
|
_unit addMPEventHandler ["mpkilled", "_this call SC_fnc_locationUnitMPKilled;"];
|
||||||
_unit setName _unitName;
|
_unit setName _unitName;
|
||||||
};
|
};
|
||||||
DMS_ai_use_launchers = _useLaunchers;
|
DMS_ai_use_launchers = _useLaunchers;
|
||||||
@ -281,6 +234,10 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi
|
|||||||
_unit = [_group2,_spawnPosition,"custom","random",_side,"soldier",_loadOut] call DMS_fnc_SpawnAISoldier;
|
_unit = [_group2,_spawnPosition,"custom","random",_side,"soldier",_loadOut] call DMS_fnc_SpawnAISoldier;
|
||||||
_unitName = [_side] call SC_fnc_selectName;
|
_unitName = [_side] call SC_fnc_selectName;
|
||||||
_unit setName _unitName;
|
_unit setName _unitName;
|
||||||
|
_unit setVariable ["SC_unitLocationName", _locationName,true];
|
||||||
|
_unit setVariable ["SC_unitLocationPosition", _pos,true];
|
||||||
|
_unit setVariable ["SC_unitSide", _side,true];
|
||||||
|
_unit addMPEventHandler ["mpkilled", "_this call SC_fnc_locationUnitMPKilled;"];
|
||||||
};
|
};
|
||||||
DMS_ai_use_launchers = _useLaunchers;
|
DMS_ai_use_launchers = _useLaunchers;
|
||||||
|
|
||||||
@ -310,7 +267,7 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi
|
|||||||
|
|
||||||
if(SC_mapMarkers) then
|
if(SC_mapMarkers) then
|
||||||
{
|
{
|
||||||
deleteMarker format ["%1", _spawnPosition];
|
deleteMarker format ["%1", _locationName];
|
||||||
_nearBanditAI = { side _x == SC_BanditSide AND _x distance _pos < 500 } count allUnits;
|
_nearBanditAI = { side _x == SC_BanditSide AND _x distance _pos < 500 } count allUnits;
|
||||||
_nearSurvivorAI = { side _x == SC_SurvivorSide AND _x distance _pos < 500 } count allUnits;
|
_nearSurvivorAI = { side _x == SC_SurvivorSide AND _x distance _pos < 500 } count allUnits;
|
||||||
|
|
||||||
@ -330,7 +287,7 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi
|
|||||||
_markerColour = "ColorRed";
|
_markerColour = "ColorRed";
|
||||||
};
|
};
|
||||||
|
|
||||||
_marker = createMarker [format ["%1", _spawnPosition],_pos];
|
_marker = createMarker [format ["%1", _locationName],_pos];
|
||||||
_marker setMarkerShape "Icon";
|
_marker setMarkerShape "Icon";
|
||||||
_marker setMarkerSize [3,3];
|
_marker setMarkerSize [3,3];
|
||||||
_marker setMarkerType "mil_dot";
|
_marker setMarkerType "mil_dot";
|
||||||
|
@ -27,7 +27,8 @@ if(diag_fps < _minFPS) exitWith
|
|||||||
[_logDetail] call SC_fnc_log;
|
[_logDetail] call SC_fnc_log;
|
||||||
};
|
};
|
||||||
|
|
||||||
_aiActive = {alive _x && (side _x == SC_BanditSide OR side _x == SC_SurvivorSide)} count allUnits;
|
_aiActive = { !isPlayer _x } count allunits;
|
||||||
|
|
||||||
if(_aiActive > _maxAIcount) exitWith
|
if(_aiActive > _maxAIcount) exitWith
|
||||||
{
|
{
|
||||||
_logDetail = format ["[OCCUPATION Static]:: %1 active AI, so not spawning AI this time",_aiActive];
|
_logDetail = format ["[OCCUPATION Static]:: %1 active AI, so not spawning AI this time",_aiActive];
|
||||||
|
@ -26,9 +26,8 @@ if(diag_fps < SC_minFPS) exitWith
|
|||||||
_logDetail = format ["[OCCUPATION:Vehicle]:: Held off spawning more AI as the server FPS is only %1",diag_fps];
|
_logDetail = format ["[OCCUPATION:Vehicle]:: Held off spawning more AI as the server FPS is only %1",diag_fps];
|
||||||
[_logDetail] call SC_fnc_log;
|
[_logDetail] call SC_fnc_log;
|
||||||
};
|
};
|
||||||
|
_aiActive = { !isPlayer _x } count allunits;
|
||||||
_aiActive = {alive _x && (side _x == SC_BanditSide OR side _x == SC_SurvivorSide) && !SC_occupyVehicleIgnoreCount} count allUnits;
|
if((_aiActive > _maxAIcount) && !SC_occupyVehicleIgnoreCount) exitWith
|
||||||
if(_aiActive > _maxAIcount) exitWith
|
|
||||||
{
|
{
|
||||||
_logDetail = format ["[OCCUPATION:Vehicle]:: %1 active AI, so not spawning AI this time",_aiActive];
|
_logDetail = format ["[OCCUPATION:Vehicle]:: %1 active AI, so not spawning AI this time",_aiActive];
|
||||||
[_logDetail] call SC_fnc_log;
|
[_logDetail] call SC_fnc_log;
|
||||||
|
Loading…
Reference in New Issue
Block a user