Tweaks to AI difficulty and added a variable to define global AI skill.

Also updated debugging info to give more flexibility as to the level of
info logged and remove some unnecessary logging.
This commit is contained in:
Ghostrider-DbD- 2017-01-08 09:46:10 -05:00
parent 1581856cec
commit 157dcfad5d
30 changed files with 459 additions and 2216 deletions

View File

@ -4,7 +4,7 @@
By Ghostrider-DbD-
11/16/16
*/
if (blck_debugON) then
if (blck_debugLevel > 2) then
{
diag_log format ["_fnc_cleanEmptyGroups:: -- >> group count = %1 ",(count allGroups)];
diag_log format ["_fnc_cleanEmptyGroups:: -- >> Group count AI side = %1", call blck_fnc_groupsOnAISide];
@ -14,5 +14,5 @@ if (blck_debugON) then
//diag_log format["_fnc_cleanEmptyGroups:: - >> type of object _x = %1",typeName _x];
if ((count units _x) isEqualTo 0) then {deleteGroup _x};
}forEach allGroups;
diag_log "_fnc_cleanEmptyGroups:: -- >> exiting function";
//if (blck_debugLevel > 2) then {diag_log "_fnc_cleanEmptyGroups:: -- >> exiting function";};

View File

@ -5,7 +5,7 @@
- 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-2-17
Last modified 1-7-17
*/
private ["_index","_timer10Min","_timer1min","_timer5min","_modType"];
@ -43,7 +43,7 @@ while {true} do
}; // Exile cleans up empty groups automatically so this should not be needed with that mod.
{
diag_log format["_fnc_mainThread:: -- >> _x = %1 and _x select 6 = %2",_x, _x select 6];
//diag_log format["_fnc_mainThread:: -- >> _x = %1 and _x select 6 = %2",_x, _x select 6];
if (_x select 6 > 0) then // The mission is not running, check the time left till it is spawned
{
if (diag_tickTime > (_x select 6)) then // time to spawn the mission
@ -54,7 +54,7 @@ while {true} do
private["_markerClass","_missionName","_missionPath","_aiDifficultyLevel"];
//diag_log format["_fnc_mainThread:: -->> _missionClass would = %1%2",_x select 2, _index];
_markerClass = _x select 2;
diag_log format["_fnc_mainThread:: -->> _markerClass = %1",_markerClass];
//diag_log format["_fnc_mainThread:: -->> _markerClass = %1",_markerClass];
_aiDifficultyLevel = _x select 4;
_missionName = selectRandom (_x select 0);
_missionPath = _x select 1;
@ -72,7 +72,7 @@ while {true} do
if ((diag_tickTime - _timer5min) > 300) then {
if (blck_timeAcceleration) then {
if (blck_debugON) then {diag_log "[blckeagls] calling time acceleration module";};
//if (blck_debugON) then {diag_log "[blckeagls] calling time acceleration module";};
[] call blck_fnc_timeAcceleration;
};
if (blck_useHC) then {[] call blck_fnc_monitorHC;}; // Not working

View File

@ -1,72 +0,0 @@
/*
Spawn and configure a group
for DBD Clan
By Ghostrider-DBD-
Copyright 2016
Last Modified 9-12-16
*/
//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"];
params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear] ];
if (blck_debugON) then
{
diag_log format["[blckeagls] _fnc_spawnGroup called parameters: _numai1 %1, _numbai2 %2, _skillLevel %3, _center %4",_numai1,_numai2,_skillLevel,_center];
};
//Spawns correct number of AI
if (_numai2 > _numai1) then {
_numbertospawn = floor( (random (_numai2 - _numai1) + _numai1 ) );
} else {
_numbertospawn = _numai2;
};
if (blck_debugON) then
{
diag_log format["spawnGroup.sqf: _numbertospawn = %1",_numbertospawn];
};
//Creates a group to make them attack players
_groupSpawned = createGroup blck_AI_Side; // ; Group changed for Exile for which player is RESISTANCE.
_groupSpawned setcombatmode blck_combatMode;
_groupSpawned allowfleeing 0;
_groupSpawned setspeedmode "FULL";
_groupSpawned setFormation blck_groupFormation;
_groupSpawned setVariable ["blck_group",true,true];
//diag_log format["spawnGroup:: group is %1",_groupSpawned];
// Determines whether or not the group has launchers
_useLauncher = blck_useLaunchers;
// define weapons list for the group
switch (_skillLevel) do {
case "blue": {_weaponList = blck_WeaponList_Blue;};
case "red": {_weaponList = blck_WeaponList_Red;};
case "green": {_weaponList = blck_WeaponList_Green;};
case "orange": {_weaponList = blck_WeaponList_Orange;};
default {_weaponList = blck_WeaponList_Blue;};
};
//Spawns the correct number of AI Groups, each with the correct number of units
//Counter variable
_i = 0;
while {_i < _numbertospawn} do {
_i = _i + 1;
if (blck_useLaunchers && _i <= blck_launchersPerGroup) then
{
_launcherType = selectRandom blck_launcherTypes;
} else {
_launcherType = "none";
};
//Finds a safe positon to spawn the AI in the area given
_safepos = [_pos,0,30,2,0,20,0] call BIS_fnc_findSafePos;
//Spawns the AI unit
//diag_log format["spawnGroup:: spawning unit #%1",_i];
// params["_pos","_weaponList","_aiGroup",["_skillLevel","red"],["_Launcher","none"],["_uniforms",blck_SkinList],["_headGear",blck_BanditHeadgear]];
[_safepos,_weaponList,_groupSpawned,_skillLevel,_launcherType,_uniforms,_headGear] call blck_fnc_spawnAI;
};
_groupSpawned selectLeader (units _groupSpawned select 0);
[_pos,_minDist,_maxDist,_groupSpawned] spawn blck_fnc_setupWaypoints;
//diag_log format["fnc_spawnGroup:: Group spawned was %1 with units of %2",_groupSpawned, units _groupSpawned];
_groupSpawned

View File

@ -1,461 +0,0 @@
/*
Generic Mission Spawner
for DBD Clan
By Ghostrider-DBD-
Copyright 2016
*/
private ["_crates","_aiGroup","_objects","_vehicles","_groupPatrolRadius","_missionLandscape","_compositions","_missionCfg","_compSel","_mines","_blck_AllMissionAI","_blck_localMissionMarker","_AI_Vehicles"];
params["_coords","_missionType","_aiDifficultyLevel"];
/*
_aiDifficultyLevel = _this select 2; // "blue","red","green" and "orange"
*/
// *************************
// Once the entire mission system can support timeout cleanup of vehicles (specifically the AI vehicle patrols) then each mission layout can define this varialbe. Until then disable timouts.
//////////////////////////////////
// To simplify debugging and also reduce load on server besure only once instance of the mission spawner is initializing at a time.
/////////////////////////////////
waitUntil {blck_missionSpawning isEqualTo false};
blck_missionSpawning = true;
diag_log format["[blckeagls] missionSpawner:: Initializing mission: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
private["_chanceHeliPatrol","_noPara","_reinforcementLootCounts","_chanceLoot"];
if (isNil "_chanceReinforcements") then
{
_chanceReinforcements = 0;
_noPara = 0;
_reinforcementLootCounts = [0,0,0,0,0,0];
_chanceHeliPatrol = 0;
_chanceLoot = 0;
};
private["_timeOut"]; // _timeOut is the time in seconds after which a mission is deactivated.
if (isNil "_markerColor") then {_markerColor = "ColorBlack"};
if (isNil "_markerType") then {_markerType = ["mil_box",[]]};
if (isNil "_timeOut") then {_timeOut = -1;};
if (isNil "_noPara") then {_noPara = 0};
if (isNil "_chanceHeliPatrol") then {_chanceHeliPatrol = 0;};
if (isNil "_chanceLoot") then {_chanceLoot = 0};
if (isNil "_reinforcementLootCounts") then
{
_weap = 2 + floor(random(4));
_mags = 5 + floor(random(6));
_backpacks = 1 + floor(random(2));
_optics = 1 + floor(random(6));
_loadout = 1 + floor(random(3));
_reinforcementLootCounts = [_weap,_mags,_optics,0,0,_backpacks];
//diag_log "missionSpawner:: default values used for _reinforcementLootCounts";
}
else
{
//diag_log "missionSpawner:: Mission specific values used for _reinforcementLootCounts";
};
if (blck_debugON) then {
diag_log format["[blckEagle] Mission Reinforcement Parameters: changeReinforcements %1 numAI %2 changePatrol %3 chanceLoot %4",_chanceReinforcements,_noPara,_chanceHeliPatrol,_chanceLoot];
};
private["_useMines"];
if (isNil "_useMines") then {_useMines = blck_useMines; /*diag_log "[blckEagles] Using default setting for _useMines";*/};
_objects = [];
_mines = [];
_crates = [];
_aiGroup = [];
_missionAIVehicles = [];
_blck_AllMissionAI = [];
_AI_Vehicles = [];
_blck_localMissionMarker = [_missionType,_coords,"","",_markerColor,_markerType];
_delayTime = 1;
_groupPatrolRadius = 50;
if (blck_labelMapMarkers select 0) then
{
//diag_log "SM1.sqf: labeling map markers *****";
_blck_localMissionMarker set [2, _markerMissionName];
};
if !(blck_preciseMapMarkers) then
{
//diag_log "SM1.sqf: Map marker will be OFFSET from the mission position";
_blck_localMissionMarker set [1,[_coords,75] call blck_fnc_randomPosition];
};
_blck_localMissionMarker set [3,blck_labelMapMarkers select 1]; // Use an arrow labeled with the mission name?
[["start",_startMsg,_blck_localMissionMarker select 2]] call blck_fnc_messageplayers;
[_blck_localMissionMarker] execVM "debug\spawnMarker.sqf";
_fn_timedOut = {
params["_startTime"];
private["_return"];
_return = ( (diag_tickTime - _startTime) > blck_MissionTimout );
_return;
};
_fn_playerWithinRange = {
params["_pos"];
private["_return"];
_return = false;
{
if (isPlayer _x and _x distance _pos <= blck_TriggerDistance) then {_return = true};
}forEach allPlayers; // playableunits; changed for Arma 1.66
_return;
};
uiSleep 1;
/////////////////////////////
// Everything has been set up for the mission and it is now waiting to be triggered by a nearby player or to time out.
// Lets let other instances of the mission spawner know it is OK to go ahead
////////////////////////////
blck_missionSpawning = false;
//diag_log "missionSpawner:: waiting for player to trigger the mission";
private["_wait","_missionStartTime","_playerInRange","_missionTimedOut"];
_missionStartTime = diag_tickTime;
_playerInRange = false;
_missionTimedOut = false;
_wait = true;
while {_wait} do
{
if (blck_debugLevel isEqualTo 3) then
{
_wait = false;
_playerInRange = true;
} else {
if ([_coords] call _fn_playerWithinRange) then
{
_wait = false;
_playerInRange = true;
} else
{
if ((diag_tickTime - _missionStartTime) > blck_MissionTimout) then
{
_wait = false;
_missionTimedOut = true;
};
};
uiSleep 1;
};
};
//waitUntil{ { (isPlayer _x && _x distance _coords <= blck_TriggerDistance /*&& vehicle _x == _x*/) || ([_missionStartTime] call _fn_timedOut) } count playableunits > 0 };
if (blck_debugON) then
{
diag_log format["missionSpawner:: Mission Triggerred contition playerInRange %1 and timout = %2",_playerInRange, _missionTimedOut];
};
if (!_playerInRange && _missionTimedOut) exitWith
{
//["timeOut",_endMsg,_blck_localMissionMarker select 2] call blck_fnc_messageplayers;
[_blck_localMissionMarker select 0] execVM "debug\deleteMarker.sqf";
_blck_localMissionMarker set [1,[0,0,0]];
_blck_localMissionMarker set [2,""];
[_objects, 1] spawn blck_fnc_cleanupObjects;
if (blck_debugON) then
{
diag_log format["[blckeagls] missionSpawner:: Mission Timed Out: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
};
if (_playerInRange) then
{
if (blck_debugON) then
{ diag_log format["[blckeagls] missionSpawner:: -- >> Mission tripped by nearby player: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
if (count _missionLootBoxes > 0) then
{
_crates = [_coords,_missionCfg select 2/* array of crates*/] call blck_fnc_spawnMissionCrates;
}
else
{
_crates = [_coords,[[selectRandom blck_crateTypes /*"Box_NATO_Wps_F"*/,[0,0,0],_crateLoot,_lootCounts]]] call blck_fnc_spawnMissionCrates;
};
//_objects append _crates;
if (blck_debugON) then
{
diag_log format["[blckeagls] missionSpawner:: Crates Spawned: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
uiSleep _delayTime;
if (blck_SmokeAtMissions select 0) then // spawn a fire and smoke near the crate
{
private ["_temp"];
_temp = [_coords,blck_SmokeAtMissions select 1] call blck_fnc_smokeAtCrates;
_objects append _temp;
_temp = nil;
};
uiSleep _delayTime;
if (_useMines) then
{
_mines = [_coords] call blck_fnc_spawnMines;
//waitUntil{!(_mines isEqualTo [];);
uiSleep _delayTime;;
};
uiSleep _delayTime;
_obj = [];
if (_missionLandscapeMode isEqualTo "random") then
{
_obj = [_coords,_missionLandscape, 3, 15, 2] call blck_fnc_spawnRandomLandscape;
} else {
_obj = [_coords, floor(random(360)),_missionLandscape,true] call blck_fnc_spawnCompositionObjects;
};
//diag_log format["_fnc_missionSpawner::->> _obj = %1",_obj];
_objects append _obj;
//diag_log format["_fnc_missionSpawner::->> _objects = %1",_objects];
_obj= nil;
if (blck_debugON) then
{
diag_log format["[blckeagls] missionSpawner:: Landscape spawned: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
uiSleep _delayTime;;
if ((count _missionLootVehicles) > 0) then // spawn loot vehicles
{
{
//diag_log format["spawnMissionCVehicles.sqf _x = %1",_x];
_offset = _x select 1; // offset relative to _coords at which to spawn the vehicle
_pos = [(_coords select 0)+(_offset select 0),(_coords select 1) + (_offset select 1),(_coords select 2)+(_offset select 2)];
_veh = [_x select 0 /* vehicle class name*/, _pos] call blck_fnc_spawnVehicle;
_vehs pushback _veh;
[_veh,_x select 2 /*loot array*/, _x select 3 /*array of values specifying number of items of each loot type to load*/] call blck_fnc_fillBoxes;
}forEach _missionLootVehicles;
};
uiSleep _delayTime;
if (blck_useStatic && (_noEmplacedWeapons > 0)) then
{
private["_static","_count"];
if ( count (_missionEmplacedWeapons) > 0 ) then
{
_static = _missionCfg select 4 select 1;
_count = _missionCfg select 4 select 0;
}
else
{
_static = blck_staticWeapons;
_count = _noEmplacedWeapons;
};
private ["_emplacedGroup","_emplacedPositions"];
_emplacedPositions = [_coords,_count,35,50] call blck_fnc_findPositionsAlongARadius;
//diag_log format["missionSpawner:: _emplacedPositions = %1",_emplacedPositions];
{
_emplacedGroup = [_x,1,1,_aiDifficultyLevel,_coords,1,2,_uniforms,_headGear] call blck_fnc_spawnGroup;
//_emplacedUnits = units _emplacedGroup;
_blck_AllMissionAI = _blck_AllMissionAI + (units _emplacedGroup);
_emplacedWeapon = [_x,_emplacedGroup,blck_staticWeapons,5,15] call blck_fnc_spawnEmplacedWeapon;
_missionAIVehicles pushback _emplacedWeapon;
uiSleep _delayTime;
}forEach _emplacedPositions;
//diag_log format["missionSpawner:: emplaced weapons data: _AI_Vehicles %1 _blck_AllMissionAI %1",_AI_Vehicles,_blck_AllMissionAI];
if (blck_debugON) then
{
diag_log format["[blckeagls] missionSpawner:: Static Weapons Spawned: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
};
uiSleep _delayTime;
//diag_log format["_fnc_missionSpawner:: after adding any static weapons, _blck_AllMissionAI is %1",_blck_AllMissionAI];
//diag_log format["_fnc_missionSpawner:: after adding any vehicle patrols, _blck_AllMissionAI is %1",_blck_AllMissionAI];
//diag_log format["missionSpawner:: _noAIGroups = %1; spawning AI Groups now",_noAIGroups];
uiSleep _delayTime;
private["_unitsToSpawn","_unitsPerGroup","_ResidualUnits","_newGroup"];
_unitsToSpawn = round(_minNoAI + round(random(_maxNoAI - _minNoAI)));
_unitsPerGroup = floor(_unitsToSpawn/_noAIGroups);
_ResidualUnits = _unitsToSpawn - (_unitsPerGroup * _noAIGroups);
//diag_log format["missionSpawner:: _unitsToSpawn %1 ; _unitsPerGroup %2 _ResidualUnits %3",_unitsToSpawn,_unitsPerGroup,_ResidualUnits];
switch (_noAIGroups) do
{
case 1: { // spawn the group near the mission center
//params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear] ];
_newGroup = [_coords,_unitsToSpawn,_unitsToSpawn,_aiDifficultyLevel,_coords,3,18,_uniforms,_headGear] call blck_fnc_spawnGroup;
_newAI = units _newGroup;
_blck_AllMissionAI = _blck_AllMissionAI + _newAI;
//diag_log format["missionSpawner: Spawning Groups: _noAIGroups=1 _newGroup=%1 _newAI = %2",_newGroup, _newAI];
};
case 2: {
//diag_log format["missionSpawner: Spawning Groups: _noAIGroups=2"]; // spawn groups on either side of the mission area
_groupLocations = [_coords,_noAIGroups,15,30] call blck_fnc_findPositionsAlongARadius;
{
private["_adjusttedGroupSize"];
if (_ResidualUnits > 0) then
{
_adjusttedGroupSize = _unitsPerGroup + _ResidualUnits;
_ResidualUnits = 0;
} else {
_adjusttedGroupSize = _unitsPerGroup;
};
_newGroup = [_x,_adjusttedGroupSize,_adjusttedGroupSize,_aiDifficultyLevel,_coords,1,12,_uniforms,_headGear] call blck_fnc_spawnGroup;
_newAI = units _newGroup;
_blck_AllMissionAI = _blck_AllMissionAI + _newAI;
//diag_log format["missionSpawner: Spawning 2 Groups: _newGroup=%1 _newAI = %2",_newGroup, _newAI];
}forEach _groupLocations;
};
case 3: { // spawn one group near the center of the mission and the rest on the perimeter
//diag_log format["missionSpawner: Spawning Groups: _noAIGroups=3"];
_newGroup = [_coords,_unitsPerGroup + _ResidualUnits,_unitsPerGroup + _ResidualUnits,_aiDifficultyLevel,_coords,1,12,_uniforms,_headGear] call blck_fnc_spawnGroup;
_newAI = units _newGroup;
_blck_AllMissionAI = _blck_AllMissionAI + _newAI;
//diag_log format["missionSpawner: Spawning Groups: _noAIGroups=3 _newGroup=%1 _newAI = %2",_newGroup, _newAI];
_groupLocations = [_coords,2,20,35] call blck_fnc_findPositionsAlongARadius;
{
_newGroup = [_x,_unitsPerGroup,_unitsPerGroup,_aiDifficultyLevel,_coords,1,12,_uniforms,_headGear] call blck_fnc_spawnGroup;
_newAI = units _newGroup;
_blck_AllMissionAI = _blck_AllMissionAI + _newAI;
//diag_log format["missionSpawner: Spawning 2 Groups:_newGroup=%1 _newAI = %2",_newGroup, _newAI];
}forEach _groupLocations;
};
default { // spawn one group near the center of the mission and the rest on the perimeter
//diag_log format["missionSpawner: Spawning Groups: _noAIGroups=default"];
_newGroup = [_coords,_unitsPerGroup + _ResidualUnits,_unitsPerGroup + _ResidualUnits,_aiDifficultyLevel,_coords,1,12,_uniforms,_headGear] call blck_fnc_spawnGroup;
_newAI = units _newGroup;
_blck_AllMissionAI = _blck_AllMissionAI + _newAI;
//diag_log format["missionSpawner: Spawning Groups: _noAIGroups=%3 _newGroup=%1 _newAI = %2",_newGroup, _newAI,_noAIGroups];
_groupLocations = [_coords,(_noAIGroups - 1),20,40] call blck_fnc_findPositionsAlongARadius;
{
_newGroup = [_x,_unitsPerGroup,_unitsPerGroup,_aiDifficultyLevel,_coords,1,12,_uniforms,_headGear] call blck_fnc_spawnGroup;
_newAI = units _newGroup;
_blck_AllMissionAI = _blck_AllMissionAI + _newAI;
//diag_log format["missionSpawner: Spawning %3 Groups: _newGroup=%1 _newAI = %2",_newGroup, _newAI,_noAIGroups];
}forEach _groupLocations;
};
};
uiSleep _delayTime;
if (blck_debugON) then
{
diag_log format["[blckeagls] missionSpawner:: AI Patrols Spawned: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
if ((random(1) < _chanceReinforcements)) then
{
_weaponList = blck_WeaponList_Red;
switch (_aiDifficultyLevel) do {
case "blue": {_weaponList = blck_WeaponList_Blue;};
case "red": {_weaponList = blck_WeaponList_Red;};
case "green": {_weaponList = blck_WeaponList_Green;};
case "orange": {_weaponList = blck_WeaponList_Orange;};
default {_weaponList = blck_WeaponList_Blue;};
};
//diag_log format["missionSpawner:: weaponList = %1",_weaponList];
private["_grpReinforcements"];
_grpReinforcements = grpNull;
diag_log format["[blckeagls] missionSpawner:: calling in reinforcements: Current mission: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
[] spawn {
//[_coords,_noPara,_aiDifficultyLevel,_chanceLoot,_reinforcementLootCounts,_weaponList,_uniforms,_headgear,_chanceHeliPatrol] call blck_fnc_Reinforcements;
//waitUntil {_grpReinforcements != grpNull};
//diag_log format["[blckeagls] missionSpawner::reinforcement spawner started: Current mission: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
if !(_grpReinforcements isEqualTo grpNull) then
{
_blck_AllMissionAI = _blck_AllMissionAI + (units _grpReinforcements);
//diag_log format["missionSpawner:: _grpReinforcements = %1",_grpReinforcements];
};
};
if (blck_useVehiclePatrols && (_noVehiclePatrols > 0)) then
{
private["_vehGroup","_patrolVehicle","_vehiclePatrolSpawns"];
_vehiclePatrolSpawns= [_coords,_noVehiclePatrols,45,60] call blck_fnc_findPositionsAlongARadius;
//diag_log format["missionSpawner:: _vehiclePatrolSpawns = %1",_vehiclePatrolSpawns];
//for "_i" from 1 to _noVehiclePatrols do
{
_vehGroup = [_x,3,3,_aiDifficultyLevel,_coords,1,2,_uniforms,_headGear] call blck_fnc_spawnGroup;
//diag_log format["missionSpawner:: group for AI Patrol vehicle spawn: group is %1 with units of %2",_vehGroup, units _vehGroup];
_blck_AllMissionAI = _blck_AllMissionAI + (units _vehGroup);
_randomVehicle = blck_AIPatrolVehicles call BIS_fnc_selectRandom;
//diag_log format["missionSpawner:: vehicle selected is %1", _randomVehicle];
_patrolVehicle = [_coords,_x,_randomVehicle,(_x distance _coords) -5,(_x distance _coords) + 5,_vehGroup] call blck_fnc_spawnVehiclePatrol;
//diag_log format["missionSpawner:: patrol vehicle spawned was %1",_patrolVehicle];
_vehGroup setVariable["groupVehicle",_patrolVehicle,true];
//uiSleep _delayTime;
_AI_Vehicles pushback _patrolVehicle;
}forEach _vehiclePatrolSpawns;
//diag_log format["missionSpawner:: vehicle patrols data: _AI_Vehicles %1 _blck_AllMissionAI %1",_AI_Vehicles,_blck_AllMissionAI];
uiSleep _delayTime;
if (blck_debugON) then
{
diag_log format["[blckeagls] missionSpawner:: Vehicle Patrols Spawned: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
};
// Trigger for mission end
//diag_log format["[blckeagls] mission Spawner _endCondition = %1",_endCondition];
private["_missionComplete"];
_missionComplete = -1;
_endIfPlayerNear = false;
_endIfAIKilled = false;
_startTime = diag_tickTime;
_missionTimedOut = false;
switch (_endCondition) do
{
case "playerNear": {_endIfPlayerNear = true;};
case "allUnitsKilled": {_endIfAIKilled = true;};
case "allKilledOrPlayerNear": {_endIfPlayerNear = true;_endIfAIKilled = true;};
};
//diag_log format["missionSpawner :: _endIfPlayerNear = %1 _endIfAIKilled= %2",_endIfPlayerNear,_endIfAIKilled];
private["_locations"];
_locations = [_coords] + _crates;
//diag_log format["missionSpawner:: Waiting for player to satisfy mission end criteria of _endIfPlayerNear %1 with _endIfAIKilled %2",_endIfPlayerNear,_endIfAIKilled];
while {_missionComplete isEqualTo -1} do
{
if (blck_debugLevel isEqualTo 3) then
{
uiSleep 120;
_missionComplete = 1;
} else {
if (_endIfPlayerNear) then {
if ( { (isPlayer _x) && ([_x,_locations,20] call blck_fnc_playerInRange) && (vehicle _x == _x) } count allPlayers > 0) then {
_missionComplete = 1;
};
};
//diag_log format["missionSpawner:: count alive _blck_AllMissionAI = %1",{alive _x} count _blck_AllMissionAI];
if (_endIfAIKilled) then {
if (({alive _x} count _blck_AllMissionAI) < 1 ) then {
_missionComplete = 1;
//diag_log format["missionSpawner:: _blck_AllMissionAI = %1","testing case _endIfAIKilled"];
};
};
uiSleep 2;
};
};
if (blck_debugON) then
{
diag_log format["[blckeagls] missionSpawner:: Mission completion criteria fulfilled: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
if (blck_useSignalEnd) then
{
//diag_log format["**** Minor\SM1.sqf:: _crate = %1",_crates select 0];
[_crates select 0] spawn blck_fnc_signalEnd;
if (blck_debugON) then
{
diag_log format["[blckeagls] missionSpawner:: SignalEnd called: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
};
[_mines] spawn blck_fnc_clearMines;
[_objects, blck_cleanupCompositionTimer] call blck_fnc_addObjToQue;
[_blck_AllMissionAI,blck_AliveAICleanUpTime] call blck_fnc_addLiveAItoQue;
[["end",_endMsg,_blck_localMissionMarker select 2]] call blck_fnc_messageplayers;
[_blck_localMissionMarker select 1, _missionType] execVM "debug\missionCompleteMarker.sqf";
[_blck_localMissionMarker select 0] execVM "debug\deleteMarker.sqf";
//[_blck_localMissionMarker select 0,"Completed"] call blck_fnc_updateMissionQue;
diag_log format["[blckeagls] missionSpawner:: end of mission: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};

View File

@ -1,459 +0,0 @@
/*
Generic Mission Spawner
for DBD Clan
By Ghostrider-DBD-
Copyright 2016
*/
private ["_crates","_aiGroup","_objects","_vehicles","_groupPatrolRadius","_missionLandscape","_compositions","_missionCfg","_compSel","_mines","_blck_AllMissionAI","_blck_localMissionMarker","_AI_Vehicles"];
params["_coords","_missionType","_aiDifficultyLevel"];
/*
_aiDifficultyLevel = _this select 2; // "blue","red","green" and "orange"
*/
// *************************
// Once the entire mission system can support timeout cleanup of vehicles (specifically the AI vehicle patrols) then each mission layout can define this varialbe. Until then disable timouts.
//////////////////////////////////
// To simplify debugging and also reduce load on server besure only once instance of the mission spawner is initializing at a time.
/////////////////////////////////
waitUntil {blck_missionSpawning isEqualTo false};
blck_missionSpawning = true;
diag_log format["[blckeagls] missionSpawner:: INITIALIZING USING MISSION PARAMETERS mission: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
private["_chanceHeliPatrol","_noPara","_reinforcementLootCounts","_chanceLoot"];
if (isNil "_chanceReinforcements") then
{
_chanceReinforcements = 0;
_noPara = 0;
_reinforcementLootCounts = [0,0,0,0,0,0];
_chanceHeliPatrol = 0;
_chanceLoot = 0;
};
private["_timeOut"]; // _timeOut is the time in seconds after which a mission is deactivated.
if (isNil "_markerColor") then {_markerColor = "ColorBlack"};
if (isNil "_markerType") then {_markerType = ["mil_box",[]]};
if (isNil "_timeOut") then {_timeOut = -1;};
if (isNil "_noPara") then {_noPara = 0};
if (isNil "_chanceHeliPatrol") then {_chanceHeliPatrol = 0;};
if (isNil "_chanceLoot") then {_chanceLoot = 0};
if (isNil "_reinforcementLootCounts") then
{
_weap = 2 + floor(random(4));
_mags = 5 + floor(random(6));
_backpacks = 1 + floor(random(2));
_optics = 1 + floor(random(6));
_loadout = 1 + floor(random(3));
_reinforcementLootCounts = [_weap,_mags,_optics,0,0,_backpacks];
//diag_log "missionSpawner:: default values used for _reinforcementLootCounts";
}
else
{
//diag_log "missionSpawner:: Mission specific values used for _reinforcementLootCounts";
};
if (blck_debugON) then {
diag_log format["(2) [blckEagle] REINFORCEMENT PARAMETERS: Mission Reinforcement Parameters for missionType %5: changeReinforcements %1 numAI %2 changePatrol %3 chanceLoot %4",_chanceReinforcements,_noPara,_chanceHeliPatrol,_chanceLoot,_missionType];
};
private["_useMines"];
if (isNil "_useMines") then {_useMines = blck_useMines; /*diag_log "[blckEagles] Using default setting for _useMines";*/};
_objects = [];
_mines = [];
_crates = [];
_aiGroup = [];
_missionAIVehicles = [];
_blck_AllMissionAI = [];
_AI_Vehicles = [];
_blck_localMissionMarker = [_missionType,_coords,"","",_markerColor,_markerType];
_delayTime = 1;
_groupPatrolRadius = 50;
if (blck_labelMapMarkers select 0) then
{
//diag_log "SM1.sqf: labeling map markers *****";
_blck_localMissionMarker set [2, _markerMissionName];
};
if !(blck_preciseMapMarkers) then
{
//diag_log "SM1.sqf: Map marker will be OFFSET from the mission position";
_blck_localMissionMarker set [1,[_coords,75] call blck_fnc_randomPosition];
};
_blck_localMissionMarker set [3,blck_labelMapMarkers select 1]; // Use an arrow labeled with the mission name?
["start",_startMsg,_blck_localMissionMarker select 2] call blck_fnc_messageplayers;
[_blck_localMissionMarker] execVM "debug\spawnMarker.sqf";
_fn_timedOut = {
params["_startTime"];
private["_return"];
_return = ( (diag_tickTime - _startTime) > blck_MissionTimout );
_return;
};
_fn_playerWithinRange = {
params["_pos"];
private["_return"];
_return = false;
{
if (isPlayer _x and _x distance _pos <= blck_TriggerDistance) then {_return = true};
}forEach playableunits;
_return;
};
uiSleep 1;
/////////////////////////////
// Everything has been set up for the mission and it is now waiting to be triggered by a nearby player or to time out.
// Lets let other instances of the mission spawner know it is OK to go ahead
////////////////////////////
blck_missionSpawning = false;
if (DBD_debugON) then {diag_log format["missionSpawner:: WAITING FOR PLAYER to trigger the mission for missionType %1",_missionType];};
private["_wait","_missionStartTime","_playerInRange","_missionTimedOut"];
_missionStartTime = diag_tickTime;
_playerInRange = false;
_missionTimedOut = false;
_wait = true;
while {_wait} do
{
uiSleep 1;
if ([_coords] call _fn_playerWithinRange) then
{
_wait = false;
_playerInRange = true;
} else
{
if ( (diag_tickTime - _missionStartTime) > blck_MissionTimout ) then
{
_wait = false;
_missionTimedOut = true;
} else {
if (blck_debugLevel == 3) then
{
sleep 120;
_wait = false;
_playerInRange = true;
diag_log format["(3) _fnc_missionSpawner:: -->> ACTIVATION Mission of missionType %1 activated based on blck_debugLevel == 3",_missionType];
};
};
};
};
//waitUntil{ { (isPlayer _x && _x distance _coords <= blck_TriggerDistance /*&& vehicle _x == _x*/) || ([_missionStartTime] call _fn_timedOut) } count playableunits > 0 };
if (blck_debugON) then
{
diag_log format["missionSpawner:: MISSION TRIGGER contition _missionType = %4 and playerInRange %1 and timout = %2 and blck_debugLevel = %3",_playerInRange, _missionTimedOut,blck_debugLevel,_missionType];
};
if (_missionTimedOut) exitWith
{
//["timeOut",_endMsg,_blck_localMissionMarker select 2] call blck_fnc_messageplayers;
[_blck_localMissionMarker select 0] execVM "debug\deleteMarker.sqf";
_blck_localMissionMarker set [1,[0,0,0]];
_blck_localMissionMarker set [2,""];
[_objects, 1] spawn blck_fnc_cleanupObjects;
if (blck_debugON) then
{
diag_log format["[blckeagls] missionSpawner:: Mission Timed Out: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
};
if (_playerInRange || blck_debugLevel == 3) then
{
if (blck_debugON) then
{ diag_log format["[blckeagls] missionSpawner:: -- >> Mission tripped by nearby player: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
if (count _missionLootBoxes > 0) then
{
_crates = [_coords,_missionCfg select 2/* array of crates*/] call blck_fnc_spawnMissionCrates;
}
else
{
_crates = [_coords,[[selectRandom blck_crateTypes /*"Box_NATO_Wps_F"*/,[0,0,0],_crateLoot,_lootCounts]]] call blck_fnc_spawnMissionCrates;
};
_objects = _objects + _crates;
if (blck_debugON) then
{
diag_log format["[blckeagls] missionSpawner:: CRATES SPAWNED: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
uiSleep _delayTime;
if (blck_SmokeAtMissions select 0) then // spawn a fire and smoke near the crate
{
private ["_temp"];
_temp = [_coords,blck_SmokeAtMissions select 1] call blck_fnc_smokeAtCrates;
_objects = _objects + _temp;
};
uiSleep _delayTime;
if (_useMines) then
{
_mines = [_coords] call blck_fnc_spawnMines;
//waitUntil{!(_mines isEqualTo [];);
uiSleep _delayTime;;
};
uiSleep _delayTime;
if (_missionLandscapeMode isEqualTo "random") then
{
_objects = [_coords,_missionLandscape, 3, 15, 2] call blck_fnc_spawnRandomLandscape;
} else {
_objects = [_coords, round(random(360)),_missionLandscape,true] call blck_fnc_spawnCompositionObjects;
};
if (blck_debugON) then
{
diag_log format["[blckeagls] missionSpawner:: LANDSCAPE SPAWNED: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
uiSleep _delayTime;;
if ((count _missionLootVehicles) > 0) then // spawn loot vehicles
{
{
//diag_log format["spawnMissionCVehicles.sqf _x = %1",_x];
_offset = _x select 1; // offset relative to _coords at which to spawn the vehicle
_pos = [(_coords select 0)+(_offset select 0),(_coords select 1) + (_offset select 1),(_coords select 2)+(_offset select 2)];
_veh = [_x select 0 /* vehicle class name*/, _pos] call blck_fnc_spawnVehicle;
_vehs pushback _veh;
[_veh,_x select 2 /*loot array*/, _x select 3 /*array of values specifying number of items of each loot type to load*/] call blck_fnc_fillBoxes;
}forEach _missionLootVehicles;
uiSleep _delayTime;
};
if (blck_useStatic && (_noEmplacedWeapons > 0)) then
{
private["_static","_count"];
if ( count (_missionEmplacedWeapons) > 0 ) then
{
_static = _missionCfg select 4 select 1;
_count = _missionCfg select 4 select 0;
}
else
{
_static = blck_staticWeapons;
_count = _noEmplacedWeapons;
};
private ["_emplacedGroup","_emplacedPositions"];
_emplacedPositions = [_coords,_count,35,50] call blck_fnc_findPositionsAlongARadius;
//diag_log format["missionSpawner:: _emplacedPositions = %1",_emplacedPositions];
{
_emplacedGroup = [_x,1,1,_aiDifficultyLevel,_coords,1,2,_uniforms,_headGear] call blck_fnc_spawnGroup;
//_emplacedUnits = units _emplacedGroup;
_blck_AllMissionAI = _blck_AllMissionAI + (units _emplacedGroup);
_emplacedWeapon = [_x,_emplacedGroup,blck_staticWeapons,5,15] call blck_fnc_spawnEmplacedWeapon;
_missionAIVehicles pushback _emplacedWeapon;
uiSleep _delayTime;
}forEach _emplacedPositions;
//diag_log format["missionSpawner:: emplaced weapons data: _AI_Vehicles %1 _blck_AllMissionAI %1",_AI_Vehicles,_blck_AllMissionAI];
if (blck_debugON) then
{
diag_log format["[blckeagls] missionSpawner:: STATIC WEAPONS SPAWNED: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
};
//diag_log format["_fnc_missionSpawner:: after adding any static weapons, _blck_AllMissionAI is %1",_blck_AllMissionAI];
if (blck_useVehiclePatrols && (_noVehiclePatrols > 0)) then
{
private["_vehGroup","_patrolVehicle","_vehiclePatrolSpawns"];
_vehiclePatrolSpawns= [_coords,_noVehiclePatrols,45,60] call blck_fnc_findPositionsAlongARadius;
diag_log format["missionSpawner:: _vehiclePatrolSpawns = %1",_vehiclePatrolSpawns];
//for "_i" from 1 to _noVehiclePatrols do
{
_vehGroup = [_x,3,3,_aiDifficultyLevel,_coords,1,2,_uniforms,_headGear] call blck_fnc_spawnGroup;
//diag_log format["missionSpawner:: group for AI Patrol vehicle spawn: group is %1 with units of %2",_vehGroup, units _vehGroup];
_blck_AllMissionAI = _blck_AllMissionAI + (units _vehGroup);
_randomVehicle = blck_AIPatrolVehicles call BIS_fnc_selectRandom;
//diag_log format["missionSpawner:: vehicle selected is %1", _randomVehicle];
_patrolVehicle = [_coords,_x,_randomVehicle,(_x distance _coords) -5,(_x distance _coords) + 5,_vehGroup] call blck_fnc_spawnVehiclePatrol;
//diag_log format["missionSpawner:: patrol vehicle spawned was %1",_patrolVehicle];
_vehGroup setVariable["groupVehicle",_patrolVehicle,true];
//uiSleep _delayTime;
_AI_Vehicles pushback _patrolVehicle;
}forEach _vehiclePatrolSpawns;
//diag_log format["missionSpawner:: vehicle patrols data: _AI_Vehicles %1 _blck_AllMissionAI %1",_AI_Vehicles,_blck_AllMissionAI];
uiSleep _delayTime;
if (blck_debugON) then
{
diag_log format["[blckeagls] missionSpawner:: VEHICLE PATROLS SPAWNED: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
};
//diag_log format["_fnc_missionSpawner:: after adding any vehicle patrols, _blck_AllMissionAI is %1",_blck_AllMissionAI];
//diag_log format["missionSpawner:: _noAIGroups = %1; spawning AI Groups now",_noAIGroups];
private["_unitsToSpawn","_unitsPerGroup","_ResidualUnits","_newGroup"];
_unitsToSpawn = round(_minNoAI + round(random(_maxNoAI - _minNoAI)));
_unitsPerGroup = floor(_unitsToSpawn/_noAIGroups);
_ResidualUnits = _unitsToSpawn - (_unitsPerGroup * _noAIGroups);
//diag_log format["missionSpawner:: _unitsToSpawn %1 ; _unitsPerGroup %2 _ResidualUnits %3",_unitsToSpawn,_unitsPerGroup,_ResidualUnits];
switch (_noAIGroups) do
{
case 1: { // spawn the group near the mission center
//params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear] ];
_newGroup = [_coords,_unitsToSpawn,_unitsToSpawn,_aiDifficultyLevel,_coords,3,18,_uniforms,_headGear] call blck_fnc_spawnGroup;
_newAI = units _newGroup;
_blck_AllMissionAI = _blck_AllMissionAI + _newAI;
//diag_log format["missionSpawner: Spawning Groups: _noAIGroups=1 _newGroup=%1 _newAI = %2",_newGroup, _newAI];
};
case 2: {
//diag_log format["missionSpawner: Spawning Groups: _noAIGroups=2"]; // spawn groups on either side of the mission area
_groupLocations = [_coords,_noAIGroups,15,30] call blck_fnc_findPositionsAlongARadius;
{
private["_adjusttedGroupSize"];
if (_ResidualUnits > 0) then
{
_adjusttedGroupSize = _unitsPerGroup + _ResidualUnits;
_ResidualUnits = 0;
} else {
_adjusttedGroupSize = _unitsPerGroup;
};
_newGroup = [_x,_adjusttedGroupSize,_adjusttedGroupSize,_aiDifficultyLevel,_coords,1,12,_uniforms,_headGear] call blck_fnc_spawnGroup;
_newAI = units _newGroup;
_blck_AllMissionAI = _blck_AllMissionAI + _newAI;
//diag_log format["missionSpawner: Spawning 2 Groups: _newGroup=%1 _newAI = %2",_newGroup, _newAI];
}forEach _groupLocations;
};
case 3: { // spawn one group near the center of the mission and the rest on the perimeter
//diag_log format["missionSpawner: Spawning Groups: _noAIGroups=3"];
_newGroup = [_coords,_unitsPerGroup + _ResidualUnits,_unitsPerGroup + _ResidualUnits,_aiDifficultyLevel,_coords,1,12,_uniforms,_headGear] call blck_fnc_spawnGroup;
_newAI = units _newGroup;
_blck_AllMissionAI = _blck_AllMissionAI + _newAI;
//diag_log format["missionSpawner: Spawning Groups: _noAIGroups=3 _newGroup=%1 _newAI = %2",_newGroup, _newAI];
_groupLocations = [_coords,2,20,35] call blck_fnc_findPositionsAlongARadius;
{
_newGroup = [_x,_unitsPerGroup,_unitsPerGroup,_aiDifficultyLevel,_coords,1,12,_uniforms,_headGear] call blck_fnc_spawnGroup;
_newAI = units _newGroup;
_blck_AllMissionAI = _blck_AllMissionAI + _newAI;
//diag_log format["missionSpawner: Spawning 2 Groups:_newGroup=%1 _newAI = %2",_newGroup, _newAI];
}forEach _groupLocations;
};
default { // spawn one group near the center of the mission and the rest on the perimeter
//diag_log format["missionSpawner: Spawning Groups: _noAIGroups=default"];
_newGroup = [_coords,_unitsPerGroup + _ResidualUnits,_unitsPerGroup + _ResidualUnits,_aiDifficultyLevel,_coords,1,12,_uniforms,_headGear] call blck_fnc_spawnGroup;
_newAI = units _newGroup;
_blck_AllMissionAI = _blck_AllMissionAI + _newAI;
//diag_log format["missionSpawner: Spawning Groups: _noAIGroups=%3 _newGroup=%1 _newAI = %2",_newGroup, _newAI,_noAIGroups];
_groupLocations = [_coords,(_noAIGroups - 1),20,40] call blck_fnc_findPositionsAlongARadius;
{
_newGroup = [_x,_unitsPerGroup,_unitsPerGroup,_aiDifficultyLevel,_coords,1,12,_uniforms,_headGear] call blck_fnc_spawnGroup;
_newAI = units _newGroup;
_blck_AllMissionAI = _blck_AllMissionAI + _newAI;
//diag_log format["missionSpawner: Spawning %3 Groups: _newGroup=%1 _newAI = %2",_newGroup, _newAI,_noAIGroups];
}forEach _groupLocations;
};
};
if (blck_debugON) then
{
diag_log format["[blckeagls] missionSpawner:: AI PATROLS SPAWNED: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
if ((random(1) < _chanceReinforcements)) then
{
_weaponList = blck_WeaponList_Red;
switch (_aiDifficultyLevel) do {
case "blue": {_weaponList = blck_WeaponList_Blue;};
case "red": {_weaponList = blck_WeaponList_Red;};
case "green": {_weaponList = blck_WeaponList_Green;};
case "orange": {_weaponList = blck_WeaponList_Orange;};
default {_weaponList = blck_WeaponList_Blue;};
};
diag_log format["missionSpawner:: weaponList = %1",_weaponList];
private["_grpReinforcements"];
_grpReinforcements = grpNull;
diag_log format["[blckeagls] missionSpawner:: calling in reinforcements: Current mission: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
[] spawn {
//[_coords,_noPara,_aiDifficultyLevel,_chanceLoot,_reinforcementLootCounts,_weaponList,_uniforms,_headgear,_chanceHeliPatrol] call blck_fnc_Reinforcements;
//waitUntil {_grpReinforcements != grpNull};
//diag_log format["[blckeagls] missionSpawner::reinforcement spawner started: Current mission: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
if !(_grpReinforcements isEqualTo grpNull) then
{
_blck_AllMissionAI = _blck_AllMissionAI + (units _grpReinforcements);
//diag_log format["missionSpawner:: _grpReinforcements = %1",_grpReinforcements];
};
};
// Trigger for mission end
//diag_log format["[blckeagls] mission Spawner _endCondition = %1",_endCondition];
private["_missionComplete"];
_missionComplete = -1;
_endIfPlayerNear = false;
_endIfAIKilled = false;
_startTime = diag_tickTime;
_missionTimedOut = false;
switch (_endCondition) do
{
case "playerNear": {_endIfPlayerNear = true;};
case "allUnitsKilled": {_endIfAIKilled = true;};
case "allKilledOrPlayerNear": {_endIfPlayerNear = true;_endIfAIKilled = true;};
};
//diag_log format["missionSpawner :: _endIfPlayerNear = %1 _endIfAIKilled= %2",_endIfPlayerNear,_endIfAIKilled];
private["_locations"];
_locations = [_coords] + _crates;
//diag_log format["missionSpawner:: Waiting for player to satisfy mission end criteria of _endIfPlayerNear %1 with _endIfAIKilled %2",_endIfPlayerNear,_endIfAIKilled];
while {_missionComplete == -1} do
{
if (_endIfPlayerNear) then {
if ( { (isPlayer _x) && ([_x,_locations,20] call blck_fnc_playerInRange) && (vehicle _x == _x) } count playableunits > 0) then {
_missionComplete = 1;
};
};
//diag_log format["missionSpawner:: count alive _blck_AllMissionAI = %1",{alive _x} count _blck_AllMissionAI];
if (_endIfAIKilled) then {
if (({alive _x} count _blck_AllMissionAI) < 1 ) then {
_missionComplete = 1;
//diag_log format["missionSpawner:: _blck_AllMissionAI = %1","testing case _endIfAIKilled"];
};
};
if (blck_debugLevel == 3) then
{
uiSleep 60;
_missionComplete = 1;
diag_log format["_fnc_missionSpawner:: -- >> Mission of missionType %1 was Tripped based on blck_debugLevel == 3",_missionType];
};
uiSleep 2;
};
if (blck_debugON) then
{
diag_log format["[blckeagls] missionSpawner:: Mission COMPLETION CRITERIA FULFILLED: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4 : blck_debugLevel = %5",_coords,_missionType,_aiDifficultyLevel,_markerMissionName,blck_debugLevel];
};
if (blck_useSignalEnd) then
{
//diag_log format["**** Minor\SM1.sqf:: _crate = %1",_crates select 0];
[_crates select 0] spawn blck_fnc_signalEnd;
if (blck_debugON) then
{
diag_log format["[blckeagls] missionSpawner:: SignalEnd called: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
};
[_mines] spawn blck_fnc_clearMines;
[_objects, blck_cleanupCompositionTimer] call blck_fnc_addObjToQue;
[_blck_AllMissionAI,blck_AliveAICleanUpTime] call blck_fnc_addLiveAItoQue;
["end",_endMsg,_blck_localMissionMarker select 2] call blck_fnc_messageplayers;
[_blck_localMissionMarker select 1, _missionType] execVM "debug\missionCompleteMarker.sqf";
[_blck_localMissionMarker select 0] execVM "debug\deleteMarker.sqf";
[_blck_localMissionMarker select 0,"Completed"] call blck_fnc_updateMissionQue;
diag_log format["[blckeagls] missionSpawner:: end of mission: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};

View File

@ -246,42 +246,7 @@ if (_playerInRange) then
}forEach _missionLootVehicles;
};
uiSleep _delayTime;
if (blck_useStatic && (_noEmplacedWeapons > 0)) then
{
private["_static","_count"];
if ( count (_missionEmplacedWeapons) > 0 ) then
{
_static = _missionCfg select 4 select 1;
_count = _missionCfg select 4 select 0;
}
else
{
_static = blck_staticWeapons;
_count = _noEmplacedWeapons;
};
private ["_emplacedGroup","_emplacedPositions"];
_emplacedPositions = [_coords,_count,35,50] call blck_fnc_findPositionsAlongARadius;
//diag_log format["missionSpawner:: _emplacedPositions = %1",_emplacedPositions];
{
_emplacedGroup = [_x,1,1,_aiDifficultyLevel,_coords,1,2,_uniforms,_headGear] call blck_fnc_spawnGroup;
if !(isNull _emplacedGroup) then
{
_blck_AllMissionAI = _blck_AllMissionAI + (units _emplacedGroup);
_emplacedWeapon = [_x,_emplacedGroup,blck_staticWeapons,5,15] call blck_fnc_spawnEmplacedWeapon;
_missionAIVehicles pushback _emplacedWeapon;
uiSleep _delayTime;
} exitWith {
_abortMissionSpawner = true;
};
}forEach _emplacedPositions;
//diag_log format["missionSpawner:: emplaced weapons data: _AI_Vehicles %1 _blck_AllMissionAI %1",_AI_Vehicles,_blck_AllMissionAI];
if (blck_debugON) then
{
diag_log format["[blckeagls] missionSpawner:: Static Weapons Spawned: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
};
uiSleep _delayTime;
//diag_log format["_fnc_missionSpawner:: after adding any static weapons, _blck_AllMissionAI is %1",_blck_AllMissionAI];
@ -361,33 +326,51 @@ if (_playerInRange) then
}forEach _groupLocations;
};
};
uiSleep _delayTime;
if (blck_debugON) then
{
diag_log format["[blckeagls] missionSpawner:: AI Patrols Spawned: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
if ((random(1) < _chanceReinforcements)) then
uiSleep _delayTime;
if (!_abortMissionSpawner && blck_useStatic && (_noEmplacedWeapons > 0)) then
{
_weaponList = blck_WeaponList_Red;
switch (_aiDifficultyLevel) do {
case "blue": {_weaponList = blck_WeaponList_Blue;};
case "red": {_weaponList = blck_WeaponList_Red;};
case "green": {_weaponList = blck_WeaponList_Green;};
case "orange": {_weaponList = blck_WeaponList_Orange;};
default {_weaponList = blck_WeaponList_Blue;};
private["_static","_count"];
if ( count (_missionEmplacedWeapons) > 0 ) then
{
_static = _missionCfg select 4 select 1;
_count = _missionCfg select 4 select 0;
}
else
{
_static = blck_staticWeapons;
_count = _noEmplacedWeapons;
};
private ["_emplacedGroup","_emplacedPositions"];
diag_log format["[blckeagls] missionSpawner:: calling in reinforcements: Current mission: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
[] spawn {
//[_coords,_noPara,_aiDifficultyLevel,_chanceLoot,_reinforcementLootCounts,_weaponList,_uniforms,_headgear,_chanceHeliPatrol] call blck_fnc_Reinforcements;
//waitUntil {_grpReinforcements != grpNull};
//diag_log format["[blckeagls] missionSpawner::reinforcement spawner started: Current mission: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
_emplacedPositions = [_coords,_count,35,50] call blck_fnc_findPositionsAlongARadius;
//diag_log format["missionSpawner:: _emplacedPositions = %1",_emplacedPositions];
{
_emplacedGroup = [_x,1,1,_aiDifficultyLevel,_coords,1,2,_uniforms,_headGear] call blck_fnc_spawnGroup;
if !(isNull _emplacedGroup) then
{
_blck_AllMissionAI = _blck_AllMissionAI + (units _emplacedGroup);
_emplacedWeapon = [_x,_emplacedGroup,blck_staticWeapons,5,15] call blck_fnc_spawnEmplacedWeapon;
_missionAIVehicles pushback _emplacedWeapon;
uiSleep _delayTime;
} exitWith {
_abortMissionSpawner = true;
};
}forEach _emplacedPositions;
//diag_log format["missionSpawner:: emplaced weapons data: _AI_Vehicles %1 _blck_AllMissionAI %1",_AI_Vehicles,_blck_AllMissionAI];
if (blck_debugON) then
{
diag_log format["[blckeagls] missionSpawner:: Static Weapons Spawned: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
};
if (blck_useVehiclePatrols && (_noVehiclePatrols > 0)) then
uiSleep _delayTime;
if (!_abortMissionSpawner && blck_useVehiclePatrols && (_noVehiclePatrols > 0)) then
{
private["_vehGroup","_patrolVehicle","_vehiclePatrolSpawns"];
_vehiclePatrolSpawns= [_coords,_noVehiclePatrols,45,60] call blck_fnc_findPositionsAlongARadius;
@ -406,14 +389,42 @@ if (_playerInRange) then
//uiSleep _delayTime;
_AI_Vehicles pushback _patrolVehicle;
}forEach _vehiclePatrolSpawns;
//diag_log format["missionSpawner:: vehicle patrols data: _AI_Vehicles %1 _blck_AllMissionAI %1",_AI_Vehicles,_blck_AllMissionAI];
uiSleep _delayTime;
if (blck_debugON) then
if (blck_debugLevel > 1) then
{
diag_log format["[blckeagls] missionSpawner:: Vehicle Patrols Spawned: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
};
if (!_abortMissionSpawner && (random(1) < _chanceReinforcements)) then
{
/*_weaponList = blck_WeaponList_Red;
switch (_aiDifficultyLevel) do {
case "blue": {_weaponList = blck_WeaponList_Blue;};
case "red": {_weaponList = blck_WeaponList_Red;};
case "green": {_weaponList = blck_WeaponList_Green;};
case "orange": {_weaponList = blck_WeaponList_Orange;};
default {_weaponList = blck_WeaponList_Blue;};
};
diag_log format["[blckeagls] missionSpawner:: calling in reinforcements: Current mission: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
[] spawn {
// Note that we need to be able to access the group spawned by the reinforcements function in order to add those AI to the list of live AI for the mission.
// Thus, we cannot use spawn to execute the function which creates a minor limitation in that if the mission is small it could be completed before AI are spawned and recorded.
// Trying to work around this by spawning
if (blck_debugLevel > 1) then {diag_log format["[blckeagls] missionSpawner::reinforcement spawner started: Current mission: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];};
_grpReinforcements = [_coords,_noPara,_aiDifficultyLevel,_chanceLoot,_reinforcementLootCounts,_weaponList,_uniforms,_headgear,_chanceHeliPatrol] call blck_fnc_callInReinforcements;
if (blck_debugLevel > 1) then {diag_log format["[blckeagls] missionSpawner::reinforcement spawner return _grpReinforcements = %1",_grpReinforcements];};
if (!isNull _grpReinforcements) then
{
_blck_AllMissionAI = _blck_AllMissionAI + (units _grpReinforcements);
};
//};
*/
};
if (_abortMissionSpawner) then
{
// discard everything
@ -473,7 +484,7 @@ if (_playerInRange) then
};
};
if (blck_debugON) then
if (blck_debugLevel > 2) then
{
diag_log format["[blckeagls] missionSpawner:: Mission completion criteria fulfilled: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};
@ -483,7 +494,7 @@ if (_playerInRange) then
//diag_log format["**** Minor\SM1.sqf:: _crate = %1",_crates select 0];
[_crates select 0] spawn blck_fnc_signalEnd;
if (blck_debugON) then
if (blck_debugLevel > 2) then
{
diag_log format["[blckeagls] missionSpawner:: SignalEnd called: _cords %1 : _missionType %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_missionType,_aiDifficultyLevel,_markerMissionName];
};

View File

@ -0,0 +1,106 @@
/*
Author: Ghostrider-DbD-
Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP
License: Attribution-NonCommercial-ShareAlike 4.0 International
call with
[
_pos,
_numAI,
_skillAI,
_chanceLoot,
_loogCounts,
_weapons,
_uniforms,
_headgear,
_patrol
] call blck_spawnReinforcements
*/
params["_pos","_numAI","_skillAI","_chanceLoot","_lootCounts","_weapons","_uniforms","_headgear","_patrol"];
diag_log format["reinforcements:: Called with parameters _pos %1 _numAI %2 _skillAI %3 _chanceLoot %4",_pos,_numAI,_skillAI,_chanceLoot];
private["_chopperType","_chopperTypeArmed","_spawnPos","_spawnVector","_spawnDistance"];
// spawn an unarmed heli
_chopperType = selectRandom["B_Heli_Transport_03_unarmed_EPOCH","O_Heli_Light_02_unarmed_EPOCH","I_Heli_Transport_02_EPOCH"];
diag_log format["reinforcements:: _chopperType seleted = %1",_chopperType];
_spawnVector = round(random(360));
_spawnDistance = 1000; // + floor(random(1500)); // We need the heli to be on-site quickly to minimize the chance that a small mission has been completed before the paratroops are deployed and added to the list of live AI for the mission
_dropLoot = (random(1) < _chanceLoot);
// Use the new functionality of getPos
// https://community.bistudio.com/wiki/getPos
_spawnPos = _pos getPos [_spawnDistance,_spawnVector];
diag_log format["reinforcements:: vector was %1 with distance %2 yielding a spawn position of %3 at distance from _pos of %4",_spawnVector,_spawnDistance,_spawnPos, (_pos distance2d _spawnPos)];
private["_supplyHeli"];
//create helicopter and spawn it
_supplyHeli = createVehicle [_chopperType, _spawnPos, [], 90, "FLY"];
_supplyHeli setDir (_spawnVector -180);
_supplyHeli setFuel 1;
_supplyHeli engineOn true;
_supplyHeli flyInHeight 250;
_supplyHeli setVehicleLock "LOCKED";
_supplyHeli addEventHandler ["GetOut",{(_this select 0) setFuel 0;(_this select 0) setDamage 1;}];
clearWeaponCargoGlobal _supplyHeli;
clearMagazineCargoGlobal _supplyHeli;
clearItemCargoGlobal _supplyHeli;
clearBackpackCargoGlobal _supplyHeli;
[_supplyHeli,blck_ModType] call blck_fnc_protectVehicle;
private["_grpPilot","_unitPilot"];
// add pilot to helicopter //add pilot (single group) to supply helicopter
_grpPilot = createGroup blck_AI_Side;
_grpPilot setBehaviour "CARELESS";
_grpPilot setCombatMode "RED";
_grpPilot setSpeedMode "FULL";
_grpPilot allowFleeing 0;
_grpPilot setVariable ["parameters",[_supplyHeli,_numAI,_skillAI,_weapons,_uniforms,_headgear,_dropLoot,_lootCounts,_patrol]];
// create a group for our paratroops
private["_paraGroup"];
_paraGroup = createGroup blck_AI_Side; // ; Group changed for Exile for which player is RESISTANCE.
_supplyHeli setVariable["paraGroup",_paraGroup];
_paraGroup setcombatmode blck_combatMode;
_paraGroup allowfleeing 0;
_paraGroup setspeedmode "FULL";
_paraGroup setFormation blck_groupFormation;
_paraGroup setVariable ["blck_group",true,true];
_unitPilot = _grpPilot createUnit ["I_helipilot_F", getPos _supplyHeli, [], 0, "FORM"];
_unitPilot setSkill 1;
_unitPilot assignAsDriver _supplyHeli;
_unitPilot moveInDriver _supplyHeli;
_grpPilot selectLeader _unitPilot;
_grpPilot setVariable["paraGroup",_paraGroup];
//set waypoint for helicopter
private["_wpDestination"];
[_grpPilot, 0] setWPPos _pos;
[_grpPilot, 0] setWaypointType "MOVE";
[_grpPilot, 0] setWaypointSpeed "FULL";
[_grpPilot, 0] setWaypointBehaviour "CARELESS";
[_grpPilot, 0] setWaypointCompletionRadius 30;
[_grpPilot, 0] setWaypointStatements ["true","(this) spawn blck_fnc_dropReinforcements;"];
//[_grpPilot,0] setWaypointTimeout [0.5,0.5,0.5];
_grpPilot setCurrentWaypoint [_grpPilot,0];
//Announce reinforcements are inbound to nearby players
private["_message"];
_message = "A Helicopter Carrying Reinforcements was Spotted Near You!";
[["reinforcements",_message,_pos]] call blck_fnc_messageplayers;
diag_log "reinforcements:: helispawned and inbound, message sent";
// add a loop here that waits until the paragroup has been spawned so that we can return it.
//waitUntil {!isNull (_supplyHeli getVariable["paraGroup",grpNull])};
//_grp = _supplyHeli getVariable["paraGroup"];
//_grp

View File

@ -0,0 +1,106 @@
/*
Author: Ghostrider-DbD-
Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP
License: Attribution-NonCommercial-ShareAlike 4.0 International
call with
[
_pos,
_numAI,
_skillAI,
_chanceLoot,
_loogCounts,
_weapons,
_uniforms,
_headgear,
_patrol
] call blck_spawnReinforcements
*/
params["_pos","_numAI","_skillAI","_chanceLoot","_lootCounts","_weapons","_uniforms","_headgear","_patrol"];
diag_log format["reinforcements:: Called with parameters _pos %1 _numAI %2 _skillAI %3 _chanceLoot %4",_pos,_numAI,_skillAI,_chanceLoot];
private["_chopperType","_chopperTypeArmed","_spawnPos","_spawnVector","_spawnDistance"];
// spawn an unarmed heli
_chopperType = selectRandom["B_Heli_Transport_03_unarmed_EPOCH","O_Heli_Light_02_unarmed_EPOCH","I_Heli_Transport_02_EPOCH"];
diag_log format["reinforcements:: _chopperType seleted = %1",_chopperType];
_spawnVector = round(random(360));
_spawnDistance = 1000; // + floor(random(1500)); // We need the heli to be on-site quickly to minimize the chance that a small mission has been completed before the paratroops are deployed and added to the list of live AI for the mission
_dropLoot = (random(1) < _chanceLoot);
// Use the new functionality of getPos
// https://community.bistudio.com/wiki/getPos
_spawnPos = _pos getPos [_spawnDistance,_spawnVector];
diag_log format["reinforcements:: vector was %1 with distance %2 yielding a spawn position of %3 at distance from _pos of %4",_spawnVector,_spawnDistance,_spawnPos, (_pos distance2d _spawnPos)];
private["_supplyHeli"];
//create helicopter and spawn it
_supplyHeli = createVehicle [_chopperType, _spawnPos, [], 90, "FLY"];
_supplyHeli setDir (_spawnVector -180);
_supplyHeli setFuel 1;
_supplyHeli engineOn true;
_supplyHeli flyInHeight 250;
_supplyHeli setVehicleLock "LOCKED";
_supplyHeli addEventHandler ["GetOut",{(_this select 0) setFuel 0;(_this select 0) setDamage 1;}];
clearWeaponCargoGlobal _supplyHeli;
clearMagazineCargoGlobal _supplyHeli;
clearItemCargoGlobal _supplyHeli;
clearBackpackCargoGlobal _supplyHeli;
[_supplyHeli,blck_ModType] call blck_fnc_protectVehicle;
private["_grpPilot","_unitPilot"];
// add pilot to helicopter //add pilot (single group) to supply helicopter
_grpPilot = createGroup blck_AI_Side;
_grpPilot setBehaviour "CARELESS";
_grpPilot setCombatMode "RED";
_grpPilot setSpeedMode "FULL";
_grpPilot allowFleeing 0;
_grpPilot setVariable ["parameters",[_supplyHeli,_numAI,_skillAI,_weapons,_uniforms,_headgear,_dropLoot,_lootCounts,_patrol]];
// create a group for our paratroops
private["_paraGroup"];
_paraGroup = createGroup blck_AI_Side; // ; Group changed for Exile for which player is RESISTANCE.
_supplyHeli setVariable["paraGroup",_paraGroup];
_paraGroup setcombatmode blck_combatMode;
_paraGroup allowfleeing 0;
_paraGroup setspeedmode "FULL";
_paraGroup setFormation blck_groupFormation;
_paraGroup setVariable ["blck_group",true,true];
_unitPilot = _grpPilot createUnit ["I_helipilot_F", getPos _supplyHeli, [], 0, "FORM"];
_unitPilot setSkill 1;
_unitPilot assignAsDriver _supplyHeli;
_unitPilot moveInDriver _supplyHeli;
_grpPilot selectLeader _unitPilot;
_grpPilot setVariable["paraGroup",_paraGroup];
//set waypoint for helicopter
private["_wpDestination"];
[_grpPilot, 0] setWPPos _pos;
[_grpPilot, 0] setWaypointType "MOVE";
[_grpPilot, 0] setWaypointSpeed "FULL";
[_grpPilot, 0] setWaypointBehaviour "CARELESS";
[_grpPilot, 0] setWaypointCompletionRadius 30;
[_grpPilot, 0] setWaypointStatements ["true","(this) spawn blck_fnc_dropReinforcements;"];
[_grpPilot,0] setWaypointTimeout [0.5,0.5,0.5];
_grpPilot setCurrentWaypoint [_grpPilot,0];
//Announce reinforcements are inbound to nearby players
private["_message"];
_message = "A Helicopter Carrying Reinforcements was Spotted Near You!";
[["reinforcements",_message,_pos]] call blck_fnc_messageplayers;
diag_log "reinforcements:: helispawned and inbound, message sent";
// add a loop here that waits until the paragroup has been spawned so that we can return it.
//waitUntil {!isNull (_supplyHeli getVariable["paraGroup",grpNull])};
//_grp = _supplyHeli getVariable["paraGroup"];
//_grp

View File

@ -0,0 +1,27 @@
/*
Author: Ghostrider-DbD-
Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP
License: Attribution-NonCommercial-ShareAlike 4.0 International
called upon completion of weapoint.
*/
_grpPilot = _this;
_params = _grpPilot getVariable["params"];
_params params["_supplyHeli","_numAI","_skillAI","_dropLoot","_lootCounts","_weapons","_uniforms","_headgear","_patrol"];
diag_log format["_fnc_dropReinforcements:: Called with parameters _supplyHeli %1 _numAI %2 _dropLoot %3",_supplyHeli,_numAI,_skillAI,_chanceLoot];
diag_log "_fnc_dropReinforcements:: heli on station, calling blck_fnc_spawnParaUnits";
[_supplyHeli,_numAI,_skillAI,_weapons,_uniforms,_headgear] spawn blck_fnc_spawnParaUnits;
if (_dropLoot) then
{
diag_log "_fnc_dropReinforcements:: heli on station, calling blck_fnc_spawnParaLoot";
[_supplyHeli,_lootCounts] spawn blck_fnc_spawnParaLoot;
};
uiSleep 10;
[_supplyHeli] call blck_fnc_sendHeliHome;

View File

@ -1,91 +0,0 @@
/*
Author: Ghostrider-DbD-
Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP
License: Attribution-NonCommercial-ShareAlike 4.0 International
call with
[
_supplyHeli, // heli from which they should para
_skillAI, // Skill [blue, red, green, orange]
] call blck_spawnHeliParaCrate
*/
params["_supplyHeli","_lootCounts","_skillAI"];
private ["_chute","_crate"];
_crate = "";
_chute = "";
diag_log "blck_spawnHeliParaCrate:: spawning crate";
private["_dir","_offset"];
_dir = getDir _supplyHeli;
_dir = if (_dir < 180) then {_dir + 210} else {_dir - 210};
_offset = _supplyHeli getPos [10, _dir];
//open parachute and attach to crate
_chute = createVehicle ["I_Parachute_02_F", [100, 100, 200], [], 0, "FLY"];
private["_modType"];
_modType = call blck_getModType;
if (_modType isEqualTo "Epoch") then
{
[_chute] call blck_fnc_protectVehicle;
};
_chute setPos [_offset select 0, _offset select 1, 250 ]; //(_offset select 2) - 10];
diag_log format["blck_spawnHeliParaCrate:: chute spawned yielding object %1 at postion %2", _chute, getPos _chute];
//create the parachute and crate
private["_crateSelected"];
_crateSelected = selectRandom["Box_FIA_Ammo_F","Box_FIA_Support_F","Box_FIA_Wps_F","I_SupplyCrate_F","Box_IND_AmmoVeh_F","Box_NATO_AmmoVeh_F","Box_East_AmmoVeh_F","IG_supplyCrate_F"];
_crate = [getPos _chute, _crateSelected] call blck_fnc_spawnCrate;
//_crate = createVehicle [_crateSelected, position _chute, [], 0, "CAN_COLLIDE"];
_crate setPos [position _supplyHeli select 0, position _supplyHeli select 1, 250]; //(position _supplyHeli select 2) - 10];
_crate attachTo [_chute, [0, 0, -1.3]];
_crate allowdamage false;
_crate enableRopeAttach true; // allow slingloading where possible
diag_log format["heliSpawnCrate:: crate spawned %1 at position %2 and attached to %3",_crate, getPos _crate, attachedTo _crate];
switch (_skillAI) do
{
case "orange": {[_crate, blck_BoxLoot_Orange, _lootCounts] call blck_fnc_fillBoxes;};
case "green": {[_crate, blck_BoxLoot_Green, _lootCounts] call blck_fnc_fillBoxes;};
case "red": {[_crate, blck_BoxLoot_Red, _lootCounts] call blck_fnc_fillBoxes;};
case "blue": {[_crate, blck_BoxLoot_Blue, _lootCounts] call blck_fnc_fillBoxes;};
default {[_crate, blck_BoxLoot_Red, _lootCounts] call blck_fnc_fillBoxes;};
};
diag_log format["heliSpawnCrate:: crate loaded and now at position %1 and attached to %2", getPos _crate, attachedTo _crate];
_fn_monitorCrate = {
params["_crate","_chute"];
uiSleep 30;
private["_crateOnGround"];
_crateOnGround = false;
while {!_crateOnGround} do
{
uiSleep 1;
diag_log format["heliSpawnCrate:: Crate Altitude: %1 Crate Velocity: %2 Crate Position: %3 Crate attachedTo %4", getPos _crate select 2, velocityModelSpace _crate select 2, getPosATL _crate, attachedTo _crate];
if ( (((velocity _crate) select 2) < 0.1) || ((getPosATL _crate select 2) < 0.1) ) then
{
uiSleep 5; // give some time for everything to settle
_crateOnGround = true;
_spawnCrate = false;
//delete the chute for clean-up purposes
detach _crate;
deleteVehicle _chute;
if (surfaceIsWater (getPos _crate)) then
{
deleteVehicle _crate;
} else
{
[_crate] call blck_fnc_signalEnd;
};
};
};
};
[_crate,_chute] spawn _fn_monitorCrate;

View File

@ -1,148 +0,0 @@
/*
Author: Ghostrider-DbD-
Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP
License: Attribution-NonCommercial-ShareAlike 4.0 International
call with
[
_pos, // the position which AI should patrol
_supplyHeli, // heli from which they should para
_numAI, // Number to spawn
_skillAI, // Skill [blue, red, green, orange]
_weapons, // array of weapons to select from
_uniforms, // array of uniform choices
_headgear // array of uniform choices
] call blck_spawnHeliParaTroops
*/
params["_pos","_supplyHeli","_numAI","_skillAI","_weapons","_uniforms","_headGear"];
// create a group for our paratroops
private["_paraGroup"];
_paraGroup = createGroup blck_AI_Side; // ; Group changed for Exile for which player is RESISTANCE.
_paraGroup setcombatmode blck_combatMode;
_paraGroup allowfleeing 0;
_paraGroup setspeedmode "FULL";
_paraGroup setFormation blck_groupFormation;
_paraGroup setVariable ["blck_group",true,true];
diag_log format["spawnHeliParatroops:: paratrooper group created; spawning %1 units",_numAI];
//https://forums.bistudio.com/topic/127341-how-to-get-cargo-capacity-and-costweight-of-stuff-into-sqf/
//_veh = TypeOf (_supplyHeli); //for example
//_maxpeople = getNumber (configFile >> "CfgVehicles" >> _veh >> "transportSoldier");
//if ( (_maxpeople - 1) < _numAI) then {_numAI = _maxpeople - 1;}; // calculate the max troops carried by the chopper minus 1 for the pilot who is already on board and adjust the number of AI to spawn as needed.
_launcherType = "none";
_sniperExists = false;
/*
for "_i" from 1 to _numAI do
{
//Spawns the AI unit
diag_log format["spawnGroup:: spawning unit #%1",_i];
_unit = [[getPos _supplyHeli select 0, getPos _supplyHeli select 1,(getPos _supplyHeli select 2) - 10],_weapons,_paraGroup,_skillAI,_launcherType,_uniforms,_headGear] call blck_fnc_spawnAI;
if !(_sniperExists) then
{
if ((random(1) < 0.2)) then
{
_sniperExists = true;
_unit setBehaviour "STEALTH";
};
};
_unit assignAsCargo _supplyHeli;
[_unit] orderGetIn true;
diag_log format["reinforcements:: spawned unit %1, at location %2",_unit,getPos _unit];
uiSleep 0.5;
};
*/
/*
diag_log "reinforcements:: eject paratroops";
{
unassignvehicle _x;
_x action ["EJECT", _supplyHeli];
sleep 0.5;
} foreach units _paraGroup;
*/
private["_dir","_offset"];
_dir = getDir _supplyHeli;
_dir = if (_dir < 180) then {_dir + 150} else {_dir - 150};
for "_i" from 1 to _numAI do
{
_offset = _supplyHeli getPos [10, _dir];
_chute = createVehicle ["I_Parachute_02_F", [100, 100, 200], [], 0, "FLY"];
private["_modType"];
_modType = call blck_getModType;
if (_modType isEqualTo "Epoch") then
{
[_chute] call blck_fnc_protectVehicle;
};
_unit = [[_offset select 0, _offset select 1, 180],_weapons,_paraGroup,_skillAI,_launcherType,_uniforms,_headGear] call blck_fnc_spawnAI;
_unit setDir (getDir _supplyHeli) - 90;
_chute setPos [_offset select 0, _offset select 1, 250]; //(_offset select 2) - 10];
_unit disableCollisionWith _supplyHeli;
_chute disableCollisionWith _supplyHeli;
_unit assignAsDriver _chute;
_unit moveInDriver _chute;
_unit allowDamage true;
uiSleep 1;
//diag_log format["reinforcements:: spawned unit %1, at location %2 and vehicle _unit %1",_unit,getPos _unit, vehicle _unit];
};
_paraGroup selectLeader ((units _paraGroup) select 0);
//diag_log "spawnHeliParatroops:: paratroops created";
_wpRendevous =_paraGroup addWaypoint [_pos, 25];
_wpRendevous setWaypointCombatMode "RED";
_wpRendevous setWaypointType "MOVE";
_wpRendevous setWaypointSpeed "NORMAL";
_wpRendevous setWaypointBehaviour "COMBAT";
_wpRendevous setWaypointCompletionRadius 25;
[_pos, 30, 45, _paraGroup] call blck_fnc_setupWaypoints;
//diag_log "spawnParatroops:: Additional waypoints added to _paraGroup";
_fn_cleanupTroops = {
private["_troopsOnGround"];
params["_group"];
_troopsOnGround = false;
while {!_troopsOnGround} do
{
_troopsOnGround = true;
{
//diag_log format["reinforments:: Tracking Paratroops unit %1 position %4 altitue %2 velocity %3 attachedTo %4",_x, (getPos _x select 2), (velocity _x select 2), getPosATL _x, attachedTo _x];
if ( (getPosATL _x select 2) < 0.1) then {
if (surfaceIsWater (position _x)) then {
diag_log format["spawnParatroops:: unit %1 at %2 deleted",_x, getPos _x];
private["_unit"];
_unit = _x;
{
_unit removeAllEventHandlers _x;
}forEach ["Killed","Fired","HandleDamage","HandleHeal","FiredNear"]
};
}
else
{_troopsOnGround = false;};
}forEach units _group;
uiSleep 1;
};
};
[_paraGroup] spawn _fn_cleanupTroops;
diag_log "spawnParatroops:: All Units on the Ground";
// Return the group spawned for book keeping purposes
diag_log format["spawnParatroops:: typeName _paraGroup = %1", (typeName _paraGroup)];
_paraGroup;

View File

@ -1,213 +0,0 @@
/*
Author: Ghostrider-DbD-
Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP / WAI for Arma 3 Epoch
License: Attribution-NonCommercial-ShareAlike 4.0 International
call with
[
_pos,
_skillAI,
_timeout
] call blck_spawnReinforcements
*/
params["_pos","_skillAI","_weapons"];
diag_log format["HeliPatrol:: Called with parameters _pos %1 _skillAI %2 _weapons %3",_pos,_skillAI,_weapons];
private["_chopperType","_chopperTypeArmed","_spawnPos","_spawnVector","_spawnDistance"];
_chopperType = selectRandom ["B_Heli_Light_01_armed_F","O_Heli_Light_02_F","O_Heli_Light_02_v2_F","B_Heli_Transport_03_F"];
diag_log format["HeliPatrol:: _chopperType seleted = %1 ",_chopperType];
_spawnVector = round(random(360));
_spawnDistance = 200 + floor(random(1500));
_spawnPos = _pos getPos [_spawnDistance,_spawnVector];
diag_log format["HeliPatrol:: vector was %1 with distance %2 yielding a spawn position of %3 at distance from _pos of %4",_spawnVector,_spawnDistance,_spawnPos, (_pos distance2d _spawnPos)];
private["_patrolHeli"];
//create helicopter and spawn it
_patrolHeli = createVehicle [_chopperType, _spawnPos, [], 90, "FLY"];
_patrolHeli setDir (_spawnVector -180);
_patrolHeli setFuel 1;
_patrolHeli engineOn true;
_patrolHeli flyInHeight 150;
_patrolHeli setVehicleLock "LOCKED";
_patrolHeli addEventHandler ["GetOut",{(_this select 0) setFuel 0;(_this select 0) setDamage 1;}];
clearWeaponCargoGlobal _patrolHeli;
clearMagazineCargoGlobal _patrolHeli;
clearItemCargoGlobal _patrolHeli;
clearBackpackCargoGlobal _patrolHeli;
private["_modType"];
_modType = call blck_fnc_getModType;
if (_modType isEqualTo "Epoch") then
{
[_patrolHeli,blck_ModType] call blck_fnc_protectVehicle;
};
private["_grpPilot","_unitPilot"];
// add pilot to helicopter //add pilot (single group) to supply helicopter
_grpPilot = createGroup blck_AI_Side;
_grpPilot setBehaviour "CARELESS";
_grpPilot setCombatMode "RED";
_grpPilot setSpeedMode "FULL";
_grpPilot allowFleeing 0;
_unitPilot = _grpPilot createUnit ["I_helipilot_F", getPos _patrolHeli, [], 0, "FORM"];
_unitPilot setSkill 1;
_unitPilot assignAsDriver _patrolHeli;
_unitPilot moveInDriver _patrolHeli;
_gunner = [[100, 100, 300],blck_WeaponList_Blue,_grpPilot,_skillAI] call blck_fnc_spawnAI;
_gunner assignAsCargo _patrolHeli;
_gunner moveInCargo [_patrolHeli,2];
_gunner enablePersonTurret [2, true];
_gunner2 = [[100, 100, 300],blck_WeaponList_Blue,_grpPilot,_skillAI] call blck_fnc_spawnAI;
_gunner2 assignAsCargo _patrolHeli;
_gunner2 moveInCargo [_patrolHeli,4];
_gunner2 enablePersonTurret [4, true];
_grpPilot selectLeader _unitPilot;
//set waypoint for helicopter
private["_wpDestination"];
_wpDestination =_grpPilot addWaypoint [_pos, 0];
_wpDestination setWaypointType "MOVE";
_wpDestination setWaypointSpeed "FULL";
_wpDestination setWaypointBehaviour "CARELESS";
_wpDestination setWaypointCompletionRadius 60;
//Announce reinforcements are inbound to nearby players
private["_message"];
_message = "A Helicopter Gunship was Spotted Near You!";
[["reinforcements",_message,_pos]] call blck_fnc_messageplayers;
diag_log "HeliPatrol:: helispawned and inbound, message sent";
//Waits until heli gets near the position to drop crate, or if waypoint timeout has been triggered
_destinationDone = false;
_startTime = diag_tickTime;
_timoutTime = 600;
while {true} do {
if ( (( (getPos _patrolHeli) distance2D _pos) < 100) || ((diag_tickTime - _startTime) > _timoutTime) ) exitWith { };
uiSleep 2;
//diag_log format["HeliPatrol:: heli %1 is %2 from mission center",_patrolHeli,_pos distance (getPos _patrolHeli)];
};
if ( (diag_tickTime - _startTime) > _timoutTime) exitWith
{
// HeliPatrol took too long so lets delete them.
deleteVehicle _patrolHeli;
deleteVehicle _unitPilot;
deleteGroup _grpPilot;
diag_log "[blckeagls] HeliPatrol failed to reach the mission site: heli and crew deleted";
};
diag_log "HeliPatrol:: heli on station";
for "_i" from 1 to 5 do
{
private["_dir","_wpPos","_wpPatrol"];
_dir = floor(random(360));
_wpPos = _pos getPos [50,_dir];
_wpPatrol =_grpPilot addWaypoint [_pos, 100];
_wpPatrol setWaypointType "LOITER";
_wpPatrol setWaypointSpeed "NORMAL";
_patrolHeli limitSpeed 45;
_wpPatrol setWaypointBehaviour "COMBAT";
_wpPatrol setWaypointLoiterType "CIRCLE";
_wpPatrol setWaypointTimeout [60, 90, 120];
//_wpPatrol setWaypointCompletionRadius 100;
_wpPatrol setWaypointName "Loiter";
/*
_wpPatrol setWaypointType "MOVE":
_wpPatrol setWaypointCompletionRadius 50;
_wpPatrol setWaypointStatements
["true",
"
(Vehicle this) flyinheight 50;
(Vehicle this) limitSpeed 45;
if(true) then {diag_log('WAI: Heli height ' + str((position Vehicle this) select 2) + '/ Heli speed ' + str(speed this)); };
"];
diag_log format["HeliPatrol:: Waypoint #1 with identity %2 added", _i, _wpPatrol]; ;
_wpPatrol setWaypointTimeout [10,15,20];
};
/*
if (_spawnPatrol) then
{
diag_log "HeliPatrol:: heli will patrol the area, setting up waypoints";
private["_wpPatrol"];
_wpPatrol setWaypointType "LOITER";
_wpPatrol setWaypointSpeed "NORMAL";
_wpPatrol setWaypointBehaviour "COMBAT";
_wpPatrol setWaypointLoiterType "CIRCLE";
_wpPatrol setWaypointTimeout [60, 90, 120];
_wpPatrol setWaypointCompletionRadius 100;
_wpPatrol setWaypointName "Loiter";
while { (waypointTimeoutCurrent _grpPilot) > 0} do
{
uiSleep 1;
diag_log format["HeliPatrol:: patrol waypoint time at %1", waypointTimeoutCurrent _grpPilot];
};
}
else
{
diag_log "HeliPatrol:: Heli will not patrol, no patrol waypoints were added";
};
*/
diag_log "HeliPatrol:: send heli back to spawn";
// Send the heli back to base
private["_wpHome"];
_wpHome =_grpPilot addWaypoint [_spawnPos, 200];
_wpHome setWaypointType "MOVE";
_wpHome setWaypointSpeed "FULL";
_wpHome setWaypointBehaviour "CASUAL";
_wpHome setWaypointCompletionRadius 200;
_wpHome setWaypointName "GoHome";
_wpHome setWaypointStatements ["true", "{deleteVehicle _x} forEach units group this;deleteVehicle (vehicle this);diag_log ""helicopter and crew deleted"""];
diag_log "HeliPatrol:: sending Heli Home";
// End of sending heli home
////////////////////////
_fn_cleanupHeli = {
params["_patrolHeli","_homePos","_grpPilot"];
// run some tests to be sure everything went OK
_heliHome = false;
_startTime = diag_tickTime;
while { !(_heliHome) } do
{
_heliHome = (_patrolHeli distance _homePos) < 300;
if ( !_heliHome && ((diag_tickTime - _startTime) > 300) ) then
{
_heliHome = true;
deleteVehicle _patrolHeli;
{
deleteVehicle _x;
}forEach units _grpPilot;
deleteGroup _grpPilot;
};
uiSleep 2;
};
};
[_patrolHeli,_spawnPos,_grpPilot] spawn _fn_cleanupHeli;
diag_log "HeliPatrol:: script done";
// Return the group used for AI reinforcements for book keeping purposes in the Mission Spawner.
diag_log format["HeliPatrol:: typeName _grpToops = %1", typeName _grpToops];
_grpToops;

View File

@ -1,213 +0,0 @@
/*
Author: Ghostrider-DbD-
Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP / WAI for Arma 3 Epoch
License: Attribution-NonCommercial-ShareAlike 4.0 International
call with
[
_pos,
_skillAI,
_timeout
] call blck_spawnReinforcements
*/
params["_pos","_skillAI","_weapons"];
diag_log format["HeliPatrol:: Called with parameters _pos %1 _skillAI %2 _weapons %3",_pos,_skillAI,_weapons];
private["_chopperType","_chopperTypeArmed","_spawnPos","_spawnVector","_spawnDistance"];
_chopperType = selectRandom ["B_Heli_Light_01_armed_F","O_Heli_Light_02_F","O_Heli_Light_02_v2_F","B_Heli_Transport_03_F"];
diag_log format["HeliPatrol:: _chopperType seleted = %1 ",_chopperType];
_spawnVector = round(random(360));
_spawnDistance = 200 + floor(random(1500));
_spawnPos = _pos getPos [_spawnDistance,_spawnVector];
diag_log format["HeliPatrol:: vector was %1 with distance %2 yielding a spawn position of %3 at distance from _pos of %4",_spawnVector,_spawnDistance,_spawnPos, (_pos distance2d _spawnPos)];
private["_patrolHeli"];
//create helicopter and spawn it
_patrolHeli = createVehicle [_chopperType, _spawnPos, [], 90, "FLY"];
_patrolHeli setDir (_spawnVector -180);
_patrolHeli setFuel 1;
_patrolHeli engineOn true;
_patrolHeli flyInHeight 150;
_patrolHeli setVehicleLock "LOCKED";
_patrolHeli addEventHandler ["GetOut",{(_this select 0) setFuel 0;(_this select 0) setDamage 1;}];
clearWeaponCargoGlobal _patrolHeli;
clearMagazineCargoGlobal _patrolHeli;
clearItemCargoGlobal _patrolHeli;
clearBackpackCargoGlobal _patrolHeli;
private["_modType"];
_modType = call blck_getModType;
if (_modType isEqualTo "Epoch") then
{
[_patrolHeli,blck_ModType] call blck_fnc_protectVehicle;
};
private["_grpPilot","_unitPilot"];
// add pilot to helicopter //add pilot (single group) to supply helicopter
_grpPilot = createGroup blck_AI_Side;
_grpPilot setBehaviour "CARELESS";
_grpPilot setCombatMode "RED";
_grpPilot setSpeedMode "FULL";
_grpPilot allowFleeing 0;
_unitPilot = _grpPilot createUnit ["I_helipilot_F", getPos _patrolHeli, [], 0, "FORM"];
_unitPilot setSkill 1;
_unitPilot assignAsDriver _patrolHeli;
_unitPilot moveInDriver _patrolHeli;
_gunner = [[100, 100, 300],blck_WeaponList_Blue,_grpPilot,_skillAI] call blck_fnc_spawnAI;
_gunner assignAsCargo _patrolHeli;
_gunner moveInCargo [_patrolHeli,2];
_gunner enablePersonTurret [2, true];
_gunner2 = [[100, 100, 300],blck_WeaponList_Blue,_grpPilot,_skillAI] call blck_fnc_spawnAI;
_gunner2 assignAsCargo _patrolHeli;
_gunner2 moveInCargo [_patrolHeli,4];
_gunner2 enablePersonTurret [4, true];
_grpPilot selectLeader _unitPilot;
//set waypoint for helicopter
private["_wpDestination"];
_wpDestination =_grpPilot addWaypoint [_pos, 0];
_wpDestination setWaypointType "MOVE";
_wpDestination setWaypointSpeed "FULL";
_wpDestination setWaypointBehaviour "CARELESS";
_wpDestination setWaypointCompletionRadius 60;
//Announce reinforcements are inbound to nearby players
private["_message"];
_message = "A Helicopter Gunship was Spotted Near You!";
[["reinforcements",_message,_pos]] call blck_fnc_messageplayers;
diag_log "HeliPatrol:: helispawned and inbound, message sent";
//Waits until heli gets near the position to drop crate, or if waypoint timeout has been triggered
_destinationDone = false;
_startTime = diag_tickTime;
_timoutTime = 600;
while {true} do {
if ( (( (getPos _patrolHeli) distance2D _pos) < 100) || ((diag_tickTime - _startTime) > _timoutTime) ) exitWith { };
uiSleep 2;
//diag_log format["HeliPatrol:: heli %1 is %2 from mission center",_patrolHeli,_pos distance (getPos _patrolHeli)];
};
if ( (diag_tickTime - _startTime) > _timoutTime) exitWith
{
// HeliPatrol took too long so lets delete them.
deleteVehicle _patrolHeli;
deleteVehicle _unitPilot;
deleteGroup _grpPilot;
diag_log "[blckeagls] HeliPatrol failed to reach the mission site: heli and crew deleted";
};
diag_log "HeliPatrol:: heli on station";
for "_i" from 1 to 5 do
{
private["_dir","_wpPos","_wpPatrol"];
_dir = floor(random(360));
_wpPos = _pos getPos [50,_dir];
_wpPatrol =_grpPilot addWaypoint [_pos, 100];
_wpPatrol setWaypointType "LOITER";
_wpPatrol setWaypointSpeed "NORMAL";
_patrolHeli limitSpeed 45;
_wpPatrol setWaypointBehaviour "COMBAT";
_wpPatrol setWaypointLoiterType "CIRCLE";
_wpPatrol setWaypointTimeout [60, 90, 120];
//_wpPatrol setWaypointCompletionRadius 100;
_wpPatrol setWaypointName "Loiter";
/*
_wpPatrol setWaypointType "MOVE":
_wpPatrol setWaypointCompletionRadius 50;
_wpPatrol setWaypointStatements
["true",
"
(Vehicle this) flyinheight 50;
(Vehicle this) limitSpeed 45;
if(true) then {diag_log('WAI: Heli height ' + str((position Vehicle this) select 2) + '/ Heli speed ' + str(speed this)); };
"];
diag_log format["HeliPatrol:: Waypoint #1 with identity %2 added", _i, _wpPatrol]; ;
_wpPatrol setWaypointTimeout [10,15,20];
};
/*
if (_spawnPatrol) then
{
diag_log "HeliPatrol:: heli will patrol the area, setting up waypoints";
private["_wpPatrol"];
_wpPatrol setWaypointType "LOITER";
_wpPatrol setWaypointSpeed "NORMAL";
_wpPatrol setWaypointBehaviour "COMBAT";
_wpPatrol setWaypointLoiterType "CIRCLE";
_wpPatrol setWaypointTimeout [60, 90, 120];
_wpPatrol setWaypointCompletionRadius 100;
_wpPatrol setWaypointName "Loiter";
while { (waypointTimeoutCurrent _grpPilot) > 0} do
{
uiSleep 1;
diag_log format["HeliPatrol:: patrol waypoint time at %1", waypointTimeoutCurrent _grpPilot];
};
}
else
{
diag_log "HeliPatrol:: Heli will not patrol, no patrol waypoints were added";
};
*/
diag_log "HeliPatrol:: send heli back to spawn";
// Send the heli back to base
private["_wpHome"];
_wpHome =_grpPilot addWaypoint [_spawnPos, 200];
_wpHome setWaypointType "MOVE";
_wpHome setWaypointSpeed "FULL";
_wpHome setWaypointBehaviour "CASUAL";
_wpHome setWaypointCompletionRadius 200;
_wpHome setWaypointName "GoHome";
_wpHome setWaypointStatements ["true", "{deleteVehicle _x} forEach units group this;deleteVehicle (vehicle this);diag_log ""helicopter and crew deleted"""];
diag_log "HeliPatrol:: sending Heli Home";
// End of sending heli home
////////////////////////
_fn_cleanupHeli = {
params["_patrolHeli","_homePos","_grpPilot"];
// run some tests to be sure everything went OK
_heliHome = false;
_startTime = diag_tickTime;
while { !(_heliHome) } do
{
_heliHome = (_patrolHeli distance _homePos) < 300;
if ( !_heliHome && ((diag_tickTime - _startTime) > 300) ) then
{
_heliHome = true;
deleteVehicle _patrolHeli;
{
deleteVehicle _x;
}forEach units _grpPilot;
deleteGroup _grpPilot;
};
uiSleep 2;
};
};
[_patrolHeli,_spawnPos,_grpPilot] spawn _fn_cleanupHeli;
diag_log "HeliPatrol:: script done";
// Return the group used for AI reinforcements for book keeping purposes in the Mission Spawner.
diag_log format["HeliPatrol:: typeName _grpToops = %1", typeName _grpToops];
_grpToops;

View File

@ -1,176 +0,0 @@
/*
Author: Ghostrider-DbD-
Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP
License: Attribution-NonCommercial-ShareAlike 4.0 International
call with
[
_pos,
_numAI,
_skillAI,
_chanceLoot,
_loogCounts,
_weapons,
_uniforms,
_headgear,
_patrol
] call blck_spawnReinforcements
*/
params["_pos","_numAI","_skillAI","_chanceLoot","_lootCounts","_weapons","_uniforms","_headgear","_patrol"];
diag_log format["reinforcements:: Called with parameters _pos %1 _numAI %2 _skillAI %3 _chanceLoot %4",_pos,_numAI,_skillAI,_chanceLoot];
private["_chopperType","_chopperTypeArmed","_spawnPos","_spawnVector","_spawnDistance"];
// spawn an unarmed heli
_chopperType = selectRandom["B_Heli_Transport_03_unarmed_EPOCH","O_Heli_Light_02_unarmed_EPOCH","I_Heli_Transport_02_EPOCH"];
diag_log format["reinforcements:: _chopperType seleted = %1",_chopperType];
_spawnVector = round(random(360));
_spawnDistance = 200 + floor(random(1500));
_dropLoot = (random(1) < _chanceLoot);
// Use the new functionality of getPos
// https://community.bistudio.com/wiki/getPos
_spawnPos = _pos getPos [_spawnDistance,_spawnVector];
diag_log format["reinforcements:: vector was %1 with distance %2 yielding a spawn position of %3 at distance from _pos of %4",_spawnVector,_spawnDistance,_spawnPos, (_pos distance2d _spawnPos)];
private["_supplyHeli"];
//create helicopter and spawn it
_supplyHeli = createVehicle [_chopperType, _spawnPos, [], 90, "FLY"];
_supplyHeli setDir (_spawnVector -180);
_supplyHeli setFuel 1;
_supplyHeli engineOn true;
_supplyHeli flyInHeight 250;
_supplyHeli setVehicleLock "LOCKED";
_supplyHeli addEventHandler ["GetOut",{(_this select 0) setFuel 0;(_this select 0) setDamage 1;}];
clearWeaponCargoGlobal _supplyHeli;
clearMagazineCargoGlobal _supplyHeli;
clearItemCargoGlobal _supplyHeli;
clearBackpackCargoGlobal _supplyHeli;
[_supplyHeli,blck_ModType] call blck_fnc_protectVehicle;
private["_grpPilot","_unitPilot"];
// add pilot to helicopter //add pilot (single group) to supply helicopter
_grpPilot = createGroup blck_AI_Side;
_grpPilot setBehaviour "CARELESS";
_grpPilot setCombatMode "RED";
_grpPilot setSpeedMode "FULL";
_grpPilot allowFleeing 0;
_unitPilot = _grpPilot createUnit ["I_helipilot_F", getPos _supplyHeli, [], 0, "FORM"];
_unitPilot setSkill 1;
_unitPilot assignAsDriver _supplyHeli;
_unitPilot moveInDriver _supplyHeli;
//set waypoint for helicopter
private["_wpDestination"];
_wpDestination =_grpPilot addWaypoint [_pos, 0];
_wpDestination setWaypointType "MOVE";
_wpDestination setWaypointSpeed "FULL";
_wpDestination setWaypointBehaviour "CARELESS";
_wpDestination setWaypointCompletionRadius 60;
//Announce reinforcements are inbound to nearby players
private["_message"];
_message = "A Helicopter Carrying Reinforcements was Spotted Near You!";
[["reinforcements",_message,_pos]] call blck_fnc_messageplayers;
diag_log "reinforcements:: helispawned and inbound, message sent";
//Waits until heli gets near the position to drop crate, or if waypoint timeout has been triggered
_destinationDone = false;
_startTime = diag_tickTime;
_timoutTime = 600;
while {true} do {
if ( (( (getPos _supplyHeli) distance2D _pos) < 100) || ((diag_tickTime - _startTime) > _timoutTime) ) exitWith { };
uiSleep 2;
//diag_log format["reinforcements:: heli %1 is %2 from mission center",_supplyHeli,_pos distance (getPos _supplyHeli)];
};
if ( (diag_tickTime - _startTime) > _timoutTime) exitWith
{
// reinforcements took too long so lets delete them.
deleteVehicle _supplyHeli;
deleteVehicle _unitPilot;
deleteGroup _grpPilot;
diag_log "[blckeagls] Reinforcements failed to reach the mission site: heli and crew deleted";
};
diag_log "reinforcements:: heli on station";
private["_grpToops"];
_grpToops = grpNull;
_spawnTroops = if (_numAI > 0) then {true} else {false};
// Spawn and paradrop troops
if (_spawnTroops) then
{
_grpToops = [_pos,_supplyHeli,_numAI,_skillAI,_weapons,_uniforms,_headgear] spawn blck_spawnHeliParaTroops;
diag_log format["reinforcements:: spawnHeliParaTroups returned variable %1 with type %2", _grpToops, typeName _grpToops];
};
_spawnCrate = if (random(1) < _chanceLoot) then {true} else {false};
if (_spawnCrate) then
{
[_supplyHeli,_lootCounts,_skillAI] spawn blck_spawnHeliParaCrate;
};
_spawnPatrol = ( random(1) < _patrol);
if (_spawnPatrol) then
{
[_pos,_skillAI, 120] spawn blck_spawnHeliPatrol;
};
diag_log "reinforcements:: send heli back to spawn";
// Send the heli back to base
private["_wpHome"];
_wpHome =_grpPilot addWaypoint [_spawnPos, 200];
_wpHome setWaypointType "MOVE";
_wpHome setWaypointSpeed "FULL";
_wpHome setWaypointBehaviour "CASUAL";
_wpHome setWaypointCompletionRadius 200;
_wpHome setWaypointName "GoHome";
_wpHome setWaypointStatements ["true", "{deleteVehicle _x} forEach units group this;deleteVehicle (vehicle this);diag_log ""helicopter and crew deleted"""];
diag_log "reinforcements:: sending Heli Home";
// End of sending heli home
////////////////////////
_fn_cleanupHeli = {
params["_supplyHeli","_homePos","_grpPilot"];
// run some tests to be sure everything went OK
_heliHome = false;
_startTime = diag_tickTime;
while { !(_heliHome) } do
{
_heliHome = (_supplyHeli distance _homePos) < 300;
if ( !_heliHome && ((diag_tickTime - _startTime) > 300) ) then
{
_heliHome = true;
deleteVehicle _supplyHeli;
{
deleteVehicle _x;
}forEach units _grpPilot;
deleteGroup _grpPilot;
};
uiSleep 2;
};
};
[_supplyHeli,_spawnPos,_grpPilot] spawn _fn_cleanupHeli;
diag_log "reinforcements:: script done";
// Return the group used for AI reinforcements for book keeping purposes in the Mission Spawner.
diag_log format["reinforcements:: typeName _grpToops = %1", typeName _grpToops];
_grpToops;

View File

@ -0,0 +1,66 @@
/*
Author: Ghostrider-DbD-
Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP
License: Attribution-NonCommercial-ShareAlike 4.0 International
called once all tasks required at the mission are complete.
*/
_grpPilot = _this select 0;
_heli = _this select 1;
diag_log "reinforcements deployed:: send heli back to spawn";
// select a random location abotu 2K from the mission
_spawnVector = round(random(360));
_spawnDistance = 2000;
_pos = getPos _heli;
// Use the new functionality of getPos
// https://community.bistudio.com/wiki/getPos
_home = _pos getPos [_spawnDistance,_spawnVector];
// Send the heli back to base
_grpPilot = group this;
[_grpPilot, 0] setWPPos _pos;
[_grpPilot, 0] setWaypointType "MOVE";
[_grpPilot, 0] setWaypointSpeed "FULL";
[_grpPilot, 0] setWaypointBehaviour "CARELESS";
[_grpPilot, 0] setWaypointCompletionRadius 200;
[_grpPilot, 0] setWaypointStatements ["true", "{deleteVehicle _x} forEach units group this;deleteVehicle (vehicle this);diag_log ""helicopter and crew deleted"""];
[_grpPilot, 0] setWaypointName "GoHome";
[_grpPilot,0] setWaypointTimeout [0.5,0.5,0.5];
diag_log "reinforcements:: sending Heli Home";
// End of sending heli home
////////////////////////
_fn_cleanupHeli = {
params["_supplyHeli","_homePos","_grpPilot"];
// run some tests to be sure everything went OK
_heliHome = false;
_startTime = diag_tickTime;
while { !(_heliHome) } do
{
_heliHome = (_supplyHeli distance _pos) < 300;
if ( !_heliHome && ((diag_tickTime - _startTime) > 300) ) then
{
_heliHome = true;
deleteVehicle _supplyHeli;
{
deleteVehicle _x;
}forEach units _grpPilot;
deleteGroup _grpPilot;
};
uiSleep 2;
};
};
[_supplyHeli,_spawnPos,_grpPilot] spawn _fn_cleanupHeli;
diag_log "reinforcements:: script done";

View File

@ -5,18 +5,19 @@
call with
[
_supplyHeli, // heli from which they should para
_skillAI, // Skill [blue, red, green, orange]
_lootCounts,
_lootSetting // [blue, red, green, orange]
] call blck_spawnHeliParaCrate
*/
params["_supplyHeli","_lootCounts","_skillAI"];
params["_supplyHeli","_lootCounts"];
private ["_chute","_crate"];
_crate = "";
_chute = "";
diag_log "blck_spawnHeliParaCrate:: spawning crate";
diag_log "_fnc_spawnParaCrate:: spawning crate";
private["_dir","_offset"];
_dir = getDir _supplyHeli;
@ -24,16 +25,16 @@ _dir = if (_dir < 180) then {_dir + 210} else {_dir - 210};
_offset = _supplyHeli getPos [10, _dir];
//open parachute and attach to crate
_chute = createVehicle ["I_Parachute_02_F", [100, 100, 200], [], 0, "FLY"];
_chute = createVehicle ["I_Parachute_02_F", [100, 100, 100], [], 0, "FLY"];
private["_modType"];
_modType = call blck_fnc_getModType;
if (_modType isEqualTo "Epoch") then
{
[_chute] call blck_fnc_protectVehicle;
};
_chute setPos [_offset select 0, _offset select 1, 250 ]; //(_offset select 2) - 10];
_chute setPos [_offset select 0, _offset select 1, 100 ]; //(_offset select 2) - 10];
diag_log format["blck_spawnHeliParaCrate:: chute spawned yielding object %1 at postion %2", _chute, getPos _chute];
diag_log format["_fnc_spawnParaCrate:: chute spawned yielding object %1 at postion %2", _chute, getPos _chute];
//create the parachute and crate
private["_crateSelected"];
@ -45,10 +46,10 @@ _crate attachTo [_chute, [0, 0, -1.3]];
_crate allowdamage false;
_crate enableRopeAttach true; // allow slingloading where possible
diag_log format["heliSpawnCrate:: crate spawned %1 at position %2 and attached to %3",_crate, getPos _crate, attachedTo _crate];
diag_log format["_fnc_spawnParaCrate:: crate spawned %1 at position %2 and attached to %3",_crate, getPos _crate, attachedTo _crate];
switch (_skillAI) do
switch (_lootSetting) do
{
case "orange": {[_crate, blck_BoxLoot_Orange, _lootCounts] call blck_fnc_fillBoxes;};
case "green": {[_crate, blck_BoxLoot_Green, _lootCounts] call blck_fnc_fillBoxes;};
@ -57,7 +58,7 @@ switch (_skillAI) do
default {[_crate, blck_BoxLoot_Red, _lootCounts] call blck_fnc_fillBoxes;};
};
diag_log format["heliSpawnCrate:: crate loaded and now at position %1 and attached to %2", getPos _crate, attachedTo _crate];
diag_log format["_fnc_spawnParaCrate:: crate loaded and now at position %1 and attached to %2", getPos _crate, attachedTo _crate];
_fn_monitorCrate = {
params["_crate","_chute"];
@ -67,10 +68,10 @@ _fn_monitorCrate = {
while {!_crateOnGround} do
{
uiSleep 1;
diag_log format["heliSpawnCrate:: Crate Altitude: %1 Crate Velocity: %2 Crate Position: %3 Crate attachedTo %4", getPos _crate select 2, velocityModelSpace _crate select 2, getPosATL _crate, attachedTo _crate];
diag_log format["_fnc_spawnParaCrate:: Crate Altitude: %1 Crate Velocity: %2 Crate Position: %3 Crate attachedTo %4", getPos _crate select 2, velocityModelSpace _crate select 2, getPosATL _crate, attachedTo _crate];
if ( (((velocity _crate) select 2) < 0.1) || ((getPosATL _crate select 2) < 0.1) ) then
{
uiSleep 5; // give some time for everything to settle
uiSleep 10; // give some time for everything to settle
_crateOnGround = true;
_spawnCrate = false;

View File

@ -5,7 +5,7 @@
call with
[
_pos, // the position which AI should patrol
_supplyHeli, // heli from which they should para
_dropPos, // heli from which they should para
_numAI, // Number to spawn
_skillAI, // Skill [blue, red, green, orange]
_weapons, // array of weapons to select from
@ -14,18 +14,19 @@
] call blck_spawnHeliParaTroops
*/
params["_pos","_supplyHeli","_numAI","_skillAI","_weapons","_uniforms","_headGear"];
params["_supplyHeli","_missionPos","_numAI","_skillAI","_weapons","_uniforms","_headGear"];
// create a group for our paratroops
private["_paraGroup"];
_paraGroup = createGroup blck_AI_Side; // ; Group changed for Exile for which player is RESISTANCE.
_supplyHeli setVariable["paraGroup",_paraGroup];
_paraGroup setcombatmode blck_combatMode;
_paraGroup allowfleeing 0;
_paraGroup setspeedmode "FULL";
_paraGroup setFormation blck_groupFormation;
_paraGroup setVariable ["blck_group",true,true];
diag_log format["spawnHeliParatroops:: paratrooper group created; spawning %1 units",_numAI];
diag_log format["_fnc_spawnParaUnits:: paratrooper group created; spawning %1 units",_numAI];
//https://forums.bistudio.com/topic/127341-how-to-get-cargo-capacity-and-costweight-of-stuff-into-sqf/
//_veh = TypeOf (_supplyHeli); //for example
@ -34,8 +35,6 @@ diag_log format["spawnHeliParatroops:: paratrooper group created; spawning %1 un
_launcherType = "none";
_sniperExists = false;
/*
for "_i" from 1 to _numAI do
{
@ -74,7 +73,7 @@ _dir = if (_dir < 180) then {_dir + 150} else {_dir - 150};
for "_i" from 1 to _numAI do
{
_offset = _supplyHeli getPos [10, _dir];
_chute = createVehicle ["I_Parachute_02_F", [100, 100, 200], [], 0, "FLY"];
_chute = createVehicle ["Steerable_Parachute_F", [100, 100, 200], [], 0, "FLY"];
private["_modType"];
_modType = call blck_fnc_getModType;
if (_modType isEqualTo "Epoch") then
@ -91,25 +90,20 @@ for "_i" from 1 to _numAI do
_unit allowDamage true;
uiSleep 1;
//diag_log format["reinforcements:: spawned unit %1, at location %2 and vehicle _unit %1",_unit,getPos _unit, vehicle _unit];
diag_log format["_fnc_spawnParaUnits:: spawned unit %1, at location %2 and vehicle _unit %1",_unit,getPos _unit, vehicle _unit];
};
_paraGroup selectLeader ((units _paraGroup) select 0);
//diag_log "spawnHeliParatroops:: paratroops created";
_wpRendevous =_paraGroup addWaypoint [_pos, 25];
_wpRendevous setWaypointCombatMode "RED";
_wpRendevous setWaypointType "MOVE";
_wpRendevous setWaypointSpeed "NORMAL";
_wpRendevous setWaypointBehaviour "COMBAT";
_wpRendevous setWaypointCompletionRadius 25;
[_pos, 30, 45, _paraGroup] call blck_fnc_setupWaypoints;
//diag_log "spawnParatroops:: Additional waypoints added to _paraGroup";
diag_log "_fnc_spawnParaUnits:: paratroops created, setting wayponts";
_paraGroup setVariable["missionPos",_missionPos];
[_paraGroup, 0] setWPPos _missionPos;
[_paraGroup, 0] setWaypointCombatMode "RED";
[_paraGroup, 0] setWaypointType "MOVE";
[_paraGroup, 0] setWaypointSpeed "NORMAL";
[_paraGroup, 0] setWaypointBehaviour "COMBAT";
[_paraGroup, 0] setWaypointCompletionRadius 20;
[_paraGroup, 0] setWaypointStatements ["true","[this getVariable[""missionPos""], 30, 45, this] call blck_fnc_setupWaypoints;"];
_fn_cleanupTroops = {
private["_troopsOnGround"];
@ -122,7 +116,7 @@ _fn_cleanupTroops = {
//diag_log format["reinforments:: Tracking Paratroops unit %1 position %4 altitue %2 velocity %3 attachedTo %4",_x, (getPos _x select 2), (velocity _x select 2), getPosATL _x, attachedTo _x];
if ( (getPosATL _x select 2) < 0.1) then {
if (surfaceIsWater (position _x)) then {
diag_log format["spawnParatroops:: unit %1 at %2 deleted",_x, getPos _x];
diag_log format["_fnc_spawnParaUnits:: unit %1 at %2 deleted",_x, getPos _x];
private["_unit"];
_unit = _x;
{
@ -139,10 +133,11 @@ _fn_cleanupTroops = {
};
diag_log "_fnc_spawnParaUnits:: waiting for paratroops to land";
[_paraGroup] spawn _fn_cleanupTroops;
diag_log "spawnParatroops:: All Units on the Ground";
// Return the group spawned for book keeping purposes
diag_log format["spawnParatroops:: typeName _paraGroup = %1", (typeName _paraGroup)];
diag_log format["_fnc_spawnParaUnits:: typeName _paraGroup = %1", (typeName _paraGroup)];
_paraGroup;

View File

@ -1,66 +0,0 @@
/*
calculate a reward player for AI Kills in crypto.
Code fragment adapted from VEMF
call as [_unit,_killer] call blck_fnc_rewardKiller;
NOTE the dependency on HALV_server_takegive_crypto !!
*/
params["_unit","_killer","_kills"];
//diag_log format["rewardKiller:: _unit = %1 and _killer %2",_unit,_killer];
private["_modType","_reward"];
_modType = call blck_getModType;
//diag_log format["[blckeagles] rewardKiller:: - _modType = %1",_modType];
if (_modType isEqualTo "Epoch") then
{
//diag_log "calculating reward for Epoch";
if ( (vehicle _killer) in blck_forbidenVehicles || (currentWeapon _killer) in blck_forbidenVehicleGuns ) then
{
_reward = 0;
}
else
{
// Give the player money for killing an AI
_maxReward = 50;
_dist = _unit distance _killer;
_reward = 0;
if (_dist < 50) then { _reward = _maxReward - (_maxReward / 1.25); _reward };
if (_dist < 100) then { _reward = _maxReward - (_maxReward / 1.5); _reward };
if (_dist < 800) then { _reward = _maxReward - (_maxReward / 2); _reward };
if (_dist > 800) then { _reward = _maxReward - (_maxReward / 4); _reward };
_reward=+(_kills*2);
//diag_log format["fnd_rewardKiller:: _bonus returned will be %1",_reward];
[_killer,_reward] call blck_fnc_giveTakeCrypto;
};
};
if (_modType isEqualTo "Exile") then
{
private["_distanceBonus","_overallRespectChange","_newKillerScore","_newKillerFrags","_maxReward","_money","_message"];
_distanceBonus = floor((_unit distance _killer)/100);
_overallRespectChange = 50 + _distanceBonus;
_newKillerScore = _killer getVariable ["ExileScore", 0];
_newKillerScore = _newKillerScore + (_overallRespectChange/2);
_killer setVariable ["ExileScore", _newKillerScore];
format["setAccountScore:%1:%2", _newKillerScore,getPlayerUID _killer] call ExileServer_system_database_query_fireAndForget;
_newKillerFrags = _killer getVariable ["ExileKills", 0];
_newKillerFrags = _newKillerFrags + 1;
_killer setVariable ["ExileKills", _newKillerFrags];
format["addAccountKill:%1", getPlayerUID _killer] call ExileServer_system_database_query_fireAndForget;
_money = _killer getVariable ["ExileMoney", 0];
_money = _money + (_overallRespectChange/2) + (_kills * 2);
_killer setVariable ["ExileMoney", _money];
format["setAccountMoney:%1:%2", _money, (getPlayerUID _killer)] call ExileServer_system_database_query_fireAndForget;
_message = ["showFragRequest",_overallRespectChange];
//_message remoteExecCall ["ExileClient_system_network_dispatchIncomingMessage", (owner _killer)];
_killer call ExileServer_object_player_sendStatsUpdate;
};
//_reward

View File

@ -39,7 +39,7 @@ if (_modType isEqualTo "Epoch") then
};
if (_modType isEqualTo "Exile") then
{
"i_g_soldier_unarmed_f" createUnit [_pos, _aiGroup, "_ai1 = this", 0.7, "COLONEL"];
"i_g_soldier_unarmed_f" createUnit [_pos, _aiGroup, "_ai1 = this", blck_baseSkill, "COLONEL"];
switch(_skillLevel) do
{
case "blue":{_ai1 setVariable["ExileMoney",floor(random(blck_maxMoneyBlue)),true];};

View File

@ -1,186 +0,0 @@
/*
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
*/
//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"];
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
//_weaponList = _this select 1; // List of weapons with which to arm the AI
//_aiGroup = _this select 2; // Group to which AI belongs
//_skillLevel = [_this,3,"red"] call BIS_fnc_param; // Assign a skill level in case one was not passed."blue", "red", "green", "orange"
//_Launcher = [_this, 4, "none"] call BIS_fnc_param; // Set launchers to "none" if no setting was passed.
//_uniforms = [_this, 5, blck_SkinList] call BIS_fnc_param; // skins to add to AI
//_headGear = [_this, 6, _shemag] call BIS_fnc_param;// headGear to add to AI
if (isNull _aiGroup) exitWith {diag_log "[blckeagls] ERROR CONDITION:-->> NULL-GROUP Provided to _fnc_spawnUnit"};
_ai1 = ObjNull;
_modType = call blck_getModType;
if (_modType isEqualTo "Epoch") then
{
"I_Soldier_EPOCH" createUnit [_pos, _aiGroup, "_ai1 = this", 0.7, "COLONEL"];
switch(_skillLevel) do
{
case "blue":{_ai1 setVariable["Crypto",1 + floor(random(blck_maxMoneyBlue)),true];};
case "red":{_ai1 setVariable["Crypto",2 + floor(random(blck_maxMoneyRed)),true];};
case "green":{_ai1 setVariable["Crypto",3 + floor(random(blck_maxMoneyGreen)),true];};
case "orange":{_ai1 setVariable["Crypto",4 + floor(random(blck_maxMoneyOrange)),true];};
};
};
if (_modType isEqualTo "Exile") then
{
"i_g_soldier_unarmed_f" createUnit [_pos, _aiGroup, "_ai1 = this", 0.7, "COLONEL"];
switch(_skillLevel) do
{
case "blue":{_ai1 setVariable["ExileMoney",floor(random(blck_maxMoneyBlue)),true];};
case "red":{_ai1 setVariable["ExileMoney",floor(random(blck_maxMoneyRed)),true];};
case "green":{_ai1 setVariable["ExileMoney",floor(random(blck_maxMoneyGreen)),true];};
case "orange":{_ai1 setVariable["ExileMoney",floor(random(blck_maxMoneyOrange)),true];};
};
};
[_ai1] call blck_fnc_removeGear;
_skin = "";
_counter = 1;
while {_skin isEqualTo "" && _counter < 10} do
{
_skin = selectRandom _uniforms; // call BIS_fnc_selectRandom;
//_ai1 forceAddUniform _skin;
_ai1 forceAddUniform _skin;
_skin = uniform _ai1;
//diag_log format["_fnc_spawnUnit::-->> for unit _ai1 % uniform is %2",_ai1, uniform _ai1];
_counter =+1;
};
//Stops the AI from being cleaned up
_ai1 setVariable["DBD_AI",1];
//Sets AI Tactics
_ai1 enableAI "TARGET";
_ai1 enableAI "AUTOTARGET";
_ai1 enableAI "MOVE";
_ai1 enableAI "ANIM";
_ai1 enableAI "FSM";
_ai1 allowDammage true;
_ai1 setBehaviour "COMBAT";
_ai1 setunitpos "AUTO";
if (_modType isEqualTo "Epoch") then
{
// do this so the AI or corpse hangs around on Epoch servers.
_ai1 setVariable ["LAST_CHECK",28800,true];
};
_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
{
//_bpck = selectRandom blck_backpack;
_ai1 addBackpack selectRandom blck_backpacks;
};
_weap = selectRandom _weaponList;
_ai1 addWeaponGlobal _weap;
_ammoChoices = getArray (configFile >> "CfgWeapons" >> _weap >> "magazines");
//_muzzles = getArray (configFile >> "CfgWeapons" >> _weap >> "muzzles");
_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 (floor(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);
if ((count(getArray (configFile >> "cfgWeapons" >> _weap >> "muzzles"))) > 1) then {
_ai1 addMagazine "1Rnd_HE_Grenade_shell";
};
_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;
//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);
};
// Add an First Aid or Grenade 50% of the time
if (round(random 10) <= 5) then
{
//_item = selectRandom blck_specialItems;
//diag_log format["spawnUnit.sqf] -- Item is %1", _item];
_ai1 addItem selectRandom blck_specialItems;
};
if (_Launcher != "none") then
{
private["_bpck"];
_ai1 addWeaponGlobal _Launcher;
for "_i" from 1 to 3 do
{
_ai1 addItemToBackpack (getArray (configFile >> "CfgWeapons" >> _Launcher >> "magazines") select 0); // call BIS_fnc_selectRandom;
};
_ai1 setVariable["Launcher",_launcher];
};
if(sunOrMoon < 0.2 && blck_useNVG)then
{
_ai1 addWeapon selectRandom blck_NVG;
_ai1 setVariable ["hasNVG", true];
}
else
{
_ai1 setVariable ["hasNVG", false];
};
// Infinite ammo
_ai1 addeventhandler ["fired", {(_this select 0) setvehicleammo 1;}];
_ai1 addEventHandler ["killed",{ [(_this select 0), (_this select 1)] execVM blck_EH_AIKilled;}]; // changed to reduce number of concurrent threads, but also works as spawn blck_AIKilled; }];
//_ai addEventHandler ["HandleDamage",{ [(_this select 0), (_this select 1)] execVM blck_EH_AIHandleDamage;}];
switch (_skillLevel) do
{
case "blue": {_index = 0;_aiSkills = blck_SkillsBlue;};
case "red": {_index = 1;_aiSkills = blck_SkillsRed;};
case "green": {_index = 2;_aiSkills = blck_SkillsGreen;};
case "orange": {_index = 3;_aiSkills = blck_SkillsOrange;};
default {_index = 0;_aiSkills = blck_SkillsBlue;};
};
//_alertDist = blck_AIAlertDistance select _index;
//_intelligence = blck_AIIntelligence select _index;
[_ai1,_aiSkills] call blck_fnc_setSkill;
_ai1 setVariable ["alertDist",blck_AIAlertDistance select _index,true];
_ai1 setVariable ["intelligence",blck_AIIntelligence select _index,true];
_ai1 setVariable ["GMS_AI",true,true];
_ai1

View File

@ -2,7 +2,7 @@
AI Mission for Epoch Mod for Arma 3
By Ghostrider
Functions and global variables used by the mission system.
Last modified 11/16/16
Last modified 1/7/17
*/
blck_functionsCompiled = false;
@ -24,7 +24,6 @@ blck_fnc_MessagePlayers = compileFinal preprocessFileLineNumbers "\q\addons\cus
// Mission-related functions
blck_fnc_missionTimer = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_missionTimer.sqf";
blck_fnc_addMissionToQue = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_addMissionToQue.sqf"; //
blck_fnc_updateMissionQue = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_updateMissionQue.sqf"; //
blck_fnc_addLiveAItoQue = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_addLiveAItoQue.sqf";
@ -37,13 +36,21 @@ blck_fnc_spawnCompositionObjects = compileFinal preprocessFileLineNumbers "\q\a
blck_fnc_spawnRandomLandscape = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnRandomLandscape.sqf";
blck_fnc_addItemToCrate = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_addItemToCrate.sqf";
blck_fnc_loadLootItemsFromArray = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc__loadLootItemsFromArray.sqf";
blck_fnc_fillBoxes = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_fillBoxes.sqf"; // Adds items to an object according to passed parameters. See the script for details.
blck_fnc_smokeAtCrates = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_smokeAtCrates.sqf"; // Spawns a wreck and adds smoke to it
blck_fnc_spawnMines = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnMines.sqf"; // Deploys mines at random locations around the mission center
blck_fnc_clearMines = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_clearMines.sqf"; // clears mines in an array passed as a parameter
blck_fnc_signalEnd = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_signalEnd.sqf"; // deploy smoke grenades at loot crates at the end of the mission.
// Reinforcement-related functions
blck_fnc_callInReinforcements = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_callInReinforcements.sqf";
blck_fnc_dropReinforcements = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_dropReinforcements.sqf";
blck_fnc_spawnHeliParaCrate = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_spawnParaCrate.sqf";
blck_fnc_spawnParaCrate = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_spawnParaUnits.sqf";
blck_fnc_sendHeliHome = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_sendHeliHome.sqf";
//blck_fnc_spawnHeliPatrol = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_spawnParaUnits.sqf";
//blck_fnc_spawnHeliPatrol = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_spawnParaUnits.sqf";
// Group-related functions
blck_fnc_spawnGroup = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Groups\GMS_fnc_spawnGroup.sqf"; // Spawn a single group and populate it with AI units]
blck_fnc_setupWaypoints = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Groups\GMS_fnc_setWaypoints.sqf"; // Set default waypoints for a group
@ -59,10 +66,7 @@ blck_fnc_spawnVehiclePatrol = compileFinal preprocessFileLineNumbers "\q\addons
// *************
//blck_fnc_spawnMissionVehicles = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_spawnMissionVehicles.sqf"; // Spawn non-AI vehicles at missions; these will be filled with loot following the parameters in the composition array for the mission
// *************
blck_fnc_Reinforcements = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_reinforcements.sqf";
blck_spawnHeliParaTroops = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_heliSpawnParatroops.sqf";
blck_spawnHeliParaCrate = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_heliSpawnCrate.sqf";
blck_spawnHeliPatrol = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_heliSpawnPatrol.sqf";
blck_fnc_protectVehicle = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_protectVehicle.sqf";
blck_fnc_configureMissionVehicle = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_configureMissionVehicle.sqf";

View File

@ -6,7 +6,7 @@
Last modified 10/25/16
*/
//blck_variablesLoaded = false;
blck_debugON = true;
blck_debugON = false;
blck_debugLevel = 0; // Reserved for certain testing modes.
blck_minFPS = 10;

View File

@ -161,12 +161,14 @@ Last modified 8/1/15
// values are ordered as follows [blue, red, green, orange];
blck_AliveAICleanUpTime = 900; // Time after mission completion at which any remaining live AI are deleted.
blck_cleanupCompositionTimer = 1200;
blck_AIAlertDistance = [150,225,250,300];
blck_AIAlertDistance = [250,325,450,500];
//blck_AIAlertDistance = [150,225,400,500];
// How precisely player locations will be revealed to AI after an AI kill
// values are ordered as follows [blue, red, green, orange];
blck_AIIntelligence = [0.5, 1, 2, 4];
blck_baseSkill = 1.0;
/***************************************************************
MISSION TYPE SPECIFIC AI SETTINGS
@ -180,30 +182,35 @@ Last modified 8/1/15
blck_SkillsOrange = [
["aimingAccuracy",0.4],["aimingShake",0.7],["aimingSpeed",0.7],["endurance",1.00],["spotDistance",1.0],["spotTime",1.0],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]
];
blck_reinforceOrange = [0.3, 5, 0.2];
// Green Missions
blck_MinAI_Green = 16;
blck_MaxAI_Green = 21;
blck_AIGrps_Green = 5;
blck_SkillsGreen = [
["aimingAccuracy",0.25],["aimingShake",0.5],["aimingSpeed",0.6],["endurance",0.9],["spotDistance",0.9],["spotTime",0.9],["courage",0.9],["reloadSpeed",0.9],["commanding",0.9],["general",0.75]
["aimingAccuracy",0.3],["aimingShake",0.65],["aimingSpeed",0.65],["endurance",0.9],["spotDistance",0.9],["spotTime",0.9],["courage",0.9],["reloadSpeed",0.9],["commanding",0.9],["general",0.75]
];
blck_reinforceGreen = [0.25, 4, 0.2];
// Red Missions
blck_MinAI_Red = 12;
blck_MaxAI_Red = 15;
blck_AIGrps_Red = 3;
blck_SkillsRed = [
["aimingAccuracy",0.16],["aimingShake",0.3],["aimingSpeed",0.6],["endurance",0.70],["spotDistance",0.7],["spotTime",0.8],["courage",0.80],["reloadSpeed",0.70],["commanding",0.8],["general",0.70]
["aimingAccuracy",0.2],["aimingShake",0.6],["aimingSpeed",0.6],["endurance",0.80],["spotDistance",0.7],["spotTime",0.8],["courage",0.80],["reloadSpeed",0.70],["commanding",0.8],["general",0.70]
];
blck_reinforceRed = [0.2, 3, 0.2];
// Blue Missions
blck_MinAI_Blue = 8;
blck_MaxAI_Blue = 12;
blck_AIGrps_Blue = 2;
blck_SkillsBlue = [
["aimingAccuracy",0.1],["aimingShake",0.25],["aimingSpeed",0.3],["endurance",0.50],["spotDistance",0.6],["spotTime",0.6],["courage",0.60],["reloadSpeed",0.60],["commanding",0.7],["general",0.60]
["aimingAccuracy",0.1],["aimingShake",0.5],["aimingSpeed",0.5],["endurance",0.50],["spotDistance",0.6],["spotTime",0.6],["courage",0.60],["reloadSpeed",0.60],["commanding",0.7],["general",0.60]
];
blck_reinforceBlue = [0.1, 2, 0.2];
// Add some money to AI; only works with Exile for now.
blck_maxMoneyOrange = 25;
blck_maxMoneyGreen = 20;

View File

@ -118,13 +118,6 @@ Last modified 8/1/15
blck_SpawnEmplaced_Blue = 1; // Number of static weapons at Blue Missions
blck_SpawnEmplaced_Red = 2; // Number of static weapons at Red Missions
// AI paratrooper reinforcement paramters
//blck_AIHelis = ["B_Heli_Light_01_armed_F","B_Heli_Transport_01_camo_F","B_Heli_Transport_03_F"];
blck_reinforcementsOrange = [0,5,0,0]; // Chance of reinforcements, number of reinforcements, Chance of reinforcing heli patrols, chance of dropping supplies for the reinforcements
blck_reinforcementsGreen = [0,4,0,0];
blck_reinforcementsRed = [0,3,0,0];
blck_reinforcementsBlue = [0,2,0.0,0];
// MISSION TIMERS
// Reduce to 1 sec for immediate spawns, or longer if you wish to space the missions out
blck_TMin_Orange = 250;
@ -171,7 +164,9 @@ Last modified 8/1/15
// How precisely player locations will be revealed to AI after an AI kill
// values are ordered as follows [blue, red, green, orange];
blck_AIIntelligence = [0.5, 1, 2, 4];
blck_baseSkill = 1.0;
/***************************************************************
MISSION TYPE SPECIFIC AI SETTINGS
@ -185,30 +180,35 @@ Last modified 8/1/15
blck_SkillsOrange = [
["aimingAccuracy",0.4],["aimingShake",0.7],["aimingSpeed",0.7],["endurance",1.00],["spotDistance",1.0],["spotTime",1.0],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]
];
blck_reinforceOrange = [0.3, 5, 0.2];
// Green Missions
blck_MinAI_Green = 16;
blck_MaxAI_Green = 21;
blck_AIGrps_Green = 5;
blck_SkillsGreen = [
["aimingAccuracy",0.25],["aimingShake",0.5],["aimingSpeed",0.6],["endurance",0.9],["spotDistance",0.9],["spotTime",0.9],["courage",0.9],["reloadSpeed",0.9],["commanding",0.9],["general",0.75]
["aimingAccuracy",0.3],["aimingShake",0.65],["aimingSpeed",0.65],["endurance",0.9],["spotDistance",0.9],["spotTime",0.9],["courage",0.9],["reloadSpeed",0.9],["commanding",0.9],["general",0.75]
];
blck_reinforceGreen = [0.25, 4, 0.2];
// Red Missions
blck_MinAI_Red = 12;
blck_MaxAI_Red = 15;
blck_AIGrps_Red = 3;
blck_SkillsRed = [
["aimingAccuracy",0.16],["aimingShake",0.3],["aimingSpeed",0.6],["endurance",0.70],["spotDistance",0.7],["spotTime",0.8],["courage",0.80],["reloadSpeed",0.70],["commanding",0.8],["general",0.70]
["aimingAccuracy",0.2],["aimingShake",0.6],["aimingSpeed",0.6],["endurance",0.80],["spotDistance",0.7],["spotTime",0.8],["courage",0.80],["reloadSpeed",0.70],["commanding",0.8],["general",0.70]
];
blck_reinforceRed = [0.2, 3, 0.2];
// Blue Missions
blck_MinAI_Blue = 8;
blck_MaxAI_Blue = 12;
blck_AIGrps_Blue = 2;
blck_SkillsBlue = [
["aimingAccuracy",0.1],["aimingShake",0.25],["aimingSpeed",0.3],["endurance",0.50],["spotDistance",0.6],["spotTime",0.6],["courage",0.60],["reloadSpeed",0.60],["commanding",0.7],["general",0.60]
["aimingAccuracy",0.1],["aimingShake",0.5],["aimingSpeed",0.5],["endurance",0.50],["spotDistance",0.6],["spotTime",0.6],["courage",0.60],["reloadSpeed",0.60],["commanding",0.7],["general",0.60]
];
blck_reinforceBlue = [0.1, 2, 0.2];
// Add some money to AI; only works with Exile for now.
blck_maxMoneyOrange = 25;
blck_maxMoneyGreen = 20;

View File

@ -28,7 +28,7 @@ if (blck_debugON) then
blck_enableOrangeMissions = 1;
blck_enableGreenMissions = 1;
blck_enableRedMissions = 2;
blck_enableBlueMissions = 2;
blck_enableBlueMissions = 1;
blck_cleanupCompositionTimer = 10; // Time after mission completion at which items in the composition are deleted.
@ -59,7 +59,7 @@ if (blck_debugON) then
blck_TMax_Green = 38;
blck_TMax_Orange = 31;
blck_reinforceBlue = [0.999, 2, 0.001];
//blck_MissionTimout = 120; // 40 min
blck_SkillsBlue = [
["aimingAccuracy",0.01],

View File

@ -30,10 +30,10 @@ _noEmplacedWeapons = blck_SpawnEmplaced_Blue;
_uniforms = blck_SkinList;
_headgear = blck_headgear;
_chanceReinforcements = 0; //blck_reinforcementsBlue select 0;
_noPara = 2; //blck_reinforcementsBlue select 1;
_chanceHeliPatrol = 0;//blck_reinforcementsBlue select 2;
_chanceLoot = 0.992; //blck_reinforcementsBlue select 3;
_chanceReinforcements = 0.9999;
_noPara = 3; //blck_reinforcementsBlue select 1;
_chanceHeliPatrol = 0;
_chanceLoot = 0.9999;
private["_weap","_mags","_backpacks","_optics","_loadout","_reinforcementLootCounts"];
_weap = 3 + floor(random(4));

View File

@ -4,7 +4,12 @@ Loosely based on the AI mission system by blckeagls ver 2.0.2
Contributions by Narines: bug fixes, testing, 'fired' event handler
Ideas or code from that by Vampire and KiloSwiss have been used for certain functions.
1/3/17 Version 6.51 Build 22
1/7/17 Version 6.53 Build 24
Added a setting blck_baseSkill = 0.7; // This defines the base skil of AI. Increase it to make AI more challenging.
Tweaked AI difficulty settings to make missions more difficult.
Tweaked debugging information to reduced unnecessary logging when not in debug-mode.
1/3/17 Version 6.51 Build 23
Moved configuration for the client from debug\blckclient.sqf to debug\blckconfig.sqf.
Added a setting blck_useKillMessages = true/false; (line 60 of the config. when true, kill messages will be send to all players when a player kills an AI. The style of the message is controlled client-side (debug\blck_config.sqf)
Added a setting blck_useKillScoreMessage = true/false; // (line 61 of the config) when true a tile is displayed to the killer with the kill score information

View File

@ -1,3 +1,3 @@
private ["_version","_versionDate"];
_blck_version = "6.51 Build 23";
_blck_versionDate = "1-4-17 9:00 PM";
_blck_version = "6.53 Build 24";
_blck_versionDate = "1-7-17 9:00 PM";

View File

@ -4,7 +4,7 @@ Loosely based on the AI mission system by blckeagls ver 2.0.2
Contributions by Narines: bug fixes, testing, 'fired' event handler
Ideas or code from that by Vampire and KiloSwiss have been used for certain functions.
1/3/17 Version 6.51 Build 22
1/3/17 Version 6.51 Build 23
Moved configuration for the client from debug\blckclient.sqf to debug\blckconfig.sqf.
Added a setting blck_useKillMessages = true/false; (line 60 of the config. when true, kill messages will be send to all players when a player kills an AI. The style of the message is controlled client-side (debug\blck_config.sqf)
Added a setting blck_useKillScoreMessage = true/false; // (line 61 of the config) when true a tile is displayed to the killer with the kill score information