Jump to content
Sign in to follow this  
RonnieJ

AI wont eject?!

Recommended Posts

Hey guys... im trying to get this AI group to eject from the chopper but they are apparently afraid to do so! :)

_grp = [_pos, side, _units, [], [], skill] call BIS_fnc_spawnGroup;

The choppers second waypoint:

_wp2 = heli_group addWaypoint [getMarkerPos "test2", 100];

_wp2 setWaypointSpeed "COMBAT";

_wp2 setWaypointType "MOVE";

_wp2 setWaypointStatements ["true","[_heli,_grp] execVM ""test.sqf"""];

Test.sqf

test = _this select 1;

{

_x action ["eject", _this select 0];

} forEach units test;

I also tried just to have the foreach in the statement of the second waypoint but that had the same effect... no eject... :confused:

---------- Post added at 02:59 PM ---------- Previous post was at 02:36 PM ----------

setWaypointStatements is that the same as onActivation in the editors GUI for waypoints?

Edited by RonnieJ

Share this post


Link to post
Share on other sites
Hey guys... im trying to get this AI group to eject from the chopper but they are apparently afraid to do so! :)

_grp = [_pos, side, _units, [], [], skill] call BIS_fnc_spawnGroup;

The choppers second waypoint:

_wp2 = heli_group addWaypoint [getMarkerPos "test2", 100];

_wp2 setWaypointSpeed "COMBAT";

_wp2 setWaypointType "MOVE";

_wp2 setWaypointStatements ["true","[_heli,_grp] execVM ""test.sqf"""];

Test.sqf

test = _this select 1;

{

_x action ["eject", _this select 0];

} forEach units test;

I also tried just to have the foreach in the statement of the second waypoint but that had the same effect... no eject... :confused:

---------- Post added at 02:59 PM ---------- Previous post was at 02:36 PM ----------

setWaypointStatements is that the same as onActivation in the editors GUI for waypoints?

There is an easier way to do this but before I post what it is, I need to know a few things...

Is the chopper landing or are they supposed to jump out of the chopper while its in the air?

Are they spawning later in the mission?

Edited by Toasticuss

Share this post


Link to post
Share on other sites

Thx

The group and chopper is spawning later on in the mission... and the group is then foreached and put into the cargo of the chopper.

The group need to eject in mid air and parachute down.

Share this post


Link to post
Share on other sites
Thx

The group and chopper is spawning later on in the mission... and the group is then foreached and put into the cargo of the chopper.

The group need to eject in mid air and parachute down.

Okay, well put a trigger where you know the helicopter will cross and have it activate it by entering the area

and put this in the ACT

_xhandle=[squadName,VehicleName] execVM  "jump.sqf";

Change squadName and VehicleName to what you have.

Use this for the jump.sqf script which will execute from the trigger

if (isServer) then {
_group =  _this select 0;
_vehicle = _this select 1;

sleep 2;

{
unassignvehicle _x;
_x action ["EJECT", _vehicle];
sleep 0.5
} foreach units _group;
};

Tell us how it goes.

Share this post


Link to post
Share on other sites

I have just tried this:

_heli = createVehicle ["Mi24_V", _pos, [], 0, "FLY"];

_grp = [_pos, side, _units, [], [], skill] call BIS_fnc_spawnGroup;

_wp2 setWaypointStatements ["true","_xhandle=[_grp,_heli] execVM ""test.sqf"";"];

And the script is run since I see the hint.

if (isServer) then {

hint "1";

_group = _this select 0;

_vehicle = _this select 1;

sleep 2;

{

unassignvehicle _x;

_x action ["EJECT", _vehicle];

sleep 0.5

} foreach units _group;

};

But the chopper is just hanging in the air and no one is leaving it.

Share this post


Link to post
Share on other sites
I have just tried this:

_heli = createVehicle ["Mi24_V", _pos, [], 0, "FLY"];

_grp = [_pos, side, _units, [], [], skill] call BIS_fnc_spawnGroup;

_wp2 setWaypointStatements ["true","_xhandle=[_grp,_heli] execVM ""test.sqf"";"];

And the script is run since I see the hint.

if (isServer) then {

hint "1";

_group = _this select 0;

_vehicle = _this select 1;

sleep 2;

{

unassignvehicle _x;

_x action ["EJECT", _vehicle];

sleep 0.5

} foreach units _group;

};

But the chopper is just hanging in the air and no one is leaving it.

Could be that the units are not grouped to the group leader.

I am not familiar with the spawnGroup function so maybe someone with more experience could help you out.

Share this post


Link to post
Share on other sites

You could try spawning parachute vehicles around the helicopter and place the units in them.

Share this post


Link to post
Share on other sites

If I do a GETOUT on the waypoint insted of just move... it lands and the pilot jumps put... when I check the chopper the groups is inside... so they are there and they have mountet hehe :)

And using call BIS_fnc_spawnGroup; does create a group with a leader

---------- Post added at 05:34 PM ---------- Previous post was at 05:32 PM ----------

When you write: _xhandle=[squadName,VehicleName] execVM "jump.sqf";

Do you then meen that its the name or the object reference? Casue im pretty sure im giving the object reference atm.

And... does every AI need a parachute on them?

Share this post


Link to post
Share on other sites

I tried the eject part of the code and that works correctly, even though it's missing ; at the end of sleep it still works.

I suspect it's how your creating the group.

I'm using it like this (I just grabbed from another project).

_grp = [getMarkerPos "test", west, ["CDF_Soldier_TL", "CDF_Soldier", "CDF_Soldier_Medic", "CDF_Soldier_GL", "CDF_Soldier_AR"],[], ["SERGEANT", "PRIVATE", "PRIVATE", "PRIVATE", "PRIVATE"],[0.3,0.1,0.1,0.1,0.1],[],[],round (random 360)] call BIS_fnc_spawnGroup;

I can just pop those in a chopper and eject them without problems.

Share this post


Link to post
Share on other sites

Okay took a different approach... im not creating the group in the parachutes when the waypoint is reached :) that worked! :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×