V40 Changes

This commit is contained in:
second_coming 2016-05-12 13:44:47 +01:00
parent 94dd74e9d3
commit ea9064414a
15 changed files with 172 additions and 141 deletions

View File

@ -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)
=================================================================================
@ -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
everyone is using it
Renamed and reorganised eventhandlers
=================================================================================
V38 (08-05-2016)
=================================================================================

View File

@ -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_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_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_staticBandits = [ ]; //[[pos],ai count,radius,search buildings]
SC_staticSurvivors = [ [[3770,8791,0],8,600,true] ]; //[[pos],ai count,radius,search buildings]
SC_occupyStatic = false; // true if you want to add AI in specific locations
SC_staticBandits = [ //[[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_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_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]
// ["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
@ -158,9 +164,9 @@ SC_LootCrateItems = [
];
SC_blackListedAreas = [
[[3810,8887,0],500,"Chernarus"], // Vybor Occupation DMS Static Mission
[[12571,14337,0],500,"Altis"], // Neochori Occupation DMS Static Mission
[[3926,7523,0],500,"Namalsk"] // Norinsk Occupation DMS Static Mission
[[3810,8887,0],500,"Chernarus"], // Vybor Occupation DMS Static Mission
[[12571,14337,0],500,"Altis"], // Neochori Occupation DMS Static Mission
[[3926,7523,0],500,"Namalsk"] // Norinsk Occupation DMS Static Mission
];
@ -252,16 +258,19 @@ if (SC_debug) then
{
SC_extendedLogging = true;
SC_mapMarkers = true;
SC_occupyPlaces = false;
SC_occupyPlaces = true;
SC_occupyVehicle = true;
SC_occupyMilitary = false;
SC_occupyStatic = false;
SC_occupyMilitary = true;
SC_occupyStatic = true;
SC_occupySky = true;
SC_occupySea = false;
SC_occupySea = true;
SC_occupyTransport = true;
SC_occupyLootCrates = true;
SC_occupyHeliCrashes = true;
SC_maxNumberofVehicles = 15;
SC_maxNumberofVehicles = 4;
SC_maxNumberofBoats = 1;
SC_maxNumberofHelis = 1;
};

View File

@ -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_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_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_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_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";

View 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;
};

View File

@ -9,5 +9,9 @@ _group = group _unit;
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];
};
};

View File

@ -52,55 +52,10 @@ while{!_validspot} do
};
};
// Check if position is near a blacklisted area
if(_validspot) then
{
_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 = [ _position ] call SC_fnc_isSafePos;
};
};
_position

View 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

View File

@ -10,11 +10,11 @@ _staticUID = 1;
if(_side == "survivor") then { _currentSide = SC_SurvivorSide };
{
_currentStatic = _x;
_spawnPosition = _currentStatic select 0;
_aiCount = _currentStatic select 1;
_radius = _currentStatic select 2;
_staticSearch = _currentStatic select 3;
_currentStatic = _x;
_spawnPosition = _currentStatic select 0;
_aiCount = _currentStatic select 1;
_radius = _currentStatic select 2;
_staticSearch = _currentStatic select 3;
_logDetail = format ["[OCCUPATION Static]:: Checking static spawn @ %1 for existing %2 AI",_spawnPosition,_currentSide];
[_logDetail] call SC_fnc_log;
@ -88,7 +88,7 @@ if(_side == "survivor") then { _currentSide = SC_SurvivorSide };
_unit = _x;
[_unit] joinSilent grpNull;
[_unit] joinSilent _group;
[_side,_unit] call SC_fnc_addMarker;
[_side,_unit] call SC_fnc_addMarker;
_unit setCaptive false;
}foreach units _initialGroup;
@ -149,7 +149,7 @@ if(_side == "survivor") then { _currentSide = SC_SurvivorSide };
if(SC_mapMarkers && !isNil "_foundBuilding") then
{
_marker = createMarker [format ["%1", _foundBuilding],_spawnPosition];
_marker = createMarker [format ["%1", _staticUID],_spawnPosition];
_marker setMarkerShape "Icon";
_marker setMarkerSize [3,3];
_marker setMarkerType "mil_dot";

View File

@ -60,7 +60,7 @@ if(count(crew _vehicle) > 0)then
_group setBehaviour "AWARE";
_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;
};

