Cleaned up code and debuged a bunch of stuff
This commit is contained in:
parent
1f335c745b
commit
a4195086ca
@ -0,0 +1,6 @@
|
||||
|
||||
params["_veh"];
|
||||
clearWeaponCargoGlobal _veh;
|
||||
clearMagazineCargoGlobal _veh;
|
||||
clearBackpackCargoGlobal _veh;
|
||||
clearItemCargoGlobal _veh;
|
@ -3,10 +3,10 @@
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last Modified 8-13-16
|
||||
Last Modified 1-22-17
|
||||
*/
|
||||
|
||||
private["_locs","_radius","_startDir","_currentDir","_Arc","_dist","_newpos","_xpos","_ypos"];
|
||||
private["_locs","_startDir","_currentDir","_Arc","_dist","_newpos"];
|
||||
params["_center","_num","_minDistance","_maxDistance"];
|
||||
|
||||
_locs = [];
|
||||
|
@ -7,7 +7,7 @@
|
||||
Copyright 2016
|
||||
Last Modified 1-22-17
|
||||
*/
|
||||
private["_findNew","_coords","_blackListCenter","_blackListRadius","_dist","_xpos","_ypos","_newPos","_townPos"];
|
||||
private["_findNew","_coords","_dist","_xpos","_ypos","_newPos","_townPos","_pole"];
|
||||
|
||||
_findNew = true;
|
||||
|
||||
@ -20,14 +20,14 @@ while {_findNew} do {
|
||||
|
||||
{
|
||||
if ((_x distance2D _coords) < blck_MinDistanceFromMission) then {
|
||||
_FindNew = true;
|
||||
_findNew = true;
|
||||
};
|
||||
}forEach DBD_HeliCrashSites;
|
||||
|
||||
{
|
||||
if ( ((_x select 0) distance2D _coords) < (_x select 1)) exitWith
|
||||
{
|
||||
_FindNew = true;
|
||||
_findNew = true;
|
||||
};
|
||||
} forEach blck_locationBlackList;
|
||||
|
||||
@ -56,7 +56,7 @@ while {_findNew} do {
|
||||
//diag_log format["-# findSafePosn.sqf -# testing _coords against Old Mission coords is %1", _x select 0];
|
||||
if ( ((_x select 0) distance2D _coords) < blck_MinDistanceFromMission) then
|
||||
{
|
||||
_FindNew = true;
|
||||
_findNew = true;
|
||||
//diag_log format["-# findSafePosn.sqf -# Too Close to Old Mission element: %1", _x];
|
||||
};
|
||||
};
|
||||
@ -72,7 +72,7 @@ while {_findNew} do {
|
||||
_newPos = [_xpos,_ypos,0];
|
||||
if (surfaceIsWater _newPos) then
|
||||
{
|
||||
_FindNew = true;
|
||||
_findNew = true;
|
||||
_i = 361;
|
||||
};
|
||||
};
|
||||
@ -80,7 +80,7 @@ while {_findNew} do {
|
||||
{
|
||||
_townPos = [((locationPosition _x) select 0), ((locationPosition _x) select 1), 0];
|
||||
if (_townPos distance2D _coords < 200) exitWith {
|
||||
_FindNew = true;
|
||||
_findNew = true;
|
||||
};
|
||||
} forEach blck_townLocations;
|
||||
|
||||
@ -93,7 +93,7 @@ while {_findNew} do {
|
||||
{
|
||||
if ((_x distance2D _coords) < 600) then
|
||||
{
|
||||
_FindNew = true;
|
||||
_findNew = true;
|
||||
};
|
||||
}forEach nearestObjects[player, [_pole], 800];
|
||||
|
||||
@ -101,7 +101,7 @@ while {_findNew} do {
|
||||
{
|
||||
if (isPlayer _x && (_x distance2D _coords) < 600) then
|
||||
{
|
||||
_FindNew = true;
|
||||
_findNew = true;
|
||||
};
|
||||
}forEach playableUnits;
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
Contact : halvhjearne@gmail.com
|
||||
*/
|
||||
params["_player","_nr"];
|
||||
|
||||
private["_cIndex","_vars","_current_crypto","_current_cryptoRaw","_playerCryptoLimit"];
|
||||
_cIndex = EPOCH_customVars find "Crypto";
|
||||
_vars = _player getVariable["VARS", call EPOCH_defaultVars_SEPXVar];
|
||||
_current_crypto = _vars select _cIndex;
|
||||
|
@ -5,27 +5,27 @@
|
||||
- whether it is time to delete the mission objects at a specific location
|
||||
- whether it is time to delete live AI associated with a specific mission
|
||||
By Ghostrider-DbD-
|
||||
Last modified 1-21-17
|
||||
Last modified 1-22-17
|
||||
*/
|
||||
private ["_timer10Min","_timer1min","_timer5min","_modType"];
|
||||
|
||||
_timer5sec = diag_tickTime;
|
||||
_timer1min = diag_tickTime;
|
||||
private ["_timer10Min","_timer1min","_timer5min","_modType","_coords"];
|
||||
_timer1sec = diag_tickTime;
|
||||
_timer15sec = diag_tickTime;
|
||||
//_timer1min = diag_tickTime;
|
||||
_timer5min = diag_tickTime;
|
||||
_timer10Min = diag_tickTime;
|
||||
//_timer10Min = diag_tickTime;
|
||||
_modType = [] call blck_fnc_getModType;
|
||||
_ai = [];
|
||||
_obj = [];
|
||||
|
||||
while {true} do
|
||||
{
|
||||
uiSleep 5; // defined in custom_server\compiles\blck_variables.sqf
|
||||
if ((diag_tickTime - _timer5sec) > 5) then
|
||||
uiSleep 1; // defined in custom_server\compiles\blck_variables.sqf
|
||||
if ((diag_tickTime - _timer1sec) > 1) then
|
||||
{
|
||||
[] call blck_fnc_vehicleMonitor;
|
||||
_timer5sec = diag_tickTime;
|
||||
_timer1sec = diag_tickTime;
|
||||
};
|
||||
if ((diag_tickTime - _timer1min) > 15) then
|
||||
if ((diag_tickTime - _timer15sec) > 15) then
|
||||
{
|
||||
//diag_log format["_fnc_mainThread:: (30) diag_tickTime = %1", diag_tickTime];
|
||||
//diag_log format["_fnc_mainThread:: (31) blck_liveMissionAI = %1", blck_liveMissionAI];
|
||||
@ -38,7 +38,7 @@ while {true} do
|
||||
blck_liveMissionAI set[ _forEachIndex, -1];
|
||||
blck_liveMissionAI = blck_liveMissionAI - [-1]; // Remove that list of live AI from the list.
|
||||
//diag_log format["_fnc_mainTread:: blck_liveMissionAI updated from %1",_ai];
|
||||
diag_log format["_fnc_mainTread:: blck_liveMissionAI updated to %1",blck_liveMissionAI];
|
||||
if (blck_debugLevel > 1) then {diag_log format["_fnc_mainTread:: blck_liveMissionAI updated to %1",blck_liveMissionAI];};
|
||||
};
|
||||
}forEach _ai;
|
||||
//diag_log format["_fnc_mainThread:: (44) blck_oldMissionObjects = %1", blck_oldMissionObjects];
|
||||
@ -52,7 +52,7 @@ while {true} do
|
||||
blck_oldMissionObjects set[_forEachIndex, -1];
|
||||
blck_oldMissionObjects = blck_oldMissionObjects - [-1];
|
||||
//diag_log format["_fnc_mainTread:: blck_oldMissionObjects updated from %1",_obj];
|
||||
diag_log format["_fnc_mainTread:: blck_oldMissionObjects updated to %1",blck_oldMissionObjects];
|
||||
if (blck_debugLevel > 1) then {diag_log format["_fnc_mainTread:: blck_oldMissionObjects updated to %1",blck_oldMissionObjects];};
|
||||
};
|
||||
}forEach _obj;
|
||||
|
||||
@ -77,7 +77,7 @@ while {true} do
|
||||
};
|
||||
};
|
||||
}forEach blck_pendingMissions;
|
||||
_timer1min = diag_tickTime;
|
||||
_timer15sec = diag_tickTime;
|
||||
|
||||
};
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
if !(blck_blacklistTraderCities) exitWith {};
|
||||
diag_log format["[blckeagls] Adding Trader Cities to blacklisted locations based on setting for blck_blacklistTraderCities = %1",blck_blacklistTraderCities];
|
||||
_traderCites = allMapMarkers;
|
||||
private _traderCites = allMapMarkers;
|
||||
|
||||
{
|
||||
if (_x in ["center","respawn_east","respawn_west","respawn_north"] && blck_blacklistTraderCities) then
|
||||
|
@ -1,5 +1,5 @@
|
||||
// pull trader cities from config
|
||||
_traderCites = allMapMarkers;
|
||||
private _traderCites = allMapMarkers;
|
||||
_tc = [];
|
||||
{
|
||||
if (getMarkerType _x isEqualTo "ExileTraderZone" && blck_blacklistTraderCities) then {
|
||||
|
@ -5,8 +5,8 @@
|
||||
Copyright 2016
|
||||
Last Modified 1/22/17
|
||||
*/
|
||||
//Sets Private Variables to they don't interfere when this script is called more than once
|
||||
private["_numbertospawn","_i","_groupSpawned","_safepos","_x","_weaponList","_useLauncher","_launcherType","_aiSkills"];
|
||||
|
||||
private["_numbertospawn","_groupSpawned","_safepos","_weaponList","_useLauncher","_launcherType"];
|
||||
|
||||
params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear] ];
|
||||
if (blck_debugLevel > 1) then
|
||||
@ -23,7 +23,7 @@ if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["spawnGroup.sqf: _numbertospawn = %1",_numbertospawn];
|
||||
};
|
||||
//Creates a group to make them attack players
|
||||
|
||||
_groupSpawned = createGroup blck_AI_Side;
|
||||
if !(isNull _groupSpawned) then
|
||||
{
|
||||
|
@ -6,19 +6,22 @@
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last Modified 1-13-17
|
||||
Last Modified 1-22-17
|
||||
*/
|
||||
|
||||
params["_objects"];
|
||||
{
|
||||
if ((typeOf _x) isKindOf "LandVehicle") then
|
||||
{
|
||||
private _crew = crew _x;
|
||||
if !(_x getVariable["releasedToPlayers",false]) then
|
||||
{
|
||||
[_x] call blck_deleteAI;
|
||||
}forEach _crew;
|
||||
private _crew = crew _x;
|
||||
{
|
||||
[_x] call blck_fnc_deleteAI;
|
||||
}forEach _crew;
|
||||
};
|
||||
deleteVehicle _x;
|
||||
};
|
||||
deleteVehicle _x;
|
||||
} forEach _objects;
|
||||
|
||||
|
||||
|
@ -91,7 +91,7 @@ _blck_localMissionMarker set [3,blck_labelMapMarkers select 1]; // Use an arrow
|
||||
[["start",_startMsg,_blck_localMissionMarker select 2]] call blck_fnc_messageplayers;
|
||||
[_blck_localMissionMarker] execVM "debug\spawnMarker.sqf";
|
||||
|
||||
if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (89) waiting for player to trigger the mission";};
|
||||
if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (94) waiting for player to trigger the mission";};
|
||||
|
||||
////////
|
||||
// All parameters are defined, lets wait until a player is nearby or the mission has timed out
|
||||
@ -101,32 +101,22 @@ private["_wait","_missionStartTime","_playerInRange","_missionTimedOut"];
|
||||
_missionStartTime = diag_tickTime;
|
||||
_playerInRange = false;
|
||||
_missionTimedOut = false;
|
||||
_wait = true;
|
||||
_wait = false;
|
||||
if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (105) starting mission trigger loop";};
|
||||
while {_wait} do
|
||||
{
|
||||
if (blck_debugLevel isEqualTo 3) then
|
||||
{
|
||||
_wait = false;
|
||||
_playerInRange = true;
|
||||
} else {
|
||||
if ({isPlayer _x && _x distance2D _coords < blck_TriggerDistance} count allPlayers > 0) then
|
||||
{
|
||||
_wait = false;
|
||||
_playerInRange = true;
|
||||
} else
|
||||
{
|
||||
if ((diag_tickTime - _missionStartTime) > blck_MissionTimout) then
|
||||
{
|
||||
_wait = false;
|
||||
_missionTimedOut = true;
|
||||
};
|
||||
};
|
||||
uiSleep 1;
|
||||
};
|
||||
diag_log "missionSpawner:: top of mission trigger loop";
|
||||
if (blck_debugLevel isEqualTo 3) exitWith {_wait = false;_playerInRange = true;};
|
||||
if ({isPlayer _x && _x distance2D _coords < blck_TriggerDistance} count allPlayers > 0) exitWith {_wait = false;_playerInRange = true;};
|
||||
if ((diag_tickTime - _missionStartTime) > blck_MissionTimout) exitWith {_wait = false;_missionTimedOut = true;};
|
||||
uiSleep 10;
|
||||
diag_log format["missionSpawner:: Trigger Loop - blck_debugLevel = %1 and _coords = %2",blck_debugLevel, _coords];
|
||||
diag_log format["missionSpawner:: Trigger Loop - players in range = %1",{isPlayer _x && _x distance2D _coords < blck_TriggerDistance} count allPlayers];
|
||||
diag_log format["missionSpawner:: Trigger Loop - timeout = %1", (diag_tickTime - _missionStartTime) > blck_MissionTimout];
|
||||
};
|
||||
|
||||
|
||||
if (_missionTimedOut) exitWith
|
||||
if ((diag_tickTime - _missionStartTime) > blck_MissionTimout) exitWith
|
||||
{
|
||||
// Deal with the case in which the mission timed out.
|
||||
//["timeOut",_endMsg,_blck_localMissionMarker select 2] call blck_fnc_messageplayers;
|
||||
@ -142,13 +132,14 @@ if (_missionTimedOut) exitWith
|
||||
};
|
||||
};
|
||||
|
||||
if (_playerInRange) then
|
||||
if (true) then
|
||||
{
|
||||
////////
|
||||
// Spawn the mission objects, loot chest, and AI
|
||||
////////
|
||||
if (blck_debugLevel > 0) then
|
||||
{ diag_log format["[blckeagls] missionSpawner:: (112) -- >> Mission tripped by nearby player: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
{
|
||||
diag_log format["[blckeagls] missionSpawner:: (112) -- >> Mission tripped by nearby player: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
|
||||
if (count _missionLootBoxes > 0) then
|
||||
@ -167,8 +158,6 @@ if (_playerInRange) then
|
||||
{
|
||||
diag_log format["[blckeagls] missionSpawner:: (131) Crates Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
|
||||
uiSleep _delayTime;
|
||||
private ["_temp"];
|
||||
if (blck_SmokeAtMissions select 0) then // spawn a fire and smoke near the crate
|
||||
{
|
||||
@ -207,52 +196,10 @@ if (_playerInRange) then
|
||||
|
||||
[_missionLootVehicles] call blck_fnc_spawnMissionLootVehicles;
|
||||
|
||||
|
||||
uiSleep _delayTime;
|
||||
private _precise = false;
|
||||
if (blck_debugLevel > 0) then {diag_log format["missionSpawner:: (233) preparing to spawn emplaced weapons for _markerClass %3:: blck_useStatic = %1 and _noEmplacedWeapons = %2",blck_useStatic,_noEmplacedWeapons,_markerClass];};
|
||||
if (blck_useStatic && (_noEmplacedWeapons > 0)) then
|
||||
{
|
||||
private ["_emplacedUnits"];
|
||||
// params["_missionEmplacedWeapons","_noEmplacedWeapons","_aiDifficultyLevel","_coords","_uniforms","_headGear",["_missionType","unspecified"]];
|
||||
_emplacedUnits = [_missionEmplacedWeapons,_noEmplacedWeapons,_aiDifficultyLevel,_coords,_uniforms,_headGear,_markerClass] call blck_fnc_spawnMissionEmplacedWeapons;
|
||||
diag_log format["missionSpawner :: (218) _emplacedUnits = %1",_emplacedUnits];
|
||||
uisleep 0.1;
|
||||
if (typeName _emplacedUnits isEqualTo "ARRAY") then
|
||||
{
|
||||
if (typeName _emplacedUnits isEqualTo "ARRAY") then
|
||||
{
|
||||
_blck_AllMissionAI append _emplacedUnits;
|
||||
};
|
||||
//diag_log format["missionSpawner :: (226) _blck_AllMissionAI updated to = %1",_blck_AllMissionAI];
|
||||
};
|
||||
if (blck_debugLevel > 0) then
|
||||
{
|
||||
diag_log format["[blckeagls] missionSpawner:: (236) Static Weapons Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
|
||||
};
|
||||
uisleep _delayTime;
|
||||
if (blck_useVehiclePatrols && (_noVehiclePatrols > 0)) then
|
||||
{
|
||||
private["_vehUnits"];
|
||||
_vehUnits = [_coords,_noVehiclePatrols,_aiDifficultyLevel,_uniforms,_headGear,_markerClass] call blck_fnc_spawnMissionVehiclePatrols;
|
||||
//diag_log format["missionSpawner :: (238) _vehUnits = %1",_vehUnits];
|
||||
if (typeName _vehUnits isEqualTo "ARRAY") then
|
||||
{
|
||||
_blck_AllMissionAI append _vehUnits;
|
||||
};
|
||||
|
||||
uiSleep _delayTime;
|
||||
if (blck_debugLevel > 0) then
|
||||
{
|
||||
diag_log format["[blckeagls] missionSpawner:: Vehicle Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
};
|
||||
uiSleep _delayTime;
|
||||
private ["_infantry"];
|
||||
_infantry = [_coords, _minNoAI,_maxNoAI,_aiDifficultyLevel,_uniforms,_headGear] call blck_fnc_spawnMissionAI;
|
||||
//diag_log format["missionSpawner:: (254) -> _infantry = %1",_infantry];
|
||||
//diag_log format["missionSpawner:: (211) -> _infantry = %1",_infantry];
|
||||
if (typeName _infantry isEqualto "ARRAY") then
|
||||
{
|
||||
_blck_AllMissionAI append _infantry;
|
||||
@ -263,6 +210,31 @@ if (_playerInRange) then
|
||||
{
|
||||
diag_log format["[blckeagls] missionSpawner:: AI Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
|
||||
uisleep _delayTime;
|
||||
if (blck_useVehiclePatrols && (_noVehiclePatrols > 0)) then
|
||||
{
|
||||
private["_veh"];
|
||||
uiSleep 1;
|
||||
_veh = [_coords,_noVehiclePatrols,_aiDifficultyLevel,_uniforms,_headGear,_markerClass] call blck_fnc_spawnMissionVehiclePatrols;
|
||||
diag_log format["missionSpawner :: (230) _veh = %1",_veh];
|
||||
_objects append (_veh select 0);
|
||||
_blck_AllMissionAI append (_veh select 1);
|
||||
uiSleep _delayTime;
|
||||
if (blck_debugLevel > 0) then
|
||||
{
|
||||
diag_log format["[blckeagls] missionSpawner:: Vehicle Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
};
|
||||
|
||||
uiSleep _delayTime;
|
||||
private {"_temp"];
|
||||
if (blck_debugLevel > 0) then {diag_log format["missionSpawner:: (213) preparing to spawn emplaced weapons for _markerClass %3:: blck_useStatic = %1 and _noEmplacedWeapons = %2",blck_useStatic,_noEmplacedWeapons,_markerClass];};
|
||||
if (blck_useStatic && (_noEmplacedWeapons > 0)) then
|
||||
{
|
||||
_temp = [_missionEmplacedWeapons,_noEmplacedWeapons,_aiDifficultyLevel,_coords,_uniforms,_headGear] call blck_fnc_spawnEmplacedWeaponArray;
|
||||
diag_log format ["missionSpawner:: (246) value returned for _temp = %1",_temp];
|
||||
};
|
||||
|
||||
if ((random(1) < _chanceReinforcements)) then
|
||||
{
|
||||
|
@ -20,8 +20,5 @@ _crate setVariable ["LAST_CHECK", 100000];
|
||||
_crate setPosATL [_px, _py, 0.5];
|
||||
_crate allowDamage false;
|
||||
_crate enableRopeAttach true;
|
||||
clearWeaponCargoGlobal _crate;
|
||||
clearMagazineCargoGlobal _crate;
|
||||
clearBackpackCargoGlobal _crate;
|
||||
clearItemCargoGlobal _crate;
|
||||
[_crate] call blck_fnc_emptyObject;
|
||||
_crate;
|
||||
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
|
||||
[_missionEmplacedWeapons,_noEmplacedWeapons,_aiDifficultyLevel,_coords,_uniforms,_headGear] call blck_fnc_spawnEmplacedWeaponArray;
|
||||
|
||||
*/
|
||||
|
||||
params["_missionEmplacedWeapons","_noEmplacedWeapons"];
|
||||
private["_return","_emplacedWeps","_wep"];
|
||||
_emplacedWeps = [];
|
||||
|
||||
diag_log "_fnc_spawnEmplacedWeaponArray start";
|
||||
// Define _missionEmplacedWeapons if not already configured.
|
||||
if (count _missionEmplacedWeapons < 1) then
|
||||
{
|
||||
_missionEmplacedWeapons = [_coords,_noEmplacedWeapons,35,50] call blck_fnc_findPositionsAlongARadius;
|
||||
};
|
||||
diag_log format["_fnc_spawnEmplacedWeaponArray:: _missionEmplacedWeapons = %1", _missionEmplacedWeapons];
|
||||
{
|
||||
// params["_vehType","_pos",["_clearInventory",true]];
|
||||
_wep = [selectRandom blck_staticWeapons,[0,0,0],false] call blck_fnc_spawnVehicle;
|
||||
diag_log format["_fnc_spawnMissionEmplacedWeapons (33) spawnVehicle returned value of _wep = %1",_wep];
|
||||
_wep setVariable["DBD_vehType","emplaced"];
|
||||
_wep setPosATL _x;
|
||||
[_wep,false] call blck_fnc_configureMissionVehicle;
|
||||
_emplacedWeps pushback _wep;
|
||||
} forEach _missionEmplacedWeapons;
|
||||
|
||||
_return = _emplacedWeps;
|
||||
diag_log format["_fnc_spawnEmplacedWeaponArray:: returning with _return = _emplacedWeps = %1",_return];
|
||||
_return
|
@ -5,39 +5,44 @@
|
||||
*/
|
||||
|
||||
params["_missionEmplacedWeapons","_noEmplacedWeapons","_aiDifficultyLevel","_coords","_uniforms","_headGear",["_missionType","unspecified"]];
|
||||
private ["_emplacedGroup","_emplacedAI","_precise","_safepos","_wepSelected","_emp","_gunner"];
|
||||
private ["_emplacedGroup","_emplacedAI","_precise","_pos","_emplaced","_emp","_gunner","_staticWeap"];
|
||||
_emplacedAI = [];
|
||||
|
||||
_staticWeap = [];
|
||||
if (blck_debugLevel > 0) then {diag_log format["[blckeagls] _fnc_spawnMissionEmplacedWeapons(10):: - >_missionEmplacedWeapons = %2 and _noEmplacedWeapons = %1",_noEmplacedWeapons,_missionEmplacedWeapons];};
|
||||
|
||||
if ( count _missionEmplacedWeapons isEqualTo 0 ) then
|
||||
{
|
||||
_missionEmplacedWeapons = [_coords,_noEmplacedWeapons,35,50] call blck_fnc_findPositionsAlongARadius;
|
||||
_precise = false;
|
||||
if (blck_debugLevel > 1) then {diag_log "_fnc_spawnMissionEmplacedWeapons:: -->> no spawn points specified, using spawns along a radius";
|
||||
};
|
||||
diag_log format["_fnc_spawnMissionEmplacedWeapons:: (16) _missionType = %2 _missionEmplacedWeapons updated to %1",_missionEmplacedWeapons,_missionType];
|
||||
diag_log format["_fnc_spawnMissionEmplacedWeapons:: (19) _missionType = %2 _missionEmplacedWeapons updated to %1",_missionEmplacedWeapons,_missionType];
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionEmplacedWeapons:: (20) spawning group to man emplaced weapon"];
|
||||
_emplacedGroup = [_x,1,1,_aiDifficultyLevel,_coords,1,2,_uniforms,_headGear] call blck_fnc_spawnGroup;
|
||||
diag_log format["_fnc_spawnMissionEmplacedWeapons:: (22) -> spawning _blck_fnc_spawnEmplaceWeapon at position %3 for _missionType %2 with group %1",_emplacedGroup, _missionType, _x];
|
||||
_emplacedAI append units _emplacedGroup;
|
||||
diag_log format["_fnc_spawnMissionEmplacedWeapons:: (21) spawning group to man emplaced weapon"];
|
||||
_emplacedGroup = [_x,1,1,_aiDifficultyLevel,[0,0,0],1,2,_uniforms,_headGear] call blck_fnc_spawnGroup;
|
||||
diag_log format["_fnc_spawnMissionEmplacedWeapons:: (23) group spawned = %1",_emplacedGroup];
|
||||
_emplacedAI append (units _emplacedGroup);
|
||||
diag_log format["_fnc_spawnMissionEmplacedWeapons:: (24) _emplacedAI updated to = %1",_emplacedAI];
|
||||
// params["_pos","_emplacedGroup","_emplacedTypes",["_minDist",20],["_maxDist",35],["_precise",false], ["_missionType","undefined" ]];
|
||||
|
||||
diag_log format["_fnc_spawnMissionEmplacedWeapons:: (26) spawning emplaced weapon"];
|
||||
if !(_precise) then
|
||||
if (_precise) then
|
||||
{
|
||||
_safepos = [_coords,5,10,0,0,20,0] call BIS_fnc_findSafePos;
|
||||
_pos = _x;
|
||||
} else {
|
||||
_pos = [_x,5,10,0,0,20,0] call BIS_fnc_findSafePos;
|
||||
};
|
||||
_wepSelected = selectRandom blck_staticWeapons;
|
||||
_emp = [_wepSelected,_safepos,false] call blck_fnc_spawnVehicle;
|
||||
|
||||
_emp = [selectRandom blck_staticWeapons,_pos,false] call blck_fnc_spawnVehicle;
|
||||
diag_log format["_fnc_spawnMissionEmplacedWeapons (33) spawnVehicle returned value of _emp = %1",_emp];
|
||||
_emp setVariable["DBD_vehType","emplaced"];
|
||||
if (_precise) then {_emp setPosATL _pos];
|
||||
_emp setPosATL _pos;
|
||||
[_emp,false] call blck_fnc_configureMissionVehicle;
|
||||
_gunner = (units _emplacedGroup) select 0;
|
||||
_gunner moveingunner _emp;
|
||||
[_emp,false] call blck_fnc_configureMissionVehicle;
|
||||
//waitUntil { count crew _emp > 0};
|
||||
blck_missionVehicles pushback _emp;
|
||||
_staticWeap pushback _emp;
|
||||
diag_log format["_fnc_spawnMissionEmplacedWeapons:: (28) emplaced weapon _wep = %1",_wep];
|
||||
}forEach _missionEmplacedWeapons;
|
||||
|
||||
_emplacedAI
|
||||
_emplaced = [_staticWeap, _emplacedAI];
|
||||
|
||||
_emplaced
|
@ -6,9 +6,9 @@
|
||||
returns [_AI_Vehicles,_missionAI] otherwise;
|
||||
*/
|
||||
params["_coords","_noVehiclePatrols","_aiDifficultyLevel","_uniforms","_headGear",["_missionType","unspecified"]];
|
||||
private["_vehGroup","_patrolVehicle","_vehiclePatrolSpawns","_missionAI","_missiongroups","_AI_Vehicles","_abort","_vehiclePatrolSpawns","_randomVehicle","_return"];
|
||||
private["_vehGroup","_patrolVehicle","_vehiclePatrolSpawns","_missionAI","_missiongroups","_vehicles","_return","_vehiclePatrolSpawns","_randomVehicle","_return"];
|
||||
_vehicles = [];
|
||||
_missionAI = [];
|
||||
|
||||
_vehiclePatrolSpawns= [_coords,_noVehiclePatrols,45,60] call blck_fnc_findPositionsAlongARadius;
|
||||
{
|
||||
_vehGroup = [_x,3,3,_aiDifficultyLevel,_coords,1,2,_uniforms,_headGear] call blck_fnc_spawnGroup;
|
||||
@ -18,8 +18,11 @@ _vehiclePatrolSpawns= [_coords,_noVehiclePatrols,45,60] call blck_fnc_findPositi
|
||||
{
|
||||
_randomVehicle = selectRandom blck_AIPatrolVehicles;
|
||||
_patrolVehicle = [_coords,_x,_randomVehicle,(_x distance _coords) -5,(_x distance _coords) + 5,_vehGroup] call blck_fnc_spawnVehiclePatrol;
|
||||
diag_log format["_fnc_spawnMissionVehiclePatrols:: - > patrol vehicle spawned was %1 with type of %2",_patrolVehicle,_randomVehicle];
|
||||
_vehGroup setVariable["groupVehicle",_patrolVehicle,true];
|
||||
_missionAI append (units _vehGroup);
|
||||
_vehicles pushback _patrolVehicle;
|
||||
_missionAI append units _vehGroup;
|
||||
diag_log format["_fnc_spawnMissionVehiclePatrols:: -- > _vehicles updated to %1",_vehicles];
|
||||
};
|
||||
}forEach _vehiclePatrolSpawns;
|
||||
if (blck_debugLevel > 1) then
|
||||
@ -27,4 +30,6 @@ if (blck_debugLevel > 1) then
|
||||
diag_log format["[blckeagls] _fnc_spawnMissionVehiclePatrols :: Vehicle Patrols Spawned: _coords %1 : _missionType %2 : _aiDifficultyLevel %3",_coords,_aiDifficultyLevel];
|
||||
};
|
||||
|
||||
_missionAI;
|
||||
_return = [_vehicles,_missionAI];
|
||||
|
||||
_return
|
@ -2,13 +2,13 @@
|
||||
Delete alive AI.
|
||||
Now called from the main thread which tracks the time elapsed so that we no longer need to wait a proscribed period of time (see changes on lines 9 and 12)
|
||||
by Ghostrider
|
||||
Last updated 10/22/16
|
||||
Last updated 1/22/17
|
||||
*/
|
||||
|
||||
params["_aiList"];
|
||||
|
||||
{
|
||||
diag_log format["_fnc_cleanupAliveAI:: -> deleteing AI Unit %1",_x];
|
||||
if (blck_debugLevel > 2) then {diag_log format["_fnc_cleanupAliveAI:: -> deleteing AI Unit %1",_x];};
|
||||
[_x] call blck_fnc_deleteAI;
|
||||
}forEach _aiList;
|
||||
|
||||
|
@ -1,19 +1,21 @@
|
||||
/*
|
||||
Delete a unit.
|
||||
by Ghostrider
|
||||
Last updated 1/13/17
|
||||
Last updated 1/22/17
|
||||
*/
|
||||
|
||||
private["_ai"];
|
||||
private["_ai","_group"];
|
||||
params["_unit"];
|
||||
|
||||
diag_log format["_fnc_deleteAI::-> deleting unit = %1",_unit];
|
||||
if (blck_debugLevel > 2) then {diag_log format["_fnc_deleteAI::-> deleting unit = %1",_unit];};
|
||||
|
||||
{
|
||||
_unit removeAllEventHandlers _x;
|
||||
}forEach ["Killed","Fired","HandleDamage","HandleHeal","FiredNear"];
|
||||
private _group = (group _unit);
|
||||
[_unit] joinSilent grpNull;
|
||||
deleteVehicle _unit;
|
||||
if (count units _group < 1) then
|
||||
if (count units _group isEqualTo 0) then
|
||||
{
|
||||
deletegroup _group;
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
by Ghostrider
|
||||
1-4-17
|
||||
1-22-17
|
||||
*/
|
||||
|
||||
private["_missionType","_wasRunover","_launcher","_legal"];
|
||||
@ -11,17 +11,19 @@ _legal = true;
|
||||
|
||||
_fn_targetVehicle = { // force AI to fire on the vehicle with launchers if equiped
|
||||
params["_vk","_unit"];
|
||||
private
|
||||
{
|
||||
if (((position _x) distance (position _unit)) <= 350) then
|
||||
{
|
||||
_x reveal [_vk, 4];
|
||||
_x dowatch _vk;
|
||||
_x doTarget _vk;
|
||||
if (_launcher != "") then
|
||||
if (_unit getVariable ["Launcher",""] != "") then
|
||||
{
|
||||
_x selectWeapon (secondaryWeapon _unit);
|
||||
_x fireAtTarget [_vk,_launcher];
|
||||
_x fireAtTarget [_vk,_unit getVariable ["Launcher"]];
|
||||
} else {
|
||||
_x doTarget _vk;
|
||||
_x doFire _vk;
|
||||
};
|
||||
};
|
||||
@ -31,7 +33,6 @@ _fn_targetVehicle = { // force AI to fire on the vehicle with launchers if equi
|
||||
_fn_applyVehicleDamage = { // apply a bit of damage
|
||||
private["_vd"];
|
||||
params["_vk"];
|
||||
//_vk = _this select 0;
|
||||
_vd = getDammage _vk;
|
||||
_vk setDamage (_vd + blck_RunGearDamage);
|
||||
};
|
||||
@ -46,7 +47,6 @@ _fn_msgIED = {
|
||||
params["_killer"];
|
||||
diag_log format["fn_msgIED:: -- >> msg = %1 and owner _killer = %2",blck_Message, (owner _killer)];
|
||||
[["IED","",0,0],[_killer]] call blck_fnc_MessagePlayers;
|
||||
//(owner _killer) publicVariableClient "blck_Message";
|
||||
};
|
||||
|
||||
if (typeOf _killer != typeOf (vehicle _killer)) then // AI was killed by a vehicle
|
||||
|
@ -1,9 +1,9 @@
|
||||
/*
|
||||
by Ghostrider
|
||||
11-11-16
|
||||
1-22-17
|
||||
*/
|
||||
|
||||
private["_launcher","_launcherRounds","_objects","_weapons","_container"];
|
||||
private["_launcher","_launcherRounds"];
|
||||
params["_unit"]; // = _this select 0;
|
||||
_launcher = _unit getVariable ["Launcher",""];
|
||||
_unit removeWeapon _Launcher;
|
||||
|
@ -3,13 +3,13 @@
|
||||
calculate a reward player for AI Kills in crypto.
|
||||
Code fragment adapted from VEMF
|
||||
call as [_unit,_killer] call blck_fnc_rewardKiller;
|
||||
Last modified 1/4/17
|
||||
Last modified 1/22/17
|
||||
*/
|
||||
|
||||
params["_unit","_killer","_kills"];
|
||||
//diag_log format["rewardKiller:: _unit = %1 and _killer %2",_unit,_killer];
|
||||
|
||||
private["_modType","_reward"];
|
||||
private["_modType","_reward","_maxReward","_dist","_killstreakReward","_distanceBonus","_newKillerScore","_newKillerFrags","_money"];
|
||||
_modType = call blck_fnc_getModType;
|
||||
|
||||
//diag_log format["[blckeagles] rewardKiller:: - _modType = %1",_modType];
|
||||
@ -69,4 +69,4 @@ if (_modType isEqualTo "Exile") then
|
||||
[["showScore",[50,_distanceBonus,_kills]], [_killer]] call blck_fnc_messageplayers;
|
||||
};
|
||||
};
|
||||
//_reward
|
||||
|
||||
|
@ -2,16 +2,13 @@
|
||||
Original Code by blckeagls
|
||||
Modified by Ghostrider
|
||||
Logic for adding AI Ammo, GL Shells and Attachments addapted from that by Buttface (A3XAI).
|
||||
Infinite Ammo fix by Narines.
|
||||
Code to delete dead AI bodies moved to AIKilled.sqf
|
||||
Everything having to do with spawning and configuring an AI should happen here
|
||||
Last Modified 11/12/16
|
||||
Last Modified 1/22/17
|
||||
*/
|
||||
|
||||
//Defines private variables so they don't interfere with other scripts
|
||||
private ["_pos","_i","_weap","_ammo","_other","_skin","_aiGroup","_ai1","_magazines","_players","_owner","_ownerOnline","_nearEntities","_skillLevel","_aiSkills","_specialItems",
|
||||
"_Launcher","_launcherRound","_vest","_index","_WeaponAttachments","_Meats","_Drink","_Food","_aiConsumableItems","_weaponList","_ammoChoices","_attachment","_attachments",
|
||||
"_headGear","_uniforms","_pistols","_specialItems","_noItems"];
|
||||
private ["_i","_weap","_skin","_ai1","_skillLevel","_aiSkills",
|
||||
"_launcherRound","_index","_ammoChoices"];
|
||||
|
||||
params["_pos","_weaponList","_aiGroup",["_skillLevel","red"],["_Launcher","none"],["_uniforms", blck_SkinList],["_headGear",blck_headgear],["_underwater",false]];
|
||||
//_pos = _this select 0; // Position at which to spawn AI
|
||||
@ -25,7 +22,7 @@ params["_pos","_weaponList","_aiGroup",["_skillLevel","red"],["_Launcher","none"
|
||||
if (isNull _aiGroup) exitWith {diag_log "[blckeagls] ERROR CONDITION:-->> NULL-GROUP Provided to _fnc_spawnUnit"};
|
||||
|
||||
_ai1 = ObjNull;
|
||||
_modType = call blck_fnc_getModType;
|
||||
private _modType = call blck_fnc_getModType;
|
||||
if (_modType isEqualTo "Epoch") then
|
||||
{
|
||||
"I_Soldier_EPOCH" createUnit [_pos, _aiGroup, "_ai1 = this", 0.7, "COLONEL"];
|
||||
@ -53,8 +50,7 @@ _skin = "";
|
||||
_counter = 1;
|
||||
while {_skin isEqualTo "" && _counter < 10} do
|
||||
{
|
||||
_skin = selectRandom _uniforms; // call BIS_fnc_selectRandom;
|
||||
//_ai1 forceAddUniform _skin;
|
||||
_skin = selectRandom _uniforms;
|
||||
_ai1 forceAddUniform _skin;
|
||||
_skin = uniform _ai1;
|
||||
//diag_log format["_fnc_spawnUnit::-->> for unit _ai1 % uniform is %2",_ai1, uniform _ai1];
|
||||
@ -81,7 +77,6 @@ if (_modType isEqualTo "Epoch") then
|
||||
|
||||
_ai1 addHeadgear (selectRandom _headGear);
|
||||
// Add a vest to AI for storage
|
||||
//_vest = selectRandom blck_vests; // call BIS_fnc_selectRandom;
|
||||
_ai1 addVest selectRandom blck_vests;
|
||||
|
||||
if ( random (1) < blck_chanceBackpack) then
|
||||
@ -91,27 +86,22 @@ if ( random (1) < blck_chanceBackpack) then
|
||||
};
|
||||
|
||||
_weap = selectRandom _weaponList;
|
||||
|
||||
private["_optics","_pointers","_muzzles","_underbarrel","_legalOptics"];
|
||||
_ai1 addWeaponGlobal _weap;
|
||||
_ammoChoices = getArray (configFile >> "CfgWeapons" >> _weap >> "magazines");
|
||||
_optics = getArray (configfile >> "CfgWeapons" >> _weap >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems");
|
||||
_pointers = getArray (configFile >> "CfgWeapons" >> _weap >> "WeaponSlotsInfo" >> "PointerSlot" >> "compatibleItems");
|
||||
_muzzles = getArray (configFile >> "CfgWeapons" >> _weap >> "WeaponSlotsInfo" >> "MuzzleSlot" >> "compatibleItems");
|
||||
_underbarrel = getArray (configFile >> "CfgWeapons" >> _weap >> "WeaponSlotsInfo" >> "UnderBarrelSlot" >> "compatibleItems");
|
||||
_legalOptics = [];
|
||||
{
|
||||
if !(_x in blck_blacklistedOptics) then {_legalOptics pushback _x};
|
||||
}forEach _optics;
|
||||
_ammo = selectRandom _ammoChoices;
|
||||
//diag_log format["[spawnUnit.sqf] _ammo returned as %1",_ammo];
|
||||
for "_i" from 2 to (round(random 3)) do {
|
||||
_ai1 addMagazine _ammo;
|
||||
};
|
||||
//if (random 1 < 0.3) then {_unit addPrimaryWeaponItem (selectRandom _muzzles)};
|
||||
_ai1 addPrimaryWeaponItem (selectRandom _legalOptics);
|
||||
_ai1 addPrimaryWeaponItem (selectRandom _pointers);
|
||||
_ai1 addPrimaryWeaponItem (selectRandom _muzzles);
|
||||
_ai1 addPrimaryWeaponItem (selectRandom _underbarrel);
|
||||
_legalOptics = _optics - blck_blacklistedOptics;
|
||||
|
||||
_ai1 addMagazines [selectRandom _ammoChoices, 3];
|
||||
|
||||
if (random 1 < 0.4) then {_ai1 addPrimaryWeaponItem (selectRandom _muzzles)};
|
||||
if (random 1 < 0.4) then {_ai1 addPrimaryWeaponItem (selectRandom _legalOptics);};
|
||||
if (random 1 < 0.4) then {_ai1 addPrimaryWeaponItem (selectRandom _pointers);};
|
||||
if (random 1 < 0.4) then {_ai1 addPrimaryWeaponItem (selectRandom _muzzles);};
|
||||
if (random 1 < 0.4) then {_ai1 addPrimaryWeaponItem (selectRandom _underbarrel);};
|
||||
if ((count(getArray (configFile >> "cfgWeapons" >> _weap >> "muzzles"))) > 1) then {
|
||||
_ai1 addMagazine "1Rnd_HE_Grenade_shell";
|
||||
};
|
||||
@ -120,11 +110,10 @@ _weap = selectRandom blck_Pistols;
|
||||
//diag_log format["[spawnUnit.sqf] _weap os %1",_weap];
|
||||
_ai1 addWeaponGlobal _weap;
|
||||
_ammoChoices = getArray (configFile >> "CfgWeapons" >> _weap >> "magazines");
|
||||
_ai1 addMagazine selectRandom _ammoChoices;
|
||||
_ai1 addMagazines [selectRandom _ammoChoices, 2];
|
||||
|
||||
//add random items to AI. _other = ["ITEM","COUNT"]
|
||||
for "_i" from 1 to (1+floor(random(3))) do {
|
||||
_i = _i + 1;
|
||||
_ai1 addItem (selectRandom blck_ConsumableItems);
|
||||
};
|
||||
|
||||
|
@ -3,13 +3,10 @@
|
||||
// Last Updated 1/22/17
|
||||
|
||||
params["_veh",["_clearInventory",true]];
|
||||
|
||||
private["_unit"];
|
||||
if (_clearInventory) then
|
||||
{
|
||||
clearWeaponCargoGlobal _veh;
|
||||
clearMagazineCargoGlobal _veh;
|
||||
clearBackpackCargoGlobal _veh;
|
||||
clearItemCargoGlobal _veh;
|
||||
[_veh] call blck_fnc_emptyObject;
|
||||
};
|
||||
_veh setVehicleLock "LOCKEDPLAYER";
|
||||
_veh addEventHandler ["GetIn",{ // Note: only fires when vehicle is local to player
|
||||
|
@ -1,11 +1,11 @@
|
||||
// =========================================================================================================
|
||||
// blckeagls mission system
|
||||
// Author: Ghostrider-DBD-
|
||||
// Last modified 9-3-16
|
||||
// Last modified 1-22-17
|
||||
// ------------------------------------------------------------------------------------------------------------
|
||||
// Unused at present, reserved for the future
|
||||
|
||||
private ["_ai_veh","_ai_veh_hitsource","_ai_veh_type","_ai_veh_name","_ai_veh_side","_ai_veh_group_side","_ai_veh_hitsource_group_side","_ai_veh_hitsource_type","_ai_veh_hitsource_name","_ai_veh_hitsource_side"];
|
||||
private ["_ai_veh","_ai_veh_type","_ai_veh_name"];
|
||||
|
||||
//diag_log "Vehicle Decommisioning handler activated";
|
||||
params["_ai_veh"];
|
||||
|
@ -2,6 +2,7 @@
|
||||
// by Ghostrider-DBD-
|
||||
// Last Updated 1-22-17
|
||||
// ["_pos","_emplacedGroup","_emplacedTypes",["_minDist",20],["_maxDist",35],["_precise",false] ] call blck_fnc_spawnEmplacedWeapon;
|
||||
|
||||
private["_emplaced","_safepos","_emp","_gunner"];
|
||||
params["_pos","_emplacedGroup","_emplacedTypes",["_minDist",20],["_maxDist",35],["_precise",false], ["_missionType","undefined" ]];
|
||||
if (isNull _emplacedGroup) exitWith {diag_log "[blckeagls] ERROR CONDITION:-->> NULL-GROUP Provided to _fnc_spawnEmplaced"; objNull;};
|
||||
|
@ -22,5 +22,6 @@ if (_modType isEqualTo "Epoch") then
|
||||
// params["_veh",["_clearInventory",true]];
|
||||
[_veh,_clearInventory] call blck_fnc_configureMissionVehicle;
|
||||
|
||||
diag_log format["spawnVehicle:: returning parameter _veh = %1",_veh];
|
||||
_veh
|
||||
|
||||
|
@ -1,11 +1,10 @@
|
||||
//////////////////////////////////////
|
||||
// spawn a vehicle, fill it with AI, and give it waypoints around the perimeter of the mission area
|
||||
// Returns an array _units that contains a list of the units that were spawned and placed in the vehicle
|
||||
|
||||
/*
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last updated 8-14-16
|
||||
|
||||
spawns a vehicle of _vehType and mans it with units in _group.
|
||||
returns _veh, the vehicle spawned.
|
||||
*/
|
||||
|
||||
private["_vehType","_safepos","_veh"];
|
||||
@ -21,7 +20,7 @@ diag_log format["_fnc_spawnVehiclePatrol::->> _group = %1",_group];
|
||||
_safepos = [_pos,0,25,0,0,20,0] call BIS_fnc_findSafePos;
|
||||
_veh = [_vehType,_safepos] call blck_fnc_spawnVehicle;
|
||||
|
||||
//diag_log format["spawnVehiclePatrols:: vehicle spawned is %1 of typeof %2",_veh, typeOf _veh];
|
||||
diag_log format["spawnVehiclePatrol:: vehicle spawned is %1 of typeof %2",_veh, typeOf _veh];
|
||||
|
||||
private["_unitNumber"];
|
||||
_unitNumber = 0;
|
||||
@ -40,7 +39,7 @@ while {(count (waypoints _group)) > 0} do
|
||||
{
|
||||
deleteWaypoint ((waypoints _group) select 0);
|
||||
};
|
||||
//diag_log format["spawnVehiclePatrols:: vehicle spawned was %1",_veh];
|
||||
|
||||
_count = 5;
|
||||
_start = _center getDir _pos;
|
||||
_angle = _start;
|
||||
@ -58,7 +57,5 @@ for "_i" from 1 to _count do
|
||||
};
|
||||
_wp = _group addWaypoint [_pos, 25];
|
||||
_wp setWaypointType "CYCLE";
|
||||
waitUntil { count crew _veh > 0};
|
||||
blck_missionVehicles pushback _veh;
|
||||
|
||||
_veh
|
||||
|
@ -49,6 +49,8 @@ if (blck_debugLevel > 2) then {diag_log format["_fnc_vehicleMonitor:: function c
|
||||
_veh removealleventhandlers "GetIn";
|
||||
_veh removealleventhandlers "GetOut";
|
||||
_veh setVehicleLock "UNLOCKED" ;
|
||||
_veh setVariable["releasedToPlayers",true];
|
||||
[_veh] call blck_fnc_emptyObject;
|
||||
if (blck_debugOn) then
|
||||
{
|
||||
diag_log format["_fnc_vehicleMonitor:: case of patrol vehicle released to players where vehicle = %1",_veh];
|
||||
@ -56,31 +58,29 @@ if (blck_debugLevel > 2) then {diag_log format["_fnc_vehicleMonitor:: function c
|
||||
};
|
||||
};
|
||||
} else {
|
||||
private ["_crew"];
|
||||
private ["_crew","_mag","_allMags","_cnt"];
|
||||
//_veh setVehicleAmmo 1;
|
||||
//_veh setFuel 1;
|
||||
// https://community.bistudio.com/wiki/fullCrew
|
||||
// 0 1 2 3 4
|
||||
// returns Array - format [[<Object>unit,<String>role,<Number>cargoIndex,<Array>turretPath,<Boolean>personTurret], ...]
|
||||
diag_log format["_fnc_vehicleMonitor:: (65) _veh = %1",_veh];
|
||||
//diag_log format["_fnc_vehicleMonitor:: (65) _veh = %1",_veh];
|
||||
_crew = fullCrew _veh;
|
||||
diag_log format["_fnc_vehicleMonitor:: (67) _crew = %1",_crew];
|
||||
//diag_log format["_fnc_vehicleMonitor:: (67) _crew = %1",_crew];
|
||||
{
|
||||
diag_log format ["_fnc_vehicleMonitor:: (69) _x = %1",_x];
|
||||
//diag_log format ["_fnc_vehicleMonitor:: (69) _x = %1",_x];
|
||||
_mag = _veh currentMagazineTurret (_x select 3);
|
||||
if (count _mag > 0) then
|
||||
{
|
||||
diag_log format["_fnc_vehicleMonitor:: (71) _mag is typeName %1", typeName _mag];
|
||||
diag_log format ["_fnc_vehicleMonitor:: (71) length _mag = %2 and _mag = %1",_mag,count _mag];
|
||||
//diag_log format["_fnc_vehicleMonitor:: (71) _mag is typeName %1", typeName _mag];
|
||||
//diag_log format ["_fnc_vehicleMonitor:: (71) length _mag = %2 and _mag = %1",_mag,count _mag];
|
||||
_allMags = magazinesAmmo _veh;
|
||||
diag_log format["_fnc_vehicleMonitor:: (71) _allMags = %1",_allMags];
|
||||
_cnt = ( {_mag isEqualTo (_x select 0); diag_log format["_fnc_vehicleMonitor _x select 0 =%1",_x select 0];}count _allMags);
|
||||
diag_log format["_fnc_vehicleMonitor:: (75) _cnt = %1",_cnt];
|
||||
//diag_log format["_fnc_vehicleMonitor:: (71) _allMags = %1",_allMags];
|
||||
_cnt = ( {_mag isEqualTo (_x select 0)}count _allMags);
|
||||
//diag_log format["_fnc_vehicleMonitor:: (75) _cnt = %1",_cnt];
|
||||
if (_cnt < 2) then {_veh addMagazineCargo [_mag,2]};
|
||||
};
|
||||
} forEach _crew;
|
||||
|
||||
|
||||
};
|
||||
}forEach _vehList;
|
||||
|
||||
|
@ -17,7 +17,7 @@ blck_fnc_monitorHC = compileFinal preprocessFileLineNumbers "\q\addons\custom_s
|
||||
blck_fnc_timeAcceleration = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\TimeAccel\GMS_fnc_Time.sqf";
|
||||
blck_fnc_getModType = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_getModType.sqf"; // Test if Epoch or Exile is loaded
|
||||
blck_fnc_groupsOnAISide = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_GroupsOnAISide.sqf"; // Returns the number of groups on the side used by AI
|
||||
//blck_fnc_deleteFromArray = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_deleteFromArray.sqf";
|
||||
blck_fnc_emptyObject = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_emptyObject.sqf";
|
||||
|
||||
// Player-related functions
|
||||
blck_fnc_rewardKiller = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_rewardKiller.sqf";
|
||||
@ -39,6 +39,7 @@ blck_fnc_spawnCompositionObjects = compileFinal preprocessFileLineNumbers "\q\a
|
||||
blck_fnc_spawnRandomLandscape = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnRandomLandscape.sqf";
|
||||
blck_fnc_spawnMissionVehiclePatrols = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnMissionVehiclePatrols.sqf";
|
||||
blck_fnc_spawnMissionEmplacedWeapons = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnMissionEmplacedWeapons.sqf";
|
||||
blck_fnc_spawnEmplacedWeaponArray = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnEmplacedWeaponArray.sqf";
|
||||
blck_fnc_spawnMissionAI = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnMissionAI.sqf";
|
||||
blck_fnc_spawnMissionLootVehicles = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnMissionLootVehicles.sqf";
|
||||
blck_fnc_spawnMissionHeli = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnMissionHeli.sqf";
|
||||
@ -66,7 +67,7 @@ blck_fnc_setupWaypoints = compileFinal preprocessFileLineNumbers "\q\addons\cus
|
||||
blck_fnc_cleanEmptyGroups = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_cleanEmptyGroups.sqf"; // GMS_fnc_cleanEmptyGroups
|
||||
|
||||
// Functions specific to vehicles, whether wheeled or static
|
||||
blck_fnc_spawnEmplacedWeapon = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_spawnEmplacedWeapon.sqf";
|
||||
//blck_fnc_spawnEmplacedWeapon = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_spawnEmplacedWeapon.sqf";
|
||||
blck_fnc_spawnVehicle = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_spawnVehicle.sqf";
|
||||
blck_fnc_spawnVehiclePatrol = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_spawnVehiclePatrol.sqf";
|
||||
blck_fnc_protectVehicle = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_protectVehicle.sqf";
|
||||
|
@ -35,14 +35,14 @@ if (blck_debugON) then
|
||||
blck_AliveAICleanUpTimer = 10; // Time after mission completion at which any remaining live AI are deleted.
|
||||
blck_bodyCleanUpTimer = 10;
|
||||
|
||||
blck_SpawnEmplaced_Orange = 4; // Number of static weapons at Orange Missions
|
||||
blck_SpawnEmplaced_Green = 3; // Number of static weapons at Green Missions
|
||||
blck_SpawnEmplaced_Orange = 0; // Number of static weapons at Orange Missions
|
||||
blck_SpawnEmplaced_Green = 0; // Number of static weapons at Green Missions
|
||||
blck_SpawnEmplaced_Blue = 1; // Number of static weapons at Blue Missions
|
||||
blck_SpawnEmplaced_Red = 2;
|
||||
|
||||
blck_SpawnVeh_Orange = 4; // Number of static weapons at Orange Missions
|
||||
blck_SpawnVeh_Green = 3; // Number of static weapons at Green Missions
|
||||
blck_SpawnVeh_Blue = 2; // Number of static weapons at Blue Missions
|
||||
blck_SpawnVeh_Blue = 1; // Number of static weapons at Blue Missions
|
||||
blck_SpawnVeh_Red = 2;
|
||||
|
||||
//blck_reinforcementsBlue = [0, 0, 0.0, 0]; // Chance of reinforcements, number of reinforcements, Chance of reinforcing heli patrols, chance of dropping supplies for the reinforcements
|
||||
|
@ -4,14 +4,26 @@ Loosely based on the AI mission system by blckeagls ver 2.0.2
|
||||
Contributions by Narines: bug fixes, testing, infinite ammo fix.
|
||||
Ideas or code from that by Vampire and KiloSwiss have been used for certain functions.
|
||||
|
||||
1/22/17 Version 6.54 build 32
|
||||
Changed code to test for conditions that trigger to spawn mission objects and AI completely
|
||||
Rewrote the code for spawning emplaced weapons from scratch.
|
||||
|
||||
1/22/17 Version 6.54 build 30
|
||||
Fixed an error in how the waitTime till a mission was respawned after being updated to inactive status.
|
||||
Added additional reporting as to the mission type for which AI, statics and vehicle patrols are being spawned.
|
||||
Continued switching from blck_debugOn to blck_debugLevel.
|
||||
Continued work to move much of the code from GMS_fnc_missionSpawner to precompiled functions.
|
||||
- tested and working for all but the emplaced weapons module.
|
||||
Removed old code that had been commented out from GMS_missionSpawner.
|
||||
deactivated the 'fired' event handler
|
||||
added an 'reloaded' event handler to units that adds a magazin of the type used to reload the weapon to prevent units running out of ammo. this also provides a break in firing and is more realistic.
|
||||
Added a check to GMS_fnc_vehicleMonitor that addes ammo to vehicle cargo when stores are low. Removed the infinite ammo script for static and vehicle weapons, again for greater realism.
|
||||
Increased number of rounds of ammo added to AI units for primary and secondary weapons.
|
||||
Tweaked code in GMS_fnc_spawnUnit to increase efficiency.
|
||||
Attempted a fix for occaisional issues with missions not triggering or ending by changing from distance to distance2D.
|
||||
Tweaked code for deleting dead AI to also delete any weapons containers nearby.
|
||||
Checked throughout for potential scope issues; ensured all private variables were declared as such.
|
||||
Changed the method by which mission patrol vehicles and static weapons are deleted at the end of a mission.
|
||||
|
||||
1/21/17 Build 29.
|
||||
Went back to the timerless system for spawning missions.
|
||||
|
@ -1,3 +1,3 @@
|
||||
private ["_version","_versionDate"];
|
||||
_blck_version = "6.54 Build 30";
|
||||
_blck_versionDate = "1-21-17 5:00 PM";
|
||||
_blck_version = "6.54 Build 32";
|
||||
_blck_versionDate = "1-22-17 8:00 PM";
|
||||
|
Loading…
x
Reference in New Issue
Block a user