Merge branch 'Expirmental'
This commit is contained in:
commit
96e1e0da4a
@ -116,7 +116,8 @@ if (!local _player) then {
|
||||
_newPlyr setVariable ["SETUP", true];
|
||||
_newPlyr setVariable ["PUID", _playerUID];
|
||||
_newPlyr setVariable ["GROUP", _playerGroup];
|
||||
_newPlyr setVariable ["REVIVE", false];
|
||||
//Zepheris - Comment Revive variable
|
||||
//_newPlyr setVariable ["REVIVE", false];
|
||||
_newPlyr setVariable ["SERVER_VARS",_player getVariable ["SERVER_VARS",[]]];
|
||||
_newPlyr setVariable ["EPOCH_playerPlayTime",_player getvariable ["EPOCH_playerPlayTime",0],true];
|
||||
|
||||
|
1
Server/mpmissions/epoch.Bornholm/TCL_System/$MIKERO$
Normal file
1
Server/mpmissions/epoch.Bornholm/TCL_System/$MIKERO$
Normal file
@ -0,0 +1 @@
|
||||
DePbo.dll.7.16
|
1
Server/mpmissions/epoch.Bornholm/TCL_System/$PREFIX$
Normal file
1
Server/mpmissions/epoch.Bornholm/TCL_System/$PREFIX$
Normal file
@ -0,0 +1 @@
|
||||
TCL_System
|
1
Server/mpmissions/epoch.Bornholm/TCL_System/$VERSION$
Normal file
1
Server/mpmissions/epoch.Bornholm/TCL_System/$VERSION$
Normal file
@ -0,0 +1 @@
|
||||
Fri Jun 28 18:09:53 2019
|
113
Server/mpmissions/epoch.Bornholm/TCL_System/Config.cpp
Normal file
113
Server/mpmissions/epoch.Bornholm/TCL_System/Config.cpp
Normal file
@ -0,0 +1,113 @@
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Tactical Combat Link - ( TypeX ) - System Config
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define _ARMA_
|
||||
|
||||
class CfgPatches
|
||||
{
|
||||
class TCL_System
|
||||
{
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = 1.82;
|
||||
requiredAddons[] = {"A3_Data_F","A3_Characters_F"};
|
||||
versionDesc = "Tactical Combat Link - ( TypeX )";
|
||||
version = "1.0.31";
|
||||
};
|
||||
};
|
||||
|
||||
class CfgMods
|
||||
{
|
||||
class TCL_Mods
|
||||
{
|
||||
dir = "@TCL";
|
||||
name = "Tactical Combat Link - ( TypeX )";
|
||||
author = "=\SNKMAN/=";
|
||||
action = "https://forums.bohemia.net/forums/topic/221659-tactical-combat-link-typex/";
|
||||
picture = "A3\Ui_f\data\Logos\arma3_expansion_alpha_ca";
|
||||
tooltip = "Tactical Combat Link";
|
||||
overview = "Tactical Combat Link - ( TypeX ) is a highly dynamic A.I. and F.X. improvement and enhancement modification for ARMA 3.";
|
||||
};
|
||||
};
|
||||
|
||||
class TCL_Path
|
||||
{
|
||||
// ///////////// PBO ////////////////
|
||||
TCL_Root = "\TCL_System\";
|
||||
// /////////////////////////////////////
|
||||
|
||||
// ///////////// Script ////////////////
|
||||
// TCL_Root = "\@TCL\AddOns\TCL_System\";
|
||||
// ///////////////////////////////////////
|
||||
};
|
||||
|
||||
#define TCL_EH_System "if (isNil 'TCL_Path') then {TCL_Path = getText (configFile >> 'TCL_Path' >> 'TCL_Root'); call compile preProcessFileLineNumbers (TCL_Path+'TCL_Preprocess.sqf') }";
|
||||
|
||||
class CfgVehicles
|
||||
{
|
||||
class Man;
|
||||
class Land;
|
||||
|
||||
class CAManBase : Man
|
||||
{
|
||||
class EventHandlers
|
||||
{
|
||||
class TCL_EH_Init
|
||||
{
|
||||
init = TCL_EH_System
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class RscText;
|
||||
|
||||
class RscStandardDisplay;
|
||||
|
||||
class RscDisplayMain : RscStandardDisplay
|
||||
{
|
||||
class controls
|
||||
{
|
||||
class TCL_System_RscDisplayMain : RscText
|
||||
{
|
||||
style = 0x01 + 0x100;
|
||||
|
||||
sizeEx = 0.05;
|
||||
|
||||
x = "(SafeZoneH + SafeZoneX) - (1 - 0.45)";
|
||||
y = "(SafeZoneH + SafeZoneY) - (1 - 0.83)";
|
||||
|
||||
w = 0.5;
|
||||
h = 0.05;
|
||||
|
||||
text = "Tactical Combat Link - TypeX";
|
||||
};
|
||||
|
||||
class TCL_Version_RscDisplayMain : TCL_System_RscDisplayMain
|
||||
{
|
||||
sizeEx = 0.03;
|
||||
|
||||
colortext[] = {1.0, 0.0, 0.0, 1.0};
|
||||
|
||||
x = "(SafeZoneH + SafeZoneX) - (1 - 0.45)";
|
||||
y = "(SafeZoneH + SafeZoneY) - (1 - 0.88)";
|
||||
|
||||
text = "Version: 1.0.31";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class CfgAddOns
|
||||
{
|
||||
class PreloadBanks {};
|
||||
|
||||
class PreloadAddOns
|
||||
{
|
||||
class TCL_System
|
||||
{
|
||||
list[] = {"TCL_System"};
|
||||
};
|
||||
};
|
||||
};
|
@ -0,0 +1,60 @@
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Church Ambient Sound
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Idea and Sounds by Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project )
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
private ["_objects","_church","_index","_sound","_time"];
|
||||
|
||||
sleep 5 - (random 5);
|
||||
|
||||
while { (True) } do
|
||||
{
|
||||
if ( [dayTime] call TCL_Daytime_F ) then
|
||||
{
|
||||
sleep 10 + (random 30);
|
||||
|
||||
if (alive player) then
|
||||
{
|
||||
if (floor (random 100) < 50) then
|
||||
{
|
||||
_objects = nearestObjects [player, ["Land_Church_01_F","Land_Church_02_F","Land_Church_03_F"], 500];
|
||||
|
||||
if (count _objects > 0) then
|
||||
{
|
||||
_church = (_objects select 0);
|
||||
|
||||
_index = [8,9,10] call TCL_Random_F;
|
||||
|
||||
_sound = (TCL_Resource select _index) call TCL_Random_F;
|
||||
|
||||
_time = 50 + (random 100);
|
||||
|
||||
if (True) then
|
||||
{
|
||||
if (_index == 8) exitWith
|
||||
{
|
||||
_time = 130 + (random 130);
|
||||
};
|
||||
|
||||
if (_index == 9) exitWith
|
||||
{
|
||||
_time = 150 + (random 150);
|
||||
};
|
||||
|
||||
if (_index == 10) exitWith
|
||||
{
|
||||
_time = 170 + (random 170);
|
||||
};
|
||||
};
|
||||
|
||||
_church say3D [_sound, 500];
|
||||
|
||||
sleep _time;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sleep 150 + (random 170);
|
||||
};
|
@ -0,0 +1,35 @@
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Lighthouse Ambient Sound
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Idea and Sounds by Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project )
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
private ["_objects","_lighthouse","_sound"];
|
||||
|
||||
sleep 10 + (random 30);
|
||||
|
||||
while { (True) } do
|
||||
{
|
||||
if ( [dayTime] call TCL_Daytime_F ) then
|
||||
{
|
||||
sleep 150 + (random 170);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fog > 0) then
|
||||
{
|
||||
_objects = nearestObjects [player, ["Land_LightHouse_F","Land_LightHouse_smalle_F","Land_LightHouse_03_green_F","Land_LightHouse_03_red_F"], 500];
|
||||
|
||||
if (count _objects > 0) then
|
||||
{
|
||||
_lighthouse = (_objects select 0);
|
||||
|
||||
_sound = (TCL_Resource select 11) call TCL_Random_F;
|
||||
|
||||
_lighthouse say3D [_sound, 1000];
|
||||
};
|
||||
};
|
||||
|
||||
sleep 150 + (random 170);
|
||||
};
|
||||
};
|
@ -0,0 +1,101 @@
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// TCL v.1.0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Radio Chatter
|
||||
// Script by =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
private ["_index","_vehicle","_turrets","_side","_string","_delay"];
|
||||
|
||||
// call compile preprocessFileLineNumbers (TCL_Path+"TCL\TCL_Database\TCL_Radio.sqf");
|
||||
|
||||
#define _define1 30 - (random 30); while { ( (_delay > 0) && (_vehicle == vehicle player) ) } do {_delay = _delay - 1; sleep 1}; _vehicle = [_vehicle] call (TCL_Chatter_F select 3)
|
||||
|
||||
#include "TCL_Resource.hpp"
|
||||
|
||||
_isAir =
|
||||
{
|
||||
( (_vehicle isKindOf "Air") && (isEngineOn _vehicle) && (TCL_Chatter select 0) && (_side == 1) )
|
||||
};
|
||||
|
||||
_isLand =
|
||||
{
|
||||
( ( (_vehicle isKindOf "Car") || (_vehicle isKindOf "Tank") ) && { (count _turrets > 0) } && { (isEngineOn _vehicle) } && { (TCL_Chatter select 0) } )
|
||||
};
|
||||
|
||||
waitUntil { !(isNull (finddisplay 46) ) };
|
||||
|
||||
_index = (findDisplay 46) displayAddEventHandler ["KeyDown", "_this call (TCL_Chatter_F select 1)"];
|
||||
|
||||
while { (TCL_FX select 6) } do
|
||||
{
|
||||
if (player != vehicle player) then
|
||||
{
|
||||
_vehicle = (vehicle player);
|
||||
|
||||
_turrets = (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "turrets");
|
||||
|
||||
_side = getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "side");
|
||||
|
||||
switch (True) do
|
||||
{
|
||||
case (call _isAir) :
|
||||
{
|
||||
[_vehicle, (TCL_Chatter select 2), True] call (TCL_Chatter_F select 2);
|
||||
|
||||
while { (call _isAir) } do
|
||||
{
|
||||
if (floor (random 100) < 75) then
|
||||
{
|
||||
0 fadeMusic (TCL_Chatter select 1);
|
||||
|
||||
_string = ( (TCL_Resource select 2) + (TCL_Resource select 5) ) call TCL_Random_F;
|
||||
|
||||
playMusic _string;
|
||||
}
|
||||
else
|
||||
{
|
||||
[_vehicle] call (TCL_Chatter_F select 0);
|
||||
};
|
||||
|
||||
_delay = _define1;
|
||||
};
|
||||
};
|
||||
|
||||
case (call _isLand) :
|
||||
{
|
||||
[_vehicle, (TCL_Chatter select 2), True] call (TCL_Chatter_F select 2);
|
||||
|
||||
while { (call _isLand) } do
|
||||
{
|
||||
0 fadeMusic (TCL_Chatter select 1);
|
||||
|
||||
switch (_side) do
|
||||
{
|
||||
case 0 :
|
||||
{
|
||||
_string = (TCL_Resource select 4) call TCL_Random_F;
|
||||
};
|
||||
|
||||
case 1 :
|
||||
{
|
||||
_string = ( (TCL_Resource select 3) + (TCL_Resource select 5) ) call TCL_Random_F;
|
||||
};
|
||||
|
||||
case 2 :
|
||||
{
|
||||
_string = (TCL_Resource select 4) call TCL_Random_F;
|
||||
};
|
||||
};
|
||||
|
||||
playMusic _string;
|
||||
|
||||
_delay = _define1;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sleep 5;
|
||||
};
|
||||
|
||||
(findDisplay 46) displayRemoveEventHandler ["KeyDown", _index];
|
@ -0,0 +1,198 @@
|
||||
#include "TCL_Resource.hpp"
|
||||
|
||||
TCL_Chatter_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Chatter Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Chatter
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{private ["_vehicle","_sounds","_delays","_count","_sound","_delay"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
|
||||
if _getRandom(50) then
|
||||
{
|
||||
_sounds = ["West_Air_v56a","West_Air_v57a","West_Air_v58a","West_Air_v59a","West_Air_v60a","West_Air_v61a","West_Air_v62a","West_Air_v63a","West_Air_v64a","West_Air_v65a","West_Air_v66a","West_Air_v67a","West_Air_v68a","West_Air_v69a","West_Air_v70a","West_Air_v71a","West_Air_v72a","West_Air_v73a","West_Air_v74a","West_Air_v75a","West_Air_v76a","West_Air_v77a","West_Air_v78a","West_Air_v79a","West_Air_v80a","West_Air_v81a","West_Air_v82a","West_Air_v83a"];
|
||||
|
||||
_delays = [4.76, 3.4, 2.12, 2.56, 4.76, 1.5, 4.84, 2.16, 2.48, 4.4, 5.56, 2.36, 1.92, 2.72, 3.48, 5.56, 2.72, 2.92, 1.92, 2.24, 5.36, 4.36, 5.32, 4.48, 4.32, 5.12, 3.76, 10.96];
|
||||
}
|
||||
else
|
||||
{
|
||||
_sounds = ["West_Air_v84a","West_Air_v85a","West_Air_v86a","West_Air_v87a","West_Air_v88a","West_Air_v89a","West_Air_v90a","West_Air_v91a","West_Air_v92a","West_Air_v93a","West_Air_v94a","West_Air_v95a","West_Air_v96a"];
|
||||
|
||||
_delays = [2.24, 5.6, 11.3, 2.6, 2.12, 1.5, 2.84, 4.56, 3.72, 4.8, 3.84, 5.2, 3.2];
|
||||
};
|
||||
|
||||
_count = 0;
|
||||
|
||||
while { ( (alive _vehicle) && { (_vehicle == vehicle player) } && { (isEngineOn _vehicle) } && { (_count < count _sounds) } && { (TCL_Chatter select 0) } ) } do
|
||||
{
|
||||
0 fadeMusic (TCL_Chatter select 1);
|
||||
|
||||
_sound = (_sounds select _count);
|
||||
|
||||
playMusic _sound;
|
||||
|
||||
_delay = (_delays select _count);
|
||||
|
||||
sleep _delay;
|
||||
|
||||
_count = _count + 1;
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Chatter Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Chatter
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{private ["_key","_vehicle","_volume"];
|
||||
|
||||
_key = _this select 1;
|
||||
|
||||
_vehicle = (vehicle player);
|
||||
|
||||
if ( ( (_vehicle isKindOf "Car") || (_vehicle isKindOf "Tank") || (_vehicle isKindOf "Air") ) && { (isEngineOn _vehicle) } ) then
|
||||
{
|
||||
if ( (_key == (TCL_FX select 9) ) && ( (TCL_Chatter select 2) != 10) ) exitWith
|
||||
{
|
||||
_volume = (TCL_Chatter select 2);
|
||||
|
||||
_volume = _volume + 1;
|
||||
|
||||
if (_volume >= 10) then
|
||||
{
|
||||
_volume = 10;
|
||||
};
|
||||
|
||||
[_vehicle, _volume, False] call (TCL_Chatter_F select 2);
|
||||
};
|
||||
|
||||
if ( (_key == (TCL_FX select 10) ) && ( (TCL_Chatter select 2) != 0) ) exitWith
|
||||
{
|
||||
_volume = (TCL_Chatter select 2);
|
||||
|
||||
_volume = _volume - 1;
|
||||
|
||||
if (_volume <= 0) then
|
||||
{
|
||||
_volume = 0;
|
||||
};
|
||||
|
||||
[_vehicle, _volume, False] call (TCL_Chatter_F select 2);
|
||||
};
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Chatter Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Chatter
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{private ["_vehicle","_volume","_type","_displayName","_value","_count","_status","_string"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
_volume = _this select 1;
|
||||
_type = _this select 2;
|
||||
|
||||
_displayName = getText (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName");
|
||||
|
||||
if (_volume > 0) then
|
||||
{
|
||||
_value = "";
|
||||
|
||||
_count = 0;
|
||||
|
||||
for "_count" from _count to (_volume - 1) do
|
||||
{
|
||||
_value = _value + "|";
|
||||
};
|
||||
|
||||
TCL_Chatter set [0, True];
|
||||
|
||||
TCL_Chatter set [1, (_volume / 10) ];
|
||||
}
|
||||
else
|
||||
{
|
||||
_value = "Disabled";
|
||||
|
||||
TCL_Chatter set [0, False];
|
||||
|
||||
TCL_Chatter set [1, _volume];
|
||||
};
|
||||
|
||||
TCL_Chatter set [2, _volume];
|
||||
|
||||
[_type, _displayName, _value] spawn
|
||||
{
|
||||
_text =
|
||||
{
|
||||
parseText format ["<t color='#ffff00' size='1.5'>Radio Chatter</t><br/>%1 <t color='#32cd32' size='1.5'>%2</t>", _this, _status];
|
||||
};
|
||||
|
||||
if (_this select 0) then
|
||||
{
|
||||
_status = "Enabled";
|
||||
|
||||
_string = (_this select 1) call _text;
|
||||
|
||||
hint _string;
|
||||
|
||||
sleep 3;
|
||||
};
|
||||
|
||||
_status = (_this select 2);
|
||||
|
||||
_string = (_this select 1) call _text;
|
||||
|
||||
hint _string;
|
||||
};
|
||||
|
||||
True;
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Chatter Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Chatter
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{private ["_vehicle","_volume"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
|
||||
if (_vehicle != vehicle player) then
|
||||
{
|
||||
_volume = (TCL_Chatter select 1);
|
||||
|
||||
while { (_volume > 0) } do
|
||||
{
|
||||
_volume = _volume - 0.1;
|
||||
|
||||
0 fadeMusic _volume;
|
||||
|
||||
sleep 0.1;
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
|
||||
playMusic "";
|
||||
|
||||
hint "";
|
||||
|
||||
0 fadeMusic 0.5;
|
||||
};
|
||||
|
||||
_vehicle = (vehicle player);
|
||||
|
||||
_vehicle
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,46 @@
|
||||
// Vehicle Macro
|
||||
#define _getVehicle(type) (_vehicle isKindOf type)
|
||||
#define _isMan(object) (object == vehicle object)
|
||||
|
||||
// Side Macro
|
||||
#define _getSide(object) (side object in _getArray(TCL_Core,1) )
|
||||
|
||||
// Array Macro
|
||||
#define _getDebug(index) (TCL_Debug select index)
|
||||
#define _getLocal(index) (TCL_Local select index)
|
||||
#define _getGlobal(index) (TCL_Global select index)
|
||||
#define _getArray(array,index) (array select index)
|
||||
#define _spawn(array,index) spawn (array select index)
|
||||
#define _call(array,index) call (array select index)
|
||||
#define _setIn(array,index,value) [array,index,value] call TCL_Array_F
|
||||
#define _isIn(group,array,index) (group in (array select index) )
|
||||
#define _setOut(array,index,value) array set [index, (array select index) - [value] ]
|
||||
|
||||
// Unit Macro
|
||||
#define _isLeader(object) (object == leader object)
|
||||
#define _getUnit(index) units _group select (count units _group - index)
|
||||
#define _getUnits(group) { (alive _x) } count (units group)
|
||||
|
||||
// Number Macro
|
||||
#define _getRandom(value) (floor (random 100) < value)
|
||||
#define _getTime(value) (time + (value) )
|
||||
|
||||
// Enemy and Friend Macro
|
||||
#define _getKnows(object) knowsAbout vehicle object
|
||||
#define _isKnown(object) ( (alive object) && (_group _getKnows(object) > 0) )
|
||||
|
||||
#define _getEnemy(object) ( { ( (alive _x) && _isLeader(_x) && (side _x getFriend side object < 0.6) ) } count (units _group) > 0)
|
||||
#define _getFriend(group) ( { ( (alive _x) && _isLeader(_x) && (side _x getFriend side leader group > 0.6) ) } count (units _group) > 0)
|
||||
|
||||
#define _isEnemy(object) (_isKnown(object) && _getEnemy(object) )
|
||||
#define _isFriend(object) (_isKnown(object) && _getFriend(object) )
|
||||
|
||||
// Vehicle Macro
|
||||
#define _unAssignVehicle(object) unAssignVehicle object; [object] orderGetIn False
|
||||
|
||||
// Variable Macro
|
||||
#define _getVariable(object,string) [object,string] call TCL_Get_Variable_F
|
||||
|
||||
// uiNameSpace
|
||||
#define _callUI(string,index) call (uiNameSpace getVariable string select index)
|
||||
#define _spawnUI(string,index) spawn (uiNameSpace getVariable string select index)
|
@ -0,0 +1,137 @@
|
||||
TCL_Crew_FX_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Crew FX Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Crew FX
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_crew","_vehicle"];
|
||||
|
||||
private _driver = (driver _vehicle);
|
||||
|
||||
private _side = (side _driver);
|
||||
|
||||
private _group = createGroup _side;
|
||||
|
||||
while { (getPos _vehicle select 2 > 3) } do
|
||||
{
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
private ["_unit","_type","_spawn"];
|
||||
|
||||
while { (count _crew > 0) } do
|
||||
{
|
||||
_unit = (_crew select 0);
|
||||
|
||||
if (floor (random 100) < 35) then
|
||||
{
|
||||
_type = (typeOf _unit);
|
||||
|
||||
_spawn = _group createUnit [_type, [ (getPos _unit select 0), (getPos _unit select 1), - 5], [], 0, "CAN_COLLIDE"];
|
||||
|
||||
_spawn setDammage (random 0.3);
|
||||
|
||||
_spawn allowDamage False;
|
||||
|
||||
[_spawn, _vehicle] spawn (TCL_Crew_FX_F select 1);
|
||||
|
||||
// _type createUnit [ [ (getPos _unit select 0), (getPos _unit select 1), - 5], _group, "if (TCL_Multiplayer) then {if (isServer) then {this allowDamage False; [this, _vehicle] spawn (TCL_Crew_FX_F select 1) } else { [this] spawn (TCL_Fire_FX_F select 0) } } else {this allowDamage False; [this, _vehicle] spawn (TCL_Crew_FX_F select 1) }"];
|
||||
};
|
||||
|
||||
_crew deleteAt (_crew find _unit);
|
||||
|
||||
deleteVehicle _unit;
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Crew Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Crew FX
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_vehicle"];
|
||||
|
||||
[_unit] join grpNull;
|
||||
|
||||
private _group = (group _unit);
|
||||
|
||||
(TCL_Disabled select 0) pushBack _group;
|
||||
|
||||
removeAllWeapons _unit;
|
||||
|
||||
_unit allowFleeing 0;
|
||||
|
||||
_unit setCaptive True;
|
||||
|
||||
_unit setUnitPos "UP";
|
||||
|
||||
_unit setSpeedMode "FULL";
|
||||
|
||||
_unit setCombatMode "BLUE";
|
||||
|
||||
_unit disableAI "AUTOCOMBAT";
|
||||
|
||||
_unit setBehaviour "CARELESS";
|
||||
|
||||
sleep 10 + (random 30);
|
||||
|
||||
if (TCL_Multiplayer) then
|
||||
{
|
||||
TCL_Public = [_unit];
|
||||
|
||||
publicVariable "TCL_Public";
|
||||
|
||||
if (TCL_Dedicated) exitWith {};
|
||||
|
||||
[_unit] spawn (TCL_Fire_FX_F select 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
[_unit] spawn (TCL_Fire_FX_F select 0);
|
||||
};
|
||||
|
||||
_unit setDir (random 360);
|
||||
|
||||
_unit setPos (getPos _vehicle);
|
||||
|
||||
_unit allowDamage True;
|
||||
|
||||
private _array = ["AmovPpneMstpSnonWnonDnon_AmovPpneMevaSnonWnonDr","AmovPpneMstpSnonWnonDnon_AmovPpneMevaSnonWnonDl"];
|
||||
|
||||
while { (alive _unit) } do
|
||||
{
|
||||
_unit doMove [ ( (getPos _unit select 0) + (random 100 - random 100) ), ( (getPos _unit select 1) + (random 100 - random 100) ), 0];
|
||||
|
||||
if (floor (random 100) < 35) then
|
||||
{
|
||||
if (_unit distance _vehicle > 5) then
|
||||
{
|
||||
if (animationState _unit in _array) exitWith {};
|
||||
|
||||
if (floor (random 100) < 50) then
|
||||
{
|
||||
_unit playMove "AmovPpneMstpSnonWnonDnon_AmovPpneMevaSnonWnonDr";
|
||||
}
|
||||
else
|
||||
{
|
||||
_unit playMove "AmovPpneMstpSnonWnonDnon_AmovPpneMevaSnonWnonDl";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_unit setDamage (damage _unit + random 0.1);
|
||||
|
||||
if (damage _unit > 0.5) then
|
||||
{
|
||||
_unit setDamage 1;
|
||||
};
|
||||
|
||||
sleep 5;
|
||||
};
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,49 @@
|
||||
TCL_Dirt_FX_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Dirt FX Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Dirt FX
|
||||
// Script by =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_vehicle","_size"];
|
||||
|
||||
if (isOnRoad _vehicle) exitWith {};
|
||||
|
||||
private "_random";
|
||||
|
||||
private _count = (_size + random _size);
|
||||
|
||||
while { (_count > 0) } do
|
||||
{
|
||||
_random = [0.5 + (random 0.7), [ (random 10 - random 10), (random 10 - random 10), 5 + (random 7) ], [0.3 + random 0.7, 0.7 - random 0.3] ];
|
||||
|
||||
drop [ ["\A3\Data_F\ParticleEffects\Universal\Universal.p3d", 16, 12, 9, 0], "", "Billboard", 0.05, (_random select 0),
|
||||
|
||||
[0,0,-1], (_random select 1), 0, 1, 0, 0,
|
||||
|
||||
(_random select 2), [ [0.1,0.1,0.1,1],[0.1,0.1,0.1,0.5],[0.1,0.1,0.1,0.3] ], [1],
|
||||
|
||||
1, 1, (TCL_Path+"TCL\TCL_AddOns\TCL_FX_F\TCL_Dirt_FX.sqf"), "", _vehicle, random 360];
|
||||
|
||||
_count = _count - 3;
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Dirt FX Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Dirt FX
|
||||
// Script by =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{
|
||||
|
||||
drop [ ["\A3\Data_f\ParticleEffects\Universal\Universal.p3d", 16, 12, 9, 0], "", "Billboard", 10, 1,
|
||||
|
||||
_this, [0,0,0], 0, 1.5, 1, 0,
|
||||
|
||||
[1 + random 1, 1 - random 1], [ [0.1,0.1,0.1,1],[0.1,0.1,0.1,0] ], [1000], 0, 0, "", "", ""];
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,84 @@
|
||||
TCL_Dust_FX_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Dust FX Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Dust FX
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_vehicle","_size"];
|
||||
|
||||
private "_random";
|
||||
|
||||
private _array = [ [0.345,0.345,0.168], [0.345,0.29,0.168], [0.4,0.3,0.2], [0.2,0.2,0.1] ] call TCL_Random_F;
|
||||
|
||||
private _color = [_array + [-0.1], _array + [-0.1], _array + [- random 0.5], _array + [-0.05] ];
|
||||
|
||||
if (floor (random 100) < 100) then
|
||||
{
|
||||
_d = 360;
|
||||
|
||||
while { (_d > 0) } do
|
||||
{
|
||||
_e = 3;
|
||||
|
||||
while { (_e > 0) } do
|
||||
{
|
||||
// _random = [7.5, [sin _d * 1, cos _d * 1, -2.0 + random 0.5 - random 1.5], [ (random 7 - random 7), (random 7 - random 7), (random 2 - random 2) ], [10 - random 2, 10 - random 4, 8] ];
|
||||
|
||||
// _random = [5, [sin _d * 3, cos _d * 3, - 3 + random 0.5 - random 1.5], [sin _d * 3, cos _d * 3, (random 3 - random 3) ], [_size] ];
|
||||
|
||||
_random =
|
||||
[
|
||||
10,
|
||||
[sin _d * 1, cos _d * 1, - 3 + random 1],
|
||||
[ (random 13 - random 13) * 3, (random 13 - random 13) * 3, (random 3 - random 3) ],
|
||||
[random _size]
|
||||
];
|
||||
|
||||
if (floor (random 100) < 50) then
|
||||
{
|
||||
// _random set [2, [70 * sin _d, 70 * cos _d, (random 3 - random 3) ] ];
|
||||
};
|
||||
|
||||
drop [ ["\A3\Data_F\ParticleEffects\Universal\Universal.p3d", 16, 12, 8, 0], "", "Billboard", 1, (_random select 0),
|
||||
|
||||
(_random select 1), (_random select 2), 0, 1, 0.7, 0.1,
|
||||
|
||||
(_random select 3), _color, [0,1,0], 0.6, 0.3, "", "", _vehicle, random 360];
|
||||
|
||||
_e = _e - 1;
|
||||
};
|
||||
|
||||
_d = _d - 1;
|
||||
|
||||
// sleep 0.01;
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_d = 0;
|
||||
|
||||
while { (_d < 361) } do
|
||||
{
|
||||
_e = 0;
|
||||
|
||||
while { (_e < 2) } do
|
||||
{
|
||||
_random = [7.5, [sin _d * 1, cos _d * 1, -2.0 + random 0.5 - random 1.5], [ (random 7 - random 7), (random 7 - random 7), (random 2 - random 2) ], [7 - random 4, 7 - random 4, 1] ];
|
||||
|
||||
drop [ ["\A3\Data_F\ParticleEffects\Universal\Universal.p3d", 16, 12, 8, 0], "", "Billboard", 1, (_random select 0),
|
||||
|
||||
(_random select 1), (_random select 2), 1, 2, 1.55, 0.10,
|
||||
|
||||
(_random select 3), _color, [0,1,0], 0.6, 0.3, "", "", _vehicle, random 360];
|
||||
|
||||
_e = _e + 1;
|
||||
};
|
||||
|
||||
_d = _d + 1;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,77 @@
|
||||
TCL_Flash_FX_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flash FX Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flash FX
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_vehicle","_size"];
|
||||
|
||||
private "_random";
|
||||
|
||||
private _count = _size;
|
||||
|
||||
_count = _count + (random _size);
|
||||
|
||||
while { (_count > 0) } do
|
||||
{
|
||||
_random =
|
||||
[
|
||||
round 1 + random 1,
|
||||
0.1 + random 0.1,
|
||||
[ (random _size), (random _size), (random _size) ]
|
||||
];
|
||||
|
||||
drop [ ["\A3\Data_F\ParticleEffects\Universal\Universal.p3d", 16, (_random select 0), 32, 1], "", "Billboard", 1, (_random select 1),
|
||||
|
||||
"destructionEffect1", [0,0,0], 0, 1, 0, 0,
|
||||
|
||||
(_random select 2), [ [1,1,1,-1],[1,1,1,-3],[1,1,1,-1] ], [ (random _size) ],
|
||||
|
||||
1, 1, "", "", _vehicle, random 360];
|
||||
|
||||
_count = _count - 1;
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flash FX Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flash FX
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_vehicle","_size"];
|
||||
|
||||
private "_random";
|
||||
|
||||
private _count = _size;
|
||||
|
||||
_count = _count + (random _size);
|
||||
|
||||
while { (_count > 0) } do
|
||||
{
|
||||
_random =
|
||||
[
|
||||
0.1 + random 0.3,
|
||||
[ (random 10 - random 10), (random 10 - random 10), (random _size) ]
|
||||
];
|
||||
|
||||
drop [ ["\A3\Data_F\ParticleEffects\Universal\Universal.p3d", 16, 0, 16, 1], "", "Billboard", 1, (_random select 0),
|
||||
|
||||
"destructionEffect1", (_random select 1), 0, 1, 0, 0,
|
||||
|
||||
[_size / 5, _size / 3], [ [1,1,1,-3],[1,1,1,-2],[1,1,1,-1],[1,1,1,-0] ], [ (random _size) + (random _size) ],
|
||||
|
||||
1, 1, "", "", _vehicle, random 360];
|
||||
|
||||
_count = _count - 1;
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,44 @@
|
||||
TCL_Mud_FX_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Mud FX Function #9
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Mud FX
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_vehicle","_size"];
|
||||
|
||||
if (isOnRoad _vehicle) exitWith {};
|
||||
|
||||
private "_random";
|
||||
|
||||
private _count = (_size * 3);
|
||||
|
||||
_count = (_count + random _size);
|
||||
|
||||
while { (_count > 0) } do
|
||||
{
|
||||
_random =
|
||||
[
|
||||
1 + random 3,
|
||||
[ (random 7 - random 7), (random 7 - random 7), 1 + (random 3) ],
|
||||
[_size / 3],
|
||||
[ [0.1,0.1,0.1,1],[0.1,0.1,0.1,0.5],[0.1,0.1,0.1,0.3] ]
|
||||
];
|
||||
|
||||
if (floor (random 100) < 35) then
|
||||
{
|
||||
_random set [3, [ [0.3,0.3,0.3,1],[0.3,0.3,0.3,0.5],[0.3,0.3,0.3,0.3] ] ];
|
||||
};
|
||||
|
||||
drop [ ["\A3\Data_F\ParticleEffects\Universal\Universal.p3d", 16, 12, 9, 0], "", "Billboard", 1, (_random select 0),
|
||||
|
||||
[0,0,-1], (_random select 1), 0, 1, 0, 0,
|
||||
|
||||
(_random select 2), (_random select 3), [1000], 0, 0, "", "", _vehicle, random 360];
|
||||
|
||||
_count = _count - 1;
|
||||
};
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,59 @@
|
||||
TCL_Shard_FX_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Shard FX Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Shrad FX
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_vehicle","_size"];
|
||||
|
||||
private _shard = ["Shard.p3d","Shard2.p3d","Shard3.p3d","Shard4.p3d"] call TCL_Random_F;
|
||||
|
||||
private _string = "\A3\Data_F\ParticleEffects\Shard\";
|
||||
|
||||
_string = _string + _shard;
|
||||
|
||||
private "_random";
|
||||
|
||||
private _count = _size;
|
||||
|
||||
_count = _count + (random _size);
|
||||
|
||||
while { (_count > 0) } do
|
||||
{
|
||||
_random =
|
||||
[
|
||||
50,
|
||||
[ (random _size - random _size), (random _size - random _size), (random _size) + (random _size) ],
|
||||
3 + random 5,
|
||||
[0.7 + random 0.3],
|
||||
0.5 - random 0.1
|
||||
];
|
||||
|
||||
if (floor (random 100) < 50) then
|
||||
{
|
||||
_random set [1, [ (random _size - random _size) * 5, (random _size - random _size) * 5, (random _size) + (random _size) ] ];
|
||||
};
|
||||
|
||||
if (_size < 10) then
|
||||
{
|
||||
_random set [3, [0.3 + random 0.7] ];
|
||||
};
|
||||
|
||||
if (_random select 3 select 0 > 0.5) then
|
||||
{
|
||||
_random set [4, 0.5 - random 0.3];
|
||||
};
|
||||
|
||||
drop [_string, "", "SpaceObject", 1, (_random select 0),
|
||||
|
||||
"destructionEffect1", (_random select 1), (_random select 2), 1, 0, 0,
|
||||
|
||||
(_random select 3), [ [1,1,1,1] ], [1000], random 0.5, random 1, "", "", _vehicle, random 360, True, (_random select 4) ];
|
||||
|
||||
_count = _count - 1;
|
||||
};
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,71 @@
|
||||
TCL_Smoke_FX_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Smoke FX Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Smoke FX
|
||||
// Script by =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_vehicle","_size"];
|
||||
|
||||
_fuel = (fuel _vehicle);
|
||||
|
||||
private ["_count","_random"];
|
||||
|
||||
private _smoke = "#particlesource" createVehicleLocal (getPos _vehicle);
|
||||
_smoke setDropInterval 0.1;
|
||||
|
||||
while { (_fuel > 0) } do
|
||||
{
|
||||
_fuel = _fuel - (random 0.005);
|
||||
|
||||
_random =
|
||||
[
|
||||
5 + random 7,
|
||||
[ (random 5 - random 5), (random 5 - random 5), 5 + random 7],
|
||||
[_size / 5, _size / 3]
|
||||
];
|
||||
|
||||
|
||||
_smoke setParticleParams [ ["\A3\Data_F\ParticleEffects\Universal\Universal_02.p3d", 8, 0, 8, 1], "", "Billboard", 1, (_random select 0),
|
||||
|
||||
"destructionEffect1", (_random select 1), 1, 1, 1, 1,
|
||||
|
||||
(_random select 2), [ [-1,-1,-1,0.1],[-1,-1,-1,0.3],[-1,-1,-1,0.5],[-1,-1,-1,1],[-1,-1,-1,0.5],[-1,-1,-1,0.3],[-1,-1,-1,0.1] ], [random 3], 0, 0, "", "", _vehicle, random 360];
|
||||
|
||||
// _smoke setParticleRandom [0.5, [0.1, 0.1, 0.1], [0.1, 0.1, 0.1], 0.1, 0.5, [0.1,0.1,0.1,0], 0, 0];
|
||||
|
||||
hint str _fuel;
|
||||
|
||||
if (False) then
|
||||
{
|
||||
|
||||
_count = 5;
|
||||
|
||||
while { (_count > 0) } do
|
||||
{
|
||||
_random =
|
||||
[
|
||||
5 + random 7,
|
||||
[ (random 5 - random 5), (random 5 - random 5), 5 + random 7],
|
||||
[_size / 5, _size / 3]
|
||||
];
|
||||
|
||||
drop [ ["\A3\Data_F\ParticleEffects\Universal\Universal_02.p3d", 8, 0, 8, 1], "", "Billboard", 1, (_random select 0),
|
||||
|
||||
"destructionEffect1", (_random select 1), 1, 1, 1, 1,
|
||||
|
||||
(_random select 2), [ [-1,-1,-1,0.1],[-1,-1,-1,0.3],[-1,-1,-1,0.5],[-1,-1,-1,1],[-1,-1,-1,0.5],[-1,-1,-1,0.3],[-1,-1,-1,0.1] ], [random 3], 0, 0, "", "", _vehicle, random 360];
|
||||
|
||||
_count = _count - 1;
|
||||
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,56 @@
|
||||
TCL_Stone_FX_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Stone FX Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Stone FX
|
||||
// Script by =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_vehicle","_size"];
|
||||
|
||||
private "_random";
|
||||
|
||||
_count = _size;
|
||||
|
||||
_count = _count + (random _size);
|
||||
|
||||
while { (_count > 0) } do
|
||||
{
|
||||
_random =
|
||||
[
|
||||
50,
|
||||
[ (random _size - random _size), (random _size - random _size), (random _size) ],
|
||||
1 + random 5,
|
||||
[0.1 + random 0.5],
|
||||
0.5 - random 0.1
|
||||
];
|
||||
|
||||
if (floor (random 100) < 50) then
|
||||
{
|
||||
if (_random select 3 select 0 < 0.3) then
|
||||
{
|
||||
_random set [1, [ (random _size - random _size) * 3, (random _size - random _size) * 3, (random _size) ] ];
|
||||
};
|
||||
};
|
||||
|
||||
if (_size < 10) then
|
||||
{
|
||||
_random set [3, [0.1 + random 0.3] ];
|
||||
};
|
||||
|
||||
if (_random select 3 select 0 > 0.3) then
|
||||
{
|
||||
_random set [4, 0.3 - random 0.1];
|
||||
};
|
||||
|
||||
drop ["\A3\Data_F\ParticleEffects\Pstone\PStone.p3d", "", "SpaceObject", 1, (_random select 0),
|
||||
|
||||
"destructionEffect1", (_random select 1), (_random select 2), 1, 0, 0,
|
||||
|
||||
(_random select 3), [ [1,1,1,1] ], [1000], 0, 0, "", "", _vehicle, random 360, True, (_random select 4) ];
|
||||
|
||||
_count = _count - 1;
|
||||
};
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,57 @@
|
||||
TCL_Explosion_FX_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Explosion FX Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Explosion FX
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_vehicle"];
|
||||
|
||||
private _size = (sizeOf typeOf _vehicle);
|
||||
|
||||
[_vehicle, _size] call (TCL_Flash_FX_F select 0);
|
||||
|
||||
[_vehicle, _size] call (TCL_Flash_FX_F select 1);
|
||||
|
||||
[_vehicle, _size] call (TCL_Shard_FX_F select 0);
|
||||
|
||||
private _detector = objNull;
|
||||
|
||||
if (TCL_Sound) then
|
||||
{
|
||||
_detector = "EmptyDetector" createVehicleLocal (getPos _vehicle);
|
||||
|
||||
private _sound = (TCL_Resource select 14) call TCL_Random_F;
|
||||
|
||||
private _distance = (_size * 50);
|
||||
|
||||
_detector say [_sound, _distance];
|
||||
};
|
||||
|
||||
while { (getPos _vehicle select 2 > 3) } do
|
||||
{
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
if (surfaceIsWater getPos _vehicle) exitWith {};
|
||||
|
||||
[_vehicle, _size] call (TCL_Dust_FX_F select 0);
|
||||
|
||||
[_vehicle, _size] spawn (TCL_Mud_FX_F select 0);
|
||||
|
||||
[_vehicle, _size] spawn (TCL_Dirt_FX_F select 0);
|
||||
|
||||
[_vehicle, _size] spawn (TCL_Stone_FX_F select 0);
|
||||
|
||||
// [_vehicle, _size] spawn (TCL_Smoke_FX_F select 0);
|
||||
|
||||
if (alive _detector) then
|
||||
{
|
||||
sleep 5;
|
||||
|
||||
deleteVehicle _detector;
|
||||
};
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,11 @@
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Dirt F.X.
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
drop [ ["\A3\Data_F\ParticleEffects\Universal\Universal.p3d", 16, 12, 9, 0], "", "Billboard", 1, 1 + random 1,
|
||||
|
||||
_this, [0,0,0], 0, 1.3 + random 0.7, 1, 0,
|
||||
|
||||
[1 + random 1, 1 - random 1, random 1], [ [0.1,0.1,0.1,1],[0.1,0.1,0.1,0] ], [1000], 0, 0, "", "", ""];
|
@ -0,0 +1,72 @@
|
||||
TCL_Fire_FX_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Fire FX Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Fire FX
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit"];
|
||||
|
||||
private _position = (getPos _unit);
|
||||
|
||||
private _offset = 0.3 + (random 0.5);
|
||||
|
||||
private _fire = "#particlesource" createVehicleLocal _position;
|
||||
_fire setDropInterval 0.01;
|
||||
_fire attachTo [_unit, [0,0,_offset] ];
|
||||
|
||||
private _light = "#lightpoint" createVehicleLocal _position;
|
||||
_light setLightBrightness 0;
|
||||
_light setLightAmbient [3,1,0];
|
||||
_light setLightColor [3,1,0];
|
||||
_light lightAttachObject [_unit, [0,0,_offset] ];
|
||||
|
||||
private _sound = createSoundSource ["Sound_Fire", _position, [], 0];
|
||||
_sound attachto [_unit, [0,0,_offset] ];
|
||||
|
||||
private _value = 1 + (random 1);
|
||||
|
||||
while { (_value > 1) } do
|
||||
{
|
||||
_fire setParticleParams [ ["\A3\Data_F\ParticleEffects\Universal\Universal.p3d", 16, 10, 32, 1], "", "Billboard", 1, 0.3 + random 0.5,
|
||||
|
||||
[0, 0, (getPos _unit select 2) + _offset], [0, 0, 0], 0, 1, 1, 0.7,
|
||||
|
||||
[_value / 3, _value / 7], [ [1,1,1,-0],[1,1,1,-1],[1,1,1,-1],[1,1,1,-1],[1,1,1,-1],[1,1,1,0] ], [3 - random 1], 0, 0, "", "", _unit];
|
||||
|
||||
_fire setParticleRandom [0.5, [0.1, 0.1, 0.1], [0.1, 0.1, 0.1], 0.1, 0.5, [0.1,0.1,0.1,0], 0, 0];
|
||||
|
||||
_light setLightBrightness (_value / 7);
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
_value = _value + (random 0.01);
|
||||
|
||||
if (floor (random 100) < 35) then
|
||||
{
|
||||
private _scream = (TCL_Resource select 15) call TCL_Random_F;
|
||||
|
||||
_unit say _scream;
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_offset = 0.5;
|
||||
|
||||
_value = _value - (random 0.01);
|
||||
|
||||
_value = _value - (rain / 7);
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
deleteVehicle _fire;
|
||||
|
||||
deleteVehicle _light;
|
||||
|
||||
deleteVehicle _sound;
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,125 @@
|
||||
TCL_Impact_FX_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Impact FX Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Impact FX
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_bullet"];
|
||||
|
||||
private _distance = (_bullet distance player);
|
||||
|
||||
while { (alive _bullet) } do
|
||||
{
|
||||
_distance = (_bullet distance player);
|
||||
|
||||
sleep 0.01;
|
||||
};
|
||||
|
||||
if (_distance < 5) then
|
||||
{
|
||||
TCL_Impact_FX set [0, (TCL_Impact_FX select 0) + 0.5];
|
||||
|
||||
private _value = (3 / _distance);
|
||||
|
||||
addCamShake [_value, 1, 50];
|
||||
|
||||
private["_delay1", "_delay2", "_fatigue"];
|
||||
|
||||
// BIS_fnc_feedback_fatiguePP = false;
|
||||
|
||||
BIS_fnc_feedback_fatigueCC = ppEffectCreate ["ColorCorrections", 1615];
|
||||
BIS_fnc_feedback_fatigueRadialBlur = ppEffectCreate ["RadialBlur", 275];
|
||||
|
||||
// BIS_fnc_feedback_fatigueBlur = ppEffectCreate ["DynamicBlur", 175];
|
||||
|
||||
// BIS_fnc_feedback_fatigueCC ppEffectEnable FALSE;
|
||||
|
||||
// init PPs to avoid fullscreen color at the beginning (used same values as for FADE OUT)-------------
|
||||
/* BIS_fnc_feedback_fatigueRadialBlur ppEffectAdjust [0,0,0.5,0.5]; //================================= hotfix of blur =================================
|
||||
// BIS_fnc_feedback_fatigueRadialBlur ppEffectCommit 0;*/
|
||||
|
||||
// add gaussian blur to make radial blur look better - LOWER
|
||||
/* BIS_fnc_feedback_fatigueBlur ppEffectAdjust [0]; //================================= hotfix of blur =================================
|
||||
// BIS_fnc_feedback_fatigueBlur ppEffectCommit 0; */
|
||||
|
||||
//RED
|
||||
BIS_fnc_feedback_fatigueCC ppEffectAdjust [1,1,0,[0.15, 0.15, 0.15, 0],[1, 1, 1, 1],[0.587, 0.587, 0.587, 0],[1, 1, 0, 0, 0, 0.2, 1]];
|
||||
|
||||
// BIS_fnc_feedback_fatigueCC ppEffectCommit 0;
|
||||
// init PPs ------------------------------------------------------------------------------------------
|
||||
// _fatigue = ((getFatigue player) - 0.5) * 2;
|
||||
|
||||
_fatigue = (TCL_Impact_FX select 0);
|
||||
|
||||
// FADE PPs IN ---------------------------------------------------------------------------------------
|
||||
_delay1 = 0.1 * acctime;
|
||||
|
||||
// slight radial blur
|
||||
BIS_fnc_feedback_fatigueRadialBlur ppEffectAdjust [0, 0, 0, 0];
|
||||
BIS_fnc_feedback_fatigueRadialBlur ppEffectCommit 0;
|
||||
BIS_fnc_feedback_fatigueRadialBlur ppEffectEnable TRUE;
|
||||
|
||||
// BIS_fnc_feedback_fatigueRadialBlur ppEffectAdjust [((0.005*_fatigue)+0.001067), ((0.005*_fatigue)+0.001067), 0.3, 0.3]; //================================= hotfix of blur =================================
|
||||
BIS_fnc_feedback_fatigueRadialBlur ppEffectAdjust [((0.0004*_fatigue)+0.001067), ((0.0004*_fatigue)+0.001067), 0.04, 0.04]; //================================= hotfix of blur =================================
|
||||
BIS_fnc_feedback_fatigueRadialBlur ppEffectCommit _delay1;
|
||||
|
||||
// add gaussian blur to make radial blur look better - when player incapacitated switch this off
|
||||
/* BIS_fnc_feedback_fatigueBlur ppEffectAdjust [_fatigue/1.5]; //================================= hotfix of blur =================================
|
||||
BIS_fnc_feedback_fatigueBlur ppEffectEnable TRUE;
|
||||
BIS_fnc_feedback_fatigueBlur ppEffectCommit _delay1;*/
|
||||
|
||||
if (currentVisionMode player == 0) then
|
||||
{
|
||||
// In normal view use red (changes with damage from gray to red)
|
||||
BIS_fnc_feedback_fatigueCC ppEffectAdjust [1,1,0,[0.15, 0.15, 0.15, ((0.466*_fatigue)+0.2)],
|
||||
[1.0, 1.0, 1.0, 1-((1.3*_fatigue)-0.8)],
|
||||
[0.587, 0.587, 0.587, 0.0],
|
||||
[0.85, 0.85, 0, 0, 0, 0.2, 1]];
|
||||
}
|
||||
else
|
||||
{
|
||||
// In NVG(1) or FLIR(2) use gray (consider using a little darker with NVGs)
|
||||
BIS_fnc_feedback_fatigueCC ppEffectAdjust [1,1,0,[0.15, 0.15, 0.15, ((0.466*_fatigue)+0.2)],
|
||||
[1, 1, 1, 1],
|
||||
[0.3, 0.3, 0.3, 0],
|
||||
[0.85, 0.85, 0, 0, 0, 0.2, 1]];
|
||||
};
|
||||
|
||||
BIS_fnc_feedback_fatigueCC ppEffectEnable TRUE;
|
||||
BIS_fnc_feedback_fatigueCC ppEffectForceInNVG TRUE;
|
||||
BIS_fnc_feedback_fatigueCC ppEffectCommit _delay1;
|
||||
|
||||
sleep (_delay1 + 0.1); //added 0.1 to avoid flickering, see news:jubiqj$d5l$1@new-server.localdomain
|
||||
|
||||
// FADE PPs OUT ---------------------------------------------------------------------------------------
|
||||
_delay2 = (1.5 + random 0.5) * acctime;
|
||||
|
||||
// _delay2 = 0.1;
|
||||
|
||||
// slight radial blur - LOWER
|
||||
BIS_fnc_feedback_fatigueRadialBlur ppEffectAdjust [0,0,0.5,0.5];
|
||||
BIS_fnc_feedback_fatigueRadialBlur ppEffectCommit _delay2;
|
||||
|
||||
// add gaussian blur to make radial blur look better - LOWER
|
||||
/* BIS_fnc_feedback_fatigueBlur ppEffectAdjust [0]; //================================= hotfix of blur =================================
|
||||
BIS_fnc_feedback_fatigueBlur ppEffectCommit _delay2; */
|
||||
|
||||
BIS_fnc_feedback_fatigueCC ppEffectAdjust [1,1,0,[0.15, 0.15, 0.15, 0],[1, 1, 1, 1],[0.3, 0.3, 0.3, 0],[1, 1, 0, 0, 0, 0.2, 1]];
|
||||
BIS_fnc_feedback_fatigueCC ppEffectCommit _delay2;
|
||||
|
||||
sleep (_delay2 + 0.1); //added 0.1 to avoid flickering, see news:jubiqj$d5l$1@new-server.localdomain
|
||||
|
||||
// switch PPs off
|
||||
// BIS_fnc_feedback_fatigueCC ppEffectEnable FALSE;
|
||||
// BIS_fnc_feedback_fatigueRadialBlur ppEffectEnable FALSE;
|
||||
// BIS_fnc_feedback_fatigueBlur ppEffectEnable FALSE; //================================= hotfix of blur =================================
|
||||
|
||||
TCL_Impact_FX set [0, (TCL_Impact_FX select 0) - 0.5];
|
||||
|
||||
// BIS_fnc_feedback_fatiguePP = false;
|
||||
};
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,92 @@
|
||||
#define TCL_DeleteAT(_array, _index, _object); (_array select _index) deleteAt ( (_array select _index) find _object);
|
||||
|
||||
TCL_Whiz_FX_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Whiz FX Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Whiz FX
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_bullet"];
|
||||
|
||||
private _direction = [_unit, player] call TCL_Rel_Dir_To_F;
|
||||
|
||||
if ( (_direction > 340) || (_direction < 20) ) then
|
||||
{
|
||||
(TCL_Whiz_FX select 0) pushBack _bullet;
|
||||
|
||||
private _array = (TCL_Whiz_FX select 1);
|
||||
|
||||
private _detector = (_array select 0);
|
||||
|
||||
TCL_DeleteAT(TCL_Whiz_FX,1,_detector);
|
||||
|
||||
[_bullet, _detector] spawn (TCL_Whiz_FX_F select 1);
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Whiz FX Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Whiz FX
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_bullet","_detector"];
|
||||
|
||||
if (alive _bullet) then
|
||||
{
|
||||
private _sound = (TCL_Resource select 0) call TCL_Random_F;
|
||||
|
||||
private _random = 1 + (random 3);
|
||||
|
||||
_detector say3D [_sound, 100, _random];
|
||||
|
||||
private _time = (time + 1);
|
||||
|
||||
while { ( (alive _bullet) && { (time < _time) } ) } do
|
||||
{
|
||||
_detector setPos (getPos _bullet);
|
||||
|
||||
sleep 0.01;
|
||||
};
|
||||
|
||||
_detector setPos [0,0,0];
|
||||
};
|
||||
|
||||
TCL_DeleteAT(TCL_Whiz_FX,0,_bullet);
|
||||
|
||||
(TCL_Whiz_FX select 1) pushBack _detector;
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Whiz FX Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Whiz FX
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_shell"];
|
||||
|
||||
private _detector = "EmptyDetector" createVehicleLocal (getPos _shell);
|
||||
|
||||
private _sound = (TCL_Resource select 1) call TCL_Random_F;
|
||||
|
||||
_detector say3D [_sound, 300];
|
||||
|
||||
private _time = (time + 1);
|
||||
|
||||
while { ( (alive _shell) && { (time < _time) } ) } do
|
||||
{
|
||||
_detector setPos (getPos _shell);
|
||||
|
||||
sleep 0.01;
|
||||
};
|
||||
|
||||
deleteVehicle _detector;
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,48 @@
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Tactical Combat Link
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// A.I. Database
|
||||
// Based on Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project )
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
if (TCL_Server) then
|
||||
{
|
||||
if (isNil "TCL_AI") then
|
||||
{
|
||||
TCL_AI = [
|
||||
|
||||
// 0 - 2 ( Reinforcement )
|
||||
1,
|
||||
0.15,
|
||||
3,
|
||||
|
||||
// 3 - 6 ( Additional )
|
||||
False,
|
||||
3,
|
||||
700,
|
||||
True,
|
||||
|
||||
// 7 - 8 ( Disable )
|
||||
False,
|
||||
False,
|
||||
|
||||
// 9 ( Regroup )
|
||||
True,
|
||||
|
||||
// 10 ( Timeout )
|
||||
170,
|
||||
|
||||
// 11 ( Synchronize )
|
||||
False
|
||||
];
|
||||
|
||||
if (TCL_FilePatching) then
|
||||
{
|
||||
if ("UserConfig\TCL\TCL_AI.sqf" call TCL_Exist_F) then
|
||||
{
|
||||
call compile preprocessFileLineNumbers "UserConfig\TCL\TCL_AI.sqf";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
@ -0,0 +1,41 @@
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Tactical Combat Link
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Debug Database
|
||||
// Based on Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project )
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
if (isNil "TCL_Debug") then
|
||||
{
|
||||
TCL_Debug = [
|
||||
|
||||
// 0 ( System Debug )
|
||||
False,
|
||||
|
||||
// 1 - 3 ( Marker Debug )
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
|
||||
// 4 ( Cursor )
|
||||
False,
|
||||
|
||||
// 5 ( Mission Debug )
|
||||
False,
|
||||
|
||||
// 6 ( Development Debug )
|
||||
False
|
||||
];
|
||||
|
||||
if (TCL_Server) then
|
||||
{
|
||||
if (TCL_FilePatching) then
|
||||
{
|
||||
if ("UserConfig\TCL\TCL_Debug.sqf" call TCL_Exist_F) then
|
||||
{
|
||||
call compile preprocessFileLineNumbers "UserConfig\TCL\TCL_Debug.sqf";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
@ -0,0 +1,49 @@
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Tactical Combat Link
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// FX Database
|
||||
// Based on Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project )
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
if (isNil "TCL_FX") then
|
||||
{
|
||||
TCL_FX = [
|
||||
|
||||
// 0 ( Bullet )
|
||||
True,
|
||||
5,
|
||||
|
||||
// 2 ( Shell )
|
||||
True,
|
||||
50,
|
||||
|
||||
// 4 ( Church )
|
||||
True,
|
||||
|
||||
// 5 ( Lighthouse )
|
||||
True,
|
||||
|
||||
// 6 - 10 ( Radio )
|
||||
True,
|
||||
3,
|
||||
3,
|
||||
199,
|
||||
210,
|
||||
|
||||
// 11 ( Crew )
|
||||
True,
|
||||
35,
|
||||
|
||||
// 13 ( Explosion )
|
||||
True
|
||||
];
|
||||
|
||||
if (TCL_FilePatching) then
|
||||
{
|
||||
if ("UserConfig\TCL\TCL_FX.sqf" call TCL_Exist_F) then
|
||||
{
|
||||
call compile preprocessFileLineNumbers "UserConfig\TCL\TCL_FX.sqf";
|
||||
};
|
||||
};
|
||||
};
|
@ -0,0 +1,88 @@
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Tactical Combat Link
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Feature Database
|
||||
// Based on Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project )
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
if (TCL_Server) then
|
||||
{
|
||||
if (isNil "TCL_Feature") then
|
||||
{
|
||||
TCL_Feature = [
|
||||
|
||||
// 0 ( Watch )
|
||||
True,
|
||||
50,
|
||||
|
||||
// 2 ( Garrison )
|
||||
True,
|
||||
|
||||
// 3 - 6 ( Smoke )
|
||||
True,
|
||||
50,
|
||||
True,
|
||||
75,
|
||||
|
||||
// 7 ( Flare )
|
||||
True,
|
||||
50,
|
||||
|
||||
// 9 ( Artillery )
|
||||
True,
|
||||
15,
|
||||
|
||||
// 11 ( House Search )
|
||||
True,
|
||||
50,
|
||||
|
||||
// 13 ( Static Weapon )
|
||||
True,
|
||||
50,
|
||||
|
||||
// 15 - 18 ( Take Cover )
|
||||
True,
|
||||
50,
|
||||
30,
|
||||
50,
|
||||
|
||||
// 19 - 21 ( Flanking )
|
||||
True,
|
||||
50,
|
||||
50,
|
||||
|
||||
// 22 - 26 ( Advancing )
|
||||
True,
|
||||
15,
|
||||
50,
|
||||
300,
|
||||
700,
|
||||
|
||||
// 27 - 29 ( Suppressed )
|
||||
True,
|
||||
0.90,
|
||||
5,
|
||||
|
||||
// 30 - 31 ( Heal )
|
||||
True,
|
||||
50,
|
||||
|
||||
// 32 - 33 ( Rearm )
|
||||
True,
|
||||
50,
|
||||
|
||||
// 34 - 35 ( Surrender )
|
||||
True,
|
||||
5
|
||||
];
|
||||
|
||||
if (TCL_FilePatching) then
|
||||
{
|
||||
if ("UserConfig\TCL\TCL_Feature.sqf" call TCL_Exist_F) then
|
||||
{
|
||||
call compile preprocessFileLineNumbers "UserConfig\TCL\TCL_Feature.sqf";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
@ -0,0 +1,33 @@
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Tactical Combat Link
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// I.Q. Database
|
||||
// Based on Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project )
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
if (TCL_Server) then
|
||||
{
|
||||
if (isNil "TCL_IQ") then
|
||||
{
|
||||
TCL_IQ = [
|
||||
|
||||
// 0 ( Knowledge )
|
||||
1,
|
||||
|
||||
// 1 ( Distance )
|
||||
100,
|
||||
|
||||
// 2 ( KnowsAbout )
|
||||
3
|
||||
];
|
||||
|
||||
if (TCL_FilePatching) then
|
||||
{
|
||||
if ("UserConfig\TCL\TCL_IQ.sqf" call TCL_Exist_F) then
|
||||
{
|
||||
call compile preprocessFileLineNumbers "UserConfig\TCL\TCL_IQ.sqf";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
@ -0,0 +1,29 @@
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Tactical Combat Link
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Radio Database
|
||||
// Based on Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project )
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
if (TCL_Server) then
|
||||
{
|
||||
if (isNil "TCL_Radio") then
|
||||
{
|
||||
TCL_Radio = [
|
||||
|
||||
// 0 - 2 ( Radio )
|
||||
True,
|
||||
30,
|
||||
[3000, 5000, 7000, 10000, 13000]
|
||||
];
|
||||
|
||||
if (TCL_FilePatching) then
|
||||
{
|
||||
if ("UserConfig\TCL\TCL_Radio.sqf" call TCL_Exist_F) then
|
||||
{
|
||||
call compile preprocessFileLineNumbers "UserConfig\TCL\TCL_Radio.sqf";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
@ -0,0 +1,42 @@
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Tactical Combat Link
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Resource Database
|
||||
// Based on Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project )
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TCL_Resource = [
|
||||
|
||||
// ( 0 - 1 )
|
||||
["Bullet_v01","Bullet_v02","Bullet_v03","Bullet_v04","Bullet_v05","Bullet_v06","Bullet_v07","Bullet_v08","Bullet_v09","Bullet_v10","Bullet_v11","Bullet_v12","Bullet_v13","Bullet_v14","Bullet_v15","Bullet_v16","Bullet_v17","Bullet_v18","Bullet_v19","Bullet_v20","Bullet_v21","Bullet_v22","Bullet_v23","Bullet_v24","Bullet_v25","Bullet_v26","Bullet_v27","Bullet_v28","Bullet_v29","Bullet_v30","Bullet_v31","Bullet_v32","Bullet_v33","Bullet_v34","Bullet_v35","Bullet_v36","Bullet_v37","Bullet_v38","Bullet_v39","Bullet_v40","Bullet_v41","Bullet_v42","Bullet_v43"],
|
||||
["Shell_In_v01","Shell_In_v02","Shell_In_v03","Shell_In_v04","Shell_In_v05","Shell_In_v06","Shell_In_v07"],
|
||||
|
||||
// ( 2 - 7 )
|
||||
["West_Air_v01a","West_Air_v02a","West_Air_v03a","West_Air_v04a","West_Air_v05a","West_Air_v06a","West_Air_v07a","West_Air_v08a","West_Air_v09a","West_Air_v10a","West_Air_v11a","West_Air_v12a","West_Air_v13a","West_Air_v14a","West_Air_v15a","West_Air_v16a","West_Air_v17a","West_Air_v18a","West_Air_v19a","West_Air_v20a","West_Air_v21a","West_Air_v22a","West_Air_v23a","West_Air_v24a","West_Air_v25a","West_Air_v26a","West_Air_v27a","West_Air_v28a","West_Air_v29a","West_Air_v30a","West_Air_v31a","West_Air_v32a","West_Air_v33a","West_Air_v34a","West_Air_v35a","West_Air_v36a","West_Air_v37a","West_Air_v38a","West_Air_v39a","West_Air_v40a","West_Air_v41a","West_Air_v42a","West_Air_v43a","West_Air_v44a","West_Air_v45a","West_Air_v46a","West_Air_v47a","West_Air_v48a","West_Air_v49a","West_Air_v50a"],
|
||||
["West_Land_v01a","West_Land_v02a","West_Land_v03a","West_Land_v04a","West_Land_v05a","West_Land_v06a","West_Land_v07a","West_Land_v08a","West_Land_v09a","West_Land_v10a","West_Land_v11a","West_Land_v12a","West_Land_v13a","West_Land_v14a"],
|
||||
["East_Land_v01a","East_Land_v02a","East_Land_v03a","East_Land_v04a","East_Land_v05a","East_Land_v06a","East_Land_v07a","East_Land_v08a","East_Land_v09a","East_Land_v10a","East_Land_v11a","East_Land_v12a","East_Land_v13a","East_Land_v14a","East_Land_v15a","East_Land_v16a","East_Land_v17a","East_Land_v18a","East_Land_v19a","East_Land_v20a","East_Land_v21a","East_Land_v22a","East_Land_v23a","East_Land_v24a","East_Land_v25a","East_Land_v26a","East_Land_v27a","East_Land_v28a","East_Land_v29a","East_Land_v30a"],
|
||||
["West_Air_Land_v01a","West_Air_Land_v02a","West_Air_Land_v03a","West_Air_Land_v04a","West_Air_Land_v05a","West_Air_Land_v06a","West_Air_Land_v07a","West_Air_Land_v08a","West_Air_Land_v09a","West_Air_Land_v10a","West_Air_Land_v11a","West_Air_Land_v12a","West_Air_Land_v13a","West_Air_Land_v14a","West_Air_Land_v15a","West_Air_Land_v16a","West_Air_Land_v17a","West_Air_Land_v18a","West_Air_Land_v19a","West_Air_Land_v20a","West_Air_Land_v21a","West_Air_Land_v22a","West_Air_Land_v23a","West_Air_Land_v24a","West_Air_Land_v25a","West_Air_Land_v26a","West_Air_Land_v27a","West_Air_Land_v28a","West_Air_Land_v29a","West_Air_Land_v30a","West_Air_Land_v31a","West_Air_Land_v32a","West_Air_Land_v33a","West_Air_Land_v34a","West_Air_Land_v35a","West_Air_Land_v36a","West_Air_Land_v37a","West_Air_Land_v38a","West_Air_Land_v39a","West_Air_Land_v40a","West_Air_Land_v41a","West_Air_Land_v42a","West_Air_Land_v43a","West_Air_Land_v44a"],
|
||||
|
||||
["West_Land_v01b","West_Land_v02b","West_Land_v03b","West_Land_v04b","West_Land_v05b","West_Land_v06b","West_Land_v07b","West_Land_v08b","West_Land_v09b","West_Land_v10b","West_Land_v11b","West_Land_v12b","West_Land_v13b","West_Land_v14b"],
|
||||
["East_Land_v01b","East_Land_v02b","East_Land_v03b","East_Land_v04b","East_Land_v05b","East_Land_v06b","East_Land_v07b","East_Land_v08b","East_Land_v09b","East_Land_v10b","East_Land_v11b","East_Land_v12b","East_Land_v13b","East_Land_v14b","East_Land_v15b","East_Land_v16b","East_Land_v17b","East_Land_v18b","East_Land_v19b","East_Land_v20b","East_Land_v21b","East_Land_v22b","East_Land_v23b","East_Land_v24b","East_Land_v25b","East_Land_v26b","East_Land_v27b","East_Land_v28b","East_Land_v29b","East_Land_v30b"],
|
||||
|
||||
// ( 8 - 10 )
|
||||
["Church_v02","Church_v06","Church_v07"],
|
||||
["Church_v03","Church_v05"],
|
||||
["Church_v01","Church_v04"],
|
||||
|
||||
// ( 11 )
|
||||
["Lighthouse_v01","Lighthouse_v02","Lighthouse_v03","Lighthouse_v04"],
|
||||
|
||||
// ( 12 - 13 )
|
||||
["Bullet_Hit_v01","Bullet_Hit_v02","Bullet_Hit_v03","Bullet_Hit_v04","Bullet_Hit_v05","Bullet_Hit_v06"],
|
||||
|
||||
["Hit_v01","Hit_v02","Hit_v03","Hit_v04","Hit_v05","Hit_v06","Hit_v07","Hit_v08","Hit_v09","Hit_v10","Hit_v11","Hit_v12","Hit_v13","Hit_v14","Hit_v15"],
|
||||
|
||||
// ( 14 )
|
||||
["Explosion_v01","Explosion_v02","Explosion_v03","Explosion_v04","Explosion_v05","Explosion_v06","Explosion_v07","Explosion_v08","Explosion_v09","Explosion_v10","Explosion_v11","Explosion_v12","Explosion_v13","Explosion_v14","Explosion_v15","Explosion_v16","Explosion_v17","Explosion_v18","Explosion_v19","Explosion_v20","Explosion_v21","Explosion_v22","Explosion_v23","Explosion_v24","Explosion_v25","Explosion_v26","Explosion_v27","Explosion_v28"],
|
||||
|
||||
// ( 15 )
|
||||
["Scream_v01","Scream_v02","Scream_v03","Scream_v04","Scream_v05"]
|
||||
];
|
@ -0,0 +1,62 @@
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Tactical Combat Link
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// System Database
|
||||
// Based on Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project )
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
if (isNil "TCL_System") then
|
||||
{
|
||||
TCL_System = [
|
||||
|
||||
// 0 ( Delay )
|
||||
0,
|
||||
|
||||
// 1 ( A.I. )
|
||||
True,
|
||||
|
||||
// 2 ( Sides )
|
||||
[EAST, WEST, RESISTANCE],
|
||||
|
||||
// 3 ( Combat System )
|
||||
True,
|
||||
|
||||
// 4 ( Get In )
|
||||
True,
|
||||
|
||||
// 5 ( Skill )
|
||||
True,
|
||||
|
||||
// 6 ( Skill Divider )
|
||||
5,
|
||||
|
||||
// 7 ( Spawn )
|
||||
True,
|
||||
|
||||
// 8 ( Delay )
|
||||
0,
|
||||
|
||||
// 9 ( F.X. )
|
||||
True,
|
||||
|
||||
// 10 ( Respawn )
|
||||
False
|
||||
];
|
||||
|
||||
if (TCL_Server) then
|
||||
{
|
||||
if (TCL_FilePatching) then
|
||||
{
|
||||
if ("UserConfig\TCL\TCL_System.sqf" call TCL_Exist_F) then
|
||||
{
|
||||
call compile preprocessFileLineNumbers "UserConfig\TCL\TCL_System.sqf";
|
||||
};
|
||||
};
|
||||
|
||||
if (TCL_Multiplayer) then
|
||||
{
|
||||
publicVariable "TCL_System";
|
||||
};
|
||||
};
|
||||
};
|
@ -0,0 +1,36 @@
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Tactical Combat Link
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Tweak Database
|
||||
// Based on Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project )
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
if (TCL_Server) then
|
||||
{
|
||||
if (isNil "TCL_Tweak") then
|
||||
{
|
||||
TCL_Tweak = [
|
||||
|
||||
// 0 ( Behaviour )
|
||||
0,
|
||||
|
||||
// 1 ( Push and Stop Distance )
|
||||
300,
|
||||
|
||||
// 2 ( Push Chance )
|
||||
50,
|
||||
|
||||
// 3 ( Push Factor )
|
||||
1
|
||||
];
|
||||
|
||||
if (TCL_FilePatching) then
|
||||
{
|
||||
if ("UserConfig\TCL\TCL_Tweak.sqf" call TCL_Exist_F) then
|
||||
{
|
||||
call compile preprocessFileLineNumbers "UserConfig\TCL\TCL_Tweak.sqf";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
@ -0,0 +1,172 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_EH_Fired_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Event Handler Fired Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Event Handler Fired
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit"];
|
||||
|
||||
if (False) then
|
||||
{
|
||||
_weapon = (currentWeapon _unit);
|
||||
|
||||
_ammo = (_unit ammo _weapon);
|
||||
|
||||
_ammo = _ammo + 1;
|
||||
|
||||
_unit setAmmo [_weapon, _ammo];
|
||||
};
|
||||
|
||||
if (TCL_Server) then
|
||||
{
|
||||
if (_unit in (TCL_Players select 0) ) then
|
||||
{
|
||||
if (TCL_Feature select 22) then
|
||||
{
|
||||
_this call (TCL_EH_Fired_F select 1);
|
||||
};
|
||||
|
||||
if (TCL_Feature select 27) then
|
||||
{
|
||||
_this call (TCL_EH_Fired_F select 2);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if (TCL_Dedicated) exitWith {};
|
||||
|
||||
private _ammo = _this select 4;
|
||||
|
||||
if (_ammo isKindOf "BulletBase") then
|
||||
{
|
||||
if ( (TCL_FX select 0) && { (floor (random 100) < (TCL_FX select 1) ) } ) then
|
||||
{
|
||||
if (_unit == player) exitWith {};
|
||||
|
||||
if ( (_unit distance player < 300) && { (count (TCL_Whiz_FX select 0) < 3) } ) then
|
||||
{
|
||||
private _bullet = _this select 6;
|
||||
|
||||
[_unit, _bullet] call (TCL_Whiz_FX_F select 0);
|
||||
};
|
||||
};
|
||||
|
||||
private _bullet = _this select 6;
|
||||
|
||||
// [_bullet] spawn (TCL_Impact_FX_F select 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( (TCL_FX select 2) && { (_ammo isKindOf "ShellBase") } && { (floor (random 100) < (TCL_FX select 3) ) } ) then
|
||||
{
|
||||
private _shell = _this select 6;
|
||||
|
||||
[_shell] spawn (TCL_Whiz_FX_F select 2);
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Event Handler Fired Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Event Handler Fired Advancing
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_weapon","_muzzle"];
|
||||
|
||||
if (count (TCL_Advancing select 0) < 5) then
|
||||
{
|
||||
private _group = (group _unit);
|
||||
|
||||
if (_group in (TCL_Advancing select 1) ) exitWith {};
|
||||
|
||||
(TCL_Advancing select 1) pushBack _group;
|
||||
|
||||
[_group] spawn
|
||||
{
|
||||
params ["_group"];
|
||||
|
||||
sleep 10;
|
||||
|
||||
TCL_DeleteAT(TCL_Advancing,1,_group);
|
||||
};
|
||||
|
||||
private _ammo = _this select 4;
|
||||
|
||||
private _distance = [_unit, _weapon, _muzzle, _ammo] call (TCL_Advancing_F select 0);
|
||||
|
||||
// player sideChat format ["TCL_EH_Fired_F > Advancing > %1", _distance];
|
||||
|
||||
if (_distance > 0) then
|
||||
{
|
||||
private _array = ( (TCL_Advancing select 0) + (TCL_Reinforcement select 0) );
|
||||
|
||||
[_unit, _array, _distance] call (TCL_Feature_F select 2);
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Event Handler Fired Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Event Handler Fired Suppressed
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit"];
|
||||
|
||||
private _time = (_unit getVariable "TCL_Suppressed");
|
||||
|
||||
if ( (time - _time) < (TCL_Feature select 28) ) then
|
||||
{
|
||||
(TCL_Suppressed select 1) pushBack _unit;
|
||||
|
||||
if ( { (_x == _unit) } count (TCL_Suppressed select 1) > (TCL_Feature select 29) ) then
|
||||
{
|
||||
TCL_Suppressed set [1, (TCL_Suppressed select 1) - [_unit] ];
|
||||
|
||||
// player sideChat format ["TCL_EH_Fired_F > Suppressed > %1", count (TCL_Suppressed select 1) ];
|
||||
|
||||
private _groups = (TCL_Groups select 0);
|
||||
|
||||
_groups = _groups - (TCL_Suppressed select 0);
|
||||
|
||||
private ["_group","_units"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _groups - 1) do
|
||||
{
|
||||
_group = (_groups select _count);
|
||||
|
||||
_units = (units _group);
|
||||
|
||||
if (_units findIf { ( (alive _x) && { (isNull objectParent _x) } ) } > -1) then
|
||||
{
|
||||
[_unit, _group] call (TCL_Suppressed_F select 0);
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_unit setVariable ["TCL_Suppressed", time];
|
||||
|
||||
TCL_Suppressed set [1, (TCL_Suppressed select 1) - [_unit] ];
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_EH_Fired_F > Suppressed > %1", count (TCL_Suppressed select 1) ];
|
||||
|
||||
True
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,61 @@
|
||||
TCL_EH_Killed_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Event Handler Killed Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Event Handler Killed
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_vehicle"];
|
||||
|
||||
if (TCL_Server) then
|
||||
{
|
||||
if (_vehicle isKindOf "Tank") then
|
||||
{
|
||||
if (TCL_FX select 11) then
|
||||
{
|
||||
if (floor (random 100) < (TCL_FX select 12) ) then
|
||||
{
|
||||
private _crew = (crew _vehicle);
|
||||
|
||||
if (_crew isEqualTo [] ) exitWith {};
|
||||
|
||||
[_crew, _vehicle] spawn (TCL_Crew_FX_F select 0);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
[_vehicle] call (TCL_EH_Killed_F select 1);
|
||||
};
|
||||
|
||||
if (TCL_Dedicated) exitWith {};
|
||||
|
||||
if (TCL_FX select 13) then
|
||||
{
|
||||
[_vehicle] spawn (TCL_Explosion_FX_F select 0);
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Event Handler Killed Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Event Handler Killed
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_vehicle"];
|
||||
|
||||
private _size = (sizeOf typeOf _vehicle);
|
||||
|
||||
private _distance = (_size * 50);
|
||||
|
||||
private _array = ( (TCL_Garrison select 0) + (TCL_Advancing select 0) + (TCL_Reinforcement select 0) );
|
||||
|
||||
[_vehicle, _array, _distance] call (TCL_Feature_F select 2);
|
||||
|
||||
True
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,116 @@
|
||||
TCL_EH_Respawn_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Respawn Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Respawn
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_kia"];
|
||||
|
||||
private _array = TCL_Respawn;
|
||||
|
||||
_array set [0, (_array select 0) + 1];
|
||||
|
||||
private _count = (_array select 0);
|
||||
|
||||
private _name = (_array select 1);
|
||||
|
||||
private _string = format ["<t color='#bebebe' size='3'>%1 Kill Count:</t> <t color='#ff0000' size='3'>%2</t>", _name, _count];
|
||||
|
||||
"DynamicBlur" ppEffectAdjust [0.0];
|
||||
"DynamicBlur" ppEffectCommit 0;
|
||||
|
||||
titleText [_string, "BLACK OUT", 3, True, True];
|
||||
|
||||
_weapon = (primaryWeapon _kia);
|
||||
|
||||
_weaponItems = (primaryWeaponItems _kia);
|
||||
|
||||
sleep 3;
|
||||
|
||||
titleText [_string, "BLACK IN", 3, True, True];
|
||||
|
||||
private "_unit";
|
||||
|
||||
if (TCL_Multiplayer) then
|
||||
{
|
||||
waitUntil { (alive player) };
|
||||
|
||||
_unit = player;
|
||||
}
|
||||
else
|
||||
{
|
||||
private _hight = (getPos _kia select 2);
|
||||
|
||||
private _position = (getPosATL _kia);
|
||||
|
||||
_position set [2, (_position select 2) + _hight];
|
||||
|
||||
_unit = (group _kia) createUnit [ (typeOf _kia), _position, [], 0, "CAN_COLLIDE"];
|
||||
|
||||
selectPlayer _unit;
|
||||
|
||||
addSwitchableUnit _unit;
|
||||
};
|
||||
|
||||
_unit addEventHandler ["Killed", {_this spawn (TCL_EH_Respawn_F select 0) } ];
|
||||
|
||||
_unit setDir (getDir _kia);
|
||||
|
||||
_unit setName (_array select 1);
|
||||
|
||||
_unit setRank (_array select 2);
|
||||
|
||||
private _stance = (stance _kia);
|
||||
|
||||
if (True) then
|
||||
{
|
||||
if (_stance isEqualTo "STAND") exitWith
|
||||
{
|
||||
_unit setUnitPos "UP";
|
||||
};
|
||||
|
||||
if (_stance isEqualTo "CROUCH") exitWith
|
||||
{
|
||||
_unit setUnitPos "MIDDLE";
|
||||
};
|
||||
|
||||
if (_stance isEqualTo "PRONE") exitWith
|
||||
{
|
||||
_unit setUnitPos "DOWN";
|
||||
};
|
||||
|
||||
if (unitPos _kia isEqualTo "DOWN") exitWith
|
||||
{
|
||||
_unit setUnitPos "DOWN";
|
||||
};
|
||||
};
|
||||
|
||||
if (isStaminaEnabled _kia) then
|
||||
{
|
||||
_unit enableStamina True;
|
||||
}
|
||||
else
|
||||
{
|
||||
_unit enableStamina False;
|
||||
};
|
||||
|
||||
_unit removeWeapon (primaryWeapon _unit);
|
||||
|
||||
_unit addWeapon _weapon;
|
||||
|
||||
{_unit removePrimaryWeaponItem _x} count (primaryWeaponItems _unit);
|
||||
|
||||
{_unit addPrimaryWeaponItem _x} count _weaponItems;
|
||||
|
||||
waitUntil { ( (alive player) && (player == player) ) };
|
||||
|
||||
{_knowsAbout = (_x knowsAbout vehicle _kia); if (_knowsAbout > 0) then {_x reveal [_unit, _knowsAbout] } } forEach allGroups;
|
||||
|
||||
deleteVehicle _kia;
|
||||
|
||||
_unit selectWeapon (primaryWeapon _unit);
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,158 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_EH_Zeus_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Event Handler Zeus Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Event Handler Zeus
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_curator","_unit"];
|
||||
|
||||
private _group = (group _unit);
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
private _vehicle = (vehicle _leader);
|
||||
|
||||
// player sideChat format ["TCL_EH_Zeus_F > Unit > %1", _unit];
|
||||
|
||||
if (_unit == _vehicle) then
|
||||
{
|
||||
// player sideChat format ["TCL_EH_Zeus_F > Vehicle > %1", (typeOf _unit) ];
|
||||
|
||||
if (TCL_Server) then
|
||||
{
|
||||
(TCL_Zeus select 0) pushBack _group;
|
||||
}
|
||||
else
|
||||
{
|
||||
TCL_Host = [_group]; publicVariable "TCL_Host";
|
||||
|
||||
// (TCL_Zeus select 0) pushBack _group; publicVariable "TCL_Zeus";
|
||||
};
|
||||
|
||||
[_group] spawn (TCL_EH_Zeus_F select 3);
|
||||
|
||||
// player sideChat format ["TCL_EH_Zeus_F > Group > %1", _group];
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Event Handler Zeus Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Event Handler Zeus
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_curator","_group","_waypoint"];
|
||||
|
||||
if (TCL_Server) then
|
||||
{
|
||||
(TCL_Zeus select 1) pushBackUnique _group;
|
||||
|
||||
(TCL_Freeze select 0) pushBackUnique _group;
|
||||
|
||||
if (_group in (TCL_Garrison select 0) ) then
|
||||
{
|
||||
private _units = (units _group);
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
_units doFollow _leader;
|
||||
|
||||
TCL_DeleteAT(TCL_Garrison,0,_group);
|
||||
|
||||
private _array = (_group getVariable "TCL_Garrison");
|
||||
|
||||
TCL_Garrison set [1, (TCL_Garrison select 1) - _array];
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
TCL_Host = _this; publicVariable "TCL_Host";
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Event Handler Zeus Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Event Handler Zeus
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_curator","_group","_waypoint"];
|
||||
|
||||
if (TCL_Server) then
|
||||
{
|
||||
private _array = (waypoints _group);
|
||||
|
||||
if (count _array == 1) then
|
||||
{
|
||||
TCL_DeleteAT(TCL_Zeus,1,_group);
|
||||
|
||||
TCL_DeleteAT(TCL_Freeze,0,_group);
|
||||
|
||||
[_group] spawn (TCL_Garrison_F select 0);
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_EH_Zeus_F > Waypoints > %1 > %2", _array, (count _array) ];
|
||||
}
|
||||
else
|
||||
{
|
||||
TCL_Host = _this; publicVariable "TCL_Host";
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Event Handler Zeus Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Event Handler Zeus
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
private _id = (groupId _group);
|
||||
|
||||
private _string = format ["%1 ( Zeus ) ", _id];
|
||||
|
||||
while { (True) } do
|
||||
{
|
||||
private _array = (waypoints _group);
|
||||
|
||||
if (count _array == 1) then
|
||||
{
|
||||
_group setGroupId [_id];
|
||||
}
|
||||
else
|
||||
{
|
||||
_group setGroupId [_string];
|
||||
};
|
||||
|
||||
if (False) then
|
||||
{
|
||||
|
||||
if (_group in (TCL_Zeus select 1) ) then
|
||||
{
|
||||
_group setGroupId [_string];
|
||||
}
|
||||
else
|
||||
{
|
||||
_group setGroupId [_id];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
if (isNull _group) exitWith {};
|
||||
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,9 @@
|
||||
/* ////////////////////////////////////////////////////////////////////////////////
|
||||
\ \ Tactical Combat Link
|
||||
\ \------------------------------------------------------------------------------
|
||||
\ \ Macros
|
||||
\ \----------------------------------------------------------------------------
|
||||
/ / By =\SNKMAN/=
|
||||
/ /-----------------------------------------------------------------------------
|
||||
*/ ///////////////////////////////////////////////////////////////////////////////
|
||||
#define TCL_DeleteAT(_array, _index, _object); (_array select _index) deleteAt ( (_array select _index) find _object);
|
@ -0,0 +1,31 @@
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Event Handler Fired ExecVM
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
private ["_units","_count","_unit"];
|
||||
|
||||
while { (True) } do
|
||||
{
|
||||
_units = allUnits;
|
||||
|
||||
_units = _units - (TCL_EH_Fired select 0);
|
||||
|
||||
if (_units isEqualTo [] ) then
|
||||
{
|
||||
sleep 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
(TCL_EH_Fired select 0) append _units;
|
||||
|
||||
_count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
_unit addEventHandler ["FiredMan", {_this call (TCL_EH_Fired_F select 0) } ];
|
||||
};
|
||||
};
|
||||
};
|
@ -0,0 +1,76 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
/* ////////////////////////////////////////////////////////////////////////////////
|
||||
\ \ KnowsAbout ExecVM
|
||||
\ \------------------------------------------------------------------------------
|
||||
\ \ By =\SNKMAN/=
|
||||
/ /-----------------------------------------------------------------------------
|
||||
*/ ///////////////////////////////////////////////////////////////////////////////
|
||||
private ["_groups","_count","_group","_units","_time","_random","_array"];
|
||||
|
||||
// "AwareFormationSoft" enableAIFeature False;
|
||||
|
||||
// "CombatFormationSoft" enableAIFeature True;
|
||||
|
||||
// player sideChat format ["TCL_KnowsAbout.sqf > Feature > %1 > %2", (checkAIFeature "AwareFormationSoft"), (checkAIFeature "CombatFormationSoft") ];
|
||||
|
||||
while { (True) } do
|
||||
{
|
||||
_groups = (TCL_Groups select 0);
|
||||
|
||||
_groups = _groups - (TCL_Idle select 0);
|
||||
|
||||
_groups = _groups - (TCL_Artillery select 0);
|
||||
|
||||
_groups = _groups - (TCL_Reinforcement select 0);
|
||||
|
||||
_count = 0;
|
||||
|
||||
for "_count" from _count to (count _groups - 1) do
|
||||
{
|
||||
_group = (_groups select _count);
|
||||
|
||||
_units = (units _group);
|
||||
|
||||
if (_units findIf { (alive _x) } > -1) then
|
||||
{
|
||||
[_group] call (TCL_KnowsAbout_F select 0);
|
||||
|
||||
if (TCL_Feature select 0) then
|
||||
{
|
||||
if (floor (random 100) < (TCL_Feature select 1) ) then
|
||||
{
|
||||
_time = (_group getVariable "TCL_Watch");
|
||||
|
||||
if (time > _time) then
|
||||
{
|
||||
[_group] spawn (TCL_Watch_F select 0);
|
||||
};
|
||||
|
||||
_random = (random 15);
|
||||
|
||||
_group setVariable ["TCL_Watch", (time + _random) ];
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
TCL_DeleteAT(TCL_Groups,0,_group);
|
||||
|
||||
if (_group in (TCL_Location select 0) ) then
|
||||
{
|
||||
_array = (_group getVariable "TCL_Location");
|
||||
|
||||
TCL_DeleteAT(TCL_Location,0,_group);
|
||||
|
||||
_array deleteAt (_array find _group);
|
||||
|
||||
// player sideChat format ["TCL_KnowsAbout > Location > %1 > %2", _group, _groups];
|
||||
|
||||
{_delete = (_x getVariable "TCL_Location"); _delete deleteAt (_delete find _group) } forEach _array;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
};
|
@ -0,0 +1,9 @@
|
||||
/* ////////////////////////////////////////////////////////////////////////////////
|
||||
\ \ Tactical Combat Link
|
||||
\ \------------------------------------------------------------------------------
|
||||
\ \ Macros
|
||||
\ \----------------------------------------------------------------------------
|
||||
/ / By =\SNKMAN/=
|
||||
/ /-----------------------------------------------------------------------------
|
||||
*/ ///////////////////////////////////////////////////////////////////////////////
|
||||
#define TCL_DeleteAT(_array, _index, _object); (_array select _index) deleteAt ( (_array select _index) find _object);
|
@ -0,0 +1,84 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
/* ////////////////////////////////////////////////////////////////////////////////
|
||||
\ \ Monitor ExecVM
|
||||
\ \------------------------------------------------------------------------------
|
||||
\ \ By =\SNKMAN/=
|
||||
/ /-----------------------------------------------------------------------------
|
||||
*/ ///////////////////////////////////////////////////////////////////////////////
|
||||
private ["_array","_vehicle"];
|
||||
|
||||
_temp = [];
|
||||
|
||||
while { (True) } do
|
||||
{
|
||||
if (True) then
|
||||
{
|
||||
_array = (TCL_Heal select 0);
|
||||
|
||||
if (_array isEqualTo [] ) exitWith {};
|
||||
|
||||
_array = (TCL_Heal select 0);
|
||||
|
||||
_array = (TCL_Heal select 0) select { (alive _x) };
|
||||
|
||||
TCL_Heal set [0, _array];
|
||||
|
||||
_array = (TCL_Heal select 1);
|
||||
|
||||
_array = (TCL_Heal select 1) select { (alive _x) };
|
||||
|
||||
TCL_Heal set [1, _array];
|
||||
};
|
||||
|
||||
if (True) then
|
||||
{
|
||||
_array = (TCL_Rearm select 0);
|
||||
|
||||
if (_array isEqualTo [] ) exitWith {};
|
||||
|
||||
_array = (TCL_Rearm select 0);
|
||||
|
||||
_array = (TCL_Rearm select 0) select { (alive _x) };
|
||||
|
||||
TCL_Rearm set [0, _array];
|
||||
|
||||
_array = (TCL_Rearm select 1);
|
||||
|
||||
_array = (TCL_Rearm select 1) select { (alive _x) };
|
||||
|
||||
TCL_Rearm set [1, _array];
|
||||
};
|
||||
|
||||
if (True) then
|
||||
{
|
||||
_array = (TCL_Flanking select 0);
|
||||
|
||||
if (_array isEqualTo [] ) exitWith {};
|
||||
|
||||
_array = (TCL_Flanking select 1);
|
||||
|
||||
_array = (TCL_Flanking select 1) select { (alive _x) };
|
||||
|
||||
TCL_Flanking set [1, _array];
|
||||
|
||||
_array = (TCL_Flanking select 2);
|
||||
|
||||
_array = (TCL_Flanking select 2) select { (alive _x) };
|
||||
|
||||
TCL_Flanking set [2, _array];
|
||||
};
|
||||
|
||||
if (True) then
|
||||
{
|
||||
_array = (TCL_Artillery select 0);
|
||||
|
||||
if (_array isEqualTo [] ) exitWith {};
|
||||
|
||||
_array = _array select {_vehicle = (vehicle leader _x); (getArray (configfile >> "CfgVehicles" >> (typeOf _vehicle) >> "availableForSupportTypes") select 0 isEqualTo "Artillery") };
|
||||
|
||||
TCL_Artillery set [0, _array];
|
||||
};
|
||||
|
||||
sleep 30;
|
||||
};
|
@ -0,0 +1,103 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
/* ////////////////////////////////////////////////////////////////////////////////
|
||||
\ \ Spawn ExecVM
|
||||
\ \------------------------------------------------------------------------------
|
||||
\ \ By =\SNKMAN/=
|
||||
/ /-----------------------------------------------------------------------------
|
||||
*/ ///////////////////////////////////////////////////////////////////////////////
|
||||
private ["_temp","_players","_groups","_array","_count","_group","_vehicles","_vehicle"];
|
||||
|
||||
_temp = [];
|
||||
|
||||
while { (True) } do
|
||||
{
|
||||
_players = (playableUnits + switchableUnits);
|
||||
|
||||
if (True) then
|
||||
{
|
||||
_players = _players - (TCL_Players select 0);
|
||||
|
||||
_array = (TCL_Players select 0) select { (alive _x) };
|
||||
|
||||
TCL_Players set [0, _array];
|
||||
|
||||
_array = (TCL_Players select 1) select { (alive _x) };
|
||||
|
||||
TCL_Players set [1, _array];
|
||||
|
||||
if (_players isEqualTo [] ) exitWith {};
|
||||
|
||||
[_players] call (TCL_Players_F select 0);
|
||||
|
||||
// player sideChat format ["TCL_Spawn > Players > %1", _players];
|
||||
};
|
||||
|
||||
_groups = allGroups;
|
||||
|
||||
if (True) then
|
||||
{
|
||||
_groups = _groups - (TCL_Groups select 0);
|
||||
|
||||
_array = ( (TCL_Disabled select 0) + (TCL_Players select 2) );
|
||||
|
||||
_groups = _groups - _array;
|
||||
|
||||
_groups = _groups select { ( (side _x in (TCL_System select 2) ) && { (units _x findIf { (alive _x) } > -1) } ) };
|
||||
|
||||
_temp = _temp - [grpNull];
|
||||
|
||||
_groups = _groups - _temp;
|
||||
|
||||
if (_groups isEqualTo [] ) exitWith {};
|
||||
|
||||
_temp = _temp - (TCL_Groups select 0);
|
||||
|
||||
_temp append _groups;
|
||||
|
||||
_count = 0;
|
||||
|
||||
for "_count" from _count to (count _groups - 1) do
|
||||
{
|
||||
_group = (_groups select _count);
|
||||
|
||||
[_group] spawn TCL_Spawn_F;
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Spawn > Groups > %1 > %2", _groups, _temp];
|
||||
};
|
||||
|
||||
_vehicles = vehicles;
|
||||
|
||||
if (True) then
|
||||
{
|
||||
_array = ( (TCL_Vehicles select 0) + (TCL_Vehicles select 1) );
|
||||
|
||||
_vehicles = _vehicles - _array;
|
||||
|
||||
_array = _vehicles select { ( (_x isKindOf "WeaponHolderSimulated") || (typeOf _x == "Steerable_Parachute_F") ) };
|
||||
|
||||
_vehicles = _vehicles - _array;
|
||||
|
||||
(TCL_Vehicles select 1) append _array;
|
||||
|
||||
if (_vehicles isEqualTo [] ) exitWith {};
|
||||
|
||||
[_vehicles] call (TCL_Vehicles_F select 0);
|
||||
|
||||
// player sideChat format ["TCL_Spawn > Vehicles > %1", _vehicles];
|
||||
};
|
||||
|
||||
if (True) then
|
||||
{
|
||||
_array = (TCL_Artillery select 0);
|
||||
|
||||
if (_array isEqualTo [] ) exitWith {};
|
||||
|
||||
_array = _array select {_vehicle = (vehicle leader _x); (getArray (configfile >> "CfgVehicles" >> (typeOf _vehicle) >> "availableForSupportTypes") select 0 isEqualTo "Artillery") };
|
||||
|
||||
TCL_Artillery set [0, _array];
|
||||
};
|
||||
|
||||
sleep 5;
|
||||
};
|
@ -0,0 +1,55 @@
|
||||
/* ////////////////////////////////////////////////////////////////////////////////
|
||||
\ \ Zeus ExecVM
|
||||
\ \------------------------------------------------------------------------------
|
||||
\ \ By =\SNKMAN/=
|
||||
/ /-----------------------------------------------------------------------------
|
||||
*/ ///////////////////////////////////////////////////////////////////////////////
|
||||
params ["_curators"];
|
||||
|
||||
waitUntil { ( (alive player) && (time > 0) ) };
|
||||
|
||||
private _bool = True;
|
||||
|
||||
private _curator = objNull;
|
||||
|
||||
private ["_count","_curator","_unit","_array"];
|
||||
|
||||
while { (_bool) } do
|
||||
{
|
||||
_count = 0;
|
||||
|
||||
for "_count" from _count to (count _curators - 1) do
|
||||
{
|
||||
_curator = (_curators select _count);
|
||||
|
||||
_unit = (getAssignedCuratorUnit _curator);
|
||||
|
||||
if (_unit == player) exitWith
|
||||
{
|
||||
_bool = False;
|
||||
|
||||
(TCL_Curator select 0) pushBack _curator;
|
||||
|
||||
publicVariable "TCL_Curator";
|
||||
|
||||
// player sideChat format ["TCL_Zeus.sqf > Curator > %1", _curator];
|
||||
};
|
||||
};
|
||||
|
||||
_array = (TCL_Curator select 0);
|
||||
|
||||
if (_array isEqualTo _curators) exitWith {};
|
||||
|
||||
// player sideChat format ["TCL_Zeus.sqf > Curators > %1 > %2", time, _curators];
|
||||
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
if (alive _curator) then
|
||||
{
|
||||
_curator addEventHandler ["CuratorObjectPlaced", {_this spawn (TCL_EH_Zeus_F select 0) } ];
|
||||
|
||||
_curator addEventHandler ["CuratorWaypointPlaced", {_this call (TCL_EH_Zeus_F select 1) } ];
|
||||
|
||||
_curator addEventHandler ["CuratorWaypointDeleted", {_this call (TCL_EH_Zeus_F select 2) } ];
|
||||
};
|
@ -0,0 +1,712 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Random_F =
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Random Function
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By Andrew Barron
|
||||
// Rewritten by Warka
|
||||
// Optimized by Karel Moricky
|
||||
// Optimised by Killzone_Kid
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{private "_return";
|
||||
|
||||
_return = selectRandom _this;
|
||||
|
||||
_return
|
||||
|
||||
};
|
||||
|
||||
TCL_Dir_To_F =
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Direction To Function
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By Andrew Barron
|
||||
// Optimised by Killzone_Kid
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_object","_position"];
|
||||
|
||||
private _direction = (_object getDir _position);
|
||||
|
||||
_direction
|
||||
|
||||
};
|
||||
|
||||
TCL_Rel_Dir_To_F =
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Relative Direction To Function
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By Andrew Barron
|
||||
// Optimised and Extended by =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_object","_position"];
|
||||
|
||||
private "_direction";
|
||||
|
||||
if (isNull objectParent _object) then
|
||||
{
|
||||
_direction = (_object getRelDir _position);
|
||||
}
|
||||
else
|
||||
{
|
||||
private _weaponPosition = [];
|
||||
|
||||
if (assignedVehicleRole _object select 0 == "Cargo") then
|
||||
{
|
||||
_weaponPosition = (_object weaponDirection currentWeapon _object);
|
||||
}
|
||||
else
|
||||
{
|
||||
private _vehicle = (vehicle _object);
|
||||
|
||||
if (_vehicle isKindOf "Tank") then
|
||||
{
|
||||
_weaponPosition = (_vehicle weaponDirection currentWeapon _vehicle);
|
||||
};
|
||||
};
|
||||
|
||||
if (_weaponPosition isEqualTo [] ) exitWith
|
||||
{
|
||||
_direction = (_object getRelDir _position);
|
||||
};
|
||||
|
||||
private _weaponDirection = (_weaponPosition select 0) atan2 (_weaponPosition select 1);
|
||||
|
||||
_weaponDirection = _weaponDirection - (_object getDir _position);
|
||||
|
||||
if (_weaponDirection < 0) then {_weaponDirection = _weaponDirection + 360};
|
||||
|
||||
if (_weaponDirection > 360) then {_weaponDirection = _weaponDirection - 360};
|
||||
|
||||
_direction = _weaponDirection;
|
||||
};
|
||||
|
||||
_direction
|
||||
|
||||
};
|
||||
|
||||
TCL_Real_Pos_F =
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Relative Position Function
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By Andrew Barron
|
||||
// Optimised by =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_position","_distance","_direction"];
|
||||
|
||||
if (_position isEqualType objNull) exitWith
|
||||
{
|
||||
private _return = (_position getPos [_distance, _direction] select [0, 2] ) + [getPos _position select 2];
|
||||
|
||||
_return
|
||||
};
|
||||
|
||||
if (_position isEqualType [] ) exitWith
|
||||
{
|
||||
private _return = (_position getPos [_distance, _direction] select [0, 2] ) + ( [ [], [_position select 2] ] select (count _position > 2) );
|
||||
|
||||
_return
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
TCL_Velocity_F =
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Velocity Function
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By Raedor
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_object"];
|
||||
|
||||
private _return = (vectorMagnitude velocity _object) * 3.6;
|
||||
|
||||
_return
|
||||
|
||||
};
|
||||
|
||||
TCL_Shuffle_F =
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Shuffle
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By Nelson Duarte
|
||||
// Optimised by Killzone_Kid
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{
|
||||
|
||||
_this = + _this;
|
||||
|
||||
private _count = (count _this);
|
||||
|
||||
for "0" from 1 to _count do
|
||||
{
|
||||
_this pushBack (_this deleteAt floor random _count);
|
||||
};
|
||||
|
||||
_this
|
||||
|
||||
};
|
||||
|
||||
TCL_Building_Pos_F =
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Building Position Function
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_building"];
|
||||
|
||||
private _index = 0;
|
||||
|
||||
while { (True) } do
|
||||
{
|
||||
if (_building buildingPos _index isEqualTo [0,0,0] ) exitWith
|
||||
{
|
||||
_index = _index - 1;
|
||||
};
|
||||
|
||||
_index = _index + 1;
|
||||
};
|
||||
|
||||
_index
|
||||
|
||||
};
|
||||
|
||||
TCL_Daytime_F =
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Daytime Function
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By CarlGustaffa
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_dayTime"];
|
||||
|
||||
private _return = False;
|
||||
|
||||
private _latitude = -1 * getNumber (configFile >> "CfgWorlds" >> worldName >> "latitude");
|
||||
private _year = 360 * (dateToNumber date);
|
||||
private _day = (_dayTime / 24) * 360;
|
||||
|
||||
private _result = ( (12 * cos (_year) - 78) * cos (_latitude) * cos (_day) ) - (24 * sin (_latitude) * cos (_year) );
|
||||
|
||||
if (_result > 0) then
|
||||
{
|
||||
_return = True;
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
};
|
||||
|
||||
TCL_Text_F =
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Text Function
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
[ {"<t color='#ffff00'>" + _this + "</t>"},
|
||||
{"<t color='#ff0000'>" + _this + "</t>"},
|
||||
{"<t color='#bebebe'>" + _this + "</t>"},
|
||||
"<t size='1.5' color='#ff0000' underline='True'>Warning!</t><br/>",
|
||||
"<t size='1.5' color='#ffff00' underline='True'>Instruction:</t><br/>",
|
||||
"<t size='1.5' color='#ffff00' underline='True'>Information:</t><br/>"
|
||||
];
|
||||
|
||||
TCL_Create_Marker_F =
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Create Marker Function
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_array","_position","_shape","_size","_type","_color"];
|
||||
|
||||
private _marker = _array joinString "";
|
||||
|
||||
if (getMarkerPos _marker isEqualTo [0,0,0] ) then
|
||||
{
|
||||
createMarker [_marker, _position];
|
||||
|
||||
_marker setMarkerShape _shape;
|
||||
|
||||
_marker setMarkerSize _size;
|
||||
|
||||
private _array = ["Horizontal","Border","FDiagonal"];
|
||||
|
||||
if (_type in _array) then
|
||||
{
|
||||
_marker setMarkerBrush _type;
|
||||
}
|
||||
else
|
||||
{
|
||||
_marker setMarkerType _type;
|
||||
};
|
||||
|
||||
_marker setMarkerColor _color;
|
||||
}
|
||||
else
|
||||
{
|
||||
_marker = "";
|
||||
};
|
||||
|
||||
_marker
|
||||
|
||||
};
|
||||
|
||||
TCL_Rank_F =
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rank Function
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit"];
|
||||
|
||||
private _return = 0;
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
private _rank = (rank _unit);
|
||||
|
||||
if (_rank isEqualTo "PRIVATE") exitWith
|
||||
{
|
||||
_return = 1;
|
||||
};
|
||||
|
||||
if (_rank isEqualTo "CORPORAL") exitWith
|
||||
{
|
||||
_return = 2;
|
||||
};
|
||||
|
||||
if (_rank isEqualTo "SERGEANT") exitWith
|
||||
{
|
||||
_return = 3;
|
||||
};
|
||||
|
||||
if (_rank isEqualTo "LIEUTENANT") exitWith
|
||||
{
|
||||
_return = 4;
|
||||
};
|
||||
|
||||
if (_rank isEqualTo "CAPTAIN") exitWith
|
||||
{
|
||||
_return = 5;
|
||||
};
|
||||
|
||||
if (_rank isEqualTo "MAJOR") exitWith
|
||||
{
|
||||
_return = 6;
|
||||
};
|
||||
|
||||
if (_rank isEqualTo "COLONEL") exitWith
|
||||
{
|
||||
_return = 7;
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
};
|
||||
|
||||
TCL_Trigger_F =
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Trigger Function
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_object"];
|
||||
|
||||
private _return = False;
|
||||
|
||||
private _trigger = (_group getVariable "TCL_Trigger");
|
||||
|
||||
if (_object inArea _trigger) then
|
||||
{
|
||||
_return = True;
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
};
|
||||
|
||||
TCL_Visible_F =
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Visible Function
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Visible
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_units","_group","_logic","_array"];
|
||||
|
||||
private _time = 0;
|
||||
|
||||
private _value = 1;
|
||||
|
||||
// private _array = [];
|
||||
|
||||
private _bool = True;
|
||||
|
||||
private _knowledge = 0;
|
||||
|
||||
private _random = 5 + (random 10);
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
private _tweak = (TCL_IQ select 2);
|
||||
|
||||
private _value = (_value + _tweak);
|
||||
|
||||
_random = (_random * _value);
|
||||
|
||||
_units = _units select { ( (alive _x) && { (_x knowsAbout vehicle _enemy > 0) } ) };
|
||||
|
||||
_units = _units - _array;
|
||||
|
||||
private _index = (_units find _leader);
|
||||
|
||||
if (_index > 0) then
|
||||
{
|
||||
private _unit = (_units select 0);
|
||||
|
||||
_units set [0, _leader];
|
||||
|
||||
_units set [_index, _unit];
|
||||
};
|
||||
|
||||
private ["_unit","_knowledge","_time"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
_knowledge = (_unit targetKnowledge vehicle _enemy) select 2;
|
||||
|
||||
if (_knowledge < 0) then
|
||||
{
|
||||
_knowledge = (_unit targetKnowledge vehicle _enemy) select 3;
|
||||
};
|
||||
|
||||
if (_knowledge > 0) then
|
||||
{
|
||||
_time = (time - _knowledge);
|
||||
|
||||
if (_time < _random) then
|
||||
{
|
||||
_bool = False;
|
||||
|
||||
_array pushBack _unit;
|
||||
|
||||
// player sideChat format ["TCL_Visible_F > Knowledge > %1 > %2 > %3", _unit, _time, _random];
|
||||
}
|
||||
else
|
||||
{
|
||||
// _unit doFollow _unit;
|
||||
|
||||
if (_unit in (TCL_Static_Weapon select 0) ) then
|
||||
{
|
||||
if (floor (random 100) < 50) then
|
||||
{
|
||||
private _vehicle = (vehicle _unit);
|
||||
|
||||
[_unit, _group, _vehicle] call (TCL_Static_Weapon_F select 4);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if (TCL_Debug select 6) then
|
||||
{
|
||||
[_unit, _enemy, _array] spawn (TCL_Debug_F select 3);
|
||||
};
|
||||
|
||||
if (_leader in _array) exitWith
|
||||
{
|
||||
_array = _units;
|
||||
};
|
||||
};
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
private _skill = [_group] call TCL_Accuracy_F;
|
||||
|
||||
_random = 15 + (random 30);
|
||||
|
||||
_random = (_random * _value);
|
||||
|
||||
_random = (_random * _skill);
|
||||
|
||||
if (_time > _random) then
|
||||
{
|
||||
_group forgetTarget _enemy;
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Visible_F > Forget > %1", _group];
|
||||
};
|
||||
|
||||
_array
|
||||
|
||||
};
|
||||
|
||||
TCL_Knowledge_F =
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Knowledge Function
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Knowledge
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_groups"];
|
||||
|
||||
private _return = False;
|
||||
|
||||
private _units = (units _enemy);
|
||||
|
||||
private ["_group","_knowsAbout"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _groups - 1) do
|
||||
{
|
||||
_group = (_groups select _count);
|
||||
|
||||
// player sideChat format ["TCL_Knowledge_F > Units > %1", (count _units) ];
|
||||
|
||||
_knowsAbout = (_units findIf { ( (alive _x) && { (_group knowsAbout vehicle _x > 0) } ) } );
|
||||
|
||||
if (_knowsAbout > -1) exitWith
|
||||
{
|
||||
_return = True;
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
};
|
||||
|
||||
TCL_Spawn_F =
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Spawn Function
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Spawn
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
while { (_count < count units _group) } do
|
||||
{
|
||||
sleep 1;
|
||||
|
||||
_count = _count + 1;
|
||||
|
||||
// player sideChat format ["TCL_Spawn_F > Count > %1 > %2", _group, _count];
|
||||
};
|
||||
|
||||
if (TCL_Multiplayer) then
|
||||
{
|
||||
private _leader = (leader _group);
|
||||
|
||||
if (local _leader) exitWith {};
|
||||
|
||||
sleep 1;
|
||||
|
||||
private _driver = objNull;
|
||||
|
||||
private _vehicle = objNull;
|
||||
|
||||
if (isNull objectParent _leader) then
|
||||
{
|
||||
_driver = objNull;
|
||||
|
||||
_vehicle = objNull;
|
||||
}
|
||||
else
|
||||
{
|
||||
_vehicle = (vehicle _leader);
|
||||
|
||||
_driver = (driver _vehicle);
|
||||
};
|
||||
|
||||
if (_group in (TCL_Zeus select 0) ) then
|
||||
{
|
||||
_group setGroupOwner 2;
|
||||
|
||||
// player sideChat format ["TCL_Spawn_F > Zeus %1 > %2", _group, (TCL_Zeus select 0) ];
|
||||
};
|
||||
|
||||
if (alive _driver) then
|
||||
{
|
||||
if (local _driver) exitWith {};
|
||||
|
||||
while { (_driver in _vehicle) } do
|
||||
{
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
_driver moveInDriver _vehicle;
|
||||
|
||||
// player sideChat format ["TCL_Spawn_F > Zeus > Local > %1 > %2", (local _driver), (local _vehicle) ];
|
||||
};
|
||||
};
|
||||
|
||||
private _value = (TCL_System select 8);
|
||||
|
||||
sleep _value;
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
if (_units findIf { (alive _x) } > -1) then
|
||||
{
|
||||
_group = [_group];
|
||||
|
||||
[_group] call (TCL_Groups_F select 0);
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
TCL_Cover_F =
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Cover Function
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Cover
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_array","_distance"];
|
||||
|
||||
private _position = (_array select 1);
|
||||
|
||||
_objects = (_array select 2);
|
||||
|
||||
if ( (_unit distance _position > _distance) || (_objects isEqualTo [] ) ) then
|
||||
{
|
||||
_objects = nearestTerrainObjects [_position, ["HIDE","ROCK","ROCKS","BUSH"], _distance];
|
||||
|
||||
_array set [2, _objects];
|
||||
|
||||
_array set [1, (getPos _unit) ];
|
||||
|
||||
// player sideChat format ["TCL_Take_Cover_F > Far > %1 > %2", _unit, (count _objects) ];
|
||||
}
|
||||
else
|
||||
{
|
||||
// player sideChat format ["TCL_Take_Cover_F > Close > %1 > %2", _unit, (count _objects) ];
|
||||
};
|
||||
|
||||
_objects
|
||||
|
||||
};
|
||||
|
||||
TCL_Exist_F =
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Exist Function
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Exist
|
||||
// By Killzone_Kid
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_file"];
|
||||
|
||||
private _return = False;
|
||||
|
||||
disableSerialization;
|
||||
|
||||
private _ctrl = findDisplay 0 ctrlCreate ["RscHTML", -1];
|
||||
|
||||
_ctrl htmlLoad _file;
|
||||
|
||||
private _bool = ctrlHTMLLoaded _ctrl;
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
_return = True;
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
};
|
||||
|
||||
TCL_Accuracy_F =
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Accuracy Function
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Accuracy
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
private _skill = 1;
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
if (alive _leader) then
|
||||
{
|
||||
_skill = _skill + (_leader skill "general");
|
||||
|
||||
_skill = _skill + (_leader skill "commanding");
|
||||
|
||||
_skill = _skill - (_leader skill "courage");
|
||||
|
||||
if (_skill < 1) then
|
||||
{
|
||||
_skill = 1;
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Accuracy_F > Skill > %1 > %2", _leader, _skill];
|
||||
};
|
||||
|
||||
_skill
|
||||
|
||||
};
|
||||
|
||||
TCL_Flanking_F =
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking Function
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
private _return = [];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
_units deleteAt (_units find _leader);
|
||||
|
||||
private _random = 3 - (random 1);
|
||||
|
||||
_value = (count _units / _random);
|
||||
|
||||
private "_unit";
|
||||
|
||||
private _count = 0;
|
||||
|
||||
while { (_count < _value) } do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
_return pushBack _unit;
|
||||
|
||||
_count = _count + 1;
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
};
|
@ -0,0 +1,276 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Advancing_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Advancing Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Advancing
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_object","_weapon","_muzzle"];
|
||||
|
||||
private _return = 0;
|
||||
|
||||
private _array = ["Throw","Put"];
|
||||
|
||||
if (_weapon in _array) exitWith {_return};
|
||||
|
||||
private _type = {_weapon isKindOf [_this, configFile >> "CfgWeapons"] };
|
||||
|
||||
if ( ("Pistol" call _type) || ("Rifle" call _type) ) then
|
||||
{
|
||||
private _muzzle = (currentMuzzle _object);
|
||||
|
||||
if (_weapon isEqualTo _muzzle) then
|
||||
{
|
||||
private _accessories = (_object weaponAccessories _muzzle);
|
||||
|
||||
private _suppressor = (_accessories select 0);
|
||||
|
||||
_return = (TCL_Feature select 24);
|
||||
|
||||
if (_suppressor isEqualTo "") then
|
||||
{
|
||||
_return = (TCL_Feature select 26);
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_return = (TCL_Feature select 24);
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
if ("Launcher" call _type) then
|
||||
{
|
||||
_return = (TCL_Feature select 25);
|
||||
}
|
||||
else
|
||||
{
|
||||
_return = (TCL_Feature select 26);
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Advancing Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Advancing
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_object","_group","_value"];
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
private _distance = (_object distance _leader);
|
||||
|
||||
if (_distance < _value) then
|
||||
{
|
||||
[_object, _group, _distance] spawn (TCL_Advancing_F select 2);
|
||||
|
||||
// player sideChat format ["TCL_Advancing_F > Group > %1", _group];
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Advancing Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Advancing
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_object","_group","_distance"];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _array = ( (TCL_Hold select 0) + (TCL_Defend select 0) + (TCL_Freeze select 0) + (TCL_Default select 0) + (TCL_Garrison select 0) );
|
||||
|
||||
if (_group in (TCL_Garrison select 0) ) then
|
||||
{
|
||||
_units = _units select { ( (isNull objectParent _x) && { (currentCommand _x isEqualTo "") } ) };
|
||||
|
||||
if (_units isEqualTo [] ) exitWith {};
|
||||
|
||||
_array deleteAt (_array find _group);
|
||||
|
||||
// player sideChat format ["TCL_Advancing_F > Garrison > %1", _units];
|
||||
};
|
||||
|
||||
if (_group in _array) then
|
||||
{
|
||||
[_object, _group, _distance] spawn (TCL_Advancing_F select 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( (floor (random 100) < 35) && { (_distance > 100) } && { (_group knowsAbout vehicle _object == 0) } ) then
|
||||
{
|
||||
private _leader = (leader _group);
|
||||
|
||||
private _behaviour = (behaviour _leader);
|
||||
private _speedMode = (speedMode _leader);
|
||||
|
||||
_units select { ( (_x == _leader) || (floor (random 100) < 50) ) } apply {_x doWatch (getPos _object) };
|
||||
|
||||
if (_distance > 300) then
|
||||
{
|
||||
if (_leader hasWeapon "Binocular") then {_leader selectWeapon "Binocular"};
|
||||
};
|
||||
|
||||
sleep 5 + (random 10);
|
||||
|
||||
if (currentWeapon _leader isEqualTo "Binocular") then
|
||||
{
|
||||
_leader selectWeapon (primaryWeapon _leader);
|
||||
};
|
||||
|
||||
if (_group knowsAbout vehicle _object == 0) then
|
||||
{
|
||||
_group setBehaviour "AWARE";
|
||||
_group setSpeedMode "NORMAL";
|
||||
|
||||
if (floor (random 100) < 50) then
|
||||
{
|
||||
_group setSpeedMode "FULL";
|
||||
};
|
||||
|
||||
(TCL_Advancing select 0) pushBack _group;
|
||||
|
||||
_group lockWp True;
|
||||
|
||||
private _value = 50;
|
||||
|
||||
if (alive _object) then
|
||||
{
|
||||
_value = 30;
|
||||
};
|
||||
|
||||
private _position = [ (getPos _object select 0) + (random _value - random _value), (getPos _object select 1) + (random _value - random _value), 0];
|
||||
|
||||
if (_group in (TCL_Garrison select 0) ) then
|
||||
{
|
||||
_units doMove _position;
|
||||
}
|
||||
else
|
||||
{
|
||||
_group move _position;
|
||||
|
||||
_units doFollow _leader;
|
||||
};
|
||||
|
||||
private _bool = True;
|
||||
|
||||
private _count = (random 50);
|
||||
|
||||
while { (_count > 0) } do
|
||||
{
|
||||
if ( (_group in (TCL_Reinforcement select 0) ) || ( (alive _object) && { (_group knowsAbout vehicle _object > 0) } ) ) exitWith
|
||||
{
|
||||
_bool = False;
|
||||
};
|
||||
|
||||
_count = _count - 1;
|
||||
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
TCL_DeleteAT(TCL_Advancing,0,_group);
|
||||
|
||||
if (_group in (TCL_Garrison select 0) ) then
|
||||
{
|
||||
{_x doMove (getPos _x) } count _units;
|
||||
|
||||
sleep 10 + (random 30);
|
||||
};
|
||||
|
||||
_group move (getPos _leader);
|
||||
};
|
||||
|
||||
sleep 10 + (random 30);
|
||||
|
||||
if (_group in (TCL_Reinforcement select 0) ) then
|
||||
{
|
||||
_bool = False;
|
||||
}
|
||||
else
|
||||
{
|
||||
_group lockWp False;
|
||||
|
||||
_group setBehaviour _behaviour;
|
||||
_group setSpeedMode _speedMode;
|
||||
|
||||
if (count waypoints _group == 1) then
|
||||
{
|
||||
private _position = (_group getVariable "TCL_Position");
|
||||
|
||||
private _value = 50;
|
||||
|
||||
if ( (alive _object) && { (_group knowsAbout vehicle _object > 0) } && { (side _group getFriend side _object > 0.6) } )then
|
||||
{
|
||||
private _random = (random 50);
|
||||
|
||||
_value = (_value + _random);
|
||||
};
|
||||
|
||||
if (floor (random 100) < _value) then
|
||||
{
|
||||
_group move _position;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
[_object, _group, _distance] spawn (TCL_Advancing_F select 3);
|
||||
};
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Advancing Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Advancing
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_object","_group","_distance"];
|
||||
|
||||
sleep (random 1);
|
||||
|
||||
private _array = [];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
{if ( (floor (random 100) < 5) && { (alive _object) } ) then {_x setUnitPos "DOWN"} else {if (floor (random 100) < 35) then {_x setUnitPos "MIDDLE"} } } count _units;
|
||||
|
||||
_units select { ( (_x == _leader) || (floor (random 100) < 50) ) } apply {_x doWatch (getPos _object); _array pushBack _x};
|
||||
|
||||
// {if ( (floor (random 100) < 50) || (_x == _leader) ) then {_x doWatch (getPos _object); _array pushBack _x} } forEach _units;
|
||||
|
||||
(TCL_Watch select 0) append _array;
|
||||
|
||||
if (_distance > 300) then
|
||||
{
|
||||
if (_leader hasWeapon "Binocular") then {_leader selectWeapon "Binocular"};
|
||||
};
|
||||
|
||||
sleep (random 30);
|
||||
|
||||
if (currentWeapon _leader isEqualTo "Binocular") then
|
||||
{
|
||||
_leader selectWeapon (primaryWeapon _leader);
|
||||
};
|
||||
|
||||
TCL_Watch set [0, (TCL_Watch select 0) - _array];
|
||||
|
||||
if (_group in (TCL_Suppressed select 0) ) then {_group = _group} else { {_x setUnitPos "AUTO"} count _units};
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,236 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Artillery_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic"];
|
||||
|
||||
if (TCL_Feature select 9) then
|
||||
{
|
||||
if (floor (random 100) < (TCL_Feature select 10) ) then
|
||||
{
|
||||
private _condition = (_logic getVariable "TCL_Artillery");
|
||||
|
||||
if (_condition select 0) then
|
||||
{
|
||||
private _leader = (leader _group);
|
||||
|
||||
private _position = (getPos _logic);
|
||||
|
||||
private _groups = (TCL_Artillery select 0);
|
||||
|
||||
_groups = _groups select { ( (side _x getFriend side _group > 0.6) && { (_x getVariable "TCL_Artillery") } ) };
|
||||
|
||||
if (_groups isEqualTo [] ) exitWith {};
|
||||
|
||||
private ["_vehicle","_distance","_bool"];
|
||||
|
||||
{_vehicle = (vehicle leader _x);
|
||||
|
||||
_distance = [_x, _group] call (TCL_Radio_F select 0);
|
||||
|
||||
_bool = [_vehicle, _position] call (TCL_Artillery_F select 2);
|
||||
|
||||
if ( (_bool) && { (_distance) } ) exitWith
|
||||
{
|
||||
_condition set [0, False];
|
||||
|
||||
_x setVariable ["TCL_Artillery", False];
|
||||
|
||||
[_enemy, _x, _logic, _vehicle] spawn (TCL_Artillery_F select 1);
|
||||
};
|
||||
|
||||
} count _groups;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic","_vehicle"];
|
||||
|
||||
private _value = [_enemy, _group, _logic] call (TCL_KnowsAbout_F select 3);
|
||||
|
||||
sleep _value;
|
||||
|
||||
sleep 10 + (random 30);
|
||||
|
||||
if (alive _logic) then
|
||||
{
|
||||
private _condition = (_logic getVariable "TCL_Artillery");
|
||||
|
||||
_condition set [1, True];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
_units = _units select { ( (canFire vehicle _x) && { (_x == gunner vehicle _x) } ) };
|
||||
|
||||
if (_units isEqualTo [] ) exitWith
|
||||
{
|
||||
_condition set [1, False];
|
||||
|
||||
sleep 30 + (random 50);
|
||||
|
||||
_condition set [0, True];
|
||||
};
|
||||
|
||||
private _time = 0;
|
||||
|
||||
private _value = (count _units);
|
||||
|
||||
private _rounds = 7 + (random 10);
|
||||
|
||||
_rounds = (_rounds / _value);
|
||||
|
||||
private ["_unit","_vehicle","_position","_bool","_magazine"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
_vehicle = (vehicle _unit);
|
||||
|
||||
_position = [ (getPos _logic select 0) + (random 70 - random 70), (getPos _logic select 1) + (random 70 - random 70), 0];
|
||||
|
||||
// _position = [ (getPos _logic select 0) + (random 100 - random 100), (getPos _logic select 1) + (random 100 - random 100), 0];
|
||||
|
||||
_bool = [_vehicle, _position] call (TCL_Artillery_F select 2);
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
_magazine = (getArtilleryAmmo [_vehicle] select 0);
|
||||
|
||||
_time = _vehicle getArtilleryETA [_position, _magazine];
|
||||
|
||||
_vehicle doArtilleryFire [_position, _magazine, _rounds];
|
||||
|
||||
sleep (random 3);
|
||||
};
|
||||
};
|
||||
|
||||
if (_time > 0) then
|
||||
{
|
||||
while { (currentcommand _vehicle isEqualTo "FIRE AT POSITION") } do
|
||||
{
|
||||
sleep 5;
|
||||
};
|
||||
|
||||
sleep _time;
|
||||
|
||||
if (alive _logic) then
|
||||
{
|
||||
_condition set [1, False];
|
||||
|
||||
sleep 170 + (random 150);
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_condition set [1, False];
|
||||
|
||||
sleep 70 + (random 50);
|
||||
};
|
||||
|
||||
if (alive _logic) then
|
||||
{
|
||||
_condition set [0, True];
|
||||
};
|
||||
|
||||
_group setVariable ["TCL_Artillery", True];
|
||||
|
||||
// player sideChat format ["TCL_Artillery_F > Artillery > %1", (_logic getVariable "TCL_Artillery") ];
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_vehicle","_position"];
|
||||
|
||||
private _return = False;
|
||||
|
||||
private _gunner = (gunner _vehicle);
|
||||
|
||||
if ( (canFire _vehicle) && { (alive _gunner) } ) then
|
||||
{
|
||||
if (getArray (configfile >> "CfgVehicles" >> (typeOf _vehicle) >> "availableForSupportTypes") select 0 isEqualTo "Artillery") then
|
||||
{
|
||||
private _magazine = (getArtilleryAmmo [_vehicle] select 0);
|
||||
|
||||
private _range = _position inRangeOfArtillery [crew _vehicle, _magazine];
|
||||
|
||||
if (_range) then
|
||||
{
|
||||
_return = [_vehicle, _position] call (TCL_Artillery_F select 3);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Artillery_F > Artillery > %1 > %2", _vehicle, _return];
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_vehicle","_position"];
|
||||
|
||||
private _return = True;
|
||||
|
||||
private _distance = 100;
|
||||
|
||||
if (_vehicle isKindOf "Tank") then
|
||||
{
|
||||
private _random = (random 100);
|
||||
|
||||
_distance = (_distance + _random);
|
||||
};
|
||||
|
||||
private _objects = _position nearEntities [ ["CAManBase","Car","Tank","Helicopter"], _distance];
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {_return};
|
||||
|
||||
private "_object";
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _objects - 1) do
|
||||
{
|
||||
_object = (_objects select _count);
|
||||
|
||||
if ( (alive _object) && { (side _object getFriend side _vehicle > 0.6) } ) exitWith
|
||||
{
|
||||
_return = False;
|
||||
|
||||
// player sideChat format ["TCL_Artillery_F > Artillery > %1 > %2", _object, _vehicle];
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,138 @@
|
||||
TCL_Feature_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Feature Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Feature
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_units"];
|
||||
|
||||
_units = _units - ( (TCL_Heal select 1) + (TCL_Rearm select 1) );
|
||||
|
||||
private "_unit";
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
if (TCL_Feature select 30) then
|
||||
{
|
||||
if (floor (random 100) < (TCL_Feature select 31) ) then
|
||||
{
|
||||
[_unit, _group] call (TCL_Heal_F select 0);
|
||||
};
|
||||
};
|
||||
|
||||
if (TCL_Feature select 32) then
|
||||
{
|
||||
if (floor (random 100) < (TCL_Feature select 33) ) then
|
||||
{
|
||||
if (_unit in (TCL_Heal select 0) ) exitWith {};
|
||||
|
||||
[_unit, _group] call (TCL_Rearm_F select 0);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Feature Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Feature
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic","_array","_knowsAbout"];
|
||||
|
||||
if (_knowsAbout > 0) then
|
||||
{
|
||||
private _units = (units _group);
|
||||
|
||||
// if (_array isEqualTo _units) exitWith {};
|
||||
|
||||
_array = [_enemy, _units, _group, _logic, _array] call TCL_Visible_F;
|
||||
|
||||
// player sideChat format ["TCL_Feature_F > Visible > %1", _array];
|
||||
};
|
||||
|
||||
if (_array isEqualTo [] ) then
|
||||
{
|
||||
if (TCL_Feature select 11) then
|
||||
{
|
||||
if (floor (random 100) < (TCL_Feature select 12) ) then
|
||||
{
|
||||
private _leader = (leader _group);
|
||||
|
||||
if (_leader distance _logic < 100) then
|
||||
{
|
||||
[_enemy, _group, _logic] call (TCL_House_Search_F select 0);
|
||||
|
||||
// player sideChat format ["TCL_Feature_F > House Search > %1", _group];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_knowsAbout > 0) then
|
||||
{
|
||||
if (TCL_Feature select 13) then
|
||||
{
|
||||
if (floor (random 100) < (TCL_Feature select 14) ) then
|
||||
{
|
||||
[_enemy, _group, _logic] call (TCL_Static_Weapon_F select 0);
|
||||
|
||||
// player sideChat format ["TCL_Feture_F > Static Weapon > %1 > %2", _group];
|
||||
};
|
||||
};
|
||||
|
||||
if (TCL_Feature select 15) then
|
||||
{
|
||||
[_enemy, _group, _array] call (TCL_Take_Cover_F select 0);
|
||||
|
||||
// player sideChat format ["TCL_Feture_F > Take Cover > %1 > %2", _group, (count _array) ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_array
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Feature Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Feature
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_object","_array","_distance"];
|
||||
|
||||
private _groups = (TCL_Groups select 0);
|
||||
|
||||
_groups = _groups - _array;
|
||||
|
||||
private ["_group","_leader"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _groups - 1) do
|
||||
{
|
||||
_group = (_groups select _count);
|
||||
|
||||
_leader = (leader _group);
|
||||
|
||||
if (isNull objectParent _leader) then
|
||||
{
|
||||
[_object, _group, _distance] call (TCL_Advancing_F select 1);
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,171 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Flanking_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
if ( { (alive _x) } count _units > 3) then
|
||||
{
|
||||
private _array = [];
|
||||
|
||||
private _random = 3 - (random 1);
|
||||
|
||||
private _value = (count _units / 2);
|
||||
|
||||
// _value = (count _units / _random);
|
||||
|
||||
if (floor (random 100) < (TCL_Feature select 20) ) then
|
||||
{
|
||||
(TCL_Flanking select 0) pushBack _group;
|
||||
|
||||
// player sideChat format ["TCL_System > Flanking In > %1", _group];
|
||||
};
|
||||
|
||||
private "_unit";
|
||||
|
||||
private _count = (count _units - 1);
|
||||
|
||||
while { (_count > _value) } do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
_array pushBack _unit;
|
||||
|
||||
_count = _count - 1;
|
||||
};
|
||||
|
||||
(TCL_Flanking select 1) append _array;
|
||||
|
||||
if (floor (random 100) < (TCL_Feature select 21) ) then
|
||||
{
|
||||
// player sideChat format ["TCL_Flanking_F > Flanking #1 > %1 > %2", _group, _array];
|
||||
}
|
||||
else
|
||||
{
|
||||
_units = _units - _array;
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
_units deleteAt (_units find _leader);
|
||||
|
||||
private _unit = (_units select 0);
|
||||
|
||||
_units deleteAt (_units find _unit);
|
||||
|
||||
(TCL_Flanking select 2) append _units;
|
||||
|
||||
// player sideChat format ["TCL_Flanking_F > Flanking #3 > %1 > %2 > %3", _group, _units, _array];
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_enemy","_position","_distance"];
|
||||
|
||||
private _value = 30;
|
||||
|
||||
private _bool = True;
|
||||
|
||||
private _random = (random 50);
|
||||
|
||||
_value = (_value + _random);
|
||||
|
||||
private _direction = (_unit getDir _enemy);
|
||||
|
||||
if (_unit in (TCL_Flanking select 1) ) then
|
||||
{
|
||||
if (_group in (TCL_Flanking select 3) ) exitWith
|
||||
{
|
||||
_direction = (_direction + _value);
|
||||
};
|
||||
|
||||
_direction = (_direction - _value);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_unit in (TCL_Flanking select 2) ) exitWith
|
||||
{
|
||||
if (_group in (TCL_Flanking select 3) ) exitWith
|
||||
{
|
||||
_direction = (_direction - _value);
|
||||
};
|
||||
|
||||
_direction = (_direction + _value);
|
||||
};
|
||||
|
||||
_bool = False;
|
||||
};
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
_position = [_unit, _distance, _direction] call TCL_Real_Pos_F;
|
||||
|
||||
if (TCL_Debug select 6) then
|
||||
{
|
||||
[_position] spawn (TCL_Flanking_F select 2);
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Take_Cover_F > Direction > %1 > %2", _unit, _direction];
|
||||
};
|
||||
|
||||
_position
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_position"];
|
||||
|
||||
private _spot = createVehicle ["Sign_Arrow_Large_Yellow_F", _position, [], 0, "CAN_COLLIDE"];
|
||||
|
||||
sleep 5;
|
||||
|
||||
deleteVehicle _spot;
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
if (_group in (TCL_Flanking select 0) ) then
|
||||
{
|
||||
TCL_DeleteAT(TCL_Flanking,0,_group);
|
||||
|
||||
// player sideChat format ["TCL_System > Flanking Out > %1", _group];
|
||||
}
|
||||
else
|
||||
{
|
||||
(TCL_Flanking select 0) pushBack _group;
|
||||
|
||||
// player sideChat format ["TCL_System > Flanking In > %1", _group];
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,106 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Flare_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flare Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flare
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic"];
|
||||
|
||||
if (TCL_Feature select 7) then
|
||||
{
|
||||
private _units = (units _group);
|
||||
|
||||
if (_group in (TCL_Flare select 0) ) exitWith {};
|
||||
|
||||
if ( (floor (random 100) < (TCL_Feature select 8) ) || ( { (_units findIf { ( (alive _x) && (hmd _x isEqualTo "") ) } > -1) } ) ) then
|
||||
{
|
||||
private ["_unit","_muzzles"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
_muzzles = getArray (configFile >> "CfgWeapons" >> (primaryWeapon _unit) >> "muzzles");
|
||||
|
||||
if ( (alive _unit) && (count _muzzles == 2) ) exitWith
|
||||
{
|
||||
(TCL_Flare select 0) pushBack _group;
|
||||
|
||||
private _magazines = [];
|
||||
|
||||
private _magazine = (magazines _unit select 0);
|
||||
|
||||
_magazines pushBack _magazine;
|
||||
|
||||
_unit removeMagazine _magazine;
|
||||
|
||||
private _array = ["1Rnd_HE_Grenade_shell","3Rnd_HE_Grenade_shell"];
|
||||
|
||||
{if ( (_x in _array) || (currentMagazine _unit in _array) ) then {_magazines pushBack _x; _unit removeMagazine _x} } forEach magazines _unit;
|
||||
|
||||
private _muzzle = (_muzzles select 1);
|
||||
|
||||
private _flare = "UGL_FlareWhite_F";
|
||||
|
||||
sleep 5 + (random 15);
|
||||
|
||||
private ["_direction","_random","_range","_distance"];
|
||||
|
||||
private _count = 3 + (random 5);
|
||||
|
||||
while { ( (alive _unit) && { (alive _logic) } && { (_count > 0) } ) } do
|
||||
{
|
||||
if (_unit distance _logic < 300) then
|
||||
{
|
||||
if (floor (random 100) < (TCL_Feature select 8) ) then
|
||||
{
|
||||
_direction = (_unit getDir _enemy);
|
||||
|
||||
_random = 30 - (random 50);
|
||||
|
||||
_range = (_direction + _random);
|
||||
|
||||
_distance = 130 + (random 50);
|
||||
|
||||
if (_unit distance _logic < _distance) then
|
||||
{
|
||||
_distance = (_unit distance _logic);
|
||||
|
||||
_distance = (_distance + _random);
|
||||
};
|
||||
|
||||
_flare = "F_40mm_White" createVehicle [ (getPos _unit select 0) + (_distance * sin _range), (getPos _unit select 1) + (_distance * cos _range), 70 + (random 70) ];
|
||||
|
||||
_flare setVelocity [0,0,-0.3];
|
||||
|
||||
_count = _count - 1;
|
||||
};
|
||||
|
||||
sleep 30 + (random 50);
|
||||
}
|
||||
else
|
||||
{
|
||||
sleep 10;
|
||||
};
|
||||
};
|
||||
|
||||
if (alive _unit) then { {_unit addMagazine _x} forEach _magazines};
|
||||
|
||||
private _value = 70 + (random 50);
|
||||
|
||||
sleep _value;
|
||||
|
||||
TCL_DeleteAT(TCL_Flare,0,_group);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,22 @@
|
||||
TCL_Follow_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Follow Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Follow
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group"];
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
private _array = ( (TCL_Heal select 0) + (TCL_Rearm select 0) + (TCL_Take_Cover select 0) + (TCL_House_Search select 0) );
|
||||
|
||||
if (_unit in _array) exitWith {True};
|
||||
|
||||
// _unit doFollow _leader;
|
||||
|
||||
True
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,238 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Garrison_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Garrison Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Garrison
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
private _time = 5 - (random 3);
|
||||
|
||||
if (_group in (TCL_Garrison select 0) ) then
|
||||
{
|
||||
_time = 0;
|
||||
};
|
||||
|
||||
sleep _time;
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
if (_group in (TCL_Freeze select 0) ) exitWith {};
|
||||
|
||||
if (_units findIf { (alive _x) } > -1) then
|
||||
{
|
||||
|
||||
if (TCL_Feature select 2) then
|
||||
{
|
||||
private _leader = (leader _group);
|
||||
|
||||
if (isNull objectParent _leader) then
|
||||
{
|
||||
if (count (waypoints _group) == 1) then
|
||||
{
|
||||
if (_group in (TCL_Reinforcement select 0) ) exitWith {};
|
||||
|
||||
private _array = [_group] call (TCL_Garrison_F select 1);
|
||||
|
||||
if (_array isEqualTo [] ) exitWith {};
|
||||
|
||||
private _building = (_array select 0);
|
||||
|
||||
private _bool = True;
|
||||
|
||||
if (_group in (TCL_Hold select 0) ) then
|
||||
{
|
||||
_bool = [_group, _building] call TCL_Trigger_F;
|
||||
};
|
||||
|
||||
if ( (_bool) && { (damage _building < 1) } ) then
|
||||
{
|
||||
_array deleteAt (_array find _building);
|
||||
|
||||
if (_group in (TCL_Garrison select 0) ) then
|
||||
{
|
||||
private _buildings = (_group getVariable "TCL_Garrison");
|
||||
|
||||
_buildings pushBack _building;
|
||||
}
|
||||
else
|
||||
{
|
||||
(TCL_Garrison select 0) pushBack _group;
|
||||
|
||||
(TCL_Garrison select 2) pushBack _group;
|
||||
|
||||
_group setVariable ["TCL_Garrison", [_building] ];
|
||||
};
|
||||
|
||||
(TCL_Garrison select 1) pushBack _building;
|
||||
|
||||
// player sideChat format ["TCL_Garrison_F > Group > %1", _group];
|
||||
|
||||
[_group, _array] call (TCL_Garrison_F select 2);
|
||||
|
||||
// player sideChat format ["TCL_Garrison_F > Building > %1 > %2", _building, (count _array) ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Garrison Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Garrison
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
private _return = [];
|
||||
|
||||
private _distance = 100;
|
||||
|
||||
if (_group in (TCL_Garrison select 0) ) then
|
||||
{
|
||||
// _distance = 50;
|
||||
};
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
private _objects = nearestObjects [_leader, ["House"], _distance];
|
||||
|
||||
_objects = _objects - (TCL_Garrison select 1);
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {_return};
|
||||
|
||||
private ["_building","_index","_position"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _objects - 1) do
|
||||
{
|
||||
_building = (_objects select _count);
|
||||
|
||||
_index = [_building] call TCL_Building_Pos_F;
|
||||
|
||||
if ( (_index == 2) && { ( [0,1,2] findIf { (_building buildingPos _x select 2 > 5) } > -1) } ) exitWith
|
||||
{
|
||||
_return = [_building];
|
||||
|
||||
_position = (_building buildingPos _index);
|
||||
|
||||
_return pushBack _position;
|
||||
|
||||
[_group] spawn (TCL_Garrison_F select 0);
|
||||
};
|
||||
|
||||
if (_index > 3) exitWith
|
||||
{
|
||||
_return = [_building];
|
||||
|
||||
while { (_index > 0) } do
|
||||
{
|
||||
_position = (_building buildingPos _index);
|
||||
|
||||
if (_return findIf { (_position distance _x > 5) } > -1) then
|
||||
{
|
||||
_return pushBack _position;
|
||||
};
|
||||
|
||||
_index = _index - 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Garrison Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Garrison
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_array"];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
_array = _array call TCL_Shuffle_F;
|
||||
|
||||
_units = _units - (TCL_Garrison select 3);
|
||||
|
||||
_units = _units select { ( (alive _x) && { (isNull objectParent _x) } ) };
|
||||
|
||||
if (count _units > count _array) then
|
||||
{
|
||||
[_group] spawn (TCL_Garrison_F select 0);
|
||||
};
|
||||
|
||||
private ["_unit","_position"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
if (_array isEqualTo [] ) exitWith {};
|
||||
|
||||
(TCL_Garrison select 3) pushBack _unit;
|
||||
|
||||
_position = (_array select 0);
|
||||
|
||||
_unit doMove _position;
|
||||
|
||||
[_unit, _group, _position] spawn (TCL_Garrison_F select 3);
|
||||
|
||||
_array deleteAt (_array find _position);
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Garrison Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Garrison
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_position"];
|
||||
|
||||
private _time = (time + 30);
|
||||
|
||||
private _distance = (_unit distance _position);
|
||||
|
||||
_time = (_time + _distance);
|
||||
|
||||
while { ( (alive _unit) && { (time < _time) } ) } do
|
||||
{
|
||||
if ( (unitReady _unit) || (count (waypoints _group) > 1) ) exitWith
|
||||
{
|
||||
if (_group in (TCL_Reinforcement select 0) ) then
|
||||
{
|
||||
_time = time;
|
||||
};
|
||||
};
|
||||
|
||||
sleep 5;
|
||||
};
|
||||
|
||||
if ( (alive _unit) && { (time < _time) } ) then
|
||||
{
|
||||
if ( (_unit distance _position > 3) || (count (waypoints _group) > 1) ) exitWith {};
|
||||
|
||||
doStop _unit;
|
||||
};
|
||||
|
||||
TCL_DeleteAT(TCL_Garrison,3,_unit);
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,256 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Heal_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Heal Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Heal
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group"];
|
||||
|
||||
private _damage = (_unit getHitPointDamage "hitlegs");
|
||||
|
||||
if ( (_damage > 0.5) || (damage _unit > 0.5) ) then
|
||||
{
|
||||
private _items = (items _unit);
|
||||
|
||||
if ("FirstAidKit" in _items) then
|
||||
{
|
||||
(TCL_Heal select 1) pushBack _unit;
|
||||
|
||||
_unit action ["HealSoldierSelf", _unit];
|
||||
|
||||
[_unit, _group] spawn (TCL_Heal_F select 2);
|
||||
|
||||
// player sideChat format ["TCL_Heal_F > Heal > %1 > %2", _unit, (damage _unit) ];
|
||||
}
|
||||
else
|
||||
{
|
||||
private _units = (units _group);
|
||||
|
||||
_units = _units - (TCL_Heal select 1);
|
||||
|
||||
_units = _units select {_items = (items _x); ( (alive _x) && { (isNull objectParent _x) } && { ("Medikit" in _items) } ) };
|
||||
|
||||
if (_units isEqualTo [] ) exitWith
|
||||
{
|
||||
[_unit, _group] call (TCL_Heal_F select 1);
|
||||
};
|
||||
|
||||
private _object = (_units select 0);
|
||||
|
||||
private _array = [_unit, _object];
|
||||
|
||||
(TCL_Heal select 0) append _array;
|
||||
|
||||
(TCL_Heal select 1) append _array;
|
||||
|
||||
[_unit, _group, _object] spawn (TCL_Heal_F select 2);
|
||||
|
||||
// player sideChat format ["TCL_Heal_F > Medic > %1 > %2", _unit, _object];
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Heal Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Heal
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group"];
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
private _objects = nearestObjects [_unit, ["CAManBase"], 100];
|
||||
|
||||
_objects = _objects - (TCL_Heal select 2);
|
||||
|
||||
private _array = _objects select { (alive _x) };
|
||||
|
||||
_objects = _objects - _array;
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {};
|
||||
|
||||
private _object = (_objects select 0);
|
||||
|
||||
(TCL_Heal select 2) pushBack _object;
|
||||
|
||||
private _items = (items _object);
|
||||
|
||||
_items = _items select { ( (_x isEqualTo "Medikit") || (_x isEqualTo "FirstAidKit") ) };
|
||||
|
||||
if (_items isEqualTo [] ) exitWith {};
|
||||
|
||||
(TCL_Heal select 0) pushBack _unit;
|
||||
|
||||
(TCL_Heal select 1) pushBack _unit;
|
||||
|
||||
private _item = (_items select 0);
|
||||
|
||||
[_unit, _group, _object, _item] spawn (TCL_Heal_F select 2);
|
||||
|
||||
// player sideChat format ["TCL_Heal_F > Medikit > %1 > %2", _unit, _object];
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Heal Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Heal
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group"];
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
if (count _this == 2) then
|
||||
{
|
||||
sleep 30 + (random 50);
|
||||
|
||||
TCL_DeleteAT(TCL_Heal,1,_unit);
|
||||
}
|
||||
else
|
||||
{
|
||||
private _object = (_this select 2);
|
||||
|
||||
if (count _this == 3) then
|
||||
{
|
||||
if (_unit distance _object < 100) then
|
||||
{
|
||||
[_unit, _group, _object] spawn (TCL_Heal_F select 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
TCL_DeleteAT(TCL_Heal,0,_unit);
|
||||
|
||||
TCL_DeleteAT(TCL_Heal,0,_object);
|
||||
|
||||
sleep 10 + (random 30);
|
||||
|
||||
TCL_DeleteAT(TCL_Heal,1,_unit);
|
||||
|
||||
TCL_DeleteAT(TCL_Heal,1,_object);
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
private _item = (_this select 3);
|
||||
|
||||
_unit forceSpeed -1;
|
||||
|
||||
private _bool = True;
|
||||
|
||||
private _time = (time + 10);
|
||||
|
||||
_unit doMove (getPos _object);
|
||||
|
||||
private _distance = (_unit distance _object);
|
||||
|
||||
_time = (_time + _distance);
|
||||
|
||||
while { ( (alive _unit) && { (time < _time) } ) } do
|
||||
{
|
||||
if (_unit distance _object < 1) exitWith
|
||||
{
|
||||
_bool = False;
|
||||
|
||||
_unit addItem _item;
|
||||
|
||||
_object removeItem _item;
|
||||
|
||||
_unit action ["HealSoldierSelf", _unit];
|
||||
|
||||
TCL_DeleteAT(TCL_Heal,2,_object);
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
TCL_DeleteAT(TCL_Heal,2,_object);
|
||||
};
|
||||
|
||||
TCL_DeleteAT(TCL_Heal,0,_unit);
|
||||
|
||||
sleep 30 + (random 50);
|
||||
|
||||
TCL_DeleteAT(TCL_Heal,1,_unit);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Heal Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Heal
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_object"];
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
_unit setUnitPos "MIDDLE";
|
||||
|
||||
_unit forceSpeed 0;
|
||||
|
||||
_object forceSpeed -1;
|
||||
|
||||
_object doMove (getPos _unit);
|
||||
|
||||
private _time = (time + 10);
|
||||
|
||||
private _distance = (_unit distance _object);
|
||||
|
||||
_time = (_time + _distance);
|
||||
|
||||
while { ( (alive _unit) && { (alive _object) } && { (time < _time) } ) } do
|
||||
{
|
||||
if (_object distance _unit < 3) exitWith
|
||||
{
|
||||
_unit doWatch _object;
|
||||
|
||||
_object doWatch _unit;
|
||||
|
||||
_object action ["HealSoldier", _unit];
|
||||
|
||||
sleep 5;
|
||||
|
||||
_unit doWatch objNull;
|
||||
|
||||
_object doWatch objNull;
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
_unit forceSpeed -1;
|
||||
|
||||
_unit setUnitPos "AUTO";
|
||||
};
|
||||
|
||||
TCL_DeleteAT(TCL_Heal,0,_unit);
|
||||
|
||||
TCL_DeleteAT(TCL_Heal,0,_object);
|
||||
|
||||
[_object, _group] call (TCL_Follow_F select 0);
|
||||
|
||||
sleep 30 + (random 50);
|
||||
|
||||
TCL_DeleteAT(TCL_Heal,1,_unit);
|
||||
|
||||
TCL_DeleteAT(TCL_Heal,1,_object);
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,202 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_House_Search_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// House Search Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// House Search
|
||||
// Script by =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic"];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _array = ( (TCL_House_Search select 0) + (TCL_Static_Weapon select 0) );
|
||||
|
||||
_units = _units - _array;
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
_units deleteAt (_units find _leader);
|
||||
|
||||
_units = _units select { ( (alive _x) && { (isNull objectParent _x) } ) };
|
||||
|
||||
if (count _units > 1) then
|
||||
{
|
||||
private _unit = _units select (count _units - 1);
|
||||
|
||||
private _objects = nearestObjects [_logic, ["House"], 100];
|
||||
|
||||
_objects = _objects - (TCL_House_Search select 1);
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {};
|
||||
|
||||
private _object = (_objects select 0);
|
||||
|
||||
if (_unit distance _object < 100) then
|
||||
{
|
||||
[_unit, _group, _logic, _objects] call (TCL_House_Search_F select 1);
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// House Search Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// House Search
|
||||
// Script by =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_logic","_objects"];
|
||||
|
||||
private ["_building","_positions"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _objects - 1) do
|
||||
{
|
||||
_building = (_objects select _count);
|
||||
|
||||
_positions = [_building] call TCL_Building_Pos_F;
|
||||
|
||||
// player sideChat format ["TCL_House_Search_F > Positions > %1", _positions];
|
||||
|
||||
if (_positions > 1) exitWith
|
||||
{
|
||||
[_unit, _group, _logic, _building, _positions] spawn (TCL_House_Search_F select 2);
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// House Search Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// House Search
|
||||
// Script by =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_logic","_building","_positions"];
|
||||
|
||||
(TCL_House_Search select 0) pushBack _unit;
|
||||
|
||||
(TCL_House_Search select 1) pushBack _building;
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
private ["_position","_distance","_time"];
|
||||
|
||||
while { ( (alive _unit) && { (alive _logic) } && { (_positions > 0) } && { (_unit distance _building < 100) } ) } do
|
||||
{
|
||||
// player sideChat format ["TCL_House_Search_F > Positions > %1", _positions];
|
||||
|
||||
_position = (_building buildingPos _positions);
|
||||
|
||||
_distance = (_unit distance _position);
|
||||
|
||||
if (_distance > 3) then
|
||||
{
|
||||
_unit doMove _position;
|
||||
|
||||
_time = (time + 10);
|
||||
|
||||
_time = (_time + _distance);
|
||||
|
||||
while { ( (alive _unit) && { (alive _logic) } && { (time < _time) } && { (_unit distance _building < 100) } ) } do
|
||||
{
|
||||
if (unitReady _unit) exitWith
|
||||
{
|
||||
// doStop _unit;
|
||||
|
||||
sleep (random 5);
|
||||
|
||||
// player sideChat format ["TCL_House_Search_F > Unit > %1", _unit];
|
||||
};
|
||||
|
||||
if (_unit distance _logic > 100) exitWith
|
||||
{
|
||||
_positions = 0;
|
||||
|
||||
// player sideChat format ["TCL_House_Search_F > Distance > %1", _unit];
|
||||
};
|
||||
|
||||
sleep 5;
|
||||
};
|
||||
};
|
||||
|
||||
_positions = _positions - 1;
|
||||
};
|
||||
|
||||
// private _leader = (leader _group);
|
||||
|
||||
// _unit doMove (getPos _leader);
|
||||
|
||||
// _unit doFollow _leader;
|
||||
};
|
||||
|
||||
TCL_DeleteAT(TCL_House_Search,0,_unit);
|
||||
|
||||
[_unit, _group] call (TCL_Follow_F select 0);
|
||||
|
||||
if (False) then
|
||||
{
|
||||
[_unit, _group, _logic, _building] spawn (TCL_House_Search_F select 3);
|
||||
};
|
||||
|
||||
sleep 30 + (random 50);
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
TCL_DeleteAT(TCL_House_Search,1,_building);
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// House Search Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// House Search
|
||||
// Script by =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_logic","_building"];
|
||||
|
||||
private _bool = True;
|
||||
|
||||
private _time = (time + 30);
|
||||
|
||||
private _position = (getPos _unit);
|
||||
|
||||
private _boundingBox = (boundingBox _building);
|
||||
|
||||
private _value = (_boundingBox select 1 select 0);
|
||||
|
||||
if (_value < (_boundingBox select 1 select 1) ) then
|
||||
{
|
||||
_value = (_boundingBox select 1 select 1);
|
||||
};
|
||||
|
||||
_value = (_value / 2);
|
||||
|
||||
while { ( (alive _unit) && { (_bool) } ) } do
|
||||
{
|
||||
if (time > _time) then
|
||||
{
|
||||
if (_unit distance _building > _value) then
|
||||
{
|
||||
_bool = False;
|
||||
}
|
||||
else
|
||||
{
|
||||
_unit setDamage 1;
|
||||
};
|
||||
};
|
||||
|
||||
sleep 5;
|
||||
};
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,10 @@
|
||||
/* ////////////////////////////////////////////////////////////////////////////////
|
||||
\ \ Tactical Combat Link
|
||||
\ \------------------------------------------------------------------------------
|
||||
\ \ Macros
|
||||
\ \----------------------------------------------------------------------------
|
||||
/ / By =\SNKMAN/=
|
||||
/ /-----------------------------------------------------------------------------
|
||||
*/ ///////////////////////////////////////////////////////////////////////////////
|
||||
#define TCL_ObjectParent(_unit); isNull objectParent _unit;
|
||||
#define TCL_DeleteAT(_array, _index, _object); (_array select _index) deleteAt ( (_array select _index) find _object);
|
@ -0,0 +1,63 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Mortar_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Mortar Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Mortar
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_vehicle"];
|
||||
|
||||
if (_group in (TCL_Reinforcement select 0) ) then
|
||||
{
|
||||
private _enemy = (_group getVariable "TCL_Enemy");
|
||||
|
||||
if ( (alive _enemy) && { (_group knowsAbout vehicle _enemy > 0) } ) then
|
||||
{
|
||||
sleep 5 + (random 10);
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
(TCL_Static_Weapon select 2) pushBack _vehicle;
|
||||
|
||||
private _logic = (_group getVariable "TCL_Logic");
|
||||
|
||||
private _position = [ (getPos _logic select 0) + (random 50 - random 50), (getPos _logic select 1) + (random 50 - random 50), 0];
|
||||
|
||||
private _bool = [_vehicle, _position] call (TCL_Artillery_F select 2);
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
private _condition = (_logic getVariable "TCL_Artillery");
|
||||
|
||||
_condition set [1, True];
|
||||
|
||||
private _rounds = 1 + (random 3);
|
||||
|
||||
private _magazine = (getArtilleryAmmo [_vehicle] select 0);
|
||||
|
||||
_time = _vehicle getArtilleryETA [_position, _magazine];
|
||||
|
||||
_vehicle doArtilleryFire [_position, _magazine, _rounds];
|
||||
|
||||
sleep _time;
|
||||
|
||||
_condition set [1, False];
|
||||
|
||||
sleep (_time * _rounds);
|
||||
}
|
||||
else
|
||||
{
|
||||
[_unit, _group, _vehicle] call (TCL_Static_Weapon_F select 4);
|
||||
|
||||
sleep 30 + (random 50);
|
||||
};
|
||||
|
||||
TCL_DeleteAT(TCL_Static_Weapon,2,_vehicle);
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,437 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Rearm_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group"];
|
||||
|
||||
private ["_ammo","_count","_magazine","_magazines","_array"];
|
||||
|
||||
private _weapon = (primaryWeapon _unit);
|
||||
|
||||
if (_weapon isEqualTo "") then
|
||||
{
|
||||
_ammo = 0;
|
||||
|
||||
_count = 0;
|
||||
|
||||
_magazine = "";
|
||||
|
||||
_magazines = [];
|
||||
}
|
||||
else
|
||||
{
|
||||
_magazines = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines");
|
||||
|
||||
_magazine = (_magazines select 0);
|
||||
|
||||
_array = [];
|
||||
|
||||
_array = (magazines _unit) select { (_x in _magazines) };
|
||||
|
||||
_count = (count _array);
|
||||
|
||||
_ammo = (_unit ammo _weapon);
|
||||
};
|
||||
|
||||
if ( (_count < 3) && { (_ammo < 50) } ) then
|
||||
{
|
||||
[_unit, _group, _magazine, _magazines] call (TCL_Rearm_F select 1);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Magazine > %1 > %2 > %3 > %4", _unit, _ammo, _count, _magazine];
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_magazine","_magazines"];
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
private _objects = nearestObjects [_unit, ["CAManBase"], 100];
|
||||
|
||||
_objects = _objects - (TCL_Rearm select 2);
|
||||
|
||||
private _array = [];
|
||||
|
||||
_array = _objects select { ( (alive _x) || (_unit knowsAbout _x == 0) ) };
|
||||
|
||||
_objects = _objects - _array;
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith
|
||||
{
|
||||
_objects = nearestObjects [_unit, ["LandVehicle"], 100];
|
||||
|
||||
_objects = _objects - (TCL_Rearm select 2);
|
||||
|
||||
_objects = _objects select { ( (alive _x) && { (crew _x isEqualTo [] ) } ) };
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {};
|
||||
|
||||
private _object = (_objects select 0);
|
||||
|
||||
_array = (magazineCargo _object);
|
||||
|
||||
if (_array isEqualTo [] ) exitWith {};
|
||||
|
||||
if (_magazine in _array) then
|
||||
{
|
||||
(TCL_Rearm select 0) pushBack _unit;
|
||||
|
||||
// (TCL_Rearm select 1) pushBack _unit;
|
||||
|
||||
(TCL_Rearm select 2) pushBack _object;
|
||||
|
||||
_array = _array select { (_x in _magazines) };
|
||||
|
||||
[_unit, _group, _object, _array] spawn (TCL_Rearm_F select 3);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Vehicle > %1 > %2", _unit, _object];
|
||||
};
|
||||
};
|
||||
|
||||
private _object = (_objects select 0);
|
||||
|
||||
private _bool = [_unit, _group, _objects, _magazine, _magazines] call (TCL_Rearm_F select 2);
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
_objects = nearestObjects [_object, ["WeaponHolderSimulated"], 5];
|
||||
|
||||
_objects = _objects - (TCL_Rearm select 2);
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {};
|
||||
|
||||
private _dummy = (_objects select 0);
|
||||
|
||||
private _weapons = (weaponCargo _dummy);
|
||||
|
||||
private _weapon = (_weapons select 0);
|
||||
|
||||
(TCL_Rearm select 0) pushBack _unit;
|
||||
|
||||
// (TCL_Rearm select 1) pushBack _unit;
|
||||
|
||||
(TCL_Rearm select 2) pushBack _object;
|
||||
|
||||
// _array = [_object, _dummy];
|
||||
|
||||
// (TCL_Rearm select 2) append _array;
|
||||
|
||||
[_unit, _group, _object, _dummy, _weapon] spawn (TCL_Rearm_F select 3);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Weapon > %1 > %2", _unit, _object];
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_objects","_magazine","_magazines"];
|
||||
|
||||
private _return = True;
|
||||
|
||||
if (_magazine isEqualTo "") exitWith {_return};
|
||||
|
||||
private ["_object","_array"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _objects - 1) do
|
||||
{
|
||||
_object = (_objects select _count);
|
||||
|
||||
_array = (magazines _object);
|
||||
|
||||
if (_magazine in _array) exitWith
|
||||
{
|
||||
_return = False;
|
||||
|
||||
(TCL_Rearm select 0) pushBack _unit;
|
||||
|
||||
// (TCL_Rearm select 1) pushBack _unit;
|
||||
|
||||
(TCL_Rearm select 2) pushBack _object;
|
||||
|
||||
_array = _array select { (_x in _magazines) };
|
||||
|
||||
[_unit, _group, _object, _array] spawn (TCL_Rearm_F select 3);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Magazines > %1 > %2", _unit, _object];
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_object"];
|
||||
|
||||
private _bool = True;
|
||||
|
||||
private _time = (time + 10);
|
||||
|
||||
private _position = (getPos _object);
|
||||
|
||||
private _boundingBox = (boundingBox _object select 1 select 1);
|
||||
|
||||
_boundingBox = (_boundingBox - 1);
|
||||
|
||||
if (_boundingBox < 1) then
|
||||
{
|
||||
_boundingBox = (_boundingBox + 1);
|
||||
};
|
||||
|
||||
_position set [1, (_position select 1) - _boundingBox];
|
||||
|
||||
_unit forceSpeed -1;
|
||||
|
||||
_unit doMove _position;
|
||||
|
||||
// (TCL_Rearm select 0) pushBack _unit;
|
||||
|
||||
(TCL_Rearm select 1) pushBack _unit;
|
||||
|
||||
// (TCL_Rearm select 2) pushBack _object;
|
||||
|
||||
private _distance = (_unit distance _object);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > BoundingBox > %1 > %2 > %3", _unit, _object, _boundingBox];
|
||||
|
||||
_time = (_time + _distance);
|
||||
|
||||
while { ( (alive _unit) && { (time < _time) } ) } do
|
||||
{
|
||||
if (_unit distance _position < _boundingBox) exitWith
|
||||
{
|
||||
_bool = False;
|
||||
|
||||
_unit forceSpeed 0;
|
||||
|
||||
_unit doWatch _object;
|
||||
|
||||
_unit setUnitPos "MIDDLE";
|
||||
|
||||
sleep 1;
|
||||
|
||||
if (count _this == 4) then
|
||||
{
|
||||
private _magazines = (_this select 3);
|
||||
|
||||
[_unit, _group, _object, _magazines] spawn (TCL_Rearm_F select 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
private _dummy = (_this select 3);
|
||||
|
||||
private _weapon = (_this select 4);
|
||||
|
||||
[_unit, _group, _object, _dummy, _weapon] spawn (TCL_Rearm_F select 5);
|
||||
};
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
[_unit, _group, _object, _bool] spawn (TCL_Rearm_F select 6);
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #4
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_object","_magazines"];
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
private _bool = False;
|
||||
|
||||
private _magazine = (_magazines select 0);
|
||||
|
||||
_unit action ["TakeMagazine", _object, _magazine];
|
||||
|
||||
_magazines deleteAt (_magazines find _magazine);
|
||||
|
||||
private _count = (count magazines _unit);
|
||||
|
||||
private _array = [];
|
||||
|
||||
private _index = 0;
|
||||
|
||||
{_unit addMagazine _x;
|
||||
|
||||
if (count magazines _unit isEqualTo _count) exitWith
|
||||
{
|
||||
_bool = True;
|
||||
};
|
||||
|
||||
_count = (count magazines _unit);
|
||||
|
||||
_index = _index + 1;
|
||||
|
||||
_array = _array + [_x];
|
||||
|
||||
_object removeMagazine _x;
|
||||
|
||||
} count _magazines;
|
||||
|
||||
if (alive _object) then
|
||||
{
|
||||
_magazines = (magazineCargo _object);
|
||||
|
||||
clearMagazineCargo _object;
|
||||
|
||||
_count = 0;
|
||||
|
||||
for "_count" from _count to (count _magazines - 1) do
|
||||
{
|
||||
_magazine = (_magazines select _count);
|
||||
|
||||
if (_magazine in _array) then
|
||||
{
|
||||
_array deleteAt (_array find _magazine);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Magazines > %1 > %2", _unit, _array];
|
||||
}
|
||||
else
|
||||
{
|
||||
_object addMagazineCargo [_magazine, 1];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if (count _magazines > _index) then
|
||||
{
|
||||
_bool = True;
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Magazines > %1 > %2", _unit, _bool];
|
||||
|
||||
sleep 3;
|
||||
|
||||
_unit selectWeapon (primaryWeapon _unit);
|
||||
|
||||
[_unit, _group, _object, _bool] spawn (TCL_Rearm_F select 6);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Magazines > %1", _unit];
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #5
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_object","_dummy","_weapon"];
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
private _bool = True;
|
||||
|
||||
private _magazines = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines");
|
||||
|
||||
private _array = [];
|
||||
|
||||
_array = (magazines _object) select { (_x in _magazines) };
|
||||
|
||||
if (_array isEqualTo [] ) then
|
||||
{
|
||||
_bool = False;
|
||||
|
||||
(TCL_Rearm select 2) pushBack _dummy;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (primaryWeapon _unit isEqualTo "") then
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
_unit action ["DropWeapon", _dummy, (primaryWeapon _unit) ];
|
||||
|
||||
sleep 3;
|
||||
};
|
||||
|
||||
_unit action ["TakeWeapon", _dummy, _weapon];
|
||||
|
||||
sleep 3;
|
||||
|
||||
_unit action ["REARM", _object];
|
||||
|
||||
_unit selectWeapon (primaryWeapon _unit);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Weapon > %1", _unit];
|
||||
};
|
||||
|
||||
[_unit, _group, _dummy, _bool] spawn (TCL_Rearm_F select 6);
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #6
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_object","_bool"];
|
||||
|
||||
_unit forceSpeed -1;
|
||||
|
||||
_unit doWatch objNull;
|
||||
|
||||
_unit setUnitPos "AUTO";
|
||||
|
||||
TCL_DeleteAT(TCL_Rearm,0,_unit);
|
||||
|
||||
[_unit, _group] call (TCL_Follow_F select 0);
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
sleep 10 + (random 30);
|
||||
|
||||
TCL_DeleteAT(TCL_Rearm,2,_object);
|
||||
}
|
||||
else
|
||||
{
|
||||
sleep 30 + (random 50);
|
||||
};
|
||||
|
||||
TCL_DeleteAT(TCL_Rearm,1,_unit);
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,92 @@
|
||||
TCL_Regroup_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Regroup Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Regroup
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_logic","_count"];
|
||||
|
||||
private _ai = (_group getVariable "TCL_AI" select 9);
|
||||
|
||||
if (_ai) then
|
||||
{
|
||||
private _array = ( (TCL_Hold select 0) + (TCL_Defend select 0) + (TCL_Location select 0) );
|
||||
|
||||
if (_group in _array) exitWith {};
|
||||
|
||||
if (_count < 3) then
|
||||
{
|
||||
if (True) then
|
||||
{
|
||||
if (floor (random 100) < 15) exitWith
|
||||
{
|
||||
// [_group] spawn (TCL_Surrender_F select 0);
|
||||
};
|
||||
};
|
||||
|
||||
private _groups = (_logic getVariable "TCL_Reinforcement");
|
||||
|
||||
_groups = _groups - [_group];
|
||||
|
||||
_groups = _groups select { (side _group isEqualTo side _x) };
|
||||
|
||||
if (_groups isEqualTo [] ) exitWith {};
|
||||
|
||||
[_group, _logic, _count, _groups] call (TCL_Regroup_F select 1);
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Regroup Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Regroup
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_logic","_count","_groups"];
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
if (isNull objectParent _leader) then
|
||||
{
|
||||
private "_units";
|
||||
|
||||
private _rank = [_leader] call TCL_Rank_F;
|
||||
|
||||
private _condition = {_this select { ( (alive _x) && { (isNull objectParent _x) } && { (_x distance _leader < 100) } ) }; count _this};
|
||||
|
||||
{_units = (units _x);
|
||||
|
||||
if ( (_count <= _units call _condition) && { (_rank <= [leader _x] call TCL_Rank_F) } && { ( [_group, _x] call (TCL_KnowsAbout_F select 4) ) } ) exitWith
|
||||
{
|
||||
_units = (units _group);
|
||||
|
||||
["TCL_Position", _group] call (TCL_Marker_F select 0);
|
||||
|
||||
// player sideChat format ["TCL_Regroup_F > Group > %1", _group];
|
||||
|
||||
_groups = (_logic getVariable "TCL_Reinforcement");
|
||||
|
||||
_groups deleteAt (_groups find _group);
|
||||
|
||||
_units join _x;
|
||||
|
||||
(TCL_Regroup select 0) append _units;
|
||||
|
||||
_units select { (count assignedVehicleRole _x > 0) } apply { [_x] orderGetIn False; [_x] allowGetIn False};
|
||||
|
||||
_units select { ( (fleeing _x) || (captive _x) ) } apply {if (fleeing _x) then {_x allowFleeing 0} else {_x setCaptive False} };
|
||||
};
|
||||
|
||||
} count _groups;
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,118 @@
|
||||
#include "TCL_Resource.hpp"
|
||||
|
||||
TCL_Simulate_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Simulate Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Simulate
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{private ["_unit","_object","_array","_animation"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_object = _this select 1;
|
||||
|
||||
if ( { (isPlayer _x) } count (units _unit) > 0) exitWith {};
|
||||
|
||||
if ( (alive _unit) && (_unit countEnemy [_object] > 0) && ( [_unit] _call(TCL_Simulate_F,1) ) ) then
|
||||
{
|
||||
_array = ["AdthPercMstpSlowWrflDnon_1","AdthPercMstpSlowWrflDnon_2","AdthPercMstpSlowWrflDnon_8","AdthPercMstpSlowWrflDnon_16","AdthPercMstpSlowWrflDnon_32","AdthPercMstpSrasWrflDnon_1","AdthPercMstpSrasWrflDnon_2","AdthPercMstpSrasWrflDnon_8","AdthPercMstpSrasWrflDnon_16","AdthPercMstpSrasWrflDnon_32"];
|
||||
|
||||
if ( { (animationState _unit == _x) } count _array > 0) then
|
||||
{
|
||||
_unit switchMove "AinjPpneMstpSnonWnonDnon_kneel";
|
||||
}
|
||||
else
|
||||
{
|
||||
_animation = _array call TCL_Random_F;
|
||||
|
||||
_unit playMove _animation;
|
||||
|
||||
sleep 30 + (random 50);
|
||||
|
||||
if (alive _unit ) then
|
||||
{
|
||||
if (isMultiplayer) then
|
||||
{
|
||||
if _getRandom(50) then
|
||||
{
|
||||
// _unit setVehicleInit "this switchMove ""AinjPpneMstpSnonWnonDnon_rolltofront""; ";
|
||||
|
||||
// processInitCommands;
|
||||
|
||||
_unit playMove "AmovPpneMstpSrasWrflDnon_AmovPercMstpSrasWrflDnon";
|
||||
}
|
||||
else
|
||||
{
|
||||
// _unit setVehicleInit "this switchMove ""AinjPpneMstpSnonWnonDnon_kneel""; ";
|
||||
|
||||
// processInitCommands;
|
||||
};
|
||||
|
||||
// clearVehicleInit _unit;
|
||||
}
|
||||
else
|
||||
{
|
||||
if _getRandom(50) then
|
||||
{
|
||||
_unit switchMove "AinjPpneMstpSnonWnonDnon_rolltofront";
|
||||
|
||||
_unit playMove "AmovPpneMstpSrasWrflDnon_AmovPercMstpSrasWrflDnon";
|
||||
}
|
||||
else
|
||||
{
|
||||
_unit switchMove "AinjPpneMstpSnonWnonDnon_kneel";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Simulate Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Simulate
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{private ["_unit","_return","_objects","_array","_count","_object"];
|
||||
|
||||
_unit = _this select 0;
|
||||
|
||||
_return = True;
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
_objects = _unit nearEntities [ ["Man","Car","Tank","Air"], 100];
|
||||
|
||||
_objects = _objects - [_unit];
|
||||
|
||||
if (count _objects > 0) then
|
||||
{
|
||||
_array = [];
|
||||
|
||||
_count = 0;
|
||||
|
||||
for "_count" from _count to (count _objects - 1) do
|
||||
{
|
||||
_object = (_objects select _count);
|
||||
|
||||
if ( ( [_object] call TCL_Armed_F) && (_unit countFriendly [_object] > 0) && (side _object != CIVILIAN) && (_unit _getKnows(_object) > 0) ) then
|
||||
{
|
||||
_setIn(_array,-1,_object);
|
||||
};
|
||||
|
||||
if (count _array > _getGlobal(42) ) exitWith
|
||||
{
|
||||
_return = False;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,130 @@
|
||||
TCL_Smoke_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Smoke Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Smoke
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group"];
|
||||
|
||||
if (TCL_Feature select 3) then
|
||||
{
|
||||
if (floor (random 100) < (TCL_Feature select 4) ) then
|
||||
{
|
||||
private _units = (units _group);
|
||||
|
||||
if (_units findIf { (alive _x) } > -1) then
|
||||
{
|
||||
private _muzzle = [];
|
||||
|
||||
private _magazine = "SmokeShell";
|
||||
|
||||
if (count _this == 3) then
|
||||
{
|
||||
_magazine = "SmokeShellRed";
|
||||
};
|
||||
|
||||
private ["_unit","_magazines"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
_magazines = (magazines _unit);
|
||||
|
||||
if ( (alive _unit) && { (_magazine in _magazines) } ) exitWith
|
||||
{
|
||||
if (_magazine isEqualTo "SmokeShell") then
|
||||
{
|
||||
_muzzle = ["SmokeShellMuzzle","SmokeShellMuzzle"];
|
||||
}
|
||||
else
|
||||
{
|
||||
_muzzle = ["SmokeShellRedMuzzle","SmokeShellRedMuzzle"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if (_muzzle isEqualTo [] ) exitWith {};
|
||||
|
||||
_unit doWatch (getPos _enemy);
|
||||
|
||||
sleep 1 + (random 3);
|
||||
|
||||
_unit forceWeaponFire _muzzle;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Smoke Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Smoke
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_vehicle"];
|
||||
|
||||
if (TCL_Feature select 5) then
|
||||
{
|
||||
if (floor (random 100) < (TCL_Feature select 6) ) then
|
||||
{
|
||||
private _units = (units _group);
|
||||
|
||||
// player sideChat format ["TCL_Smoke_F > Vehicle > %1", _group];
|
||||
|
||||
_units = _units select { ( (_x in assignedVehicle _x) && { (assignedVehicleRole _x select 0 == "Cargo") } && { ("SmokeShell" in magazines _x) } ) };
|
||||
|
||||
if (_units isEqualTo [] ) exitWith {};
|
||||
|
||||
private _velocity = [_vehicle] call TCL_Velocity_F;
|
||||
|
||||
if (_velocity > 10) then
|
||||
{
|
||||
sleep 1 + (random 3);
|
||||
};
|
||||
|
||||
private _direction = [_enemy, _vehicle] call TCL_Dir_To_F;
|
||||
|
||||
private ["_unit","_position","_smoke","_speed","_value","_angle"];
|
||||
|
||||
private _random = 1 + (random 3);
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
if (_random == 0) exitWith {};
|
||||
|
||||
if ( (alive _unit) && { (_random > 0) } && { (floor (random 100) < 50) } ) then
|
||||
{
|
||||
_unit removeMagazines "SmokeShell";
|
||||
|
||||
sleep (random 3);
|
||||
|
||||
_position = [ (getPos _unit select 0), (getPos _unit select 1), (getPos _unit select 2) + 2];
|
||||
|
||||
_smoke = createVehicle ["SmokeShell", _position, [], 0, "NONE"];
|
||||
|
||||
_random = _random - 1;
|
||||
|
||||
_speed = 7 + (random 3);
|
||||
|
||||
_value = 150 + (random 60);
|
||||
|
||||
_angle = (_direction - _value);
|
||||
|
||||
_smoke setVelocity [ (sin _angle) * _speed, (cos _angle) * _speed, _speed];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,266 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Static_Weapon_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic"];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _array = ( (TCL_Static_Weapon select 0) + (TCL_House_Search select 0) );
|
||||
|
||||
_units = _units - _array;
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
_units deleteAt (_units find _leader);
|
||||
|
||||
_units = _units select { ( (alive _x) && { (isNull objectParent _x) } ) };
|
||||
|
||||
if (count _units > 1) then
|
||||
{
|
||||
private _unit = _units select (count _units - 1);
|
||||
|
||||
private _vehicle = [_unit, _group, _logic] call (TCL_Static_Weapon_F select 1);
|
||||
|
||||
if (alive _vehicle) then
|
||||
{
|
||||
private _bool = True;
|
||||
|
||||
if (_group in (TCL_Hold select 0) ) then
|
||||
{
|
||||
_bool = [_group, _vehicle] call TCL_Trigger_F;
|
||||
};
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
[_unit, _group, _logic, _vehicle] spawn (TCL_Static_Weapon_F select 2);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_logic"];
|
||||
|
||||
private _return = objNull;
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
private _objects = _unit nearEntities ["StaticWeapon", 100];
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {_return};
|
||||
|
||||
private _array = ( (TCL_Static_Weapon select 1) + (TCL_Static_Weapon select 2) );
|
||||
|
||||
_objects = _objects - _array;
|
||||
|
||||
_objects = _objects select { ( (alive _x) && { (someAmmo _x) } && { (_unit knowsAbout _x > 0) } && { (_x distance _leader < 100) } ) };
|
||||
|
||||
private ["_vehicle","_side","_crew"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _objects - 1) do
|
||||
{
|
||||
_vehicle = (_objects select _count);
|
||||
|
||||
_side = False;
|
||||
|
||||
if (getNumber (configFile >> "CfgVehicles" >> (typeOf _unit) >> "side") isEqualTo getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "side") ) then
|
||||
{
|
||||
_side = True;
|
||||
};
|
||||
|
||||
_crew = (crew _vehicle);
|
||||
|
||||
if ( (_side) && { (_crew isEqualTo [] ) } ) exitWith
|
||||
{
|
||||
_return = _vehicle;
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_logic","_vehicle"];
|
||||
|
||||
_unit assignAsGunner _vehicle;
|
||||
|
||||
_unit doMove (getPos _vehicle);
|
||||
|
||||
(TCL_Static_Weapon select 0) pushBack _unit;
|
||||
|
||||
(TCL_Static_Weapon select 1) pushBack _vehicle;
|
||||
|
||||
[_unit] orderGetIn True; [_unit] allowGetIn True;
|
||||
|
||||
// player sideChat format ["TCL_Static_Weapon_F > Vehicle > %1", _vehicle];
|
||||
|
||||
private _time = (time + 30);
|
||||
|
||||
private _distance = (_unit distance _vehicle);
|
||||
|
||||
_time = (_time + _distance);
|
||||
|
||||
while { ( (alive _unit) && { (time < _time) } && { (isNull objectParent _unit) } ) } do
|
||||
{
|
||||
sleep 5;
|
||||
};
|
||||
|
||||
if ( (alive _unit) && { (time < _time) } && { (_unit == gunner _vehicle) } ) then
|
||||
{
|
||||
[_unit, _group, _vehicle] spawn (TCL_Static_Weapon_F select 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
TCL_DeleteAT(TCL_Static_Weapon,0,_unit);
|
||||
|
||||
TCL_DeleteAT(TCL_Static_Weapon,1,_vehicle);
|
||||
|
||||
_unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False;
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_vehicle"];
|
||||
|
||||
private _bool = True;
|
||||
|
||||
private _missile = False;
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private ["_leader","_weapon","_enemy"];
|
||||
|
||||
if (getArray (configfile >> "CfgVehicles" >> (typeOf _vehicle) >> "availableForSupportTypes") isEqualTo [] ) then
|
||||
{
|
||||
_bool = False;
|
||||
|
||||
private _weapons = (weapons _vehicle);
|
||||
|
||||
private _magazines = getArray (configfile >> "CfgWeapons" >> (_weapons select 0) >> "magazines");
|
||||
|
||||
private _magazine = (_magazines select 0);
|
||||
|
||||
private _ammo = getText (configfile >> "CfgMagazines" >> _magazine >> "ammo");
|
||||
|
||||
if (_ammo isKindOf "MissileBase") then
|
||||
{
|
||||
_missile = True;
|
||||
};
|
||||
};
|
||||
|
||||
while { ( (alive _unit) && { (_unit == gunner _vehicle) } ) } do
|
||||
{
|
||||
_leader = (leader _group);
|
||||
|
||||
if ( (canFire _vehicle) && { (someAmmo _vehicle) } ) then
|
||||
{
|
||||
if (_bool) then
|
||||
{
|
||||
if (_vehicle in (TCL_Static_Weapon select 2) ) exitWith {};
|
||||
|
||||
[_unit, _group, _vehicle] spawn (TCL_Mortar_F select 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_missile) then
|
||||
{
|
||||
// _weapon = (weapons _vehicle select 0);
|
||||
|
||||
// _enemy = (_group getVariable "TCL_Enemy");
|
||||
|
||||
// _vehicle fireAtTarget [_enemy, _weapon];
|
||||
|
||||
// player sideChat format ["TCL_Static_Weapon_F > Missile > %1 > %2", _unit, _weapon];
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False;
|
||||
};
|
||||
|
||||
_enemy = (_group getVariable "TCL_Enemy");
|
||||
|
||||
if (_unit distance _enemy < 10) then
|
||||
{
|
||||
[_unit, _group, _vehicle] call (TCL_Static_Weapon_F select 4);
|
||||
};
|
||||
|
||||
if (_group in (TCL_Reinforcement select 2) ) then
|
||||
{
|
||||
[_unit, _group, _vehicle] call (TCL_Static_Weapon_F select 4);
|
||||
};
|
||||
|
||||
_group = (group _unit);
|
||||
|
||||
_waypoint = (_group getVariable "TCL_Waypoint");
|
||||
|
||||
if (_unit distance _waypoint > 500) then
|
||||
{
|
||||
if (behaviour _leader isEqualTo "COMBAT") then
|
||||
{
|
||||
[_unit, _group, _vehicle] call (TCL_Static_Weapon_F select 4);
|
||||
};
|
||||
};
|
||||
|
||||
sleep 5;
|
||||
};
|
||||
|
||||
if (_unit == gunner _vehicle) then
|
||||
{
|
||||
_unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False;
|
||||
};
|
||||
|
||||
TCL_DeleteAT(TCL_Static_Weapon,0,_unit);
|
||||
|
||||
sleep 10 + (random 30);
|
||||
|
||||
TCL_DeleteAT(TCL_Static_Weapon,1,_vehicle);
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon Function #4
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_vehicle"];
|
||||
|
||||
if (_group in (TCL_Artillery select 0) ) exitWith {};
|
||||
|
||||
_unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False;
|
||||
|
||||
True
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,69 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Suppressed_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Suppressed Fire Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Suppressed Fire
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group"];
|
||||
|
||||
private _distance = 300;
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
if ( (_group knowsAbout vehicle _unit > 0) && (_leader distance _unit < _distance) ) then
|
||||
{
|
||||
private _direction = [_unit, _leader] call TCL_Rel_Dir_To_F;
|
||||
|
||||
// player sideChat format ["TCL_Suppressed_F > Direction > %1 > %2", _group, _direction];
|
||||
|
||||
if ( (_direction > 340) || (_direction < 20) ) then
|
||||
{
|
||||
(TCL_Suppressed select 0) pushBack _group;
|
||||
|
||||
[_unit, _group] spawn (TCL_Suppressed_F select 1);
|
||||
|
||||
// player sideChat format ["TCL_Suppressed_F > Group > %1", _group];
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Suppressed Fire Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Suppressed Fire
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group"];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
private _behaviour = (behaviour _leader);
|
||||
|
||||
_group setBehaviour "STEALTH";
|
||||
|
||||
{_x setUnitPos "DOWN"} count _units;
|
||||
|
||||
sleep 10 + (random 30);
|
||||
|
||||
if (_units findIf { (alive _x) } > -1) then
|
||||
{
|
||||
_group setBehaviour _behaviour;
|
||||
|
||||
{_x setUnitPos "AUTO"} count _units;
|
||||
|
||||
sleep 10 + (random 30);
|
||||
};
|
||||
|
||||
TCL_DeleteAT(TCL_Suppressed,0,_group);
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,141 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Surrender_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Surrender Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Surrender
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _unit = _units select random (count _units - 1);
|
||||
|
||||
if ( (isPlayer _unit) || (captive _unit) || (fleeing _unit) || (_unit in (TCL_Surrender select 0) ) ) exitWith {};
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
_unit setCaptive True;
|
||||
|
||||
(TCL_Surrender select 0) pushBack _unit;
|
||||
|
||||
private _bool = True;
|
||||
|
||||
private _weapon = (primaryWeapon _unit);
|
||||
|
||||
if (_weapon isEqualTo "") then
|
||||
{
|
||||
_bool = False;
|
||||
};
|
||||
|
||||
private _dummy = createVehicle ["GroundWeaponHolder_Scripted", (getPos _unit), [], 0, "CAN_COLLIDE"];
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
_unit forceSpeed 0;
|
||||
|
||||
_unit action ["DropWeapon", _dummy, _weapon];
|
||||
|
||||
waitUntil { (primaryWeapon _unit isEqualTo "") };
|
||||
|
||||
_unit forceSpeed -1;
|
||||
};
|
||||
|
||||
private _weapons = (weapons _unit);
|
||||
|
||||
_weapons apply {_dummy addWeapon _x; _unit removeWeapon _x};
|
||||
|
||||
private _magazines = (magazines _unit);
|
||||
|
||||
_weapons apply {_dummy addMagazine _x; _unit removeMagazine _x};
|
||||
|
||||
// _unit action ["Surrender", _unit];
|
||||
|
||||
_unit playMove "AmovPercMstpSsurWnonDnon";
|
||||
|
||||
// _units deleteAt (_units find _unit);
|
||||
|
||||
[_unit, _dummy, _weapon] spawn (TCL_Surrender_F select 1);
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Surrender Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Surrender
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_dummy","_weapon"];
|
||||
|
||||
// private _value = 1;
|
||||
|
||||
private _courage = (_unit skill "courage");
|
||||
|
||||
_courage = (_courage / 3);
|
||||
|
||||
// _value = (_value - _courage);
|
||||
|
||||
// player sideChat format ["TCL_Surrender_F > Courage > %1 > %2", _unit, _courage];
|
||||
|
||||
private ["_random","_fleeing"];
|
||||
|
||||
_fleeing = 0;
|
||||
|
||||
while { ( (alive _unit) && { (captive _unit) } ) } do
|
||||
{
|
||||
_random = (random _courage);
|
||||
|
||||
_fleeing = (_fleeing + _random);
|
||||
|
||||
_unit allowFleeing _fleeing;
|
||||
|
||||
sleep 10 + (random 30);
|
||||
|
||||
if (fleeing _unit) exitWith
|
||||
{
|
||||
// _unit move [ (getPos _unit select 0) + (random 100) - (random 100), (getPos _unit select 1) + (random 100) - (random 100), 0];
|
||||
|
||||
_unit switchMove "";
|
||||
|
||||
// player sideChat format ["TCL_Surrender_F > Fleeing > %1 > %2", _unit, _fleeing];
|
||||
|
||||
if (floor (random 100) < 50) then
|
||||
{
|
||||
if (True) exitWith
|
||||
{
|
||||
[_unit, _dummy, _dummy, _weapon] spawn (TCL_Rearm_F select 3);
|
||||
};
|
||||
|
||||
_unit forceSpeed 0;
|
||||
|
||||
_unit doWatch _dummy;
|
||||
|
||||
_unit setUnitPos "MIDDLE";
|
||||
|
||||
_unit action ["TakeWeapon", _dummy, _weapon];
|
||||
|
||||
sleep 3;
|
||||
|
||||
_unit action ["REARM", _dummy];
|
||||
|
||||
_unit forceSpeed -1;
|
||||
|
||||
_unit doWatch objNull;
|
||||
|
||||
_unit setUnitPos "AUTO";
|
||||
};
|
||||
|
||||
sleep 10 + (random 30);
|
||||
|
||||
_unit setCaptive False;
|
||||
};
|
||||
};
|
||||
|
||||
TCL_DeleteAT(TCL_Surrender,0,_unit);
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,475 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Take_Cover_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Take Cover Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Take Cover
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_units"];
|
||||
|
||||
private _array = ( (TCL_Sneaking select 0) + (TCL_Garrison select 0) );
|
||||
|
||||
if (_group in _array) exitWith {};
|
||||
|
||||
private _bool = False;
|
||||
|
||||
_array = (TCL_Hold select 0);
|
||||
|
||||
if (_group in _array) then
|
||||
{
|
||||
_bool = True;
|
||||
};
|
||||
|
||||
_array = ( (TCL_Heal select 0) + (TCL_Rearm select 0) + (TCL_Take_Cover select 0) + (TCL_House_Search select 0) + (TCL_Static_Weapon select 0) );
|
||||
|
||||
_units = _units - _array;
|
||||
|
||||
private ["_unit","_enemy"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
if (floor (random 100) < (TCL_Feature select 16) ) then
|
||||
{
|
||||
if ( (alive _unit) && { (isNull objectParent _unit) } ) then
|
||||
{
|
||||
[_unit, _enemy, _group, _bool] call (TCL_Take_Cover_F select 1);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Take Cover Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Take Cover
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_enemy","_group","_bool"];
|
||||
|
||||
if (alive _enemy) then
|
||||
{
|
||||
private _array = (_unit getVariable "TCL_Take_Cover");
|
||||
|
||||
if (isNil "_array") then
|
||||
{
|
||||
_unit setVariable ["TCL_Take_Cover", [time, [], (getPos _unit) ] ];
|
||||
|
||||
_array = (_unit getVariable "TCL_Take_Cover");
|
||||
|
||||
private _text = format ["TCL_Take_Cover_F > Error > %1 > %2 > %3 > %4", _unit, (side _unit), _group, (typeOf _unit) ];
|
||||
|
||||
diag_log ("////////////////////////////////// TCL error dump //////////////////////////////////" + endl + _text + endl + "///////////////////////////////////////////////////////////////////////////");
|
||||
|
||||
player sideChat _text;
|
||||
|
||||
_string = format ["%1<t align='center'>Ups...!<br/>Something went wrong %2...<br/>Don't worry the problem will be solved as soon as this message appears.<br/>Please help me fix this issue by reporting the line stored in your .rpt file!</t>", (TCL_Text_F select 5), name player];
|
||||
|
||||
hint parseText _string;
|
||||
};
|
||||
|
||||
if (time > (_array select 0) ) then
|
||||
{
|
||||
private _time = (time + 15);
|
||||
|
||||
if (_unit knowsAbout vehicle _enemy > 0) then
|
||||
{
|
||||
// _time = _time + (random 15);
|
||||
|
||||
_time = _time + (random 30);
|
||||
|
||||
private _object = [_unit, _enemy, _group, _bool, _array] call (TCL_Take_Cover_F select 2);
|
||||
|
||||
if (alive _object) then
|
||||
{
|
||||
(TCL_Take_Cover select 0) pushBack _unit;
|
||||
|
||||
(TCL_Take_Cover select 1) pushBack _object;
|
||||
|
||||
[_unit, _enemy, _group, _object, _bool] spawn (TCL_Take_Cover_F select 3);
|
||||
|
||||
// player sideChat format ["TCL_Take_Cover_F > %1 > %2", _unit, (typeOf _object) ];
|
||||
};
|
||||
};
|
||||
|
||||
_array set [0, _time];
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Take Cover Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Take Cover
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_enemy","_group","_bool","_array"];
|
||||
|
||||
private _return = objNull;
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
private _position = _unit;
|
||||
|
||||
private _distance = (TCL_Feature select 17);
|
||||
|
||||
private _waypoint = (_group getVariable "TCL_Waypoint");
|
||||
|
||||
if (_unit distance _waypoint < _distance) then
|
||||
{
|
||||
_position = _waypoint;
|
||||
};
|
||||
|
||||
if (_group in (TCL_Flanking select 0) ) then
|
||||
{
|
||||
_position = [_unit, _group, _enemy, _position, _distance] call (TCL_Flanking_F select 1);
|
||||
};
|
||||
|
||||
// private _objects = [];
|
||||
|
||||
// private _objects = [_unit, _array, _distance] call TCL_Cover_F;
|
||||
|
||||
private _objects = (_array select 1);
|
||||
|
||||
if ( (_objects isEqualTo [] ) || (_unit distance (_array select 2) > _distance) ) then
|
||||
{
|
||||
// _objects = nearestTerrainObjects [_position, ["TREE","WALL","HOUSE"], _distance];
|
||||
|
||||
// _objects = nearestTerrainObjects [_position, ["HIDE","ROCK","ROCKS","BUSH"], _distance];
|
||||
|
||||
// _objects = nearestTerrainObjects [_position, ["TREE","WALL","HOUSE","FENCE"], _distance];
|
||||
|
||||
// _objects = nearestTerrainObjects [_position, ["HIDE","BUSH","TREE","WALL","HOUSE","FENCE"], _distance];
|
||||
|
||||
// _objects = nearestTerrainObjects [_position, ["ROCK","ROCKS","HIDE","BUSH","TREE","HOUSE"], _distance];
|
||||
|
||||
_objects = nearestTerrainObjects [_position, ["ROCK","ROCKS","HIDE","BUSH","TREE","WALL","HOUSE","FENCE"], _distance];
|
||||
|
||||
_array set [1, _objects];
|
||||
|
||||
_array set [2, (getPos _unit) ];
|
||||
|
||||
// player sideChat format ["TCL_Take_Cover_F > Objects > %1 > %2", _unit, (count _objects) ];
|
||||
};
|
||||
|
||||
_objects = _objects - (TCL_Take_Cover select 1);
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {};
|
||||
|
||||
private "_object";
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _objects - 1) do
|
||||
{
|
||||
_object = (_objects select _count);
|
||||
|
||||
if ( (_bool) || (_unit distance _waypoint < _distance) || ( (_unit distance _enemy) > (_enemy distance _object) ) ) then
|
||||
{
|
||||
// if ( ( (_unit distance _object) < (_enemy distance _object) ) && { (_enemy distance _object > 5) } ) then
|
||||
|
||||
// if ( ( (_unit distance _object) < (_enemy distance _object) ) || (_unit distance _object > 5) || (_enemy distance _object > 5) ) then
|
||||
|
||||
if ( ( (_unit distance _object) < (_enemy distance _object) ) && { (_enemy distance _object > _distance) } ) then
|
||||
{
|
||||
// player sideChat format ["TCL_Take_Cover_F > Object > %1", _object];
|
||||
|
||||
// if ( (boundingBox _object select 1) findIf { ( (_x < 0.7) || (_x > 7) ) } > -1) exitWith
|
||||
|
||||
if ( (boundingBox _object select 1) findIf { (_x > 15) } > -1) exitWith
|
||||
{
|
||||
// player sideChat format ["TCL_Take_Cover_F > BoundingBox > %1", _object];
|
||||
};
|
||||
|
||||
if ( (TCL_Take_Cover select 1) findIf { (_object distance _x < 3) } > -1) exitWith
|
||||
{
|
||||
// player sideChat format ["TCL_Take_Cover_F > Distance > %1", _object];
|
||||
};
|
||||
|
||||
if (_bool) exitWith
|
||||
{
|
||||
if ( [_group, _object] call TCL_Trigger_F) then
|
||||
{
|
||||
_return = _object;
|
||||
};
|
||||
};
|
||||
|
||||
_return = _object;
|
||||
};
|
||||
};
|
||||
|
||||
if (alive _return) exitWith
|
||||
{
|
||||
// player sideChat format ["TCL_Take_Cover_F > Exit > %1 > %2 > %3", _unit, _count, (count _objects) ];
|
||||
};
|
||||
};
|
||||
|
||||
if (alive _return) then
|
||||
{
|
||||
_return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// _return = (_objects select 0);
|
||||
|
||||
// player sideChat format ["TCL_Take_Cover_F > Behind > %1 > %2", _unit, _object];
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Take Cover Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Take Cover
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_enemy","_group","_object","_bool"];
|
||||
|
||||
// player sideChat format ["TCL_Take_Cover_F > %1 > %2 > %3 > %4", _object, (typeOf _object), (sizeOf typeOf _object), (boundingBox _object select 1) ];
|
||||
|
||||
private _random = 50;
|
||||
|
||||
if (_unit distance _object > 10) then
|
||||
{
|
||||
_random = 75;
|
||||
};
|
||||
|
||||
if (floor (random 100) < _random) then
|
||||
{
|
||||
_unit setUnitPos "UP";
|
||||
}
|
||||
else
|
||||
{
|
||||
_unit setUnitPos "MIDDLE";
|
||||
};
|
||||
|
||||
private ["_marker","_text"];
|
||||
|
||||
if (TCL_Debug select 3) then
|
||||
{
|
||||
_marker = [ [_unit, time], (getPos _object), "Icon", [1,1], "mil_triangle", "colorWhite"] call TCL_Create_Marker_F;
|
||||
|
||||
_text = {private _string = "Take Cover"; if (_unit in (TCL_Flanking select 1) ) then {_string = "Flanking"} else {if (_unit in (TCL_Flanking select 2) ) then {_string = "Flanking"} }; format ["%1 ( %2 ) %3 %4", _unit, _string, (_unit distance _object), _object] };
|
||||
|
||||
_marker setMarkerText call _text;
|
||||
};
|
||||
|
||||
private _direction = (_object getDir _enemy);
|
||||
|
||||
private _boundingBox = (boundingBox _object select 1 select 0);
|
||||
|
||||
// player sideChat format ["TCL_Take_Cover_F > BoundingBox > %1 > %2 > %3", _unit, _object, (boundingBox _object select 1) ];
|
||||
|
||||
if (_boundingBox > 3) then
|
||||
{
|
||||
_boundingBox = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_boundingBox < 1) then
|
||||
{
|
||||
_boundingBox = _boundingBox + 1;
|
||||
};
|
||||
};
|
||||
|
||||
private _cover = [_object, - _boundingBox, _direction] call TCL_Real_Pos_F;
|
||||
|
||||
_unit doMove _cover;
|
||||
|
||||
private _spot = objNull;
|
||||
|
||||
if (TCL_Debug select 6) then
|
||||
{
|
||||
_spot = createVehicle ["Sign_Arrow_Large_Blue_F", _cover, [], 0, "CAN_COLLIDE"];
|
||||
};
|
||||
|
||||
private _time = (time + 10);
|
||||
|
||||
_time = _time + (_unit distance _cover);
|
||||
|
||||
while { ( (alive _unit) && { (time < _time) } ) } do
|
||||
{
|
||||
// if (_unit distance _cover < 5) then {_unit setUnitPos "MIDDLE"};
|
||||
|
||||
// if ( (unitReady _unit) || (_unit distance _cover < 1) ) exitWith
|
||||
|
||||
// if (_unit distance _cover < _boundingBox) exitWith
|
||||
|
||||
// if (_unit distance2D _cover < 1) exitWith
|
||||
|
||||
// if ( (unitReady _unit) && { (_unit distance _cover < _boundingBox) } ) exitWith
|
||||
|
||||
// player sideChat format ["TCL_Take_Cover_F > %1 > %2 > %3", _unit, (unitReady _unit), (_unit distance _cover) ];
|
||||
|
||||
if (_unit distance2D _cover < _boundingBox) exitWith
|
||||
{
|
||||
// player sideChat format ["TCL_Take_Cover_F > %1 > %2 > %3", _unit, (_unit distance _cover), (boundingBox _object select 1 select 2) ];
|
||||
|
||||
// player sideChat format ["TCL_Take_Cover_F > BoundingBox > %1 > %2 > %3 > %4", _unit, _cover, _object, (boundingBox _object select 1) ];
|
||||
};
|
||||
|
||||
if (TCL_Debug select 3) then
|
||||
{
|
||||
_marker setMarkerText call _text;
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
if (TCL_Debug select 3) then
|
||||
{
|
||||
deleteMarker _marker;
|
||||
};
|
||||
|
||||
if (alive _spot) then
|
||||
{
|
||||
deleteVehicle _spot;
|
||||
};
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
private _flanking = True;
|
||||
|
||||
if (time < _time) then
|
||||
{
|
||||
if (TCL_Debug select 6) then
|
||||
{
|
||||
_spot = createVehicle ["Sign_Arrow_Large_Green_F", _cover, [], 0, "CAN_COLLIDE"];
|
||||
};
|
||||
|
||||
_unit setUnitPos "AUTO";
|
||||
|
||||
// _unit doWatch (getPos _enemy);
|
||||
|
||||
if (_object isKindOf "House") exitWith
|
||||
{
|
||||
sleep 10 + (random 30);
|
||||
|
||||
// player sideChat format ["TCL_Take_Cover_F > House > %1", _unit, _object];
|
||||
};
|
||||
|
||||
_unit forceSpeed 0;
|
||||
|
||||
if ( (floor (random 100) < 50) && { (_unit distance _enemy < 300) } ) then
|
||||
{
|
||||
sleep 10 + (random 30);
|
||||
|
||||
if (combatMode _group isEqualTo "YELLOW") then
|
||||
{
|
||||
// sleep 10 + (random 30);
|
||||
};
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
if (_bool) then
|
||||
{
|
||||
// sleep 10 + (random 30);
|
||||
};
|
||||
|
||||
_group = (group _unit);
|
||||
|
||||
private _waypoint = (_group getVariable "TCL_Waypoint");
|
||||
|
||||
if (_unit distance _waypoint < 100) then
|
||||
{
|
||||
if (alive _spot) then
|
||||
{
|
||||
deleteVehicle _spot;
|
||||
|
||||
_spot = createVehicle ["Sign_Arrow_Large_F", _cover, [], 0, "CAN_COLLIDE"];
|
||||
};
|
||||
|
||||
sleep 10 + (random 30);
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
sleep 10 + (random 30);
|
||||
};
|
||||
|
||||
_random = (TCL_Feature select 18);
|
||||
|
||||
if (_group in (TCL_Flanking select 0) ) then
|
||||
{
|
||||
_random = 100;
|
||||
};
|
||||
|
||||
if (floor (random 100) < _random) then
|
||||
{
|
||||
_array = ( (TCL_Flanking select 1) + (TCL_Flanking select 2) );
|
||||
|
||||
// if (_unit in _array) then
|
||||
// {
|
||||
|
||||
_time = (time + 10);
|
||||
|
||||
_random = (random 30);
|
||||
|
||||
_time = (_time + _random);
|
||||
|
||||
TCL_DeleteAT(TCL_Take_Cover,0,_unit);
|
||||
|
||||
if (alive _spot) then
|
||||
{
|
||||
deleteVehicle _spot;
|
||||
|
||||
_spot = createVehicle ["Sign_Arrow_Large_Yellow_F", _cover, [], 0, "CAN_COLLIDE"];
|
||||
};
|
||||
|
||||
while { (alive _unit) } do
|
||||
{
|
||||
if ( (time > _time) || (_unit in (TCL_Take_Cover select 0) ) ) exitWith
|
||||
{
|
||||
_flanking = False;
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
// };
|
||||
};
|
||||
|
||||
_unit forceSpeed -1;
|
||||
|
||||
if (alive _spot) then
|
||||
{
|
||||
deleteVehicle _spot;
|
||||
};
|
||||
};
|
||||
|
||||
_unit setUnitPos "AUTO";
|
||||
|
||||
if (_flanking) then
|
||||
{
|
||||
TCL_DeleteAT(TCL_Take_Cover,0,_unit);
|
||||
};
|
||||
|
||||
sleep 10 + (random 30);
|
||||
|
||||
TCL_DeleteAT(TCL_Take_Cover,1,_object);
|
||||
}
|
||||
else
|
||||
{
|
||||
TCL_DeleteAT(TCL_Take_Cover,0,_unit);
|
||||
|
||||
TCL_DeleteAT(TCL_Take_Cover,1,_object);
|
||||
};
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,117 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Tank_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Tank Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Tank
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic","_units"];
|
||||
|
||||
private _vehicle = (vehicle _enemy);
|
||||
|
||||
if ( (_vehicle isKindOf "Tank") && { (isEngineOn _vehicle) } ) then
|
||||
{
|
||||
private ["_unit","_weapon","_array"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
_weapon = (secondaryWeapon _unit);
|
||||
|
||||
_array = [];
|
||||
|
||||
if (_weapon isKindOf ["Launcher", configFile >> "CfgWeapons"] ) exitWith
|
||||
{
|
||||
_array = (magazines _unit) select { (getText (configfile >> "CfgMagazines" >> _x >> "displayNameShort") isEqualTo "AT") };
|
||||
|
||||
// player sideChat format ["TCL_Tank_F > Magazines > %1 > %2", _unit, _array];
|
||||
|
||||
if (_array isEqualTo [] ) exitWith
|
||||
{
|
||||
// [_enemy, _group, _logic] call (TCL_Static_Weapon_F select 0);
|
||||
};
|
||||
|
||||
// _unit selectWeapon _weapon;
|
||||
|
||||
[_unit, _enemy, _weapon] spawn (TCL_Tank_F select 1);
|
||||
|
||||
// _muzzle = (weaponState _unit select 1);
|
||||
|
||||
// _unit fireAtTarget [_enemy, _weapon];
|
||||
|
||||
// _unit fire _weapon;
|
||||
|
||||
// _unit doTarget _enemy;
|
||||
|
||||
// _unit doWatch _enemy;
|
||||
|
||||
// _unit fire _weapon;
|
||||
|
||||
// _unit action ["USEWEAPON", _weapon, _enemy, 1];
|
||||
|
||||
// _unit doFire _enemy;
|
||||
};
|
||||
|
||||
if (False) then
|
||||
{
|
||||
// [_enemy, _group, _logic] call (TCL_Static_Weapon_F select 0);
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Tank_F > Magazines > %1 > %2", _unit, _array];
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Tank Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Tank
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_enemy","_weapon"];
|
||||
|
||||
private _vehicle = (vehicle _enemy);
|
||||
|
||||
_unit forceSpeed 0;
|
||||
|
||||
_unit doWatch _vehicle;
|
||||
|
||||
// _unit disableAI "AUTOCOMBAT";
|
||||
|
||||
// _unit setBehaviour "CARELESS";
|
||||
|
||||
_unit doFire _vehicle;
|
||||
|
||||
_unit doTarget _vehicle;
|
||||
|
||||
_unit selectWeapon _weapon;
|
||||
|
||||
// player sideChat format ["TCL_Tank_F > Unit > %1 > %2", _unit, _vehicle];
|
||||
|
||||
sleep 3;
|
||||
|
||||
// _unit doFire _vehicle;
|
||||
|
||||
// _unit commandTarget _vehicle;
|
||||
|
||||
// _unit commandFire _vehicle;
|
||||
|
||||
_unit fire _weapon;
|
||||
|
||||
// _unit fireAtTarget [_vehicle, _weapon];
|
||||
|
||||
sleep 3;
|
||||
|
||||
_unit forceSpeed -1;
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,82 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Watch_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Watch Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Watch
|
||||
// Script by =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
_units = _units - (TCL_Watch select 0);
|
||||
|
||||
if (_units isEqualTo [] ) exitWith {};
|
||||
|
||||
private _unit = _units select random (count _units - 1);
|
||||
|
||||
if (isNull objectParent _unit) then
|
||||
{
|
||||
private _velocity = [_unit] call TCL_Velocity_F;
|
||||
|
||||
if (_velocity < 1) then
|
||||
{
|
||||
(TCL_Watch select 0) pushBack _unit;
|
||||
|
||||
private _range = (random 180);
|
||||
|
||||
private _direction = (getDir _unit - _range);
|
||||
|
||||
if (_direction < 0) then
|
||||
{
|
||||
_direction = _direction + 360;
|
||||
};
|
||||
|
||||
private _distance = 50;
|
||||
|
||||
private _random = (random 70);
|
||||
|
||||
_distance = (_distance + _random);
|
||||
|
||||
private _position = [ (getPos _unit select 0) + sin (_direction * _distance), (getPos _unit select 1) + cos (_direction * _distance), 1 + (random 1) ];
|
||||
|
||||
// private _spot = "Land_HelipadCircle_F" createVehicleLocal _position;
|
||||
|
||||
_unit doWatch _position;
|
||||
|
||||
if (floor (random 100) < 50) then
|
||||
{
|
||||
if (_unit hasWeapon "Binocular") then {_unit selectWeapon "Binocular"};
|
||||
};
|
||||
|
||||
sleep 10 + (random 30);
|
||||
|
||||
// _unit playMove "Acts_AidlPercMstpSlowWrflDnon_pissing";
|
||||
|
||||
if (_group in (TCL_Reinforcement select 0) ) then
|
||||
{
|
||||
_unit = _unit;
|
||||
}
|
||||
else
|
||||
{
|
||||
_unit doWatch objNull;
|
||||
|
||||
// sleep 10 + (random 30);
|
||||
};
|
||||
|
||||
if (currentWeapon _unit isEqualTo "Binocular") then
|
||||
{
|
||||
_unit selectWeapon (primaryWeapon _unit);
|
||||
};
|
||||
|
||||
// deleteVehicle _spot;
|
||||
|
||||
TCL_DeleteAT(TCL_Watch,0,_unit);
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,328 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Artillery_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic"];
|
||||
|
||||
if (TCL_Feature select 9) then
|
||||
{
|
||||
if (floor (random 100) < (TCL_Feature select 10) ) then
|
||||
{
|
||||
private _condition = (_logic getVariable "TCL_Artillery");
|
||||
|
||||
if (_condition select 0) then
|
||||
{
|
||||
private _objects = [];
|
||||
|
||||
private _echo = _group;
|
||||
|
||||
private _units = (units _echo);
|
||||
|
||||
{_objects append (synchronizedObjects _x) } count _units;
|
||||
|
||||
private _leader = (leader _echo);
|
||||
|
||||
private _groups = (TCL_Artillery select 0);
|
||||
|
||||
_groups = _groups select {_vehicle = (vehicle leader _x); ( (alive _vehicle) && { (alive gunner _vehicle) } && { (canFire _vehicle) } && { (someAmmo _vehicle) } && { (side _echo getFriend side _x > 0.6) } ) };
|
||||
|
||||
if (_groups isEqualTo [] ) exitWith {};
|
||||
|
||||
private _position = (getPos _logic);
|
||||
|
||||
private _distance = [_echo] call (TCL_Radio_F select 0);
|
||||
|
||||
private ["_kilo","_vehicle","_bool"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _groups - 1) do
|
||||
{
|
||||
_kilo = (_groups select _count);
|
||||
|
||||
_vehicle = (vehicle leader _kilo);
|
||||
|
||||
_bool = [_vehicle, _position] call (TCL_Artillery_F select 3);
|
||||
|
||||
if ( (_vehicle getVariable "TCL_Artillery") && { (_bool) } && { (_leader distance _vehicle < _distance) } ) exitWith
|
||||
{
|
||||
// if ( (floor (random 100) < 50) || (_vehicle in _objects) ) then
|
||||
|
||||
_condition set [0, False];
|
||||
|
||||
_vehicle setVariable ["TCL_Artillery", False];
|
||||
|
||||
// player sideChat format ["TCL_Artillery_F > %1", _vehicle];
|
||||
|
||||
[_enemy, _kilo, _logic, _vehicle, _condition] spawn (TCL_Artillery_F select 1);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic","_vehicle","_condition"];
|
||||
|
||||
private _value = [_enemy, _group, _logic] call (TCL_KnowsAbout_F select 3);
|
||||
|
||||
sleep _value;
|
||||
|
||||
private _time = 0;
|
||||
|
||||
private _count = 5 - (random 3);
|
||||
|
||||
sleep 10 + (random 30);
|
||||
|
||||
_condition set [1, True];
|
||||
|
||||
private _position = [ (getPos _logic select 0) + (random 100 - random 100), (getPos _logic select 1) + (random 100 - random 100), 0];
|
||||
|
||||
private _bool = [_vehicle, _position] call (TCL_Artillery_F select 2);
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
private _units = (units _group);
|
||||
|
||||
_units = _units select { (typeOf _vehicle isEqualTo (typeOf vehicle _x) ) };
|
||||
|
||||
if (_units isEqualTo [] ) exitWith {};
|
||||
|
||||
[_units, _logic] spawn (TCL_Artillery_F select 4);
|
||||
|
||||
// private _time = 0;
|
||||
|
||||
private _rounds = 0;
|
||||
|
||||
private _magazine = (getArtilleryAmmo [_vehicle] select 0);
|
||||
|
||||
_time = _vehicle getArtilleryETA [_position, _magazine];
|
||||
|
||||
if (False) then
|
||||
{
|
||||
|
||||
{
|
||||
_vehicle = (vehicle _x);
|
||||
|
||||
private _gunner = (gunner _vehicle);
|
||||
|
||||
private _muzzle = (currentMuzzle _gunner);
|
||||
|
||||
_rounds = (_vehicle ammo _muzzle);
|
||||
|
||||
_rounds = (_rounds / _count);
|
||||
|
||||
private _magazine = (getArtilleryAmmo [_vehicle] select 0);
|
||||
|
||||
_time = _vehicle getArtilleryETA [_position, _magazine];
|
||||
|
||||
_vehicle doArtilleryFire [_position, _magazine, _rounds];
|
||||
|
||||
sleep (random 5);
|
||||
|
||||
} forEach _units;
|
||||
|
||||
private _value = (_time * _rounds);
|
||||
|
||||
_value = (_value / _count);
|
||||
|
||||
// player sideChat format ["TCL_Artillery_F > Artillery > %1 > %2 > %3 > %4", _time, _value, _count, _rounds];
|
||||
|
||||
_time = (_time / _count);
|
||||
|
||||
private _count = _rounds;
|
||||
|
||||
while { (_count > 0) } do
|
||||
{
|
||||
sleep _time;
|
||||
|
||||
_count = _count - 1;
|
||||
};
|
||||
|
||||
// sleep _value;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Artillery_F > Artillery > %1", _condition];
|
||||
|
||||
// _condition set [1, False];
|
||||
|
||||
sleep 30 + (random 50);
|
||||
|
||||
_vehicle setVariable ["TCL_Artillery", True];
|
||||
|
||||
if (_time > 0) then
|
||||
{
|
||||
sleep 50 + (random 70);
|
||||
}
|
||||
else
|
||||
{
|
||||
sleep 30 + (random 50);
|
||||
};
|
||||
|
||||
_condition set [0, True];
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_vehicle","_position"];
|
||||
|
||||
private _return = False;
|
||||
|
||||
private _gunner = (gunner _vehicle);
|
||||
|
||||
if ( (canFire _vehicle) && { (alive _gunner) } ) then
|
||||
{
|
||||
if (getArray (configfile >> "CfgVehicles" >> (typeOf _vehicle) >> "availableForSupportTypes") select 0 isEqualTo "Artillery") then
|
||||
{
|
||||
private _magazine = (getArtilleryAmmo [_vehicle] select 0);
|
||||
|
||||
// _value = getNumber (configFile >> "CfgAmmo" >> _magazine >> "indirectHit");
|
||||
|
||||
// player sideChat str _magazine;
|
||||
|
||||
// player sideChat str _value;
|
||||
|
||||
private _range = _position inRangeOfArtillery [crew _vehicle, _magazine];
|
||||
|
||||
if (_range) then
|
||||
{
|
||||
_return = [_vehicle, _position] call (TCL_Artillery_F select 3);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Artillery_F > Artillery > %1 > %2", _vehicle, _return];
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_vehicle","_position"];
|
||||
|
||||
private _return = True;
|
||||
|
||||
// private _objects = _position nearEntities [ ["CAManBase","Car","Tank","Helicopter"], 100];
|
||||
|
||||
private _objects = _position nearEntities [ ["Man","Car","Tank","Helicopter"], 100];
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {_return};
|
||||
|
||||
_array = (allUnits + vehicles);
|
||||
|
||||
_objects = allUnits;
|
||||
|
||||
private "_object";
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _objects - 1) do
|
||||
{
|
||||
_object = (_objects select _count);
|
||||
|
||||
// if ( (alive _object) && { (side _object getFriend side _vehicle > 0.6) } && { (_object in _array) } ) exitWith
|
||||
|
||||
if ( (alive _object) && { (side _object getFriend side _vehicle > 0.6) } && { (_object distance _position < 100) } ) exitWith
|
||||
{
|
||||
_return = False;
|
||||
|
||||
// player sideChat format ["TCL_Artillery_F > Artillery > %1 > %2", _object, _vehicle];
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery Function #4
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_units","_logic"];
|
||||
|
||||
private _time = 0;
|
||||
|
||||
private _array = [];
|
||||
|
||||
// private _rounds = 0;
|
||||
|
||||
private _rounds = 3 + (random 5);
|
||||
|
||||
private _position = [ (getPos _logic select 0) + (random 100 - random 100), (getPos _logic select 1) + (random 100 - random 100), 0];
|
||||
|
||||
private ["_unit","_vehicle"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
_array pushBack _unit;
|
||||
|
||||
_vehicle = (vehicle _unit);
|
||||
|
||||
private _gunner = (gunner _vehicle);
|
||||
|
||||
private _muzzle = (currentMuzzle _gunner);
|
||||
|
||||
// _rounds = (_vehicle ammo _muzzle);
|
||||
|
||||
// _rounds = (_rounds / _random);
|
||||
|
||||
private _magazine = (getArtilleryAmmo [_vehicle] select 0);
|
||||
|
||||
_time = _vehicle getArtilleryETA [_position, _magazine];
|
||||
|
||||
_vehicle doArtilleryFire [_position, _magazine, _rounds];
|
||||
|
||||
sleep (random 5);
|
||||
};
|
||||
|
||||
if (_array isEqualTo _units) then
|
||||
{
|
||||
while { (currentcommand _vehicle isEqualTo "FIRE AT POSITION") } do
|
||||
{
|
||||
sleep 5;
|
||||
};
|
||||
|
||||
sleep _time;
|
||||
|
||||
private _condition = (_logic getVariable "TCL_Artillery");
|
||||
|
||||
_condition set [1, False];
|
||||
|
||||
// player sideChat format ["TCL_Artillery_F > Artillery > %1", _condition];
|
||||
};
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,139 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Flanking_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
private _array = [];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _random = 3 - (random 1);
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
_value = (count _units / _random);
|
||||
|
||||
(TCL_Flanking select 0) pushBack _group;
|
||||
|
||||
private "_unit";
|
||||
|
||||
private _count = (count _units - 1);
|
||||
|
||||
while { (_count > _value) } do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
_array pushBack _unit;
|
||||
|
||||
_count = _count - 1;
|
||||
};
|
||||
|
||||
if (floor (random 100) < (TCL_Feature select 19) ) exitWith
|
||||
{
|
||||
(TCL_Flanking select 1) append _array;
|
||||
|
||||
// player sideChat format ["TCL_Flanking_F > Flanking #1 > %1 > %2", _group, _array];
|
||||
};
|
||||
|
||||
if (floor (random 100) < (TCL_Feature select 20) ) exitWith
|
||||
{
|
||||
_units = _units - _array;
|
||||
|
||||
if (floor (random 100) < (TCL_Feature select 21) ) then
|
||||
{
|
||||
_units deleteAt (_units find _leader);
|
||||
};
|
||||
|
||||
if (_leader in _units) then
|
||||
{
|
||||
_units = _units;
|
||||
|
||||
// player sideChat format ["TCL_Flanking_F > Flanking #2 > %1 > %2", _group, _units];
|
||||
}
|
||||
else
|
||||
{
|
||||
_units = _units select { (floor (random 100) < 50) };
|
||||
|
||||
_units pushBack _leader;
|
||||
|
||||
// player sideChat format ["TCL_Flanking_F > Flanking #3 > %1 > %2", _group, _units];
|
||||
};
|
||||
|
||||
(TCL_Flanking select 2) append _units;
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_enemy","_position","_distance"];
|
||||
|
||||
private _value = 30;
|
||||
|
||||
private _bool = True;
|
||||
|
||||
private _random = (random 50);
|
||||
|
||||
_value = (_value + _random);
|
||||
|
||||
private _direction = (_unit getDir _enemy);
|
||||
|
||||
if (_unit in (TCL_Flanking select 1) ) then
|
||||
{
|
||||
_direction = (_direction + _value);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_unit in (TCL_Flanking select 2) ) exitWith
|
||||
{
|
||||
_direction = (_direction - _value);
|
||||
};
|
||||
|
||||
_bool = False;
|
||||
};
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
_position = [_unit, _distance, _direction] call TCL_Real_Pos_F;
|
||||
|
||||
if (TCL_Debug select 6) then
|
||||
{
|
||||
[_position] spawn (TCL_Flanking_F select 2);
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Take_Cover_F > Direction > %1 > %2", _unit, _direction];
|
||||
};
|
||||
|
||||
_position
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_position"];
|
||||
|
||||
private _spot = createVehicle ["Sign_Arrow_Large_Yellow_F", _position, [], 0, "CAN_COLLIDE"];
|
||||
|
||||
sleep 5;
|
||||
|
||||
deleteVehicle _spot;
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,80 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Mortar_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Mortar Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Mortar
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_vehicle"];
|
||||
|
||||
if (_group in (TCL_Reinforcement select 0) ) then
|
||||
{
|
||||
private _enemy = (_group getVariable "TCL_Enemy");
|
||||
|
||||
if ( (alive _enemy) && { (_group knowsAbout vehicle _enemy > 0) } ) then
|
||||
{
|
||||
private _leader = (leader _group);
|
||||
|
||||
(TCL_Static_Weapon select 2) pushBack _vehicle;
|
||||
|
||||
private _logic = (_group getVariable "TCL_Logic");
|
||||
|
||||
private _magazine = (getArtilleryAmmo [_vehicle] select 0);
|
||||
|
||||
private _position = [ (getPos _logic select 0) + (random 50 - random 50), (getPos _logic select 1) + (random 50 - random 50), 0];
|
||||
|
||||
private _bool = [_vehicle, _position] call (TCL_Artillery_F select 2);
|
||||
|
||||
private _range = (getPos _logic) inRangeOfArtillery [crew _vehicle, _magazine];
|
||||
|
||||
if ( (_bool) && { (_range) } ) then
|
||||
{
|
||||
private _condition = (_logic getVariable "TCL_Artillery");
|
||||
|
||||
_condition set [1, True];
|
||||
|
||||
sleep 5 + (random 10);
|
||||
|
||||
// private _count = 1 + (random 3);
|
||||
|
||||
if (canFire _vehicle) then
|
||||
{
|
||||
private _rounds = (_unit ammo currentMuzzle gunner _vehicle);
|
||||
|
||||
_rounds = (_rounds / 3);
|
||||
|
||||
// private _count = (random _rounds);
|
||||
|
||||
_time = _vehicle getArtilleryETA [_position, _magazine];
|
||||
|
||||
_vehicle doArtilleryFire [_position, _magazine, _rounds];
|
||||
|
||||
sleep _time;
|
||||
|
||||
// sleep (10 * _count);
|
||||
};
|
||||
|
||||
_condition set [1, False];
|
||||
|
||||
TCL_DeleteAT(TCL_Static_Weapon,2,_vehicle);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_leader in (TCL_Static_Weapon select 0) ) exitWith {};
|
||||
|
||||
// player sideChat format ["TCL_Mortar_F > Vehicle > %1", _vehicle];
|
||||
|
||||
_unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False;
|
||||
|
||||
sleep 30 + (random 50);
|
||||
|
||||
TCL_DeleteAT(TCL_Static_Weapon,2,_vehicle);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,523 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Rearm_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group"];
|
||||
|
||||
private ["_magazine","_count","_magazines","_array","_ammo","_value"];
|
||||
|
||||
private _weapon = (primaryWeapon _unit);
|
||||
|
||||
if (_weapon isEqualTo "") then
|
||||
{
|
||||
_ammo = 0;
|
||||
|
||||
_count = 0;
|
||||
|
||||
_magazine = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
_magazines = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines");
|
||||
|
||||
_magazine = (_magazines select 0);
|
||||
|
||||
_array = [];
|
||||
|
||||
_array = (magazines _unit) select { (_x in _magazines) };
|
||||
|
||||
// _array = (magazines _unit) select { (_x isEqualTo _magazine) };
|
||||
|
||||
// _ammo = getNumber (configfile >> "CfgMagazines" >> _magazine >> "count");
|
||||
|
||||
_count = (count _array);
|
||||
|
||||
_ammo = (_unit ammo _weapon);
|
||||
|
||||
// _value = (_ammo * _magazines);
|
||||
};
|
||||
|
||||
if ( (_count < 3) && { (_ammo < 50) } ) then
|
||||
{
|
||||
[_unit, _group, _magazine, _magazines] call (TCL_Rearm_F select 1);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Magazine > %1 > %2 > %3 > %4 > %5", _unit, _ammo, _value, _magazine, _magazines];
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_magazine","_magazines"];
|
||||
|
||||
if (True) then
|
||||
{
|
||||
private _objects = nearestObjects [_unit, ["CAManBase"], 100];
|
||||
|
||||
_objects = _objects - (TCL_Rearm select 2);
|
||||
|
||||
private _array = [];
|
||||
|
||||
_array = _objects select { ( (alive _x) || (_unit knowsAbout _x == 0) ) };
|
||||
|
||||
_objects = _objects - _array;
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith
|
||||
{
|
||||
_objects = nearestObjects [_unit, ["LandVehicle"], 100];
|
||||
|
||||
_objects = _objects - (TCL_Rearm select 2);
|
||||
|
||||
_objects = _objects select { ( (alive _x) && { (crew _x isEqualTo [] ) } ) };
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {};
|
||||
|
||||
private _object = (_objects select 0);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Vehicle > %1 > %2", _unit, _object];
|
||||
|
||||
_array = (magazineCargo _object);
|
||||
|
||||
if (_array isEqualTo [] ) exitWith {};
|
||||
|
||||
if (_magazine in _array) then
|
||||
{
|
||||
(TCL_Rearm select 0) pushBack _unit;
|
||||
|
||||
// (TCL_Rearm select 1) pushBack _unit;
|
||||
|
||||
(TCL_Rearm select 2) pushBack _object;
|
||||
|
||||
_array = _array select { (_x in _magazines) };
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Cargo > %1 > %2", _unit, _index];
|
||||
|
||||
[_unit, _group, _object, _array] spawn (TCL_Rearm_F select 3);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Vehicle > %1 > %2", _unit, _object];
|
||||
};
|
||||
};
|
||||
|
||||
private _object = (_objects select 0);
|
||||
|
||||
private _bool = [_unit, _group, _magazine, _objects] call (TCL_Rearm_F select 2);
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
_objects = nearestObjects [_object, ["WeaponHolderSimulated"], 5];
|
||||
|
||||
_objects = _objects - (TCL_Rearm select 2);
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {};
|
||||
|
||||
private _dummy = (_objects select 0);
|
||||
|
||||
private _weapons = (weaponCargo _dummy);
|
||||
|
||||
private _weapon = (_weapons select 0);
|
||||
|
||||
(TCL_Rearm select 0) pushBack _unit;
|
||||
|
||||
// (TCL_Rearm select 1) pushBack _unit;
|
||||
|
||||
(TCL_Rearm select 2) pushBack _object;
|
||||
|
||||
// _array = [_object, _dummy];
|
||||
|
||||
// (TCL_Rearm select 2) append _array;
|
||||
|
||||
[_unit, _group, _object, _dummy, _weapon] spawn (TCL_Rearm_F select 3);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Weapon > %1 > %2", _unit, _object];
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_magazine","_objects"];
|
||||
|
||||
private _return = True;
|
||||
|
||||
if (_magazine isEqualTo "") exitWith {_return};
|
||||
|
||||
private ["_object","_magazines","_array"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _objects - 1) do
|
||||
{
|
||||
_object = (_objects select _count);
|
||||
|
||||
_magazines = (magazines _object);
|
||||
|
||||
if (_magazine in _magazines) exitWith
|
||||
{
|
||||
_return = False;
|
||||
|
||||
(TCL_Rearm select 0) pushBack _unit;
|
||||
|
||||
// (TCL_Rearm select 1) pushBack _unit;
|
||||
|
||||
(TCL_Rearm select 2) pushBack _object;
|
||||
|
||||
_array = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines");
|
||||
|
||||
_magazines = _magazines select { (_x in _array) };
|
||||
|
||||
[_unit, _group, _object, _magazines] spawn (TCL_Rearm_F select 3);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Magazines > %1 > %2", _unit, _object];
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_object"];
|
||||
|
||||
private _bool = True;
|
||||
|
||||
private _time = (time + 10);
|
||||
|
||||
private _position = (getPos _object);
|
||||
|
||||
private _boundingBox = (boundingBox _object select 1 select 1);
|
||||
|
||||
_position set [1, (_position select 1) - _boundingBox];
|
||||
|
||||
_unit doMove _position;
|
||||
|
||||
// (TCL_Rearm select 0) pushBack _unit;
|
||||
|
||||
(TCL_Rearm select 1) pushBack _unit;
|
||||
|
||||
// (TCL_Rearm select 2) pushBack _object;
|
||||
|
||||
private _distance = (_unit distance _object);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Unit > %1 > %2", _unit, _object];
|
||||
|
||||
_time = (_time + _distance);
|
||||
|
||||
while { ( (alive _unit) && { (time < _time) } ) } do
|
||||
{
|
||||
if (_unit distance _position < _boundingBox) exitWith
|
||||
{
|
||||
_bool = False;
|
||||
|
||||
_unit forceSpeed 0;
|
||||
|
||||
_unit doWatch _object;
|
||||
|
||||
_unit setUnitPos "MIDDLE";
|
||||
|
||||
sleep 1;
|
||||
|
||||
// _unit playMove "Acts_AidlPercMstpSlowWrflDnon_pissing";
|
||||
|
||||
if (count _this == 4) then
|
||||
{
|
||||
private _magazines = (_this select 3);
|
||||
|
||||
[_unit, _group, _object, _magazines] spawn (TCL_Rearm_F select 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
private _dummy = (_this select 3);
|
||||
|
||||
private _weapon = (_this select 4);
|
||||
|
||||
[_unit, _group, _object, _dummy, _weapon] spawn (TCL_Rearm_F select 5);
|
||||
};
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
[_unit, _group, _object, _bool] spawn (TCL_Rearm_F select 6);
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #4
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_object","_magazines"];
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
private _bool = False;
|
||||
|
||||
private _magazine = (_magazines select 0);
|
||||
|
||||
_unit action ["TakeMagazine", _object, _magazine];
|
||||
|
||||
// {_object removeMagazine _x} count _magazines;
|
||||
|
||||
_magazines deleteAt (_magazines find _magazine);
|
||||
|
||||
if (False) then
|
||||
{
|
||||
// [_unit, _group, _object, _magazines] call (TCL_Rearm_F select 7);
|
||||
|
||||
if (False) then
|
||||
{
|
||||
|
||||
_cargo = (magazineCargo _object);
|
||||
|
||||
_index = (_cargo find _magazine);
|
||||
|
||||
if (_index != -1) then
|
||||
{
|
||||
private _count = 0;
|
||||
|
||||
clearMagazineCargo _object;
|
||||
|
||||
// {if (_index != _count) then
|
||||
{
|
||||
// _object addMagazineCargo [_x, 1];
|
||||
};
|
||||
|
||||
_count = _count + 1;
|
||||
|
||||
// } forEach _cargo;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
private _count = (count magazines _unit);
|
||||
|
||||
// _count = (magazineCargo _object);
|
||||
|
||||
// {_unit addMagazine _x; if (count magazines _unit > _count) then {_count = (count magazines _unit); _object removeMagazine _x} else {_bool = True} } count _magazines;
|
||||
|
||||
private _array = [];
|
||||
|
||||
private _index = 0;
|
||||
|
||||
{_unit addMagazine _x;
|
||||
|
||||
if (count magazines _unit isEqualTo _count) exitWith
|
||||
{
|
||||
_bool = True;
|
||||
};
|
||||
|
||||
_count = (count magazines _unit);
|
||||
|
||||
_index = _index + 1;
|
||||
|
||||
_array = _array + [_x];
|
||||
|
||||
_object removeMagazine _x;
|
||||
|
||||
} count _magazines;
|
||||
|
||||
if (alive _object) then
|
||||
{
|
||||
_cargo = (magazineCargo _object);
|
||||
|
||||
clearMagazineCargo _object;
|
||||
|
||||
_count = 0;
|
||||
|
||||
for "_count" from _count to (count _cargo - 1) do
|
||||
{
|
||||
_magazine = (_cargo select _count);
|
||||
|
||||
if (_magazine in _array) then
|
||||
{
|
||||
_array deleteAt (_array find _magazine);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Magazines > %1 > %2", _unit, _array];
|
||||
|
||||
sleep 1;
|
||||
|
||||
// _object addMagazineCargo [_magazine, 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
_object addMagazineCargo [_magazine, 1];
|
||||
};
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Magazines > %1 > %2", _unit, (count _cargo), count (magazineCargo _object) ];
|
||||
};
|
||||
|
||||
if (count _magazines > _index) then
|
||||
{
|
||||
_bool = True;
|
||||
};
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Magazines > %1 > %2", _unit, _bool];
|
||||
|
||||
// _unit addMagazines [_magazine, (count _magazines) ];
|
||||
|
||||
sleep 3;
|
||||
|
||||
_unit selectWeapon (primaryWeapon _unit);
|
||||
|
||||
[_unit, _group, _object, _bool] spawn (TCL_Rearm_F select 6);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Magazines > %1", _unit];
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #5
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_object","_dummy","_weapon"];
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
private _bool = False;
|
||||
|
||||
// private _array = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines");
|
||||
|
||||
// private _magazines = (magazines _object) select { (_x in _array) };
|
||||
|
||||
if (primaryWeapon _unit isEqualTo "") then
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
_unit action ["DropWeapon", _dummy, (primaryWeapon _unit) ];
|
||||
|
||||
sleep 3;
|
||||
};
|
||||
|
||||
_unit action ["TakeWeapon", _dummy, _weapon];
|
||||
|
||||
sleep 3;
|
||||
|
||||
// {_unit addMagazine _x} count _magazines;
|
||||
|
||||
_unit action ["REARM", _object];
|
||||
|
||||
_unit selectWeapon (primaryWeapon _unit);
|
||||
|
||||
[_unit, _group, _dummy, _bool] spawn (TCL_Rearm_F select 6);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Weapon > %1", _unit];
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #6
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_object","_bool"];
|
||||
|
||||
_unit forceSpeed -1;
|
||||
|
||||
_unit doWatch objNull;
|
||||
|
||||
_unit setUnitPos "AUTO";
|
||||
|
||||
TCL_DeleteAT(TCL_Rearm,0,_unit);
|
||||
|
||||
[_unit, _group] call (TCL_Follow_F select 0);
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
sleep 10 + (random 30);
|
||||
|
||||
TCL_DeleteAT(TCL_Rearm,2,_object);
|
||||
}
|
||||
else
|
||||
{
|
||||
sleep 30 + (random 50);
|
||||
};
|
||||
|
||||
TCL_DeleteAT(TCL_Rearm,1,_unit);
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #7
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_object","_magazines"];
|
||||
|
||||
private _count = (count magazines _unit);
|
||||
|
||||
private _cargo = (magazineCargo _object);
|
||||
|
||||
private _index = 0;
|
||||
|
||||
private _array = [];
|
||||
|
||||
private "_magazine";
|
||||
|
||||
{_unit addMagazine _x;
|
||||
|
||||
if (count magazines _unit isEqualTo _count) exitWith
|
||||
{
|
||||
_bool = True;
|
||||
};
|
||||
|
||||
_count = (count magazines _unit);
|
||||
|
||||
_index = _index + 1;
|
||||
|
||||
_magazine = (_cargo find _x);
|
||||
|
||||
_array pushBack _magazine;
|
||||
|
||||
} forEach _magazines;
|
||||
|
||||
if (count _magazines > _index) then
|
||||
{
|
||||
_bool = True;
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Cargo > %1 > %2 > %3", _unit, _array, _cargo];
|
||||
|
||||
True
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,210 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Static_Weapon_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic"];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _array = ( (TCL_Static_Weapon select 0) + (TCL_House_Search select 0) );
|
||||
|
||||
_units = _units - _array;
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
_units deleteAt (_units find _leader);
|
||||
|
||||
_units = _units select { ( (alive _x) && { (isNull objectParent _x) } ) };
|
||||
|
||||
if (count _units > 1) then
|
||||
{
|
||||
private _unit = _units select (count _units - 1);
|
||||
|
||||
private _vehicle = [_unit, _group, _logic] call (TCL_Static_Weapon_F select 1);
|
||||
|
||||
if (alive _vehicle) then
|
||||
{
|
||||
private _bool = True;
|
||||
|
||||
if (_group in (TCL_Hold select 0) ) then
|
||||
{
|
||||
_bool = [_group, _vehicle] call TCL_Trigger_F;
|
||||
};
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
[_unit, _group, _logic, _vehicle] spawn (TCL_Static_Weapon_F select 2);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_logic"];
|
||||
|
||||
private _return = objNull;
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
private _objects = _unit nearEntities ["StaticWeapon", 100];
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {_return};
|
||||
|
||||
_objects = _objects - ( (TCL_Static_Weapon select 1) + (TCL_Static_Weapon select 2) );
|
||||
|
||||
_objects = _objects select { ( (alive _x) && { (someAmmo _x) } && { (_unit knowsAbout _x > 0) } && { (_x distance _leader < 100) } ) };
|
||||
|
||||
private ["_vehicle","_side","_crew"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _objects - 1) do
|
||||
{
|
||||
_vehicle = (_objects select _count);
|
||||
|
||||
_side = False;
|
||||
|
||||
if (getNumber (configFile >> "CfgVehicles" >> (typeOf _unit) >> "side") isEqualTo getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "side") ) then
|
||||
{
|
||||
_side = True;
|
||||
};
|
||||
|
||||
_crew = (crew _vehicle);
|
||||
|
||||
if ( (_side) && { (_crew isEqualTo [] ) } ) exitWith
|
||||
{
|
||||
_return = _vehicle;
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_logic","_vehicle"];
|
||||
|
||||
_unit disableAI "AUTOTARGET";
|
||||
|
||||
_unit assignAsGunner _vehicle;
|
||||
|
||||
_unit doMove (getPos _vehicle);
|
||||
|
||||
(TCL_Static_Weapon select 0) pushBack _unit;
|
||||
|
||||
(TCL_Static_Weapon select 1) pushBack _vehicle;
|
||||
|
||||
[_unit] orderGetIn True; [_unit] allowGetIn True;
|
||||
|
||||
// player sideChat format ["TCL_Static_Weapon_F > Vehicle > %1", _vehicle];
|
||||
|
||||
private _time = (time + 30);
|
||||
|
||||
private _distance = (_unit distance _vehicle);
|
||||
|
||||
_time = (_time + _distance);
|
||||
|
||||
while { ( (alive _unit) && { (time < _time) } && { (isNull objectParent _unit) } ) } do
|
||||
{
|
||||
sleep 5;
|
||||
};
|
||||
|
||||
if ( (alive _unit) && { (time < _time) } && { (_unit == gunner _vehicle) } ) then
|
||||
{
|
||||
_unit enableAI "AUTOTARGET";
|
||||
|
||||
[_unit, _group, _logic, _vehicle] spawn (TCL_Static_Weapon_F select 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
TCL_DeleteAT(TCL_Static_Weapon,0,_unit);
|
||||
|
||||
TCL_DeleteAT(TCL_Static_Weapon,1,_vehicle);
|
||||
|
||||
_unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False;
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_logic","_vehicle"];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private ["_leader","_waypoint"];
|
||||
|
||||
while { ( (alive _unit) && { (_unit == gunner _vehicle) } ) } do
|
||||
{
|
||||
_leader = (leader _group);
|
||||
|
||||
if ( (canFire _vehicle) && { (someAmmo _vehicle) } ) then
|
||||
{
|
||||
if (getArray (configfile >> "CfgVehicles" >> (typeOf _vehicle) >> "availableForSupportTypes") select 0 isEqualTo "Artillery") then
|
||||
{
|
||||
if (_vehicle in (TCL_Static_Weapon select 2) ) exitWith {};
|
||||
|
||||
[_unit, _group, _vehicle] spawn (TCL_Mortar_F select 0);
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False;
|
||||
};
|
||||
|
||||
if (_group in (TCL_Reinforcement select 2) ) then
|
||||
{
|
||||
if (_leader in (TCL_Static_Weapon select 0) ) exitWith {};
|
||||
|
||||
_unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False;
|
||||
};
|
||||
|
||||
if (_unit distance _logic > 500) then
|
||||
{
|
||||
if (behaviour _leader isEqualTo "COMBAT") then
|
||||
{
|
||||
if (_leader in (TCL_Static_Weapon select 0) ) exitWith {};
|
||||
|
||||
_unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False;
|
||||
};
|
||||
};
|
||||
|
||||
sleep 5;
|
||||
};
|
||||
|
||||
if (_unit == gunner _vehicle) then
|
||||
{
|
||||
_unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False;
|
||||
};
|
||||
|
||||
TCL_DeleteAT(TCL_Static_Weapon,0,_unit);
|
||||
|
||||
sleep 10 + (random 30);
|
||||
|
||||
TCL_DeleteAT(TCL_Static_Weapon,1,_vehicle);
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,521 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Take_Cover_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Take Cover Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Take Cover
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_units"];
|
||||
|
||||
private _array = ( (TCL_Sneaking select 0) + (TCL_Garrison select 0) );
|
||||
|
||||
if (_group in _array) exitWith {};
|
||||
|
||||
_array = ( (TCL_Hold select 0) + (TCL_Waiting select 0) );
|
||||
|
||||
private _bool = False;
|
||||
|
||||
if (_group in _array) then
|
||||
{
|
||||
_bool = True;
|
||||
};
|
||||
|
||||
_array = ( (TCL_Heal select 0) + (TCL_Rearm select 0) + (TCL_Take_Cover select 0) + (TCL_House_Search select 0) + (TCL_Static_Weapon select 0) );
|
||||
|
||||
_units = _units - _array;
|
||||
|
||||
private ["_unit","_enemy"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
if (floor (random 100) < (TCL_Feature select 16) ) then
|
||||
{
|
||||
if ( (alive _unit) && { (isNull objectParent _unit) } ) then
|
||||
{
|
||||
[_unit, _enemy, _group, _bool] call (TCL_Take_Cover_F select 1);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Take Cover Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Take Cover
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_enemy","_group","_bool"];
|
||||
|
||||
if (alive _enemy) then
|
||||
{
|
||||
private _array = (_unit getVariable "TCL_Take_Cover");
|
||||
|
||||
if (isNil "_array") then
|
||||
{
|
||||
_unit setVariable ["TCL_Take_Cover", [time, [], (getPos _unit) ] ];
|
||||
|
||||
_array = (_unit getVariable "TCL_Take_Cover");
|
||||
|
||||
private _text = format ["TCL_Take_Cover_F > Error > %1 > %2 > %3 > %4", _unit, (side _unit), _group, (typeOf _unit) ];
|
||||
|
||||
diag_log ("////////////////////////////////// TCL error dump //////////////////////////////////" + endl + _text + endl + "///////////////////////////////////////////////////////////////////////////");
|
||||
|
||||
player sideChat _text;
|
||||
|
||||
_string = format ["%1<t align='center'>Ups...!<br/>Something went wrong %2...<br/>Don't worry the problem will be solved as soon as this message appears.<br/>Please help me fix this issue by reporting the line stored in your .rpt file!</t>", (TCL_Text_F select 5), name player];
|
||||
|
||||
hint parseText _string;
|
||||
};
|
||||
|
||||
if (time > (_array select 0) ) then
|
||||
{
|
||||
// private _time = (time + 5);
|
||||
|
||||
private _time = (time + 15);
|
||||
|
||||
if (_unit knowsAbout vehicle _enemy > 0) then
|
||||
{
|
||||
_time = _time + (random 15);
|
||||
|
||||
// _time = _time + (random 30);
|
||||
|
||||
private _object = [_unit, _enemy, _group, _bool, _array] call (TCL_Take_Cover_F select 2);
|
||||
|
||||
if (alive _object) then
|
||||
{
|
||||
(TCL_Take_Cover select 0) pushBack _unit;
|
||||
|
||||
(TCL_Take_Cover select 1) pushBack _object;
|
||||
|
||||
[_unit, _enemy, _group, _object, _bool] spawn (TCL_Take_Cover_F select 3);
|
||||
|
||||
// player sideChat format ["TCL_Take_Cover_F > %1 > %2", _unit, (typeOf _object) ];
|
||||
};
|
||||
};
|
||||
|
||||
_array set [0, _time];
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Take Cover Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Take Cover
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_enemy","_group","_bool","_array"];
|
||||
|
||||
private _distance = (TCL_Feature select 17);
|
||||
|
||||
private _return = objNull;
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
private _waypoint = (_group getVariable "TCL_Waypoint");
|
||||
|
||||
private _position = _unit;
|
||||
|
||||
if (_unit distance _waypoint < _distance) then
|
||||
{
|
||||
_position = _waypoint;
|
||||
};
|
||||
|
||||
if (_group in (TCL_Flanking select 0) ) then
|
||||
{
|
||||
private _direction = 50;
|
||||
|
||||
if (_unit in (TCL_Flanking select 1) ) then
|
||||
{
|
||||
_direction = - 50;
|
||||
};
|
||||
|
||||
_position = [_unit, _distance, _direction] call TCL_Real_Pos_F;
|
||||
};
|
||||
|
||||
// private _objects = [];
|
||||
|
||||
// private _objects = [_unit, _array, _distance] call TCL_Cover_F;
|
||||
|
||||
private _objects = (_array select 1);
|
||||
|
||||
if ( (_objects isEqualTo [] ) || (_unit distance (_array select 2) > _distance) ) then
|
||||
{
|
||||
// _objects = nearestTerrainObjects [_position, ["HIDE","ROCK","ROCKS","BUSH"], _distance];
|
||||
|
||||
_objects = nearestTerrainObjects [_position, ["HIDE","ROCK","ROCKS","BUSH","TREE","WALL","HOUSE","FENCE"], _distance];
|
||||
|
||||
// _objects = nearestTerrainObjects [_position, ["TREE","WALL","HOUSE","FENCE"], _distance];
|
||||
|
||||
// _objects = nearestTerrainObjects [_position, ["TREE","WALL","HOUSE","FENCE"], _distance];
|
||||
|
||||
_array set [1, _objects];
|
||||
|
||||
_array set [2, (getPos _unit) ];
|
||||
|
||||
// player sideChat format ["TCL_Take_Cover_F > Objects > %1 > %2", _unit, (count _objects) ];
|
||||
};
|
||||
|
||||
_objects = _objects - (TCL_Take_Cover select 1);
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {};
|
||||
|
||||
if (False) exitWith
|
||||
{
|
||||
_return = (_objects select 0);
|
||||
};
|
||||
|
||||
private "_object";
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _objects - 1) do
|
||||
{
|
||||
_object = (_objects select _count);
|
||||
|
||||
if ( (_unit distance _waypoint < _distance) || ( (_unit distance _enemy) > (_enemy distance _object) ) ) then
|
||||
|
||||
// if ( (_bool) || (_unit distance _waypoint < _distance) || ( (_unit distance _enemy) > (_enemy distance _object) ) ) then
|
||||
{
|
||||
if (True) then
|
||||
|
||||
// if ( ( (_unit distance _object) < (_enemy distance _object) ) || (_unit distance _object > 5) || (_enemy distance _object > 5) ) then
|
||||
{
|
||||
// player sideChat format ["TCL_Take_Cover_F > Object > %1", _object];
|
||||
|
||||
if (False) exitWith
|
||||
|
||||
// if ( (boundingBox _object select 1) findIf { ( (_x < 0.7) || (_x > 7) ) } > -1) exitWith
|
||||
{
|
||||
// player sideChat format ["TCL_Take_Cover_F > BoundingBox > %1", _object];
|
||||
};
|
||||
|
||||
if (False) exitWith
|
||||
|
||||
// if ( (TCL_Take_Cover select 1) findIf { (_object distance _x < 5) } > -1) exitWith
|
||||
{
|
||||
// player sideChat format ["TCL_Take_Cover_F > Distance > %1", _object];
|
||||
};
|
||||
|
||||
_return = _object;
|
||||
};
|
||||
};
|
||||
|
||||
if (alive _return) exitWith
|
||||
{
|
||||
// player sideChat format ["TCL_Take_Cover_F > Exit > %1 > %2 > %3", _unit, _count, (count _objects) ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Take Cover Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Take Cover
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_enemy","_group","_object","_bool"];
|
||||
|
||||
// player sideChat format ["TCL_Take_Cover_F > %1 > %2 > %3 > %4", _object, (typeOf _object), (sizeOf typeOf _object), (boundingBox _object select 1) ];
|
||||
|
||||
private _random = 50;
|
||||
|
||||
if (_unit distance _object > 10) then
|
||||
{
|
||||
_random = 75;
|
||||
};
|
||||
|
||||
if (floor (random 100) < _random) then
|
||||
{
|
||||
_unit setUnitPos "UP";
|
||||
}
|
||||
else
|
||||
{
|
||||
_unit setUnitPos "MIDDLE";
|
||||
};
|
||||
|
||||
private ["_marker","_text"];
|
||||
|
||||
if (TCL_Debug select 3) then
|
||||
{
|
||||
_marker = [ [_unit, time], (getPos _object), "Icon", [1,1], "mil_triangle", "colorWhite"] call TCL_Create_Marker_F;
|
||||
|
||||
_text = {format ["%1 ( Take Cover ) %2 %3 ", _unit, (_unit distance _object), _object] };
|
||||
|
||||
_marker setMarkerText call _text;
|
||||
};
|
||||
|
||||
private _direction = (_object getDir _enemy);
|
||||
|
||||
private _boundingBox = (boundingBox _object select 1 select 0);
|
||||
|
||||
// _boundingBox = _boundingBox + 1;
|
||||
|
||||
// player sideChat format ["TCL_Take_Cover_F > BoundingBox > %1 > %2 > %3", _unit, _object, (boundingBox _object select 1) ];
|
||||
|
||||
if (_boundingBox > 3) then
|
||||
{
|
||||
_boundingBox = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_boundingBox < 1) then
|
||||
{
|
||||
_boundingBox = _boundingBox + 1;
|
||||
};
|
||||
};
|
||||
|
||||
// _boundingBox = 1;
|
||||
|
||||
_cover = [_object, - _boundingBox, _direction] call TCL_Real_Pos_F;
|
||||
|
||||
_unit doMove _cover;
|
||||
|
||||
private _spot = objNull;
|
||||
|
||||
if (TCL_Debug select 6) then
|
||||
{
|
||||
_spot = createVehicle ["Sign_Arrow_Large_Blue_F", _cover, [], 0, "CAN_COLLIDE"];
|
||||
};
|
||||
|
||||
// _unit disableAI "AUTOTARGET";
|
||||
|
||||
// _unit doWatch _cover;
|
||||
|
||||
// _unit doWatch objNull;
|
||||
|
||||
// _unit commandWatch objNull;
|
||||
|
||||
private _time = (time + 10);
|
||||
|
||||
_time = _time + (_unit distance _cover);
|
||||
|
||||
while { ( (alive _unit) && { (time < _time) } ) } do
|
||||
{
|
||||
// if (_unit distance _cover < 5) then {_unit setUnitPos "MIDDLE"};
|
||||
|
||||
// if ( (unitReady _unit) || (_unit distance _cover < 1) ) exitWith
|
||||
|
||||
// if (_unit distance _cover < _boundingBox) exitWith
|
||||
|
||||
// if (_unit distance2D _cover < 1) exitWith
|
||||
|
||||
// if ( (unitReady _unit) && { (_unit distance _cover < _boundingBox) } ) exitWith
|
||||
|
||||
if (_unit distance2D _cover < _boundingBox) exitWith
|
||||
{
|
||||
// player sideChat format ["TCL_Take_Cover_F > BoundingBox > %1 > %2 > %3", _unit, _object, (boundingBox _object select 1) ];
|
||||
|
||||
// player sideChat format ["TCL_Take_Cover_F > %1 > %2 > %3", _unit, (_unit distance _cover), (boundingBox _object select 1 select 2) ];
|
||||
};
|
||||
|
||||
if (TCL_Debug select 3) then
|
||||
{
|
||||
_marker setMarkerText call _text;
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
if (TCL_Debug select 3) then
|
||||
{
|
||||
deleteMarker _marker;
|
||||
};
|
||||
|
||||
if (alive _spot) then
|
||||
{
|
||||
deleteVehicle _spot;
|
||||
};
|
||||
|
||||
if (alive _unit) then
|
||||
|
||||
// if ( (alive _unit) && { (_unit distance _cover < 3) } ) then
|
||||
{
|
||||
if (time < _time) then
|
||||
{
|
||||
if (TCL_Debug select 6) then
|
||||
{
|
||||
_spot = createVehicle ["Sign_Arrow_Large_Green_F", _cover, [], 0, "CAN_COLLIDE"];
|
||||
};
|
||||
|
||||
// sleep 1;
|
||||
|
||||
// if ( (unitReady _unit) || (floor (random 100) < 50) || (_unit in (TCL_Flanking select 1) ) ) then
|
||||
|
||||
// if (_unit distance _cover < 1) then
|
||||
|
||||
// if ( (unitReady _unit) || (_unit in (TCL_Flanking select 1) ) ) then
|
||||
|
||||
if (True) then
|
||||
{
|
||||
_unit forceSpeed 0;
|
||||
|
||||
player sideChat format ["TCL_Take_Cover_F > Ready > %1", _unit];
|
||||
};
|
||||
|
||||
_unit doWatch (getPos _enemy);
|
||||
|
||||
// _unit enableAI "AUTOTARGET";
|
||||
|
||||
_boundingBox = (boundingBox _object select 1 select 2);
|
||||
|
||||
if (_boundingBox > 1.4) then
|
||||
{
|
||||
_unit setUnitPos "UP";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_boundingBox > 1.0) then
|
||||
{
|
||||
if (floor (random 100) < 15) then
|
||||
{
|
||||
_unit setUnitPos "UP";
|
||||
}
|
||||
else
|
||||
{
|
||||
_unit setUnitPos "MIDDLE";
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_unit setUnitPos "DOWN";
|
||||
};
|
||||
};
|
||||
|
||||
// _unit setUnitPos "AUTO";
|
||||
|
||||
if ( (floor (random 100) < 50) && { (_unit distance _enemy < 500) } ) then
|
||||
{
|
||||
sleep 10 + (random 30);
|
||||
|
||||
if (combatMode _group isEqualTo "YELLOW") then
|
||||
{
|
||||
sleep 10 + (random 30);
|
||||
};
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
if (_bool) then
|
||||
{
|
||||
sleep 10 + (random 30);
|
||||
};
|
||||
|
||||
_group = (group _unit);
|
||||
|
||||
private _waypoint = (_group getVariable "TCL_Waypoint");
|
||||
|
||||
if (_unit distance _waypoint < 100) then
|
||||
{
|
||||
if (alive _spot) then
|
||||
{
|
||||
deleteVehicle _spot;
|
||||
|
||||
_spot = createVehicle ["Sign_Arrow_Large_F", _cover, [], 0, "CAN_COLLIDE"];
|
||||
};
|
||||
|
||||
sleep 10 + (random 30);
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
sleep 10 + (random 30);
|
||||
};
|
||||
|
||||
// sleep 10 + (random 30);
|
||||
|
||||
_random = 35;
|
||||
|
||||
if (_unit in (TCL_Flanking select 1) ) then
|
||||
{
|
||||
private _value = (TCL_Feature select 19);
|
||||
|
||||
_random = (_random + _value);
|
||||
|
||||
_random = 100;
|
||||
};
|
||||
|
||||
if (floor (random 100) < _random) then
|
||||
{
|
||||
_time = (time + 10);
|
||||
|
||||
_random = (random 30);
|
||||
|
||||
_time = (_time + _random);
|
||||
|
||||
TCL_DeleteAT(TCL_Take_Cover,0,_unit);
|
||||
|
||||
if (alive _spot) then
|
||||
{
|
||||
deleteVehicle _spot;
|
||||
|
||||
_spot = createVehicle ["Sign_Arrow_Large_Yellow_F", _cover, [], 0, "CAN_COLLIDE"];
|
||||
};
|
||||
|
||||
while { (alive _unit) } do
|
||||
{
|
||||
if ( (time > _time) || (_unit in (TCL_Take_Cover select 0) ) ) exitWith
|
||||
{
|
||||
_unit forceSpeed -1;
|
||||
|
||||
// player sideChat format ["TCL_Take_Cover_F > %1", _unit];
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_unit forceSpeed -1;
|
||||
};
|
||||
|
||||
if (alive _spot) then
|
||||
{
|
||||
deleteVehicle _spot;
|
||||
};
|
||||
};
|
||||
|
||||
_unit setUnitPos "AUTO";
|
||||
|
||||
// private _leader = (leader _group);
|
||||
|
||||
// _unit doFollow _leader;
|
||||
|
||||
TCL_DeleteAT(TCL_Take_Cover,0,_unit);
|
||||
|
||||
// [_unit, _group] call (TCL_Follow_F select 0);
|
||||
|
||||
sleep 10 + (random 30);
|
||||
|
||||
TCL_DeleteAT(TCL_Take_Cover,1,_object);
|
||||
}
|
||||
else
|
||||
{
|
||||
TCL_DeleteAT(TCL_Take_Cover,0,_unit);
|
||||
|
||||
TCL_DeleteAT(TCL_Take_Cover,1,_object);
|
||||
};
|
||||
|
||||
// private _leader = (leader _group);
|
||||
|
||||
// _unit doFollow (leader _unit);
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,227 @@
|
||||
TCL_Artillery_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic"];
|
||||
|
||||
if (TCL_Feature select 9) then
|
||||
{
|
||||
if (floor (random 100) < (TCL_Feature select 10) ) then
|
||||
{
|
||||
private _condition = (_logic getVariable "TCL_Artillery");
|
||||
|
||||
if (_condition select 0) then
|
||||
{
|
||||
private _alpha = _group;
|
||||
|
||||
private _leader = (leader _alpha);
|
||||
|
||||
private _groups = (TCL_Artillery select 0);
|
||||
|
||||
_groups = _groups select {_vehicle = (vehicle leader _x); ( (alive _vehicle) && { (canFire _vehicle) } && { (someAmmo _vehicle) } && { (side _alpha getFriend side _x > 0.6) } ) };
|
||||
|
||||
if (_groups isEqualTo [] ) exitWith {};
|
||||
|
||||
private _distance = (_alpha getVariable "TCL_AI" select 3);
|
||||
|
||||
private _position = (getPos _logic);
|
||||
|
||||
private ["_bravo","_vehicle","_magazine","_range"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _groups - 1) do
|
||||
{
|
||||
_bravo = (_groups select _count);
|
||||
|
||||
_vehicle = (vehicle leader _bravo);
|
||||
|
||||
_magazine = (getArtilleryAmmo [_vehicle] select 0);
|
||||
|
||||
_range = _position inRangeOfArtillery [crew _vehicle, _magazine];
|
||||
|
||||
player sideChat format ["TCL_Artillery_F > Range > %1", _range];
|
||||
|
||||
if ( (_vehicle getVariable "TCL_Artillery") && { (_range) } && { (_leader distance _vehicle < _distance) } ) then
|
||||
{
|
||||
_condition set [0, False];
|
||||
|
||||
// _logic setVariable ["TCL_Artillery", False];
|
||||
|
||||
_vehicle setVariable ["TCL_Artillery", False];
|
||||
|
||||
[_enemy, _logic, _vehicle, _condition] spawn (TCL_Artillery_F select 1);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_logic","_vehicle","_condition"];
|
||||
|
||||
private _time = 10 + (random 30);
|
||||
|
||||
// _time = _time + (random 50);
|
||||
|
||||
player sideChat format ["TCL_Artillery_F > Artillery > %1", _vehicle];
|
||||
|
||||
sleep _time;
|
||||
|
||||
if ( [_logic, _vehicle] call (TCL_Artillery_F select 2) ) then
|
||||
{
|
||||
private _bool = False;
|
||||
|
||||
if (TCL_Sound) then
|
||||
{
|
||||
_bool = True;
|
||||
};
|
||||
|
||||
_condition set [1, True];
|
||||
|
||||
_vehicle doWatch (getPos _logic);
|
||||
|
||||
sleep 5 + (random 10);
|
||||
|
||||
private _magazine = (getArtilleryAmmo [_vehicle] select 0);
|
||||
|
||||
private _ammo = getText (configfile >> "CfgMagazines" >> _magazine >> "ammo");
|
||||
|
||||
private _count = 3 + (random 5);
|
||||
|
||||
_vehicle doArtilleryFire [ (getPos _logic), _magazine, _count];
|
||||
|
||||
if (True) exitWith {};
|
||||
|
||||
while { (_count > 0) } do
|
||||
{
|
||||
_vehicle doArtilleryFire [ (getPos _logic), _magazine, _count];
|
||||
|
||||
_count = _count - 1;
|
||||
|
||||
sleep 3 + (random 5);
|
||||
};
|
||||
|
||||
if (True) exitWith {};
|
||||
|
||||
if ( (_vehicle isKindOf "Tank") && { (isNull objectParent _enemy) } ) then
|
||||
{
|
||||
// _ammo = "Sh_82mm_AMOS";
|
||||
};
|
||||
|
||||
// _ammo = "Sh_155mm_AMOS";
|
||||
|
||||
// _ammo = "Cluster_155mm_AMOS";
|
||||
|
||||
private _range = 30;
|
||||
|
||||
private _random = (random 50);
|
||||
|
||||
private _distance = (_range + _random);
|
||||
|
||||
private _position = (getPos _logic);
|
||||
|
||||
private ["_random","_distance","_shell"];
|
||||
|
||||
private _count = 7 + (random 10);
|
||||
|
||||
while { (_count > 0) } do
|
||||
{
|
||||
private _random = (random 30);
|
||||
|
||||
private _distance = (_range + _random);
|
||||
|
||||
_shell = _ammo createVehicle [ (_position select 0) + (random _distance - random _distance), (_position select 1) + (random _distance - random _distance), 100];
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
if (floor (random 100) < (TCL_FX select 3) ) then
|
||||
{
|
||||
if (TCL_Multiplayer) then
|
||||
{
|
||||
TCL_Public = [_shell];
|
||||
|
||||
publicVariable "TCL_Public";
|
||||
|
||||
if (TCL_Dedicated) exitWith {};
|
||||
|
||||
[_shell] spawn (TCL_Whiz_FX_F select 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
[_shell] spawn (TCL_Whiz_FX_F select 2);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_shell setVelocity [0,0,-100];
|
||||
|
||||
sleep 3 + (random 5);
|
||||
|
||||
_count = _count - 1;
|
||||
};
|
||||
|
||||
_condition set [1, False];
|
||||
|
||||
sleep 5 + (random 10);
|
||||
|
||||
_vehicle doWatch objNull;
|
||||
|
||||
sleep 150 + (random 170);
|
||||
}
|
||||
else
|
||||
{
|
||||
sleep 30 + (random 50);
|
||||
};
|
||||
|
||||
_condition set [0, True];
|
||||
|
||||
_vehicle setVariable ["TCL_Artillery", True];
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_logic","_vehicle"];
|
||||
|
||||
private _return = True;
|
||||
|
||||
private _objects = _logic nearEntities [ ["CAManBase","Car","Tank","Helicopter"], 100];
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {_return};
|
||||
|
||||
private "_object";
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _objects - 1) do
|
||||
{
|
||||
_object = (_objects select _count);
|
||||
|
||||
if ( (alive _object) && { (side _object getFriend side _vehicle > 0.6) } ) exitWith
|
||||
{
|
||||
_return = False;
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,180 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Flanking_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
private _array = [];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
if (count _units > 1) then
|
||||
{
|
||||
|
||||
private _random = 3 - (random 1);
|
||||
|
||||
_value = (count _units / _random);
|
||||
|
||||
(TCL_Flanking select 0) pushBack _group;
|
||||
|
||||
private "_unit";
|
||||
|
||||
private _count = (count _units - 1);
|
||||
|
||||
while { (_count > _value) } do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
_array pushBack _unit;
|
||||
|
||||
_count = _count - 1;
|
||||
};
|
||||
|
||||
if (floor (random 100) < (TCL_Feature select 20) ) then
|
||||
{
|
||||
(TCL_Flanking select 1) append _array;
|
||||
|
||||
player sideChat format ["TCL_Flanking_F > Flanking #1 > %1 > %2", _group, _array];
|
||||
}
|
||||
else
|
||||
{
|
||||
_units = _units - _array;
|
||||
|
||||
if (floor (random 100) < (TCL_Feature select 21) ) then
|
||||
{
|
||||
(TCL_Flanking select 1) append _array;
|
||||
|
||||
(TCL_Flanking select 2) append _units;
|
||||
|
||||
player sideChat format ["TCL_Flanking_F > Flanking #2 > %1 > %2", _group, _units];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (floor (random 100) < (TCL_Feature select 22) ) then
|
||||
{
|
||||
_units = _units select { (floor (random 100) < 75) };
|
||||
|
||||
// _units = (_units / _random);
|
||||
|
||||
(TCL_Flanking select 1) append _array;
|
||||
|
||||
(TCL_Flanking select 2) append _units;
|
||||
|
||||
player sideChat format ["TCL_Flanking_F > Flanking #3 > %1 > %2", _group, _units];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_enemy","_position","_distance"];
|
||||
|
||||
private _value = 30;
|
||||
|
||||
private _bool = True;
|
||||
|
||||
private _random = (random 50);
|
||||
|
||||
_value = (_value + _random);
|
||||
|
||||
private _direction = (_unit getDir _enemy);
|
||||
|
||||
if (_unit in (TCL_Flanking select 1) ) then
|
||||
{
|
||||
_direction = (_direction + _value);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_unit in (TCL_Flanking select 2) ) exitWith
|
||||
{
|
||||
_direction = (_direction - _value);
|
||||
};
|
||||
|
||||
_bool = False;
|
||||
};
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
_position = [_unit, _distance, _direction] call TCL_Real_Pos_F;
|
||||
|
||||
if (TCL_Debug select 6) then
|
||||
{
|
||||
[_position] spawn (TCL_Flanking_F select 2);
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Take_Cover_F > Direction > %1 > %2", _unit, _direction];
|
||||
};
|
||||
|
||||
_position
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_position"];
|
||||
|
||||
private _spot = createVehicle ["Sign_Arrow_Large_Yellow_F", _position, [], 0, "CAN_COLLIDE"];
|
||||
|
||||
sleep 5;
|
||||
|
||||
deleteVehicle _spot;
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Flanking
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_flanking"];
|
||||
|
||||
if (_group in (TCL_Flanking select 0) ) then
|
||||
{
|
||||
player sideChat format ["TCL_System > Flanking Out > %1", _group];
|
||||
|
||||
if (_flanking) then
|
||||
{
|
||||
(TCL_Flanking select 0) deleteAt ( (TCL_Flanking select 0) find _group);
|
||||
|
||||
TCL_Flanking set [1, (TCL_Flanking select 1) - units _group];
|
||||
|
||||
TCL_Flanking set [2, (TCL_Flanking select 2) - units _group];
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_flanking = True;
|
||||
|
||||
[_group] call (TCL_Flanking_F select 0);
|
||||
|
||||
if (_flanking) then
|
||||
{
|
||||
// (TCL_Flanking select 0) pushBack _group;
|
||||
|
||||
player sideChat format ["TCL_System > Flanking In > %1", _group];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,521 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Rearm_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group"];
|
||||
|
||||
private ["_magazine","_count","_magazines","_array","_ammo","_value"];
|
||||
|
||||
private _weapon = (primaryWeapon _unit);
|
||||
|
||||
if (_weapon isEqualTo "") then
|
||||
{
|
||||
_ammo = 0;
|
||||
|
||||
_count = 0;
|
||||
|
||||
_magazine = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
_magazines = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines");
|
||||
|
||||
_magazine = (_magazines select 0);
|
||||
|
||||
_array = [];
|
||||
|
||||
_array = (magazines _unit) select { (_x in _magazines) };
|
||||
|
||||
// _array = (magazines _unit) select { (_x isEqualTo _magazine) };
|
||||
|
||||
// _ammo = getNumber (configfile >> "CfgMagazines" >> _magazine >> "count");
|
||||
|
||||
_count = (count _array);
|
||||
|
||||
_ammo = (_unit ammo _weapon);
|
||||
|
||||
// _value = (_ammo * _magazines);
|
||||
};
|
||||
|
||||
if ( (_count < 3) && { (_ammo < 50) } ) then
|
||||
{
|
||||
[_unit, _group, _magazine] call (TCL_Rearm_F select 1);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Magazine > %1 > %2 > %3 > %4 > %5", _unit, _ammo, _value, _magazine, _magazines];
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_magazine"];
|
||||
|
||||
if (True) then
|
||||
{
|
||||
private _objects = nearestObjects [_unit, ["CAManBase"], 100];
|
||||
|
||||
_objects = _objects - (TCL_Rearm select 2);
|
||||
|
||||
private _array = [];
|
||||
|
||||
_array = _objects select { ( (alive _x) || (_unit knowsAbout _x == 0) ) };
|
||||
|
||||
_objects = _objects - _array;
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith
|
||||
{
|
||||
_objects = nearestObjects [_unit, ["LandVehicle"], 100];
|
||||
|
||||
_objects = _objects - (TCL_Rearm select 2);
|
||||
|
||||
_objects = _objects select { ( (alive _x) && { (crew _x isEqualTo [] ) } ) };
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {};
|
||||
|
||||
private _object = (_objects select 0);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Vehicle > %1 > %2", _unit, _object];
|
||||
|
||||
_magazines = (magazineCargo _object);
|
||||
|
||||
if (_magazines isEqualTo [] ) exitWith {};
|
||||
|
||||
if (_magazine in _magazines) then
|
||||
{
|
||||
(TCL_Rearm select 0) pushBack _unit;
|
||||
|
||||
// (TCL_Rearm select 1) pushBack _unit;
|
||||
|
||||
(TCL_Rearm select 2) pushBack _object;
|
||||
|
||||
_array = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines");
|
||||
|
||||
_index = [];
|
||||
|
||||
_magazines = _magazines select { (_x in _array) } apply {_index pushBack (_magazines find _x) };
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Cargo > %1 > %2", _unit, _index];
|
||||
|
||||
[_unit, _group, _object, _magazines] spawn (TCL_Rearm_F select 3);
|
||||
|
||||
player sideChat format ["TCL_Rearm_F > Vehicle > %1 > %2", _unit, _object];
|
||||
};
|
||||
};
|
||||
|
||||
private _object = (_objects select 0);
|
||||
|
||||
private _bool = [_unit, _group, _magazine, _objects] call (TCL_Rearm_F select 2);
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
_objects = nearestObjects [_object, ["WeaponHolderSimulated"], 5];
|
||||
|
||||
_objects = _objects - (TCL_Rearm select 2);
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {};
|
||||
|
||||
private _dummy = (_objects select 0);
|
||||
|
||||
private _weapons = (weaponCargo _dummy);
|
||||
|
||||
private _weapon = (_weapons select 0);
|
||||
|
||||
(TCL_Rearm select 0) pushBack _unit;
|
||||
|
||||
// (TCL_Rearm select 1) pushBack _unit;
|
||||
|
||||
// (TCL_Rearm select 2) pushBack _object;
|
||||
|
||||
(TCL_Rearm select 2) pushBack _dummy;
|
||||
|
||||
[_unit, _group, _object, _dummy, _weapon] spawn (TCL_Rearm_F select 3);
|
||||
|
||||
player sideChat format ["TCL_Rearm_F > Weapon > %1 > %2", _unit, _object];
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_magazine","_objects"];
|
||||
|
||||
private _return = True;
|
||||
|
||||
if (_magazine isEqualTo "") exitWith {_return};
|
||||
|
||||
private ["_object","_magazines","_array"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _objects - 1) do
|
||||
{
|
||||
_object = (_objects select _count);
|
||||
|
||||
_magazines = (magazines _object);
|
||||
|
||||
if (_magazine in _magazines) exitWith
|
||||
{
|
||||
_return = False;
|
||||
|
||||
(TCL_Rearm select 0) pushBack _unit;
|
||||
|
||||
// (TCL_Rearm select 1) pushBack _unit;
|
||||
|
||||
(TCL_Rearm select 2) pushBack _object;
|
||||
|
||||
_array = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines");
|
||||
|
||||
_magazines = _magazines select { (_x in _array) };
|
||||
|
||||
[_unit, _group, _object, _magazines] spawn (TCL_Rearm_F select 3);
|
||||
|
||||
player sideChat format ["TCL_Rearm_F > Magazines > %1 > %2", _unit, _object];
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_object"];
|
||||
|
||||
private _bool = True;
|
||||
|
||||
private _time = (time + 10);
|
||||
|
||||
private _position = (getPos _object);
|
||||
|
||||
private _boundingBox = (boundingBox _object select 1 select 1);
|
||||
|
||||
_position set [1, (_position select 1) - _boundingBox];
|
||||
|
||||
_unit doMove _position;
|
||||
|
||||
// (TCL_Rearm select 0) pushBack _unit;
|
||||
|
||||
(TCL_Rearm select 1) pushBack _unit;
|
||||
|
||||
// (TCL_Rearm select 2) pushBack _object;
|
||||
|
||||
private _distance = (_unit distance _object);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Unit > %1 > %2", _unit, _object];
|
||||
|
||||
_time = (_time + _distance);
|
||||
|
||||
while { ( (alive _unit) && { (time < _time) } ) } do
|
||||
{
|
||||
if (_unit distance _position < _boundingBox) exitWith
|
||||
{
|
||||
_bool = False;
|
||||
|
||||
_unit forceSpeed 0;
|
||||
|
||||
_unit doWatch _object;
|
||||
|
||||
_unit setUnitPos "MIDDLE";
|
||||
|
||||
sleep 1;
|
||||
|
||||
// _unit playMove "Acts_AidlPercMstpSlowWrflDnon_pissing";
|
||||
|
||||
if (count _this == 4) then
|
||||
{
|
||||
private _magazines = (_this select 3);
|
||||
|
||||
[_unit, _group, _object, _magazines] spawn (TCL_Rearm_F select 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
private _dummy = (_this select 3);
|
||||
|
||||
private _weapon = (_this select 4);
|
||||
|
||||
[_unit, _group, _object, _dummy, _weapon] spawn (TCL_Rearm_F select 5);
|
||||
};
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
[_unit, _group, _object, _bool] spawn (TCL_Rearm_F select 6);
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #4
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_object","_magazines"];
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
private _bool = False;
|
||||
|
||||
private _magazine = (_magazines select 0);
|
||||
|
||||
_unit action ["TakeMagazine", _object, _magazine];
|
||||
|
||||
// {_object removeMagazine _x} count _magazines;
|
||||
|
||||
_magazines deleteAt (_magazines find _magazine);
|
||||
|
||||
if (False) then
|
||||
{
|
||||
// [_unit, _group, _object, _magazines] call (TCL_Rearm_F select 7);
|
||||
|
||||
if (False) then
|
||||
{
|
||||
|
||||
_cargo = (magazineCargo _object);
|
||||
|
||||
_index = (_cargo find _magazine);
|
||||
|
||||
if (_index != -1) then
|
||||
{
|
||||
private _count = 0;
|
||||
|
||||
clearMagazineCargo _object;
|
||||
|
||||
// {if (_index != _count) then
|
||||
{
|
||||
// _object addMagazineCargo [_x, 1];
|
||||
};
|
||||
|
||||
_count = _count + 1;
|
||||
|
||||
// } forEach _cargo;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
private _count = (count magazines _unit);
|
||||
|
||||
// _count = (magazineCargo _object);
|
||||
|
||||
// {_unit addMagazine _x; if (count magazines _unit > _count) then {_count = (count magazines _unit); _object removeMagazine _x} else {_bool = True} } count _magazines;
|
||||
|
||||
_array = [];
|
||||
|
||||
private _index = 0;
|
||||
|
||||
{_unit addMagazine _x;
|
||||
|
||||
if (count magazines _unit isEqualTo _count) exitWith
|
||||
{
|
||||
_bool = True;
|
||||
};
|
||||
|
||||
_count = (count magazines _unit);
|
||||
|
||||
_index = _index + 1;
|
||||
|
||||
_array = _array + [_x];
|
||||
|
||||
_object removeMagazine _x;
|
||||
|
||||
} count _magazines;
|
||||
|
||||
if (alive _object) then
|
||||
{
|
||||
_cargo = (magazineCargo _object);
|
||||
|
||||
clearMagazineCargo _object;
|
||||
|
||||
_count = 0;
|
||||
|
||||
for "_count" from _count to (count _cargo - 1) do
|
||||
{
|
||||
_magazine = (_cargo select _count);
|
||||
|
||||
if (_magazine in _array) then
|
||||
{
|
||||
_array deleteAt (_array find _magazine);
|
||||
|
||||
// _object addMagazineCargo [_magazine, 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
// _object addMagazineCargo [_magazine, 1];
|
||||
};
|
||||
};
|
||||
|
||||
player sideChat format ["TCL_Rearm_F > Magazines > %1 > %2", _unit, (count _cargo), count (magazineCargo _object) ];
|
||||
};
|
||||
|
||||
if (count _magazines > _index) then
|
||||
{
|
||||
_bool = True;
|
||||
};
|
||||
};
|
||||
|
||||
player sideChat format ["TCL_Rearm_F > Magazines > %1 > %2", _unit, _bool];
|
||||
|
||||
// _unit addMagazines [_magazine, (count _magazines) ];
|
||||
|
||||
sleep 3;
|
||||
|
||||
_unit selectWeapon (primaryWeapon _unit);
|
||||
|
||||
[_unit, _group, _object, _bool] spawn (TCL_Rearm_F select 6);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Magazines > %1", _unit];
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #5
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_object","_dummy","_weapon"];
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
private _bool = False;
|
||||
|
||||
// private _array = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines");
|
||||
|
||||
// private _magazines = (magazines _object) select { (_x in _array) };
|
||||
|
||||
if (primaryWeapon _unit isEqualTo "") then
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
_unit action ["DropWeapon", _dummy, (primaryWeapon _unit) ];
|
||||
|
||||
sleep 3;
|
||||
};
|
||||
|
||||
_unit action ["TakeWeapon", _dummy, _weapon];
|
||||
|
||||
sleep 3;
|
||||
|
||||
// {_unit addMagazine _x} count _magazines;
|
||||
|
||||
_unit action ["REARM", _object];
|
||||
|
||||
_unit selectWeapon (primaryWeapon _unit);
|
||||
|
||||
[_unit, _group, _dummy, _bool] spawn (TCL_Rearm_F select 6);
|
||||
|
||||
// player sideChat format ["TCL_Rearm_F > Weapon > %1", _unit];
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #6
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_object","_bool"];
|
||||
|
||||
_unit forceSpeed -1;
|
||||
|
||||
_unit doWatch objNull;
|
||||
|
||||
_unit setUnitPos "AUTO";
|
||||
|
||||
TCL_DeleteAT(TCL_Rearm,0,_unit);
|
||||
|
||||
[_unit, _group] call (TCL_Follow_F select 0);
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
sleep 10 + (random 30);
|
||||
|
||||
TCL_DeleteAT(TCL_Rearm,2,_object);
|
||||
}
|
||||
else
|
||||
{
|
||||
sleep 30 + (random 50);
|
||||
};
|
||||
|
||||
TCL_DeleteAT(TCL_Rearm,1,_unit);
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm Function #7
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rearm
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_object","_magazines"];
|
||||
|
||||
private _count = (count magazines _unit);
|
||||
|
||||
private _cargo = (magazineCargo _object);
|
||||
|
||||
private _index = 0;
|
||||
|
||||
private _array = [];
|
||||
|
||||
private "_magazine";
|
||||
|
||||
{_unit addMagazine _x;
|
||||
|
||||
if (count magazines _unit isEqualTo _count) exitWith
|
||||
{
|
||||
_bool = True;
|
||||
};
|
||||
|
||||
_count = (count magazines _unit);
|
||||
|
||||
_index = _index + 1;
|
||||
|
||||
_magazine = (_cargo find _x);
|
||||
|
||||
_array pushBack _magazine;
|
||||
|
||||
} forEach _magazines;
|
||||
|
||||
if (count _magazines > _index) then
|
||||
{
|
||||
_bool = True;
|
||||
};
|
||||
|
||||
player sideChat format ["TCL_Rearm_F > Cargo > %1 > %2 > %3", _unit, _array, _cargo];
|
||||
|
||||
True
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,82 @@
|
||||
TCL_Regroup_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Regroup Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Regroup by =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_logic"];
|
||||
|
||||
private _condition = (_group getVariable "TCL_AI" select 8);
|
||||
|
||||
if (_condition) then
|
||||
{
|
||||
private _array = ( (TCL_Hold select 0) + (TCL_Defend select 0) + (TCL_Location select 0) );
|
||||
|
||||
if (_group in _array) exitWith {};
|
||||
|
||||
if ( { ( (alive _x) && (isNull objectParent _x) ) } count (units _group) < 3) then
|
||||
{
|
||||
private _groups = (_logic getVariable "TCL_Reinforcement");
|
||||
|
||||
_groups = _groups - [_group];
|
||||
|
||||
if (count _groups > 0) then
|
||||
{
|
||||
[_group, _logic, _groups] call (TCL_Regroup_F select 1);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Regroup Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Regroup by =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_logic","_groups"];
|
||||
|
||||
private _alpha = _group;
|
||||
|
||||
private _leader = (leader _alpha);
|
||||
|
||||
if (_leader == vehicle _leader) then
|
||||
{
|
||||
private _rank = [_leader] call TCL_Rank_F;
|
||||
|
||||
private "_bravo";
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _groups - 1) do
|
||||
{
|
||||
_bravo = (_groups select _count);
|
||||
|
||||
if ( { ( (alive _x) && (_x == vehicle _x) && (_x distance _leader < 100) ) } count (units _bravo) >= { ( (alive _x) && (_x == vehicle _x) && (_x distance _leader < 100) ) } count (units _alpha) ) then
|
||||
{
|
||||
if ( [_alpha, _bravo] call (TCL_KnowsAbout_F select 3) ) then
|
||||
{
|
||||
if (_rank <= [leader _bravo] call TCL_Rank_F) then
|
||||
{
|
||||
["TCL_Position", _alpha] call (TCL_Marker_F select 0);
|
||||
|
||||
// player sideChat format ["TCL_Join_F > Group > %1", _alpha];
|
||||
|
||||
private _units = (units _alpha);
|
||||
|
||||
_units join _bravo;
|
||||
|
||||
{if (count assignedVehicleRole _x > 0) then { [_x] orderGetIn False; [_x] allowGetIn False} } forEach _units;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,262 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Static_Weapon_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group"];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _array = ( (TCL_Static_Weapon select 0) + (TCL_House_Search select 0) );
|
||||
|
||||
_units = _units - _array;
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
_units deleteAt (_units find _leader);
|
||||
|
||||
_units = _units select { ( (alive _x) && { (isNull objectParent _x) } ) };
|
||||
|
||||
if (count _units > 1) then
|
||||
{
|
||||
private _unit = _units select (count _units - 1);
|
||||
|
||||
private _vehicle = [_unit, _group] call (TCL_Static_Weapon_F select 1);
|
||||
|
||||
if (alive _vehicle) then
|
||||
{
|
||||
private _bool = True;
|
||||
|
||||
if (_group in (TCL_Hold select 0) ) then
|
||||
{
|
||||
_bool = [_group, _vehicle] call TCL_Trigger_F;
|
||||
};
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
[_unit, _group, _vehicle] spawn (TCL_Static_Weapon_F select 2);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group"];
|
||||
|
||||
private _return = objNull;
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
private _objects = _unit nearEntities ["StaticWeapon", 100];
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {_return};
|
||||
|
||||
_objects = _objects - (TCL_Static_Weapon select 1);
|
||||
|
||||
_objects = _objects select { ( (alive _x) && { (someAmmo _x) } && { (_unit knowsAbout _x > 0) } && { (_x distance _leader < 100) } ) };
|
||||
|
||||
private ["_vehicle","_side","_crew"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _objects - 1) do
|
||||
{
|
||||
_vehicle = (_objects select _count);
|
||||
|
||||
_side = False;
|
||||
|
||||
if (getNumber (configFile >> "CfgVehicles" >> (typeOf _unit) >> "side") isEqualTo getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "side") ) then
|
||||
{
|
||||
_side = True;
|
||||
};
|
||||
|
||||
_crew = (crew _vehicle);
|
||||
|
||||
if ( (_side) && { (_crew isEqualTo [] ) } ) exitWith
|
||||
{
|
||||
_return = _vehicle;
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_vehicle"];
|
||||
|
||||
_unit disableAI "AUTOTARGET";
|
||||
|
||||
_unit assignAsGunner _vehicle;
|
||||
|
||||
_unit doMove (getPos _vehicle);
|
||||
|
||||
(TCL_Static_Weapon select 0) pushBack _unit;
|
||||
|
||||
(TCL_Static_Weapon select 1) pushBack _vehicle;
|
||||
|
||||
[_unit] orderGetIn True; [_unit] allowGetIn True;
|
||||
|
||||
private _time = (time + 30);
|
||||
|
||||
private _distance = (_unit distance _vehicle);
|
||||
|
||||
_time = (_time + _distance);
|
||||
|
||||
while { ( (alive _unit) && { (time < _time) } && { (isNull objectParent _unit) } ) } do
|
||||
{
|
||||
sleep 5;
|
||||
};
|
||||
|
||||
if ( (alive _unit) && { (time < _time) } && { (_unit == gunner _vehicle) } ) then
|
||||
{
|
||||
_unit enableAI "AUTOTARGET";
|
||||
|
||||
[_unit, _group, _vehicle] spawn (TCL_Static_Weapon_F select 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
TCL_DeleteAT(TCL_Static_Weapon,0,_unit);
|
||||
|
||||
TCL_DeleteAT(TCL_Static_Weapon,1,_vehicle);
|
||||
|
||||
_unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False;
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Static Weapon
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_unit","_group","_vehicle"];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _behaviour = (behaviour _unit);
|
||||
|
||||
if (_behaviour isEqualTo "COMBAT") then
|
||||
{
|
||||
{_x disableAI "AUTOCOMBAT"} count _units;
|
||||
|
||||
_group setBehaviour "AWARE";
|
||||
};
|
||||
|
||||
// (TCL_Static_Weapon select 0) pushBack _unit;
|
||||
|
||||
// (TCL_Static_Weapon select 1) pushBack _vehicle;
|
||||
|
||||
private ["_leader","_time","_random","_waypoint"];
|
||||
|
||||
while { ( (alive _unit) && { (_unit == gunner _vehicle) } ) } do
|
||||
{
|
||||
_leader = (leader _group);
|
||||
|
||||
if ( (canFire _vehicle) && { (someAmmo _vehicle) } ) then
|
||||
{
|
||||
_enemy = (_group getVariable "TCL_Enemy");
|
||||
|
||||
if ( (alive _enemy) && { (_unit knowsAbout vehicle _enemy > 0) } ) then
|
||||
{
|
||||
_time = (time + 10);
|
||||
|
||||
_random = (random 30);
|
||||
|
||||
if (True) exitWith
|
||||
{
|
||||
_magazine = (getArtilleryAmmo [_vehicle] select 0);
|
||||
|
||||
_range = (getPos _enemy) inRangeOfArtillery [crew _vehicle, _magazine];
|
||||
|
||||
if (_range) then
|
||||
{
|
||||
private _count = (random 3);
|
||||
|
||||
while { (_count > 0) } do
|
||||
{
|
||||
_vehicle doArtilleryFire [ (getPos _enemy), _magazine, 1];
|
||||
|
||||
sleep 3 + (random 5);
|
||||
|
||||
_count = _count - 1;
|
||||
};
|
||||
};
|
||||
|
||||
player sideChat format ["TCL_Static_Weapon_F > Vehicle > %1 > %2 > %3 > %4", _range, _enemy, _vehicle, _magazine];
|
||||
|
||||
sleep 10 + (random 30);
|
||||
};
|
||||
|
||||
_vehicle doTarget _enemy;
|
||||
|
||||
_time = (_time + _random);
|
||||
|
||||
while { (time < _time) } do
|
||||
{
|
||||
if (_vehicle aimedAtTarget [_enemy] > 0) exitWith
|
||||
{
|
||||
_vehicle fireAtTarget [_enemy];
|
||||
|
||||
// player sideChat format ["TCL_Static_Weapon_F > Vehicle > %1", _vehicle];
|
||||
|
||||
sleep 10 + (random 30);
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False;
|
||||
};
|
||||
|
||||
_group = (group _unit);
|
||||
|
||||
_waypoint = (_group getVariable "TCL_Waypoint");
|
||||
|
||||
// player sideChat format ["TCL_Static_Weapon_F > %1", _unit];
|
||||
|
||||
if ( (_unit distance _leader > 100) || (_unit distance _waypoint > 500) ) exitWith
|
||||
{
|
||||
_unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False;
|
||||
};
|
||||
|
||||
sleep 5;
|
||||
};
|
||||
|
||||
if (_unit == gunner _vehicle) then
|
||||
{
|
||||
_unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False;
|
||||
};
|
||||
|
||||
_group setBehaviour _behaviour;
|
||||
|
||||
TCL_DeleteAT(TCL_Static_Weapon,0,_unit);
|
||||
|
||||
sleep 10 + (random 30);
|
||||
|
||||
TCL_DeleteAT(TCL_Static_Weapon,1,_vehicle);
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,231 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Artillery_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic"];
|
||||
|
||||
if (TCL_Feature select 9) then
|
||||
{
|
||||
if (floor (random 100) < (TCL_Feature select 10) ) then
|
||||
{
|
||||
private _condition = (_logic getVariable "TCL_Artillery");
|
||||
|
||||
if (_condition select 0) then
|
||||
{
|
||||
private _echo = _group;
|
||||
|
||||
private _leader = (leader _echo);
|
||||
|
||||
private _groups = (TCL_Artillery select 0);
|
||||
|
||||
_groups = _groups select {_vehicle = (vehicle leader _x); ( (alive _vehicle) && { (alive gunner _vehicle) } && { (canFire _vehicle) } && { (someAmmo _vehicle) } && { (side _echo getFriend side _x > 0.6) } ) };
|
||||
|
||||
if (_groups isEqualTo [] ) exitWith {};
|
||||
|
||||
private _position = (getPos _logic);
|
||||
|
||||
private _distance = [_echo] call (TCL_Radio_F select 0);
|
||||
|
||||
private ["_kilo","_vehicle","_string","_magazine","_range"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _groups - 1) do
|
||||
{
|
||||
_kilo = (_groups select _count);
|
||||
|
||||
_vehicle = (vehicle leader _kilo);
|
||||
|
||||
// _string = getText ( (configfile >> "CfgVehicles" >> (typeOf _vehicle) >> "availableForSupportTypes") select 0);
|
||||
|
||||
// if (_string isEqualTo "Artillery") then
|
||||
|
||||
if (getArray (configfile >> "CfgVehicles" >> (typeOf _vehicle) >> "availableForSupportTypes") select 0 isEqualTo "Artillery") then
|
||||
{
|
||||
_magazine = (getArtilleryAmmo [_vehicle] select 0);
|
||||
|
||||
_range = _position inRangeOfArtillery [crew _vehicle, _magazine];
|
||||
|
||||
// player sideChat format ["TCL_Artillery_F > Range > %1 > %2", _range, _vehicle];
|
||||
|
||||
if ( (_vehicle getVariable "TCL_Artillery") && { (_range) } && { (_leader distance _vehicle < _distance) } ) then
|
||||
{
|
||||
_condition set [0, False];
|
||||
|
||||
_vehicle setVariable ["TCL_Artillery", False];
|
||||
|
||||
[_enemy, _kilo, _logic, _vehicle, _condition] spawn (TCL_Artillery_F select 1);
|
||||
|
||||
// player sideChat format ["TCL_Artillery_F > Range > %1 > %2", _range, _vehicle];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic","_vehicle","_condition"];
|
||||
|
||||
private _sleep = [_enemy, _group, _logic] call (TCL_KnowsAbout_F select 3);
|
||||
|
||||
sleep _sleep;
|
||||
|
||||
// private _bool = [_logic, _vehicle] call (TCL_Artillery_F select 2);
|
||||
|
||||
if (True) then
|
||||
{
|
||||
private _count = 3;
|
||||
|
||||
sleep 5 + (random 10);
|
||||
|
||||
private _gunner = (gunner _vehicle);
|
||||
|
||||
if ( (alive _vehicle) && { (alive _gunner) } ) then
|
||||
{
|
||||
private _time = 0;
|
||||
|
||||
private _count = 3;
|
||||
|
||||
_condition set [1, True];
|
||||
|
||||
private _skill = [_group] call TCL_Accuracy_F;
|
||||
|
||||
private _magazine = (getArtilleryAmmo [_vehicle] select 0);
|
||||
|
||||
private _rounds = (_vehicle ammo currentMuzzle _gunner);
|
||||
|
||||
_rounds = (_rounds / _count);
|
||||
|
||||
private ["_position","_bool"];
|
||||
|
||||
while { ( (alive _vehicle) && { (alive _gunner) } && { (_count > 0) } ) } do
|
||||
{
|
||||
_position = [ (getPos _logic select 0) + (random 100 - random 100), (getPos _logic select 1) + (random 100 - random 100), 0];
|
||||
|
||||
_bool = [_vehicle, _position] call (TCL_Artillery_F select 2);
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
_time = _vehicle getArtilleryETA [_position, _magazine];
|
||||
|
||||
_vehicle doArtilleryFire [_position, _magazine, _rounds];
|
||||
|
||||
// player sideChat format ["TCL_Artillery_F > Artillery > %1 > %2 > %3", _vehicle, _time, _rounds];
|
||||
|
||||
sleep (_time / _skill);
|
||||
};
|
||||
|
||||
_count = _count - 1;
|
||||
};
|
||||
|
||||
sleep _time;
|
||||
|
||||
_condition set [1, False];
|
||||
|
||||
sleep 30 + (random 50);
|
||||
|
||||
_vehicle setVariable ["TCL_Artillery", True];
|
||||
|
||||
sleep 50 + (random 70);
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
sleep 30 + (random 50);
|
||||
|
||||
_vehicle setVariable ["TCL_Artillery", True];
|
||||
};
|
||||
|
||||
_condition set [0, True];
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_vehicle","_position"];
|
||||
|
||||
private _return = True;
|
||||
|
||||
// private _objects = _position nearEntities [ ["CAManBase","Car","Tank","Helicopter"], 100];
|
||||
|
||||
private _objects = _position nearEntities [ ["Man","Car","Tank","Helicopter"], 100];
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {_return};
|
||||
|
||||
_array = (allUnits + vehicles);
|
||||
|
||||
_objects = allUnits;
|
||||
|
||||
private "_object";
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _objects - 1) do
|
||||
{
|
||||
_object = (_objects select _count);
|
||||
|
||||
// if ( (alive _object) && { (side _object getFriend side _vehicle > 0.6) } && { (_object in _array) } ) exitWith
|
||||
|
||||
if ( (alive _object) && { (side _object getFriend side _vehicle > 0.6) } && { (_object distance _position < 100) } ) exitWith
|
||||
{
|
||||
_return = False;
|
||||
|
||||
player sideChat format ["TCL_Artillery_F > Artillery > %1 > %2", _object, _vehicle];
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Artillery
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_vehicle"];
|
||||
|
||||
private _magazine = "";
|
||||
|
||||
if (canFire _vehicle) then
|
||||
{
|
||||
if (getArray (configfile >> "CfgVehicles" >> (typeOf _vehicle) >> "availableForSupportTypes") select 0 isEqualTo "Artillery") then
|
||||
{
|
||||
_magazine = (getArtilleryAmmo [_vehicle] select 0);
|
||||
|
||||
_range = _position inRangeOfArtillery [crew _vehicle, _magazine];
|
||||
|
||||
if (_range) exitWith
|
||||
{
|
||||
_magazine;
|
||||
};
|
||||
|
||||
_magazine = "";
|
||||
};
|
||||
};
|
||||
|
||||
_magazine
|
||||
|
||||
};
|
||||
];
|
@ -0,0 +1,435 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Groups_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Groups Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_groups"];
|
||||
|
||||
private _array = [];
|
||||
|
||||
_array append _groups;
|
||||
|
||||
private ["_group","_units","_objects"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _groups - 1) do
|
||||
{
|
||||
_group = (_groups select _count);
|
||||
|
||||
_units = (units _group);
|
||||
|
||||
if (_units findIf { (alive _x) } > -1) then
|
||||
{
|
||||
_objects = [];
|
||||
|
||||
{_objects append (synchronizedObjects _x) } count _units;
|
||||
|
||||
{ [_x, _group, _objects] call (TCL_Groups_F select 1) } count ["TCL_Idle","TCL_Hold","TCL_Defend","TCL_Custom","TCL_Freeze","TCL_Default","TCL_Disabled","TCL_Enhanced","TCL_Location"];
|
||||
};
|
||||
};
|
||||
|
||||
if (count (TCL_Custom select 0) > 0) then
|
||||
{
|
||||
_array = ( (TCL_Hold select 0) + (TCL_Defend select 0) + (TCL_Custom select 0) + (TCL_Location select 0) );
|
||||
|
||||
_array = (_array arrayIntersect _array);
|
||||
|
||||
_groups = _groups - _array;
|
||||
|
||||
(TCL_Disabled select 0) append _groups;
|
||||
|
||||
private _sort = (TCL_Initialized select 0);
|
||||
|
||||
_sort = _sort - _array;
|
||||
|
||||
_sort = _sort - (TCL_Disabled select 0);
|
||||
|
||||
(TCL_Disabled select 0) append _sort;
|
||||
};
|
||||
|
||||
_array = _array - (TCL_Players select 2);
|
||||
|
||||
_array = _array - (TCL_Disabled select 0);
|
||||
|
||||
_array = _array - (TCL_Initialized select 0);
|
||||
|
||||
_array = _array select { (side _x in (TCL_System select 2) ) };
|
||||
|
||||
{ [_x] call (TCL_Get_In_F select 0); [_x] call (TCL_Groups_F select 7); [units _x] call (TCL_Units_F select 0); [_x] spawn (TCL_Garrison_F select 0) } forEach _array;
|
||||
|
||||
(TCL_Groups select 0) append _array;
|
||||
|
||||
(TCL_Initialized select 0) append _array;
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Groups Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_type","_group","_objects"];
|
||||
|
||||
if (_type isEqualTo "TCL_Location") then
|
||||
{
|
||||
[_group, _objects] call (TCL_Groups_F select 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isNil {_group getVariable _type} ) then
|
||||
{
|
||||
private _bool = [_type, _group] call (TCL_Groups_F select 3);
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
_bool = [_type, _group, _objects] call (TCL_Groups_F select 4);
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
[_type, _group] call (TCL_Groups_F select 5);
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_group getVariable _type) then
|
||||
{
|
||||
[_type, _group] call (TCL_Groups_F select 6);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Groups Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_units"];
|
||||
|
||||
private _array = _units select { (side _x isEqualTo sideLogic) };
|
||||
|
||||
_units = _units - _array;
|
||||
|
||||
if (_units isEqualTo [] ) exitWith {True};
|
||||
|
||||
_array = [];
|
||||
|
||||
private "_unit";
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
if (units _unit findIf { (alive _x) } > -1) then
|
||||
{
|
||||
_array pushBackUnique (group _unit);
|
||||
};
|
||||
};
|
||||
|
||||
if (_array isEqualTo [] ) exitWith {True};
|
||||
|
||||
_array pushBack _group;
|
||||
|
||||
{ (TCL_Location select 0) pushBackUnique _x} forEach _array;
|
||||
|
||||
_group setVariable ["TCL_Location", _array];
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Groups Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_type","_group"];
|
||||
|
||||
private _return = True;
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private "_unit";
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
if (isNil {_unit getVariable _type} ) then
|
||||
{
|
||||
_return = _return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_unit getVariable _type) then
|
||||
{
|
||||
_return = False;
|
||||
|
||||
_count = (count _units);
|
||||
|
||||
[_type, _group] call (TCL_Groups_F select 6);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Groups Function #4
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_type","_group","_objects"];
|
||||
|
||||
private _return = True;
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {_return};
|
||||
|
||||
_objects = _objects select { (triggerText _x == _type) };
|
||||
|
||||
private "_object";
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _objects - 1) do
|
||||
{
|
||||
_object = (_objects select _count);
|
||||
|
||||
if (_object isKindOf "EmptyDetector") exitWith
|
||||
{
|
||||
_return = False;
|
||||
|
||||
[_type, _group] call (TCL_Groups_F select 6);
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Groups Function #5
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_type","_group"];
|
||||
|
||||
private _objects = allMissionObjects "EmptyDetector";
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {True};
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
_objects = _objects select { (triggerText _x == _type) };
|
||||
|
||||
private "_object";
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _objects - 1) do
|
||||
{
|
||||
_object = (_objects select _count);
|
||||
|
||||
if (_leader inArea _object) exitWith
|
||||
{
|
||||
[_type, _group, _object] call (TCL_Groups_F select 6);
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Groups Function #6
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_type","_group"];
|
||||
|
||||
private _string = call compile _type;
|
||||
|
||||
private _array = (_string select 0);
|
||||
|
||||
if (_group in _array) exitWith
|
||||
{
|
||||
private _error = [];
|
||||
|
||||
_error pushBack _group;
|
||||
|
||||
_error pushBack format ["<t color='#ffff00'>( %1 )</t>", count units _group];
|
||||
|
||||
private _text = _error joinString " ";
|
||||
|
||||
hint parseText format ["%1<t align='left'>A.I. group <t color='#32cd32'>%2</t> was about to initialize multiple times in the same A.I. group type '<t color='#32cd32'>%3</t>'.<br/>Please make sure to use any A.I. group type for each A.I. group except '<t color='#32cd32'>Location</t>' A.I. group(s) ONCE only.", (TCL_Text_F select 3), _text, _type];
|
||||
};
|
||||
|
||||
if (_type == "TCL_Idle") exitWith
|
||||
{
|
||||
(TCL_Idle select 0) pushBack _group;
|
||||
};
|
||||
|
||||
if (_type == "TCL_Hold") exitWith
|
||||
{
|
||||
(TCL_Hold select 0) pushBack _group;
|
||||
|
||||
private "_object";
|
||||
|
||||
if (count _this == 3) then
|
||||
{
|
||||
_object = _this select 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
private _leader = (leader _group);
|
||||
|
||||
_object = createTrigger ["EmptyDetector", (getPos _leader) ];
|
||||
|
||||
_object setTriggerArea [50, 50, 0, False];
|
||||
|
||||
private _side = format ["%1", (side _leader) ];
|
||||
|
||||
_object setTriggerActivation [_side, "PRESENT", False];
|
||||
};
|
||||
|
||||
_group setVariable ["TCL_Enemy", objNull];
|
||||
|
||||
_group setVariable ["TCL_Trigger", _object];
|
||||
|
||||
["TCL_Marker", _group, _object] call (TCL_Marker_F select 0);
|
||||
};
|
||||
|
||||
if (_type == "TCL_Defend") exitWith
|
||||
{
|
||||
(TCL_Defend select 0) pushBack _group;
|
||||
};
|
||||
|
||||
if (_type == "TCL_Custom") exitWith
|
||||
{
|
||||
(TCL_Custom select 0) pushBack _group;
|
||||
};
|
||||
|
||||
if (_type == "TCL_Freeze") exitWith
|
||||
{
|
||||
(TCL_Freeze select 0) pushBack _group;
|
||||
};
|
||||
|
||||
if (_type == "TCL_Default") exitWith
|
||||
{
|
||||
(TCL_Default select 0) pushBack _group;
|
||||
};
|
||||
|
||||
if (_type == "TCL_Disabled") exitWith
|
||||
{
|
||||
(TCL_Disabled select 0) pushBack _group;
|
||||
};
|
||||
|
||||
if (_type == "TCL_Enhanced") exitWith
|
||||
{
|
||||
(TCL_Freeze select 0) pushBack _group;
|
||||
|
||||
(TCL_Default select 0) pushBack _group;
|
||||
|
||||
(TCL_Enhanced select 0) pushBack _group;
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Groups Function #7
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
private _random = (random 15);
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
_group setVariable ["TCL_Move", 5];
|
||||
|
||||
private _vehicle = (vehicle _leader);
|
||||
|
||||
_group setVariable ["TCL_Enemy", objNull];
|
||||
|
||||
_group setVariable ["TCL_Watch", (time + _random) ];
|
||||
|
||||
_group setVariable ["TCL_Position", (getPos _leader) ];
|
||||
|
||||
_group setVariable ["TCL_Waypoint", (getPos _leader) ];
|
||||
|
||||
_group setVariable ["TCL_Behaviour", [ (behaviour _leader), (combatMode _group), (formation _group), (speedMode _group) ] ];
|
||||
|
||||
if (getArray (configfile >> "CfgVehicles" >> (typeOf _vehicle) >> "availableForSupportTypes") select 0 isEqualTo "Artillery") then
|
||||
{
|
||||
(TCL_Artillery select 0) pushBack _group;
|
||||
|
||||
_group setVariable ["TCL_Artillery", True];
|
||||
|
||||
if (_group in (TCL_Location select 0) ) exitWith
|
||||
{
|
||||
TCL_DeleteAT(TCL_Location,0,_group);
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Groups_F > Artillery > %1", _group];
|
||||
};
|
||||
|
||||
if (isNil { (_group getVariable "TCL_AI") } )then
|
||||
{
|
||||
_group setVariable ["TCL_AI", TCL_AI];
|
||||
}
|
||||
else
|
||||
{
|
||||
private _text = format ["%1<t align='left'>The '<t color='#32cd32'>TCL_AI</t>' settings of <t color='#ffff00'>%2</t> are not configurated properly!<br/>Please check the '<t color='#32cd32'>TCL_AI</t>' settings of <t color='#ffff00'>%2</t> and correct them.", (TCL_Text_F select 3), _group];
|
||||
|
||||
private _array = TCL_AI;
|
||||
|
||||
private _ai = (_group getVariable "TCL_AI");
|
||||
|
||||
if (_array isEqualTypeArray _ai) then
|
||||
{
|
||||
_text = _text;
|
||||
}
|
||||
else
|
||||
{
|
||||
hint parseText _text;
|
||||
};
|
||||
};
|
||||
|
||||
if (_group getVariable "TCL_AI" select 7) then
|
||||
{
|
||||
["TCL_Freeze", _group] call (TCL_Groups_F select 6);
|
||||
};
|
||||
|
||||
if (_group getVariable "TCL_AI" select 8) then
|
||||
{
|
||||
["TCL_Default", _group] call (TCL_Groups_F select 6);
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Groups_F > Conditions > %1", _group];
|
||||
|
||||
True
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,9 @@
|
||||
/* ////////////////////////////////////////////////////////////////////////////////
|
||||
\ \ Tactical Combat Link
|
||||
\ \------------------------------------------------------------------------------
|
||||
\ \ Macros
|
||||
\ \----------------------------------------------------------------------------
|
||||
/ / By =\SNKMAN/=
|
||||
/ /-----------------------------------------------------------------------------
|
||||
*/ ///////////////////////////////////////////////////////////////////////////////
|
||||
#define TCL_DeleteAT(_array, _index, _object); (_array select _index) deleteAt ( (_array select _index) find _object);
|
@ -0,0 +1,49 @@
|
||||
TCL_Players_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Players Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_players"];
|
||||
|
||||
(TCL_Players select 0) append _players;
|
||||
|
||||
private ["_player","_group","_leader"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _players - 1) do
|
||||
{
|
||||
_player = (_players select _count);
|
||||
|
||||
_group = (group _player);
|
||||
|
||||
_leader = (leader _group);
|
||||
|
||||
[_player] call (TCL_Marker_F select 0);
|
||||
|
||||
if (_player == _leader) then
|
||||
{
|
||||
(TCL_Players select 2) pushBackUnique _group;
|
||||
|
||||
{ [_x] call (TCL_Marker_F select 0) } forEach units _player;
|
||||
};
|
||||
|
||||
_player setVariable ["TCL_Suppressed", time];
|
||||
|
||||
if (TCL_Dedicated) then
|
||||
{
|
||||
_player addEventHandler ["FiredMan", {_this call (TCL_EH_Fired_F select 0) } ];
|
||||
};
|
||||
};
|
||||
|
||||
if (TCL_System select 3) then
|
||||
{
|
||||
(TCL_Players select 1) append _players;
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,50 @@
|
||||
TCL_Units_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Units Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_units"];
|
||||
|
||||
private ["_unit","_vehicle","_weapon","_ammo"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
_unit allowFleeing 0;
|
||||
|
||||
_unit disableAI "TARGET";
|
||||
|
||||
_vehicle = (vehicle _unit);
|
||||
|
||||
if (_vehicle isKindOf "StaticWeapon") then
|
||||
{
|
||||
private _group = (group _unit);
|
||||
|
||||
(TCL_Static_Weapon select 0) pushBack _unit;
|
||||
|
||||
(TCL_Static_Weapon select 1) pushBack _vehicle;
|
||||
|
||||
[_unit, _group, _vehicle] spawn (TCL_Static_Weapon_F select 3);
|
||||
};
|
||||
|
||||
[_unit] call (TCL_Skill_F select 0);
|
||||
|
||||
[_unit] call (TCL_Marker_F select 0);
|
||||
|
||||
_unit setVariable ["TCL_Take_Cover", [time, [], (getPos _unit) ] ];
|
||||
};
|
||||
|
||||
if (TCL_System select 3) then
|
||||
{
|
||||
(TCL_Players select 1) append _units;
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,33 @@
|
||||
TCL_Vehicles_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Vehicles Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_vehicles"];
|
||||
|
||||
(TCL_Vehicles select 0) append _vehicles;
|
||||
|
||||
private "_vehicle";
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _vehicles - 1) do
|
||||
{
|
||||
_vehicle = (_vehicles select _count);
|
||||
|
||||
if (TCL_Multiplayer) then
|
||||
{
|
||||
_vehicle addMPEventHandler ["MPKilled", {_this call (TCL_EH_Killed_F select 0) } ];
|
||||
}
|
||||
else
|
||||
{
|
||||
_vehicle addEventHandler ["Killed", {_this call (TCL_EH_Killed_F select 0) } ];
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,9 @@
|
||||
/* ////////////////////////////////////////////////////////////////////////////////
|
||||
\ \ Tactical Combat Link
|
||||
\ \------------------------------------------------------------------------------
|
||||
\ \ Macros
|
||||
\ \----------------------------------------------------------------------------
|
||||
/ / By =\SNKMAN/=
|
||||
/ /-----------------------------------------------------------------------------
|
||||
*/ ///////////////////////////////////////////////////////////////////////////////
|
||||
#define TCL_DeleteAT(_array, _index, _object); (_array select _index) deleteAt ( (_array select _index) find _object);
|
@ -0,0 +1,154 @@
|
||||
TCL_Assign_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Assign Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Assign
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_units","_group"];
|
||||
|
||||
private _return = True;
|
||||
|
||||
if (_units isEqualTo [] ) exitWith {_return = False};
|
||||
|
||||
private _unit = (_units select 0);
|
||||
|
||||
if (isNull objectParent _unit) then
|
||||
{
|
||||
private _objects = _unit nearEntities ["Car", 100];
|
||||
|
||||
private _array = ( (TCL_Assign select 0) + (TCL_Stuck select 0) );
|
||||
|
||||
_objects = _objects - _array;
|
||||
|
||||
_objects = _objects select { ( (alive _x) && { (fuel _x > 0) } && { (canMove _x) } && { (_unit knowsAbout _x > 0) } ) };
|
||||
|
||||
if (_objects isEqualTo [] ) exitWith {};
|
||||
|
||||
private ["_vehicle","_side","_crew"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _objects - 1) do
|
||||
{
|
||||
_vehicle = (_objects select _count);
|
||||
|
||||
_side = False;
|
||||
|
||||
if (getNumber (configFile >> "CfgVehicles" >> (typeOf _unit) >> "side") isEqualTo getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "side") ) then
|
||||
{
|
||||
_side = True;
|
||||
};
|
||||
|
||||
_crew = (crew _vehicle);
|
||||
|
||||
if ( (_side) && { (_crew isEqualTo [] ) } ) exitWith
|
||||
{
|
||||
_return = False;
|
||||
|
||||
(TCL_Assign select 0) pushBack _vehicle;
|
||||
|
||||
[_units, _group, _vehicle] call (TCL_Assign_F select 1);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Assign Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Assign
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_units","_group","_vehicle"];
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
if (_group in (TCL_Artillery select 0) ) exitWith {};
|
||||
|
||||
// player sideChat format ["TCL_Assign_F > Vehicle > %1", _vehicle];
|
||||
|
||||
_units select { (_x in (TCL_Static_Weapon select 0) ) } apply {_x leaveVehicle assignedVehicle _x; [_x] orderGetIn False; [_x] allowGetIn False};
|
||||
|
||||
{if (_x in assignedVehicle _x) then {_units = _units - [_x] } else {if (count assignedVehicleRole _x > 0) then {_units = _units - [_x]; [_x] orderGetIn True; [_x] allowGetIn True} } } count _units;
|
||||
|
||||
if (_units isEqualTo [] ) exitWith {True};
|
||||
|
||||
_units = [_units, _vehicle] call (TCL_Assign_F select 2);
|
||||
|
||||
if (_units isEqualTo [] ) exitWith {True};
|
||||
|
||||
{_x assignAsCargo _vehicle} count _units;
|
||||
|
||||
{if (assignedVehicle _x == _vehicle) then {_units = _units - [_x]; [_x] orderGetIn True; [_x] allowGetIn True} } count _units;
|
||||
|
||||
if (_units isEqualTo [] ) exitWith {True};
|
||||
|
||||
[_units, _group, _vehicle] call (TCL_Assign_F select 0);
|
||||
|
||||
// player sideChat format ["TCL_Assign_F > Units > %1", _units];
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Assign Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Assign
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_units","_vehicle"];
|
||||
|
||||
private _positions = ["Driver","Gunner","Commander"];
|
||||
|
||||
private ["_position","_unit"];
|
||||
|
||||
while { (count _positions > 0) } do
|
||||
{
|
||||
_position = (_positions select 0);
|
||||
|
||||
if (_units isEqualTo [] ) exitWith {};
|
||||
|
||||
// player sideChat format ["TCL_Assign_F > Positions > %1", _positions];
|
||||
|
||||
if (_vehicle emptyPositions _position > 0) then
|
||||
{
|
||||
_unit = (_units select 0);
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
if (_position isEqualTo "Driver") exitWith
|
||||
{
|
||||
_unit assignAsDriver _vehicle;
|
||||
};
|
||||
|
||||
if (_position isEqualTo "Gunner") exitWith
|
||||
{
|
||||
_unit assignAsGunner _vehicle;
|
||||
};
|
||||
|
||||
if (_position isEqualTo "Commander") exitWith
|
||||
{
|
||||
_unit assignAsCommander _vehicle;
|
||||
};
|
||||
};
|
||||
|
||||
_units deleteAt (_units find _unit);
|
||||
|
||||
[_unit] orderGetIn True; [_unit] allowGetIn True;
|
||||
|
||||
// player sideChat format ["TCL_Assign_F > Position > %1 > %2", _unit, _position];
|
||||
};
|
||||
|
||||
_positions deleteAt (_positions find _position);
|
||||
};
|
||||
|
||||
_units
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,212 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Behaviour_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Behaviour Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Behaviour
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
private ["_behaviour","_combatMode","_speedMode","_formation"];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
if (_group in (TCL_Reinforcement select 1) ) then
|
||||
{
|
||||
if (isNull objectParent _leader) then
|
||||
{
|
||||
_behaviour = "AWARE";
|
||||
}
|
||||
else
|
||||
{
|
||||
_behaviour = selectRandom ["SAFE","SAFE","AWARE","AWARE"];
|
||||
|
||||
private _vehicle = (vehicle _leader);
|
||||
|
||||
if (_vehicle isKindOf "Air") then
|
||||
{
|
||||
_behaviour = "AWARE";
|
||||
};
|
||||
};
|
||||
|
||||
_combatMode = "YELLOW";
|
||||
|
||||
if (combatMode _group isEqualTo "RED") then
|
||||
{
|
||||
_combatMode = "RED";
|
||||
|
||||
(TCL_Red select 0) pushBack _group;
|
||||
};
|
||||
|
||||
if (_group in (TCL_Sneaking select 0) ) then
|
||||
{
|
||||
_behaviour = (behaviour _leader);
|
||||
_combatMode = (combatMode _group);
|
||||
};
|
||||
|
||||
if (speedMode _group isEqualTo "NORMAL") then
|
||||
{
|
||||
(TCL_Speed select 0) pushBack _group;
|
||||
}
|
||||
else
|
||||
{
|
||||
_group setVariable ["TCL_Speed", (speedMode _group) ];
|
||||
};
|
||||
|
||||
_speedMode = selectRandom ["FULL","FULL","FULL","FULL"];
|
||||
_formation = selectRandom ["WEDGE","COLUMN","STAG COLUMN"];
|
||||
}
|
||||
else
|
||||
{
|
||||
_behaviour = "COMBAT";
|
||||
|
||||
private _random = (TCL_Tweak select 0);
|
||||
|
||||
if (floor (random 100) < _random) then
|
||||
{
|
||||
{_x disableAI "AUTOCOMBAT"} count _units;
|
||||
|
||||
_behaviour = "AWARE";
|
||||
};
|
||||
|
||||
_combatMode = "YELLOW";
|
||||
|
||||
if (_group in (TCL_Red select 0) ) then
|
||||
{
|
||||
_combatMode = "RED";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (floor (random 100) < 50) then
|
||||
{
|
||||
_combatMode = "RED";
|
||||
};
|
||||
};
|
||||
|
||||
if (_group in (TCL_Sneaking select 0) ) then
|
||||
{
|
||||
_behaviour = (behaviour _leader);
|
||||
_combatMode = (combatMode _group);
|
||||
};
|
||||
|
||||
_formation = selectRandom ["WEDGE","WEDGE","ECH LEFT","ECH RIGHT","VEE"];
|
||||
|
||||
if (_group in (TCL_Speed select 0) ) then
|
||||
{
|
||||
_speedMode = selectRandom ["NORMAL","FULL"];
|
||||
}
|
||||
else
|
||||
{
|
||||
_speedMode = (_group getVariable "TCL_Speed");
|
||||
};
|
||||
};
|
||||
|
||||
if (behaviour _leader isEqualTo "STEALTH") then
|
||||
{
|
||||
_behaviour = "STEALTH";
|
||||
};
|
||||
|
||||
_group setSpeedMode _speedMode;
|
||||
|
||||
_group setFormation _formation;
|
||||
|
||||
_group setBehaviour _behaviour;
|
||||
|
||||
_group setCombatMode _combatMode;
|
||||
|
||||
_units doFollow _leader;
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Behaviour Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Behaviour
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic"];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
{_x setUnitPos "AUTO"} count _units;
|
||||
|
||||
private _speedMode = (speedMode _group);
|
||||
|
||||
private _formation = (formation _group);
|
||||
|
||||
private _behaviour = (behaviour _leader);
|
||||
|
||||
(TCL_Behaviour select 0) pushBack _group;
|
||||
|
||||
private _combatMode = (combatMode _group);
|
||||
|
||||
if (_leader distance _logic > 300) then
|
||||
{
|
||||
[_enemy, _group, _logic] spawn (TCL_Unassign_F select 0);
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Behaviour_F > Group > %1", _group];
|
||||
|
||||
_group setSpeedMode "FULL";
|
||||
|
||||
_group setBehaviour "AWARE";
|
||||
|
||||
_group setCombatMode "YELLOW";
|
||||
|
||||
if (floor (random 100) < 35) then
|
||||
{
|
||||
_group setFormation "WEDGE";
|
||||
}
|
||||
else
|
||||
{
|
||||
_group setFormation "STAG COLUMN";
|
||||
};
|
||||
|
||||
_units = _units - (TCL_Helicopter select 0);
|
||||
|
||||
_units doFollow _leader;
|
||||
|
||||
{_x forceSpeed -1} count _units;
|
||||
|
||||
private ["_waypoint","_knowsAbout"];
|
||||
|
||||
while { ( (units _group findIf { (alive _x) } > -1) && { (_group in (TCL_Reinforcement select 0) ) } ) } do
|
||||
{
|
||||
_waypoint = (_group getVariable "TCL_Waypoint");
|
||||
|
||||
_knowsAbout = (_group getVariable "TCL_KnowsAbout");
|
||||
|
||||
if (_knowsAbout == 0) exitWith
|
||||
{
|
||||
_group setSpeedMode _speedMode;
|
||||
|
||||
_group setFormation _formation;
|
||||
|
||||
_group setBehaviour _behaviour;
|
||||
|
||||
_group setCombatMode _combatMode;
|
||||
};
|
||||
|
||||
if (_leader distance _waypoint < 100) then
|
||||
{
|
||||
if (behaviour _leader isEqualTo _behaviour) exitWith {};
|
||||
|
||||
_group setBehaviour _behaviour;
|
||||
};
|
||||
|
||||
sleep 5;
|
||||
};
|
||||
|
||||
TCL_DeleteAT(TCL_Behaviour,0,_group);
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,136 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Enemy_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Enemy Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Enemy
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group"];
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
private _units = (TCL_Players select 0);
|
||||
|
||||
if (TCL_System select 3) then
|
||||
{
|
||||
_units = (TCL_Players select 1);
|
||||
};
|
||||
|
||||
_units = _units select { ( (alive _x) && { (side _group getFriend side _x < 0.6) } ) };
|
||||
|
||||
if (alive _enemy) then
|
||||
{
|
||||
_units = _units select { ( ( (_group knowsAbout vehicle _x) >= (_group knowsAbout vehicle _enemy) ) && { ( (_leader distance _x) < (_leader distance _enemy) ) } ) };
|
||||
};
|
||||
|
||||
private "_unit";
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
if (_group knowsAbout vehicle _unit > 0 ) exitWith
|
||||
{
|
||||
_enemy = _unit;
|
||||
};
|
||||
};
|
||||
|
||||
_enemy
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Enemy Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Enemy
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic"];
|
||||
|
||||
private _knowsAbout = (_group getVariable "TCL_KnowsAbout");
|
||||
|
||||
private _ai = (_group getVariable "TCL_AI" select 10);
|
||||
|
||||
private _value = ["TCL_Time", (time + _ai) ];
|
||||
|
||||
if ( (alive _enemy) && { (_group knowsAbout vehicle _enemy > 0) } ) then
|
||||
{
|
||||
_knowsAbout = 0;
|
||||
|
||||
_logic setVariable _value;
|
||||
|
||||
_group setVariable _value;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_group in (TCL_Reinforcement select 1) ) then
|
||||
{
|
||||
_knowsAbout = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_knowsAbout > 3) then
|
||||
{
|
||||
private _time = (_group getVariable "TCL_Time");
|
||||
|
||||
if (time > _time) then
|
||||
{
|
||||
private _array = ( (TCL_Hold select 0) + (TCL_Join select 0) + (TCL_Defend select 0) + (TCL_Artillery select 0) );
|
||||
|
||||
if (_group in _array) then
|
||||
{
|
||||
(TCL_Retreat select 0) pushBack _group;
|
||||
}
|
||||
else
|
||||
{
|
||||
_group setVariable _value;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_knowsAbout = _knowsAbout + 1;
|
||||
};
|
||||
};
|
||||
|
||||
_group setVariable ["TCL_KnowsAbout", _knowsAbout];
|
||||
|
||||
if (_knowsAbout == 3) then
|
||||
{
|
||||
(TCL_Reinforcement select 2) pushBack _group;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_knowsAbout == 0) then
|
||||
{
|
||||
if (_group in (TCL_Reinforcement select 2) ) then
|
||||
{
|
||||
TCL_DeleteAT(TCL_Reinforcement,2,_group);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if (_group in (TCL_Sneaking select 0) ) then
|
||||
{
|
||||
private _leader = (leader _group);
|
||||
|
||||
if ( (_leader distance _logic < 100) || ( [_enemy, _group] call (TCL_Sneaking_F select 0) ) ) then
|
||||
{
|
||||
private _units = (units _group);
|
||||
|
||||
{_x setUnitPos "AUTO"} count _units;
|
||||
|
||||
TCL_DeleteAT(TCL_Sneaking,0,_group);
|
||||
|
||||
[_group] call (TCL_Behaviour_F select 0);
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,210 @@
|
||||
TCL_Helicopter_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Helicopter Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_logic","_vehicle"];
|
||||
|
||||
private _array = [];
|
||||
|
||||
private _bool = False;
|
||||
|
||||
private _cargo = True;
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
if (_group getVariable "TCL_Eject") then
|
||||
{
|
||||
private "_unit";
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
if (assignedVehicleRole _unit select 0 == "Cargo") then
|
||||
{
|
||||
_array pushBack _unit;
|
||||
|
||||
if (backpack _unit isEqualTo "B_Parachute") then
|
||||
{
|
||||
_unit action ["EJECT", _vehicle];
|
||||
|
||||
_unit allowDamage False;
|
||||
|
||||
_array pushBack _unit;
|
||||
|
||||
sleep 1 - (random 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
_bool = True;
|
||||
};
|
||||
|
||||
[_unit] orderGetIn False; [_unit] allowGetIn False;
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_bool = True;
|
||||
|
||||
_units select { (assignedVehicleRole _x select 0 == "Cargo") } apply {if ( (floor (random 100) < 35) && { (count (assignedVehicleRole _x) > 1) } ) then {_cargo = False} else {_array pushBack _x; [_x] orderGetIn False; [_x] allowGetIn False} };
|
||||
};
|
||||
|
||||
private _crew = (crew _vehicle);
|
||||
|
||||
_crew = _crew - _array;
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
_vehicle flyInHeight 100;
|
||||
|
||||
_vehicle land "GET OUT";
|
||||
};
|
||||
|
||||
if (count _array > 0) then
|
||||
{
|
||||
while { (_array findIf { (_x in _vehicle) } > -1) } do
|
||||
{
|
||||
sleep 5;
|
||||
};
|
||||
|
||||
{_x allowDamage True} count _array;
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
if (_leader in _array) then
|
||||
{
|
||||
_group setVariable ["TCL_Helicopter", (driver _vehicle) ];
|
||||
}
|
||||
else
|
||||
{
|
||||
_group setVariable ["TCL_Helicopter", _leader];
|
||||
|
||||
_leader = (_array select 0);
|
||||
|
||||
_group selectLeader _leader;
|
||||
|
||||
{_x setUnitRank "PRIVATE"} count _crew;
|
||||
|
||||
_array select { (rank _x isEqualTo "PRIVATE") } apply {_x setUnitRank "CORPORAL"};
|
||||
};
|
||||
};
|
||||
|
||||
private _random = 75;
|
||||
|
||||
private _driver = (driver _vehicle);
|
||||
|
||||
private _gunner = (gunner _vehicle);
|
||||
|
||||
if ( (alive _gunner) && { (canFire _vehicle) } && { (someAmmo _vehicle) } ) then
|
||||
{
|
||||
_random = 50;
|
||||
};
|
||||
|
||||
_vehicle flyInHeight 100;
|
||||
|
||||
if ( (alive _logic) && { (_cargo) } && { (floor (random 100) < _random) } ) then
|
||||
{
|
||||
private _crew = (crew _vehicle);
|
||||
|
||||
(TCL_Helicopter select 0) append _crew;
|
||||
|
||||
_position = (_group getVariable "TCL_Position");
|
||||
|
||||
sleep 5 + (random 10);
|
||||
|
||||
_driver doMove _position;
|
||||
|
||||
private _land = "Land_HelipadEmpty_F" createVehicleLocal _position;
|
||||
|
||||
while { ( (alive _vehicle) && { (_vehicle distance2D _position > 100) } ) } do
|
||||
{
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
if (alive _logic) then
|
||||
{
|
||||
_vehicle land "LAND";
|
||||
|
||||
{doStop _x} count _crew;
|
||||
|
||||
while { (getPos _vehicle select 2 > 10) } do
|
||||
{
|
||||
sleep 1;
|
||||
};
|
||||
};
|
||||
|
||||
deleteVehicle _land;
|
||||
}
|
||||
else
|
||||
{
|
||||
_vehicle flyInHeight 50;
|
||||
|
||||
if (floor (random 100) < 50) then
|
||||
{
|
||||
_group selectLeader _driver;
|
||||
};
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Helicopter Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_crew","_vehicle"];
|
||||
|
||||
_vehicle forceSpeed -1;
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
private _driver = (driver _vehicle);
|
||||
|
||||
private _position = (_group getVariable "TCL_Position");
|
||||
|
||||
_units = _units - _crew;
|
||||
|
||||
if (_units findIf { (alive _x) } > -1) then
|
||||
{
|
||||
private _unit = (_units select 0);
|
||||
|
||||
{if (_x == _leader) exitWith {_unit = _x} } count _units;
|
||||
|
||||
_driver doMove (getPos _unit);
|
||||
|
||||
while { (_vehicle distance2D _unit > 100) } do
|
||||
{
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
if (floor (random 100) < 50) then
|
||||
{
|
||||
_vehicle land "LAND";
|
||||
}
|
||||
else
|
||||
{
|
||||
_vehicle land "GET IN";
|
||||
};
|
||||
};
|
||||
|
||||
_group move _position;
|
||||
|
||||
[_group] call (TCL_Remount_F select 2);
|
||||
|
||||
while { ( (alive _vehicle) && { (_vehicle distance2D _position > 100) } ) } do
|
||||
{
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
_vehicle land "LAND";
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,87 @@
|
||||
TCL_Join_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Join Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Join
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_logic","_units"];
|
||||
|
||||
private _ai = (_group getVariable "TCL_AI" select 8);
|
||||
|
||||
if (_ai) then
|
||||
{
|
||||
private _array = ( (TCL_Hold select 0) + (TCL_Defend select 0) + (TCL_Location select 0) );
|
||||
|
||||
if (_group in _array) exitWith {};
|
||||
|
||||
if (_units < 3) then
|
||||
{
|
||||
private _groups = (_logic getVariable "TCL_Reinforcement");
|
||||
|
||||
_groups = _groups - [_group];
|
||||
|
||||
_groups = _groups select { (side _group isEqualTo side _x) };
|
||||
|
||||
if (_groups isEqualTo [] ) exitWith {};
|
||||
|
||||
[_group, _logic, _units, _groups] call (TCL_Join_F select 1);
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Join Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Join
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_logic","_units","_groups"];
|
||||
|
||||
private _alpha = _group;
|
||||
|
||||
private _leader = (leader _alpha);
|
||||
|
||||
if (_leader == vehicle _leader) then
|
||||
{
|
||||
private _rank = [_leader] call TCL_Rank_F;
|
||||
|
||||
private "_bravo";
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _groups - 1) do
|
||||
{
|
||||
_bravo = (_groups select _count);
|
||||
|
||||
_condition = (units _bravo) select { ( (alive _x) && { (isNull objectParent _x) } && { (_x distance _leader < 100) } ) };
|
||||
|
||||
if ( (_units <= count _condition) && { (_rank <= [leader _bravo] call TCL_Rank_F) } && { ( [_alpha, _bravo] call (TCL_KnowsAbout_F select 4) ) } ) exitWith
|
||||
{
|
||||
private _units = (units _alpha);
|
||||
|
||||
["TCL_Position", _alpha] call (TCL_Marker_F select 0);
|
||||
|
||||
// player sideChat format ["TCL_Join_F > Group > %1", _alpha];
|
||||
|
||||
_groups = (_logic getVariable "TCL_Reinforcement");
|
||||
|
||||
_groups deleteAt (_groups find _alpha);
|
||||
|
||||
_units join _bravo;
|
||||
|
||||
(TCL_Regroup select 0) append _units;
|
||||
|
||||
_units select { (count assignedVehicleRole _x > 0) } apply { [_x] orderGetIn False; [_x] allowGetIn False};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,205 @@
|
||||
TCL_KnowsAbout_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// KnowsAbout Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// KnowsAbout
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
private _units = (TCL_Players select 0);
|
||||
|
||||
if (TCL_System select 3) then
|
||||
{
|
||||
_units = (TCL_Players select 1);
|
||||
};
|
||||
|
||||
_units = _units select { ( (alive _x) && { (_group knowsAbout vehicle _x > 0) } && { (side _group getFriend side _x < 0.6) } ) };
|
||||
|
||||
private "_unit";
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
if ( [_unit, _group] call (TCL_KnowsAbout_F select 1) ) exitWith
|
||||
{
|
||||
private _enemy = _unit;
|
||||
|
||||
private _logic = [_enemy] call (TCL_Logic_F select 0);
|
||||
|
||||
(TCL_Logic select 0) pushBack _logic;
|
||||
|
||||
_logic setVariable ["TCL_Group", (group _enemy) ];
|
||||
|
||||
_logic setVariable ["TCL_Units", (units _enemy) ];
|
||||
|
||||
["TCL_Logic", _logic] call (TCL_Marker_F select 0);
|
||||
|
||||
_logic setVariable ["TCL_Artillery", [True, False] ];
|
||||
|
||||
[_enemy, _group, _logic] call (TCL_Reinforcement_F select 0);
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// KnowsAbout Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// KnowsAbout
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group"];
|
||||
|
||||
if (_group in (TCL_Reinforcement select 0) ) exitWith {_return = False};
|
||||
|
||||
private _return = True;
|
||||
|
||||
private _array = (TCL_Logic select 0);
|
||||
|
||||
private _ai = (_group getVariable "TCL_AI");
|
||||
|
||||
private "_logic";
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _array - 1) do
|
||||
{
|
||||
_logic = (_array select _count);
|
||||
|
||||
if ( [_enemy, _group, _logic] call (TCL_KnowsAbout_F select 2) ) exitWith
|
||||
{
|
||||
_return = False;
|
||||
|
||||
if (_ai select 3) then
|
||||
{
|
||||
_return = True;
|
||||
}
|
||||
else
|
||||
{
|
||||
private _bool = False;
|
||||
|
||||
if (_group knowsAbout vehicle _enemy > (_ai select 4) ) then
|
||||
{
|
||||
_bool = True;
|
||||
}
|
||||
else
|
||||
{
|
||||
private _leader = (leader _group);
|
||||
|
||||
if (_leader distance _logic < (_ai select 5) ) then
|
||||
{
|
||||
_bool = True;
|
||||
};
|
||||
};
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
if (_ai select 6) then
|
||||
{
|
||||
(TCL_Join select 0) pushBack _group;
|
||||
};
|
||||
|
||||
[_enemy, _group, _logic] call (TCL_Reinforcement_F select 0);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// KnowsAbout Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// KnowsAbout
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic"];
|
||||
|
||||
private _return = False;
|
||||
|
||||
private _groups = (_logic getVariable "TCL_Reinforcement");
|
||||
|
||||
if (_groups findIf { (side _group getFriend side _x < 0.6) } > -1) exitWith {_return};
|
||||
|
||||
if ( (group _enemy) isEqualTo (_logic getVariable "TCL_Group") ) then
|
||||
{
|
||||
_return = True;
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// KnowsAbout Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// KnowsAbout
|
||||
// By =\SNKMAN/=
|
||||
// Used: TCL_System.fsm
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic"];
|
||||
|
||||
private _time = (TCL_Radio select 1);
|
||||
|
||||
private _random = (random _time);
|
||||
|
||||
_time = (_time + _random);
|
||||
|
||||
_skill = [_group] call TCL_Accuracy_F;
|
||||
|
||||
_time = (_time / _skill);
|
||||
|
||||
// player sideChat format ["TCL_KnowsAbout_F > Time > %1 > %2 > %3", _group, _skill, (round _time) ];
|
||||
|
||||
_time = (time + _time);
|
||||
|
||||
private _return = _time;
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// KnowsAbout Function #4
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// KnowsAbout
|
||||
// By =\SNKMAN/=
|
||||
// Used: Join Function #1 Reveal Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_echo","_kilo"];
|
||||
|
||||
private _return = False;
|
||||
|
||||
private _units = (units _kilo);
|
||||
|
||||
private _value = (TCL_IQ select 0);
|
||||
|
||||
private _knowsAbout = (_units findIf { ( (alive _x) && { (_echo knowsAbout vehicle _x > _value) } ) } );
|
||||
|
||||
if (_knowsAbout == -1) then
|
||||
{
|
||||
_units = (units _echo);
|
||||
|
||||
_knowsAbout = (_units findIf { ( (alive _x) && { (_kilo knowsAbout vehicle _x > _value) } ) } );
|
||||
};
|
||||
|
||||
if (_knowsAbout > -1) then
|
||||
{
|
||||
_return = True;
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_KnowsAbout_F > KnowsAbout > %1 > %2", _echo, _knowsAbout];
|
||||
|
||||
_return
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,67 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Logic_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Logic Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Logic
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy"];
|
||||
|
||||
private _side = createCenter sideLogic;
|
||||
|
||||
private _group = createGroup _side;
|
||||
|
||||
private _logic = _group createUnit ["Logic", (getPos _enemy), [], 0, "NONE"];
|
||||
|
||||
[_logic] join _group;
|
||||
|
||||
_logic allowDamage False;
|
||||
|
||||
_logic
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Logic Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Logic
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_logic","_spot"];
|
||||
|
||||
if (alive _spot) then
|
||||
{
|
||||
deleteVehicle _spot;
|
||||
};
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _array = (_logic getVariable "TCL_Reinforcement");
|
||||
|
||||
{TCL_DeleteAT(TCL_Reinforcement,_x,_group) } forEach [0,1,2];
|
||||
|
||||
{TCL_DeleteAT(_x,0,_group) } forEach [TCL_Red, TCL_Join, TCL_Retreat, TCL_Request, TCL_Waiting, TCL_Sneaking, TCL_Flanking, TCL_Behaviour];
|
||||
|
||||
if (_units findIf { (alive _x) } < 0) then
|
||||
{
|
||||
["TCL_Position", _group] call (TCL_Marker_F select 0);
|
||||
};
|
||||
|
||||
_array deleteAt (_array find _group);
|
||||
|
||||
if (_array isEqualTo [] ) then
|
||||
{
|
||||
TCL_DeleteAT(TCL_Logic,0,_logic);
|
||||
|
||||
["TCL_Delete", _logic] call (TCL_Marker_F select 0);
|
||||
|
||||
deleteVehicle _logic;
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,9 @@
|
||||
/* ////////////////////////////////////////////////////////////////////////////////
|
||||
\ \ Tactical Combat Link
|
||||
\ \------------------------------------------------------------------------------
|
||||
\ \ Macros
|
||||
\ \----------------------------------------------------------------------------
|
||||
/ / By =\SNKMAN/=
|
||||
/ /-----------------------------------------------------------------------------
|
||||
*/ ///////////////////////////////////////////////////////////////////////////////
|
||||
#define TCL_DeleteAT(_array, _index, _object); (_array select _index) deleteAt ( (_array select _index) find _object);
|
@ -0,0 +1,244 @@
|
||||
TCL_Move_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Move Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Move
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic","_array","_spot","_waypoint"];
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
private _position = (_group getVariable "TCL_Position");
|
||||
|
||||
if ( [_enemy, _group, _logic] call (TCL_Move_F select 1) ) then
|
||||
{
|
||||
_position = [_enemy, _group, _logic, _array] call (TCL_Move_F select 2);
|
||||
};
|
||||
|
||||
if ( (_leader distance _position > 10) || (_leader distance _waypoint > 10) ) then
|
||||
{
|
||||
_group move _position;
|
||||
|
||||
if (alive _spot) then
|
||||
{
|
||||
_spot setPos _position;
|
||||
};
|
||||
};
|
||||
|
||||
_group setVariable ["TCL_Waypoint", _position];
|
||||
|
||||
["TCL_Position", _group, _position] call (TCL_Marker_F select 0);
|
||||
|
||||
// player sideChat format ["TCL_Move_F > Group > %1 > %2", _group, _position];
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Move Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Move
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic"];
|
||||
|
||||
private _return = False;
|
||||
|
||||
if (_group in (TCL_Hold select 0) ) then
|
||||
{
|
||||
if ( [_group, _logic] call TCL_Trigger_F ) then
|
||||
{
|
||||
_return = True;
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_group in (TCL_Waiting select 0) ) then
|
||||
{
|
||||
if ( [_enemy, _group, _logic] call (TCL_Waiting_F select 0) ) then
|
||||
{
|
||||
_return = True;
|
||||
|
||||
TCL_Waiting set [0, (TCL_Waiting select 0) - [_group] ];
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_return = True;
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Move Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Move
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic","_array"];
|
||||
|
||||
private "_position";
|
||||
|
||||
private _knowsAbout = 0;
|
||||
|
||||
if (alive _enemy) then
|
||||
{
|
||||
_knowsAbout = (_group knowsAbout vehicle _enemy);
|
||||
};
|
||||
|
||||
private _value = 100;
|
||||
|
||||
private _distance = 0;
|
||||
|
||||
private _object = _logic;
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
private _direction = (random 360);
|
||||
|
||||
if (_knowsAbout > 0) then
|
||||
{
|
||||
private _count = (count _array);
|
||||
|
||||
// if ( (_count > 0) || { (floor (random 100) < 50) } ) then
|
||||
|
||||
if (_count > 0) then
|
||||
{
|
||||
if (_count == 0) then
|
||||
{
|
||||
_count = 1;
|
||||
};
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _range = (TCL_Tweak select 1);
|
||||
|
||||
private _random = (TCL_Tweak select 2);
|
||||
|
||||
if (_leader distance _logic < _range) then
|
||||
{
|
||||
if (combatmode _group isEqualTo "RED") then
|
||||
{
|
||||
_random = (_random + 15);
|
||||
};
|
||||
|
||||
if (_leader in _array) then
|
||||
{
|
||||
if (isNull objectParent _leader) exitWith {};
|
||||
|
||||
_random = (_random / _count);
|
||||
|
||||
// player sideChat format ["TCL_Move_F > Leader > %1 > %2 > %3", _group, _random, _count];
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_random = 100;
|
||||
};
|
||||
|
||||
if (floor (random 100) < _random) then
|
||||
{
|
||||
_distance = (_leader distance _enemy);
|
||||
|
||||
private _tweak = (TCL_Tweak select 3);
|
||||
|
||||
_value = 1 + (random _tweak);
|
||||
|
||||
_distance = (_distance / _value);
|
||||
|
||||
// player sideChat format ["TCL_Move_F > Move > %1 > %2 > %3%4 > %5 > %6 > %7 > %8", _group, (count _array), (round _random), "%", round (_leader distance _enemy), (round _range), (behaviour _leader), (combatMode _group ) ];
|
||||
}
|
||||
else
|
||||
{
|
||||
_distance = 0;
|
||||
|
||||
_object = _leader;
|
||||
|
||||
// player sideChat format ["TCL_Move_F > Stop > %1 > %2 > %3 > %4 > %5 > %6 > %7%8", _group, round (_leader distance _enemy), (behaviour _leader ), (combatMode _group), (count _array), (round _range), (round _random), "%"];
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Move_F > Visible > %1 > %2 > %3 > %4 > %5", _group, _range, round (_leader distance _enemy), (combatMode _group), (behaviour _leader ) ];
|
||||
|
||||
_direction = (_enemy getDir _leader);
|
||||
|
||||
if (floor (random 100) < 50) then
|
||||
{
|
||||
_random = (random 10 - random 10);
|
||||
|
||||
_direction = (_direction + _random);
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Move_F > Direction > %1 > %2", _group, _direction];
|
||||
}
|
||||
else
|
||||
{
|
||||
_skill = [_group] call TCL_Accuracy_F;
|
||||
|
||||
_value = (_value / _skill);
|
||||
|
||||
_distance = (random _value - random _value);
|
||||
|
||||
// player sideChat format ["TCL_Move_F > Random > %1 > %2 > %3", _group, _skill, _value];
|
||||
|
||||
// player sideChat format ["TCL_Move_F > Random > %1 > %2 > %3 > %4 > %5", _group, round (_leader distance _enemy), (behaviour _leader ), (combatMode _group), (count _array) ];
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_distance = (random _value - random _value);
|
||||
|
||||
if (alive _enemy) then
|
||||
{
|
||||
if ( (group _enemy) isEqualTo (_logic getVariable "TCL_Group") ) then
|
||||
{
|
||||
_groups = (_logic getVariable "TCL_Reinforcement");
|
||||
|
||||
{if (_x knowsAbout vehicle _enemy > 0) exitWith {_logic setPos (getPos _enemy) } } count _groups;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if (vehicle _leader isKindOf "Ship") then
|
||||
{
|
||||
_direction = (_enemy getDir _leader);
|
||||
|
||||
_distance = (_leader distance _enemy);
|
||||
|
||||
_distance = (_distance - 300);
|
||||
|
||||
private _position = [_object, _distance, _direction] call TCL_Real_Pos_F;
|
||||
|
||||
if (surfaceIsWater _position) then
|
||||
{
|
||||
_distance = _distance;
|
||||
}
|
||||
else
|
||||
{
|
||||
_distance = (_distance + 200);
|
||||
};
|
||||
};
|
||||
|
||||
if (_logic getVariable "TCL_Artillery" select 1) then
|
||||
{
|
||||
if (_leader distance _logic < 200) then
|
||||
{
|
||||
_distance = 0;
|
||||
|
||||
_object = _leader;
|
||||
|
||||
// player sideChat format ["TCL_Move_F > Artillery > %1", _group];
|
||||
};
|
||||
};
|
||||
|
||||
_position = [_object, _distance, _direction] call TCL_Real_Pos_F;
|
||||
|
||||
_position
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,108 @@
|
||||
TCL_Radio_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Radio Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Radio
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_x"];
|
||||
|
||||
private _return = True;
|
||||
|
||||
if (TCL_Radio select 0) then
|
||||
{
|
||||
_return = False;
|
||||
|
||||
private _bool = [_group] call (TCL_Radio_F select 1);
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
private _leader = (leader _group);
|
||||
|
||||
private _distance = [_group] call (TCL_Radio_F select 2);
|
||||
|
||||
if (_leader distance leader _x < _distance) then
|
||||
{
|
||||
_bool = [_x] call (TCL_Radio_F select 1);
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
_leader = (leader _x);
|
||||
|
||||
_distance = [_x] call (TCL_Radio_F select 2);
|
||||
|
||||
if (_leader distance leader _group < _distance) then
|
||||
{
|
||||
_return = True;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Radio Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Radio
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
private _return = False;
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
if (_units findIf { ( (alive _x) && ( ("ItemRadio" in items _x) || ("ItemRadio" in assigneditems _x) ) ) } > -1) then {_return = True};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Radio Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Radio
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
private _vehicle = (vehicle leader _group);
|
||||
|
||||
private "_index";
|
||||
|
||||
if (True) then
|
||||
{
|
||||
if (_vehicle isKindOf "Man") exitWith
|
||||
{
|
||||
_index = 0;
|
||||
};
|
||||
|
||||
if (_vehicle isKindOf "Car") exitWith
|
||||
{
|
||||
_index = 1;
|
||||
};
|
||||
|
||||
if (_vehicle isKindOf "Tank") exitWith
|
||||
{
|
||||
_index = 2;
|
||||
};
|
||||
|
||||
if (_vehicle isKindOf "Air") exitWith
|
||||
{
|
||||
_index = 3;
|
||||
};
|
||||
|
||||
_index = 0;
|
||||
};
|
||||
|
||||
private _return = (TCL_Radio select 2 select _index);
|
||||
|
||||
_return
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,125 @@
|
||||
TCL_Rating_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rating Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rating
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group"];
|
||||
|
||||
private _array = [];
|
||||
|
||||
private _rating = [];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
_array = (units _enemy) select { ( (alive _x) && { (_group knowsAbout vehicle _x > 0) } ) };
|
||||
|
||||
{_rating = [_x, _rating] call (TCL_Rating_F select 1) } count [_array, _units];
|
||||
|
||||
private _ai = (_group getVariable "TCL_AI" select 1);
|
||||
|
||||
private _return = [_rating, _ai] call (TCL_Rating_F select 2);
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rating Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rating
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_units","_rating"];
|
||||
|
||||
private _array = [];
|
||||
|
||||
private _value = 0.01;
|
||||
|
||||
private ["_unit","_vehicle"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
if (alive _unit) then
|
||||
{
|
||||
if ( (weapons _unit isEqualTo [] ) || (magazines _unit isEqualTo [] ) ) exitWith {};
|
||||
|
||||
_value = _value + 1;
|
||||
|
||||
_array pushBack _unit;
|
||||
};
|
||||
|
||||
_vehicle = (vehicle _unit);
|
||||
|
||||
if (_vehicle in _array) then
|
||||
{
|
||||
_array = _array;
|
||||
}
|
||||
else
|
||||
{
|
||||
_array pushBack _vehicle;
|
||||
|
||||
if ( (canFire _vehicle) && { (someAmmo _vehicle) } ) then
|
||||
{
|
||||
if (_vehicle isKindOf "Car") exitWith
|
||||
{
|
||||
_value = _value + 5;
|
||||
};
|
||||
|
||||
if (_vehicle isKindOf "Tank") exitWith
|
||||
{
|
||||
_value = _value + 10;
|
||||
};
|
||||
|
||||
if (_vehicle isKindOf "Air") exitWith
|
||||
{
|
||||
_value = _value + 15;
|
||||
};
|
||||
|
||||
if (_vehicle isKindOf "Ship") exitWith
|
||||
{
|
||||
_value = _value + 15;
|
||||
};
|
||||
|
||||
_value = _value + 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_rating pushBack _value;
|
||||
|
||||
_rating
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rating Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Rating
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_array","_ai"];
|
||||
|
||||
private _rating = ( (_array select 0) / (_array select 1) );
|
||||
|
||||
_rating = (_rating + 0.01) / 2;
|
||||
|
||||
if (_rating > 1) then {_rating = 1};
|
||||
|
||||
private _return = False;
|
||||
|
||||
if (_rating > _ai) then
|
||||
{
|
||||
_return = True;
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,285 @@
|
||||
#include "TCL_Macros.hpp"
|
||||
|
||||
TCL_Reinforcement_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Reinforcement Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Reinforcement
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic"];
|
||||
|
||||
private "_groups";
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
private _ai = (_group getVariable "TCL_AI");
|
||||
|
||||
{ (TCL_Reinforcement select _x) pushBack _group} forEach [0,1];
|
||||
|
||||
if (isNil { (_logic getVariable "TCL_Reinforcement") } ) then
|
||||
{
|
||||
(TCL_Request select 0) pushBack _group;
|
||||
|
||||
_logic setVariable ["TCL_AI", _ai];
|
||||
|
||||
_logic setVariable ["TCL_Reinforcement", [_group] ];
|
||||
|
||||
if (_group in (TCL_Hold select 0) ) exitWith {};
|
||||
|
||||
if (floor (random 100) < 15) then
|
||||
{
|
||||
[_enemy, _group] call (TCL_Sneaking_F select 0);
|
||||
|
||||
// player sideChat format ["TCL_Reinforcement_F > Sneaking > %1", _group];
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( (floor (random 100) < 35) && { ( { (alive _x) } count (units _group) < { (alive _x) } count (units _enemy) ) } ) then
|
||||
{
|
||||
if (_leader distance _enemy > 300) then
|
||||
{
|
||||
(TCL_Waiting select 0) pushBack _group;
|
||||
|
||||
private _time = (time + 50);
|
||||
|
||||
_time = _time + (random 70);
|
||||
|
||||
_group setVariable ["TCL_Waiting", _time];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_groups = (_logic getVariable "TCL_Reinforcement");
|
||||
|
||||
_groups pushBack _group;
|
||||
|
||||
if (floor (random 100) < 15) then
|
||||
{
|
||||
[_enemy, _group] call (TCL_Sneaking_F select 0);
|
||||
};
|
||||
};
|
||||
|
||||
if (_group in (TCL_Location select 0) ) then
|
||||
{
|
||||
_groups = (_group getVariable "TCL_Location");
|
||||
|
||||
_ai set [2, count _groups];
|
||||
};
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
if (_group in (TCL_Garrison select 0) ) then
|
||||
{
|
||||
// _units doFollow _leader;
|
||||
|
||||
if (_group in (TCL_Hold select 0) ) exitWith {};
|
||||
|
||||
private _array = (_group getVariable "TCL_Garrison");
|
||||
|
||||
TCL_DeleteAT(TCL_Garrison,0,_group);
|
||||
|
||||
TCL_Garrison set [1, (TCL_Garrison select 1) - _array];
|
||||
};
|
||||
|
||||
if (TCL_Feature select 19) then
|
||||
{
|
||||
if (floor (random 100) < (TCL_Feature select 20) ) then
|
||||
{
|
||||
if (floor (random 100) < 50) then
|
||||
{
|
||||
(TCL_Flanking select 3) pushBack _group;
|
||||
};
|
||||
|
||||
[_group] call (TCL_Flanking_F select 0);
|
||||
};
|
||||
};
|
||||
|
||||
private _time = (_ai select 10);
|
||||
|
||||
_group setVariable ["TCL_Time", (time + _time) ];
|
||||
|
||||
[_enemy, _group, _logic] execFSM (TCL_Path+"TCL\TCL_Reinforcement_F\TCL_System.fsm");
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Reinforcement Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Reinforcement
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic"];
|
||||
|
||||
if (alive _enemy) then
|
||||
{
|
||||
if ( [_enemy, _group, _logic] call (TCL_Reinforcement_F select 2) ) then
|
||||
{
|
||||
private _x = [_enemy, _group] call (TCL_Reinforcement_F select 3);
|
||||
|
||||
private _units = (units _x);
|
||||
|
||||
if (_units findIf { (alive _x) } > -1) then
|
||||
{
|
||||
private _leader = (leader _x);
|
||||
|
||||
if (_x in (TCL_Join select 0) ) exitWith
|
||||
{
|
||||
TCL_DeleteAT(TCL_Join,0,_x);
|
||||
};
|
||||
|
||||
if (isNull objectParent _leader) then
|
||||
{
|
||||
_leader playMove "Acts_listeningToRadio_Loop";
|
||||
|
||||
[_leader] spawn
|
||||
{
|
||||
params ["_leader"];
|
||||
|
||||
private _value = 5 + (random 7);
|
||||
|
||||
sleep _value;
|
||||
|
||||
_leader switchMove "";
|
||||
};
|
||||
};
|
||||
|
||||
private _ai = (_logic getVariable "TCL_AI");
|
||||
|
||||
if (_ai select 11) then
|
||||
{
|
||||
_x setVariable ["TCL_AI", _condition];
|
||||
};
|
||||
|
||||
[_enemy, _x, _logic] call (TCL_Reinforcement_F select 0);
|
||||
|
||||
private _vehicle = (vehicle _leader);
|
||||
|
||||
if (_vehicle isKindOf "Helicopter") then
|
||||
{
|
||||
[_enemy, _group, _vehicle] spawn (TCL_Smoke_F select 0);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Reinforcement Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Reinforcement
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic"];
|
||||
|
||||
private _return = False;
|
||||
|
||||
private _groups = (_logic getVariable "TCL_Reinforcement");
|
||||
|
||||
if (_group in (TCL_Location select 0) ) then
|
||||
{
|
||||
private _array = (_group getVariable "TCL_Location");
|
||||
|
||||
{if (_x in _groups) then {_x = _x} else {_return = True} } count _array;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_group in (TCL_Join select 0) ) then
|
||||
{
|
||||
_return = False;
|
||||
}
|
||||
else
|
||||
{
|
||||
_groups = _groups - (TCL_Join select 0);
|
||||
|
||||
private _ai = (_group getVariable "TCL_AI" select 2);
|
||||
|
||||
_ai = _ai + 1;
|
||||
|
||||
if (count _groups < _ai) then
|
||||
{
|
||||
_return = True;
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Reinforcement_F > Request > %1 > %2 > %3", _group, (count _groups), _ai];
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Reinforcement Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Reinforcement
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group"];
|
||||
|
||||
private _groups = (TCL_Groups select 0);
|
||||
|
||||
if (_group in (TCL_Location select 0) ) then
|
||||
{
|
||||
_groups = (_group getVariable "TCL_Location");
|
||||
}
|
||||
else
|
||||
{
|
||||
_groups = _groups - (TCL_Location select 0);
|
||||
};
|
||||
|
||||
private _array = ( (TCL_Hold select 0) + (TCL_Zeus select 1) + (TCL_Defend select 0) + (TCL_Freeze select 0) + (TCL_Default select 0) + (TCL_Artillery select 0) + (TCL_Reinforcement select 0) );
|
||||
|
||||
_groups = _groups - _array;
|
||||
|
||||
_groups append (TCL_Join select 0);
|
||||
|
||||
private _return = grpNull;
|
||||
|
||||
if (_groups isEqualTo [] ) exitWith {_return};
|
||||
|
||||
if ( [_enemy, _group] call (TCL_Rating_F select 0) ) then
|
||||
{
|
||||
private _leader = (leader _group);
|
||||
|
||||
private _condition = [_group] call (TCL_Radio_F select 2);
|
||||
|
||||
private ["_distance","_units","_bool"];
|
||||
|
||||
{_distance = (_leader distance leader _x);
|
||||
|
||||
if (_distance < _condition) then
|
||||
{
|
||||
_units = (units _x);
|
||||
|
||||
if ( (_units findIf { (alive _x) } > -1) && { (side _group getFriend side _x > 0.6) } ) then
|
||||
{
|
||||
if (side _x getFriend side _enemy < 0.6) then
|
||||
{
|
||||
_bool = [_group, _x] call (TCL_Radio_F select 0);
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
_return = _x;
|
||||
|
||||
_condition = _distance;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
} count _groups;
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,281 @@
|
||||
TCL_Remount_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Remount Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Remount
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
{_x setUnitPos "AUTO"} count _units;
|
||||
|
||||
_group setVariable ["TCL_Enemy", objNull];
|
||||
|
||||
if (isNil { (_group getVariable "TCL_Helicopter") } ) then
|
||||
{
|
||||
_leader = _leader;
|
||||
}
|
||||
else
|
||||
{
|
||||
_leader = (_group getVariable "TCL_Helicopter");
|
||||
|
||||
if (alive _leader) then
|
||||
{
|
||||
_group selectLeader _leader;
|
||||
}
|
||||
else
|
||||
{
|
||||
_leader = (leader _group);
|
||||
};
|
||||
};
|
||||
|
||||
private _vehicle = (assignedVehicle _leader);
|
||||
|
||||
if ( (alive _vehicle) && { (canMove _vehicle) } ) then
|
||||
{
|
||||
_vehicle = _vehicle;
|
||||
}
|
||||
else
|
||||
{
|
||||
_vehicle = (vehicle _leader);
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Remount_F > Vehicle > %1", _vehicle];
|
||||
|
||||
[_group, _vehicle] call (TCL_Remount_F select 1);
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Remount Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Remount
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_vehicle"];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
private _position = (_group getVariable "TCL_Position");
|
||||
|
||||
["TCL_Remount", _group] call (TCL_Marker_F select 0);
|
||||
|
||||
if (_leader in (TCL_Static_Weapon select 0) ) then
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
_units select { (_x in (TCL_Static_Weapon select 0) ) } apply {_x leaveVehicle assignedVehicle _x; [_x] orderGetIn False; [_x] allowGetIn False};
|
||||
|
||||
// {if (_x in (TCL_Static_Weapon select 0) ) then {_x leaveVehicle assignedVehicle _x; [_x] orderGetIn False; [_x] allowGetIn False} } forEach _units;
|
||||
};
|
||||
|
||||
if (True) then
|
||||
{
|
||||
if (_vehicle isKindOf "Ship") exitWith
|
||||
{
|
||||
[_group] call (TCL_Remount_F select 2);
|
||||
};
|
||||
|
||||
if (_vehicle isKindOf "Helicopter") exitWith
|
||||
{
|
||||
private _crew = (crew _vehicle);
|
||||
|
||||
if (_crew findIf { (alive _x) } > -1) then
|
||||
{
|
||||
[_group, _crew, _vehicle] spawn (TCL_Helicopter_F select 1);
|
||||
};
|
||||
|
||||
TCL_Helicopter set [0, (TCL_Helicopter select 0) - _crew];
|
||||
};
|
||||
|
||||
if (_vehicle isKindOf "LandVehicle") exitWith
|
||||
{
|
||||
[_group] call (TCL_Remount_F select 2);
|
||||
|
||||
// player sideChat format ["TCL_Remount_F > Vehicle > %1", (typeOf _vehicle) ];
|
||||
};
|
||||
};
|
||||
|
||||
_group lockWp False;
|
||||
|
||||
_group move _position;
|
||||
|
||||
_units doFollow _leader;
|
||||
|
||||
[_group] call (TCL_Remount_F select 4);
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Remount Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Remount
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
private _vehicles = [];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
(TCL_Remount select 0) pushBack _group;
|
||||
|
||||
private ["_unit","_vehicle"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
_vehicle = (assignedVehicle _unit);
|
||||
|
||||
if (_vehicle in _vehicles) then
|
||||
{
|
||||
_vehicle = _vehicle;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_unit in _vehicle) then
|
||||
{
|
||||
_unit = _unit;
|
||||
}
|
||||
else
|
||||
{
|
||||
_vehicles pushBack _vehicle;
|
||||
|
||||
TCL_Assign set [0, (TCL_Assign select 0) - [_vehicle] ];
|
||||
|
||||
["TCL_Remount", _group, _vehicle] call (TCL_Marker_F select 0);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_units orderGetIn True; _units allowGetIn True;
|
||||
|
||||
[_group, _vehicles] spawn (TCL_Remount_F select 3);
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Remount Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Remount
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_vehicles"];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
{_x forceSpeed 0} count _vehicles;
|
||||
|
||||
while { (count _units > 0) } do
|
||||
{
|
||||
// player sideChat format ["TCL_Remount_F > Units > %1", _units];
|
||||
|
||||
_units = _units select { ( (alive _x) && { (isNull objectParent _x) } && { (count assignedVehicleRole _x > 0) } && { (assignedVehicle _x in _vehicles) } && { (_x in units _group) } ) };
|
||||
|
||||
if (_group in (TCL_Reinforcement select 0) ) exitWith
|
||||
{
|
||||
{if (_x distance assignedVehicle _x > 100) then { [_x] orderGetIn False; [_x] allowGetIn False} } count _units;
|
||||
};
|
||||
|
||||
sleep 5;
|
||||
};
|
||||
|
||||
{_x forceSpeed -1} count _vehicles;
|
||||
|
||||
TCL_Remount set [0, (TCL_Remount select 0) - [_group] ];
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Remount Function #4
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Remount
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
private _array = (_group getVariable "TCL_Behaviour");
|
||||
|
||||
_group setBehaviour (_array select 0);
|
||||
|
||||
_group setCombatMode (_array select 1);
|
||||
|
||||
_group setFormation (_array select 2);
|
||||
|
||||
_group setSpeedMode (_array select 3);
|
||||
|
||||
[_group] spawn (TCL_Remount_F select 5);
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Remount Function #5
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Remount
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group"];
|
||||
|
||||
if (_group in (TCL_Garrison select 2) ) then
|
||||
{
|
||||
private _bool = True;
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
private _position = (_group getVariable "TCL_Position");
|
||||
|
||||
private _distance = (_leader distance _position);
|
||||
|
||||
private _time = (time + 30);
|
||||
|
||||
_time = (_time + _distance);
|
||||
|
||||
while { (_leader distance _position > 10) } do
|
||||
{
|
||||
if ( (time > _time) || (_group in (TCL_Reinforcement select 0) ) ) exitWith
|
||||
{
|
||||
_bool = False;
|
||||
};
|
||||
|
||||
sleep 10;
|
||||
};
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
private _units = (units _group);
|
||||
|
||||
if (vehicle _leader isKindOf "Car") then
|
||||
{
|
||||
{ [_x] orderGetIn False; [_x] allowGetIn False} count _units;
|
||||
|
||||
sleep 10;
|
||||
};
|
||||
|
||||
[_group] spawn (TCL_Garrison_F select 0);
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,162 @@
|
||||
TCL_Reveal_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Reveal Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Reveal
|
||||
// By =\SNKMAN/=
|
||||
// Used: Unassign Function #3
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_logic"];
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private _skill = [_group] call TCL_Accuracy_F;
|
||||
|
||||
private _groups = (_logic getVariable "TCL_Reinforcement");
|
||||
|
||||
// player sideChat format ["TCL_Reveal_F > TCL_Unassign_F > %1", _groups];
|
||||
|
||||
_groups = _groups - [_group];
|
||||
|
||||
private ["_enemy","_bool","_knowsAbout","_knowledge","_random"];
|
||||
|
||||
{_enemy = (_x getVariable "TCL_Enemy");
|
||||
|
||||
_bool = [_group, _x] call (TCL_Radio_F select 0);
|
||||
|
||||
if ( (alive _enemy) && { (_bool) } ) then
|
||||
{
|
||||
_knowsAbout = (_x knowsAbout vehicle _enemy);
|
||||
|
||||
if (_knowsAbout > (_group knowsAbout vehicle _enemy) ) then
|
||||
{
|
||||
_bool = [_group, _x] call (TCL_KnowsAbout_F select 4);
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
_knowledge = (_group knowsAbout vehicle _enemy);
|
||||
|
||||
_random = (random _knowsAbout);
|
||||
|
||||
_random = (_random * _skill);
|
||||
|
||||
_knowledge = (_knowledge + _random);
|
||||
|
||||
_group reveal [_enemy, _knowledge];
|
||||
|
||||
// player sideChat format ["TCL_Reveal_F > Unassign > Reveal > %1 > %2", _x, _group];
|
||||
}
|
||||
else
|
||||
{
|
||||
_units doWatch (getPos _enemy);
|
||||
|
||||
// player sideChat format ["TCL_Reveal_F > Unassign > Watch > %1 > %2", _x, _group];
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Reveal_F > Unassign > %1 > %2 > %3 > %4", _enemy, _x, _group, _knowsAbout];
|
||||
};
|
||||
};
|
||||
|
||||
} count _groups;
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Reveal Function #1
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Reveal
|
||||
// By =\SNKMAN/=
|
||||
// Used: TCL_System.fsm
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group","_logic"];
|
||||
|
||||
private _groups = (TCL_Groups select 0);
|
||||
|
||||
private _skill = [_group] call TCL_Accuracy_F;
|
||||
|
||||
_groups = _groups - (TCL_Reinforcement select 0);
|
||||
|
||||
_groups = _groups select { (side _group getFriend side _x > 0.6) };
|
||||
|
||||
if (_groups isEqualTo [] ) exitWith {True};
|
||||
|
||||
private _value = (TCL_IQ select 0);
|
||||
|
||||
private _distance = (TCL_IQ select 1);
|
||||
|
||||
private _knowsAbout = (_group knowsAbout vehicle _enemy);
|
||||
|
||||
private ["_leader","_bool","_units","_random"];
|
||||
|
||||
{_leader = (leader _x);
|
||||
|
||||
_bool = [_group, _x, _distance] call (TCL_Reveal_F select 2);
|
||||
|
||||
if ( (isNull objectParent _leader) && { (_bool) } ) exitWith
|
||||
{
|
||||
_units = (units _x);
|
||||
|
||||
_random = (random _knowsAbout);
|
||||
|
||||
// _random = (_random / _skill);
|
||||
|
||||
if (_random > _value) then
|
||||
{
|
||||
_x reveal [_enemy, _random];
|
||||
|
||||
// player sideChat format ["TCL_Reveal_F > Communicate > Reveal > %1 > %2 > %3", _enemy, _group, _x];
|
||||
}
|
||||
else
|
||||
{
|
||||
_units doWatch (getPos _enemy);
|
||||
|
||||
// player sideChat format ["TCL_Reveal_F > Communicate > Watch > %1 > %2 > %3", _enemy, _group, _x];
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Reveal_F > Enemy > %1 > %2 > %3 > %4", _enemy, _group, _x, _random];
|
||||
};
|
||||
|
||||
} count _groups;
|
||||
|
||||
True
|
||||
|
||||
},
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Reveal Function #2
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Reveal
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_x","_distance"];
|
||||
|
||||
private _return = False;
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
private ["_unit","_bool"];
|
||||
|
||||
private _count = 0;
|
||||
|
||||
for "_count" from _count to (count _units - 1) do
|
||||
{
|
||||
_unit = (_units select _count);
|
||||
|
||||
if ( (alive _unit) && { (units _x findIf { ( (alive _x) && { (_unit distance _x < _distance) } ) } > -1) } ) exitWith
|
||||
{
|
||||
_bool = [_group, _x] call (TCL_KnowsAbout_F select 4);
|
||||
|
||||
if (_bool) then
|
||||
{
|
||||
_return = True;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,22 @@
|
||||
TCL_Ship_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Ship Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_logic","_vehicle"];
|
||||
|
||||
private _bool = True;
|
||||
|
||||
while { ( (alive _vehicle) && (canMove _vehicle) ) } do
|
||||
{
|
||||
if (getPosATL _vehicle select 2 < 3) exitWith {};
|
||||
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
{ [_x] orderGetIn False; [_x] allowGetIn False} forEach units _group;
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,58 @@
|
||||
TCL_Sneaking_F = [
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/* /--------------------------------------------------------------------------
|
||||
\ \ Sneaking Function #0
|
||||
\ \-------------------------------------------------------------------------
|
||||
\ \ By =\SNKMAN/=
|
||||
/ /------------------------------------------------------------------------
|
||||
*//////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_enemy","_group"];
|
||||
|
||||
private _return = False;
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
_knowsAbout = (_units findIf { ( (alive _x) && { (group _enemy knowsAbout vehicle _x > 0) } ) } );
|
||||
|
||||
if (_group in (TCL_Sneaking select 0) ) then
|
||||
{
|
||||
if (_knowsAbout > -1) then
|
||||
{
|
||||
_return = True;
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_knowsAbout == -1) then
|
||||
{
|
||||
private _leader = (leader _group);
|
||||
|
||||
if (_leader distance _enemy < 300) then
|
||||
{
|
||||
if ( (units _enemy findIf { (_group knowsAbout vehicle _x > 0) } > -1) || (_group in (TCL_Reinforcement select 1) ) ) then
|
||||
{
|
||||
if (isNull objectParent _leader) then
|
||||
{
|
||||
_return = True;
|
||||
|
||||
{_x disableAI "AUTOCOMBAT"} count _units;
|
||||
|
||||
_group setBehaviour "AWARE";
|
||||
_group setCombatMode "WHITE";
|
||||
|
||||
(TCL_Sneaking select 0) pushBack _group;
|
||||
|
||||
// player sideChat format ["TCL_Sneaking_F > Sneaking > %1", _group];
|
||||
|
||||
{if (floor (random 100) < 50) then {_x setUnitPos "MIDDLE"} } count _units;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
|
||||
}
|
||||
];
|
@ -0,0 +1,89 @@
|
||||
TCL_Stuck_F = [
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Stuck Function #0
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Stuck
|
||||
// By =\SNKMAN/=
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
{params ["_group","_vehicle"];
|
||||
|
||||
private _leader = (leader _group);
|
||||
|
||||
if (_leader in assignedVehicle _leader) then
|
||||
{
|
||||
private _driver = (driver _vehicle);
|
||||
|
||||
if (alive _driver) then
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
[_leader] orderGetIn False;
|
||||
|
||||
_leader assignAsDriver _vehicle;
|
||||
|
||||
[_leader] orderGetIn True;
|
||||
};
|
||||
|
||||
private _units = (units _group);
|
||||
|
||||
if (_count == 0) then
|
||||
{
|
||||
if (_units findIf { (currentCommand _x isEqualTo "GET IN") } > -1) then
|
||||
{
|
||||
_count = 30;
|
||||
|
||||
// player sideChat format ["TCL_Stuck_F > Get In > %1", _group];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_vehicle distance _position > 3) then
|
||||
{
|
||||
_count = 30;
|
||||
|
||||
_position = (getPos _vehicle);
|
||||
|
||||
// player sideChat format ["TCL_Stuck_F > Moving > %1", _group];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_vehicle in (TCL_Stuck select 0) ) then
|
||||
{
|
||||
_count = _count - 1;
|
||||
|
||||
_group leaveVehicle _vehicle;
|
||||
|
||||
// player sideChat format ["TCL_Stuck_F > Stuck > %1", _group];
|
||||
}
|
||||
else
|
||||
{
|
||||
_count = 30;
|
||||
|
||||
(TCL_Stuck select 0) pushBack _vehicle;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
private _array = [5,15,25];
|
||||
|
||||
if (_count in _array) then
|
||||
{
|
||||
// _return = _units findIf { ( (_x == vehicle _x) && { (currentCommand _x isEqualTo "GET IN") } && { (_x distance assignedVehicle _x < 100) } ) };
|
||||
|
||||
{if ( (isNull objectParent _x) && { (currentCommand _x isEqualTo "GET IN") } && { (_x distance assignedVehicle _x < 100) } ) exitWith { [_group, assignedVehicle _x] spawn (TCL_Vehicle_F select 2) } } count _units;
|
||||
};
|
||||
|
||||
_count = _count - 1;
|
||||
};
|
||||
|
||||
// player sideChat format ["TCL_Stuck_F > Count > %1 > %2", _group, _count];
|
||||
};
|
||||
|
||||
_count
|
||||
|
||||
}
|
||||
];
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user