View File

@ -44,7 +44,7 @@ for "_i" from 1 to SC_numberofHeliCrashes do
clearMagazineCargoGlobal _box;
clearWeaponCargoGlobal _box;
clearItemCargoGlobal _box;
_box enableRopeAttach false;
_box enableRopeAttach SC_ropeAttach;
_box setVariable ["permaLoot",true];
_box allowDamage false;

View File

@ -83,7 +83,7 @@ for "_i" from 1 to SC_numberofLootCrates do
clearWeaponCargoGlobal _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 allowDamage false; // Stop crates taking damage

View File

@ -26,7 +26,7 @@ if(diag_fps < _minFPS) exitWith
[_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
{
@ -142,7 +142,7 @@ _areaToScan = [ false, false ] call SC_fnc_findsafePos;
{
DMS_ai_use_launchers = false;
_group = [_spawnPosition, _aiCount, _difficulty, "random", "bandit"] call DMS_fnc_SpawnAIGroup;
DMS_ai_use_launchers = true;
DMS_ai_use_launchers = _useLaunchers;
{
_unit = _x;
@ -166,7 +166,7 @@ _areaToScan = [ false, false ] call SC_fnc_findsafePos;
DMS_ai_use_launchers = false;
_group = [_spawnPosition, _aiCount, _difficulty, "random", "bandit"] call DMS_fnc_SpawnAIGroup;
DMS_ai_use_launchers = true;
DMS_ai_use_launchers = _useLaunchers;
{
_unit = _x;

View File

@ -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(SC_extendedLogging) then
@ -55,6 +56,7 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi
_locationName = text _x;
_locationType = type _x;
_pos = [_temppos select 0, _temppos select 1, 0];
if(SC_extendedLogging) then
{
@ -75,61 +77,8 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi
[_logDetail] call SC_fnc_log;
};
};
// Don't spawn if too near a player base
_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;
};
};
_okToSpawn = [ _pos ] call SC_fnc_isSafePos;
// Don't spawn additional AI if there are already AI in range
_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;
_unit = [_group,_spawnPosition,"custom","random",_side,"soldier",_loadOut] call DMS_fnc_SpawnAISoldier;
_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;
};
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;
_unitName = [_side] call SC_fnc_selectName;
_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;
@ -310,7 +267,7 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi
if(SC_mapMarkers) then
{
deleteMarker format ["%1", _spawnPosition];
deleteMarker format ["%1", _locationName];
_nearBanditAI = { side _x == SC_BanditSide 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";
};
_marker = createMarker [format ["%1", _spawnPosition],_pos];
_marker = createMarker [format ["%1", _locationName],_pos];
_marker setMarkerShape "Icon";
_marker setMarkerSize [3,3];
_marker setMarkerType "mil_dot";

View File

@ -27,7 +27,8 @@ if(diag_fps < _minFPS) exitWith
[_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
{
_logDetail = format ["[OCCUPATION Static]:: %1 active AI, so not spawning AI this time",_aiActive];

View File

@ -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] call SC_fnc_log;
};
_aiActive = {alive _x && (side _x == SC_BanditSide OR side _x == SC_SurvivorSide) && !SC_occupyVehicleIgnoreCount} count allUnits;
if(_aiActive > _maxAIcount) exitWith
_aiActive = { !isPlayer _x } count allunits;
if((_aiActive > _maxAIcount) && !SC_occupyVehicleIgnoreCount) exitWith
{
_logDetail = format ["[OCCUPATION:Vehicle]:: %1 active AI, so not spawning AI this time",_aiActive];
[_logDetail] call SC_fnc_log;