Fixed missing uniforms and added checks for units spawned on water.

This commit is contained in:
Chris Cardozo 2020-10-01 08:03:23 -04:00
parent a23a9aad3c
commit 959c4da4d7
3 changed files with 17 additions and 38 deletions

View File

@ -21,10 +21,11 @@ switch (toLower worldName) do
case "taviana": {_mapCenter = [12000,12000,0];_maxDistance = 12000}; case "taviana": {_mapCenter = [12000,12000,0];_maxDistance = 12000};
case "napf" : {_mapCenter = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");_maxDistance = 12000}; case "napf" : {_mapCenter = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");_maxDistance = 12000};
case "lythium": {_mapCenter = [10000,10000,0]; _maxDistance = 6000;}; case "lythium": {_mapCenter = [10000,10000,0]; _maxDistance = 6000;};
case "vt7": {_mapCenter = [9000,9000,0]; _maxDistance = 9000};
default {_mapCenter = [6000,6000,0]; _maxDistance = 6000;}; default {_mapCenter = [6000,6000,0]; _maxDistance = 6000;};
}; };
_evaluate = true; private _evaluate = true;
while {_evaluate} do while {_evaluate} do
{ {
_waterPos = [ _waterPos = [
@ -35,33 +36,14 @@ _evaluate = true;
2, // water mode [2 = water only] 2, // water mode [2 = water only]
25, // max gradient 25, // max gradient
0 // shoreMode [0 = anywhere] 0 // shoreMode [0 = anywhere]
] call BIS_fnc_findSafePos; ] call BIS_fnc_findSafePos;
/*
_priorUMSpositions = +blck_priorDynamicUMS_Missions; if (((getTerrainHeightASL _waterPos) < -4) && (getTerrainHeightASL _waterPos) > -10) then
{ {
if (diag_tickTime > ((_x select 1) + 1800) then _evaluate = false;
{
blck_priorDynamicUMS_Missions = blck_priorDynamicUMS_Missions - _x;
} else {
if (_waterPos distance2D (_x select 0) < 2000) exitWith {_evaluate = false};
};
} forEach _priorUMSpositions;
*/
if (_evaluate) then
{
if (abs(getTerrainHeightASL _waterPos) < 30) then
{
if (abs(getTerrainHeightASL _waterPos) > 1) then
{
//_waterMarker = createMarker [format["water mission %1",getTerrainHeightASL _waterPos],_waterPos];
//_waterMarker setMarkerColor "ColorRed";
//_waterMarker setMarkerType "mil_triangle";
//_waterMarker setMarkerText format["Depth %1",getTerrainHeightASL _waterPos];
_evaluate = false;
};
};
}; };
}; };
//diag_log format["_findShoreLocation: _waterPos = %1",_waterPos];
_waterPos _waterPos

View File

@ -12,7 +12,7 @@
*/ */
#include "\q\addons\custom_server\Configs\blck_defines.hpp"; #include "\q\addons\custom_server\Configs\blck_defines.hpp";
private ["_i","_weap","_skin","_unit","_skillLevel","_aiSkills","_launcherRound","_index","_ammoChoices","_optics","_pointers","_muzzles","_underbarrel","_legalOptics"]; private ["_i","_weap","_unit","_skillLevel","_aiSkills","_launcherRound","_index","_ammoChoices","_optics","_pointers","_muzzles","_underbarrel","_legalOptics"];
params["_pos","_aiGroup",["_skillLevel","red"],["_uniforms", []],["_headGear",[]],["_vests",[]],["_backpacks",[]],["_Launcher","none"],["_weaponList",[]],["_sideArms",[]],["_scuba",false],["_garrison",false]]; params["_pos","_aiGroup",["_skillLevel","red"],["_uniforms", []],["_headGear",[]],["_vests",[]],["_backpacks",[]],["_Launcher","none"],["_weaponList",[]],["_sideArms",[]],["_scuba",false],["_garrison",false]];
if (_weaponList isEqualTo []) then {_weaponList = [_skillLevel] call blck_fnc_selectAILoadout}; if (_weaponList isEqualTo []) then {_weaponList = [_skillLevel] call blck_fnc_selectAILoadout};
@ -60,17 +60,6 @@ if (_scuba) then
_unit swiminDepth (([_pos] call blck_fnc_findWaterDepth) / 2); _unit swiminDepth (([_pos] call blck_fnc_findWaterDepth) / 2);
}; };
_skin = "";
_counter = 1;
if (surfaceIsWater (getPos _unit)) then
{
_uniforms = blck_UMS_uniforms;
_headGear = blck_UMS_headgear;
_weaponList = blck_UMS_weapons;
_vests = blck_UMS_vests;
};
//Sets AI Tactics //Sets AI Tactics
_unit enableAI "ALL"; _unit enableAI "ALL";
if(_garrison) then if(_garrison) then
@ -81,6 +70,14 @@ _unit allowDammage true;
_unit setBehaviour "COMBAT"; _unit setBehaviour "COMBAT";
_unit setunitpos "AUTO"; _unit setunitpos "AUTO";
if (surfaceIsWater (getPos _unit)) then
{
_uniforms = blck_UMS_uniforms;
_headGear = blck_UMS_headgear;
_weaponList = blck_UMS_weapons;
_vests = blck_UMS_vests;
};
_unit forceAddUniform (selectRandom _uniforms);
if !(_headGear isEqualTo []) then if !(_headGear isEqualTo []) then
{ {
_unit addHeadgear (selectRandom _headGear); _unit addHeadgear (selectRandom _headGear);

View File

@ -52,7 +52,7 @@ blck_missionData = [];
blck_activeMissionsList = []; blck_activeMissionsList = [];
blck_initializedMissionsList = []; blck_initializedMissionsList = [];
blck_blackListedLocations = []; // [ [marker, time]] blck_blackListedLocations = []; // [ [marker, time]]
blck_activeMonitorThreads = 0;
blck_validEndStates = ["allUnitsKilled", "playerNear", "allKilledOrPlayerNear","assetSecured"]; blck_validEndStates = ["allUnitsKilled", "playerNear", "allKilledOrPlayerNear","assetSecured"];
blck_validLootSpawnTimings = ["atMissionSpawnGround","atMissionSpawnAir","atMissionEndGround","atMissionEndAir"]; blck_validLootSpawnTimings = ["atMissionSpawnGround","atMissionSpawnAir","atMissionEndGround","atMissionEndAir"];
blck_validLootLoadTimings = ["atMissionCompletion", "atMissionSpawn"]; blck_validLootLoadTimings = ["atMissionCompletion", "atMissionSpawn"];