Forum Jump :

Author Message


Posts: 13
Rank:


Level: Member

Country: be
Location:
Occupation: Student
Age: 24
In-game name:

 
#1 Posted at 2013-08-06 16:32        
     
so im making this script so i can let ai call backup with a trigger
i execute it with a number, depending of what base the ai is at...
this would be an example:
[1] execVM "heli.sqf"

the problem is the heli wont go to the base location, it wont go to the waypoint, annyone knows why?
inside the heli.sqf:

_base = _this select 0;

//base 1
if (_base == 1) then
{
_xpos = 8113.7085;
_ypos = 9278.9697;
};

//base 2
if (_base == 2) then
{
_xpos = 11527.872;
_ypos = 5019.8696;
};

//base 3
if (_base == 3) then
{
_xpos = 100;
_ypos = 100;
};

/////////////////////////////////////spawn heli and ai in correct location

_grouppilot = createGroup east;


_vehicle_0 = objNull;
if (true) then
{
_this = createVehicle ["UH1Y_DZ", [6675.8667, 1837.8453, 6.2356529], [], 0, "FLY"];
_this setVariable ["Sarge",1,true];
_vehicle_0 = _this;
_this setDir -177.78214;
_this setPos [6675.8667, 1837.8453, 6.2356529];
};

_unit_3 = objNull;
if (true) then
{
_this = _grouppilot createUnit ["BAF_Pilot_MTP", [6642.7354, 8021.4053, 9.1552734e-005], [], 0, "CARGO"];
_unit_3 = _this;
_this setUnitRank "CAPTAIN";
_this setUnitAbility 1;
_this moveInDriver _vehicle_0;
if (true) then {_groupheli selectLeader _this;};
};
_grouppilot setCombatMode "BLUE";
_grouppilot setBehaviour "CARELESS";

_unit_5 = objNull;
if (true) then
{
_this = _grouppilot createUnit ["BAF_Pilot_MTP", [6639.1006, 8021.5103], [], 0, "CARGO"];
_unit_5 = _this;
_this setVehicleInit "_this moveInTurret [_vehicle_0,[1]];";
_this setUnitRank "LIEUTENANT";
_this setUnitAbility 1;
_this moveInTurret [_vehicle_0,[1]];
if (true) then {_groupheli selectLeader _this;};
};

_unit_7 = objNull;
if (true) then
{
_this = _grouppilot createUnit ["BAF_Pilot_MTP", [6643.6538, 8019.312, 6.1035156e-005], [], 0, "CARGO"];
_unit_7 = _this;
_this setVehicleInit "_this moveInTurret [_vehicle_0,[0]];";
_this setUnitRank "CORPORAL";
_this setUnitAbility 1;
_this moveInTurret [_vehicle_0,[0]];
if (false) then {_groupheli selectLeader _this;};
};



_this = _grouppilot addWaypoint [[_xpos, _ypos, 0], 0];
_this setWaypointType "MOVE";
_waypoint_0 = _this;
_grouppilot setcurrentWaypoint _waypoint_0;

/*affect correct base
if (_base == 1) then {groupbackup1 = _groupheli;};
if (_base == 2) then {groupbackup2 = _groupheli;};
if (_base == 3) then {groupbackup3 = _groupheli;};
*/

waitUntil {([_xpos, _ypos, 50] distance _vehicle_0) < 200;};
_grouppilot setCombatMode "RED";
_grouppilot setBehaviour "COMBAT";

www.ceasefiredayz.com





Tags: Ai, Backup, Heli, Waypoint