Skip to content

Commit

Permalink
0.3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
armazac committed Aug 13, 2016
1 parent 5ece583 commit 09a182c
Show file tree
Hide file tree
Showing 18 changed files with 851 additions and 244 deletions.
119 changes: 119 additions & 0 deletions AI/QRF/CTRGsupport.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
private ["_group","_population","_posTown","_vehs","_soldier","_vehtype","_pos","_wp","_numgroups","_attackpos","_count","_tgroup","_ao"];

_posTown = _this;

_vehs = [];
_soldiers = [];
_groups = [];

_count = 0;
_pos = AIT_NATO_HQPos;

_dir = [_pos,_posTown] call BIS_fnc_dirTo;

_attackpos = [_posTown,[0,150]] call SHK_pos;

//Determine direction to attack from (preferrably away from water)
_attackdir = random 360;
if(surfaceIsWater ([_posTown,150,_attackDir] call BIS_fnc_relPos)) then {
_attackdir = _attackdir + 180;
if(_attackdir > 359) then {_attackdir = _attackdir - 359};
if(surfaceIsWater ([_posTown,150,_attackDir] call BIS_fnc_relPos)) then {
_attackdir = _attackdir + 90;
if(_attackdir > 359) then {_attackdir = _attackdir - 359};
if(surfaceIsWater ([_posTown,150,_attackDir] call BIS_fnc_relPos)) then {
_attackdir = _attackdir + 180;
if(_attackdir > 359) then {_attackdir = _attackdir - 359};
};
};
};
_attackdir = _attackdir - 45;


_ao = [_posTown,[350,500],_attackdir + (random 90)] call SHK_pos;
_group = createGroup blufor;


{
_type = _x;
_civ = _group createUnit [_type, AIT_NATO_HQPos, [],0, "NONE"];
_civ setRank "CAPTAIN";
}foreach(AIT_NATO_Units_CTRGSupport);

sleep 0.2;

//Transport
_tgroup = creategroup blufor;
_pos = [_pos,60,80,false,[0,0],[100,AIT_NATO_Vehicle_CTRGTransport]] call SHK_pos;
sleep 0.1;
_veh = createVehicle [AIT_NATO_Vehicle_CTRGTransport, _pos, [], 0,""];
_vehs pushback _veh;


_veh setDir (_dir);
_tgroup addVehicle _veh;
createVehicleCrew _veh;
{
[_x] joinSilent _tgroup;
_x setVariable ["NOAI",true,false];
_x setVariable ["garrison","HQ",false];
}foreach(crew _veh);

{
_x moveInCargo _veh;
_soldiers pushback _x;
_x setVariable ["garrison","HQ",false];
}foreach(units _group);

sleep 1;

_moveto = [AIT_NATO_HQPos,500,_dir] call SHK_pos;
_wp = _tgroup addWaypoint [_moveto,0];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "COMBAT";
_wp setWaypointSpeed "FULL";
_wp setWaypointCompletionRadius 150;
_wp setWaypointStatements ["true","(vehicle this) flyInHeight 100;"];

_wp = _tgroup addWaypoint [_ao,0];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "COMBAT";
_wp setWaypointStatements ["true","(vehicle this) AnimateDoor ['Door_rear_source', 1, false];"];
wp setWaypointCompletionRadius 50;
_wp setWaypointSpeed "FULL";

_wp = _tgroup addWaypoint [_ao,0];
_wp setWaypointType "SCRIPTED";
_wp setWaypointStatements ["true","[vehicle this,50] execVM 'funcs\addons\eject.sqf'"];
_wp setWaypointTimeout [10,10,10];

_wp = _tgroup addWaypoint [_ao,0];
_wp setWaypointType "SCRIPTED";
_wp setWaypointStatements ["true","(vehicle this) AnimateDoor ['Door_rear_source', 0, false];"];
_wp setWaypointTimeout [15,15,15];

_moveto = [AIT_NATO_HQPos,200,_dir] call SHK_pos;

_wp = _tgroup addWaypoint [_moveto,0];
_wp setWaypointType "LOITER";
_wp setWaypointBehaviour "SAFE";
_wp setWaypointSpeed "FULL";
_wp setWaypointCompletionRadius 100;

_wp = _tgroup addWaypoint [_moveto,0];
_wp setWaypointType "SCRIPTED";
_wp setWaypointStatements ["true","[vehicle this] execVM 'funcs\cleanup.sqf'"];

_wp = _group addWaypoint [_attackpos,20];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "COMBAT";

_wp = _group addWaypoint [_attackpos,0];
_wp setWaypointType "GUARD";
_wp setWaypointBehaviour "COMBAT";

{
_x addCuratorEditableObjects [_vehs+_soldiers,true];
} forEach allCurators;


8 changes: 6 additions & 2 deletions AI/QRF/NATOattack.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,21 @@ while {_count < _numgroups} do {

_wp = _tgroup addWaypoint [_moveto,0];
_wp setWaypointType "LOITER";
_wp setWaypointBehaviour "SAFE";
_wp setWaypointBehaviour "CARELESS";
_wp setWaypointSpeed "FULL";
_wp setWaypointCompletionRadius 100;

_wp = _tgroup addWaypoint [_moveto,0];
_wp setWaypointType "SCRIPTED";
_wp setWaypointStatements ["true","[vehicle this] execVM 'funcs\cleanup.sqf'"];

_wp = _group addWaypoint [_attackpos,0];
_wp = _group addWaypoint [_attackpos,20];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "COMBAT";

_wp = _group addWaypoint [_attackpos,0];
_wp setWaypointType "GUARD";
_wp setWaypointBehaviour "COMBAT";

{
_x addCuratorEditableObjects [_vehs+_soldiers,true];
Expand Down
Loading

0 comments on commit 09a182c

Please sign in to comment.