Jump to content
Sign in to follow this  
cyclone83

AI boarding multiple vehicles?

Recommended Posts

Hi guys,

I'm stuck on this for many days now and all research did't lead me to what I am searching for.

The mission scenario:

An AI group with player lead by an AI unit starts at the mission beginning in a vehicles cargo via the common "unit moveInCargo vehicle" line. As I want the player to sit in the drivers cabin I gave every unit a specific seat with the "unit assignAsCargo [vehicle, 3]" line. By thinking it over I maybe should change the moveInCargo line to: {x_ moveInCargo vehicle} forEach units groupname?

Now as we get droped out at the MTVR's "unload transport" WP we're supposed to board another vehicle (a Dingo2A2). I want the player to get in as driver but I cannot manage to get it done. "Get in" WP doesn't do the trick, moveInCargo etc. neither works :(

Has anyone a solution or suggestion for this, possibly without heavy scripting formulas?

Edited by Cyclone83

Share this post


Link to post
Share on other sites

I think if memory serves you need move them out of the vehicle using something like this

{ unassignVehicle _x;
_x leaveVehicle car_name;
   moveOut _x; 
_x moveincargo new_car_name;
} foreach units group player -[player];
unassignVehicle player;
moveOut player;
player moveindriver new_car_name;

I think you only need the leavevehicle or moveout command but it shouldn't do any harm to leave them all in.

Share this post


Link to post
Share on other sites

Hm, looks good so far. Unfortunately there're a few other WP's between getting unload by the 1st vehicle and boarding the 2nd one. Your example looks like getting boarded directly after leaving the 1st vehicle?

Share this post


Link to post
Share on other sites

Just split it

// out
{ unassignVehicle _x;
   _x leaveVehicle car_name;
      moveOut _x; 
} foreach units group player

//in
{ _x moveincargo new_car_name;
} foreach units group player -[player];
player moveindriver new_car_name;

Share this post


Link to post
Share on other sites

Thanks mate ;)

Sadly those lines didn't solve it neither :( But i could manage it with a little work around:

First of all I had to rename the AI group leader. He wouldn't get in the first vehicle - cause he got the same name as the group itself :p It neither worked by renaming him to "a0". After renaming him to "a7" it worked :)

As to the assign stuff: I created an "out.sqf" and "in.sqf" which are fired by "player in thislist".

It looks like:

a1 unassignvehicle MTVR;

a2 unassignvehicle MTVR;

etc.

and right befor the "Get in" WP the "in.sqf" is beeing called with the lines:

a1 assignasdriver Dingo2A2;

a2 assignasgunner Dingo2A2;

a3 assignascargo Dingo2A2;

a7 assignascargo Dingo2A2;

This works great now. If I put those lines simply in the "on activation" field of a trigger it won't work for some strange reason :/

Anyway, Thanks! Problem solved ;)

Edited by Cyclone83

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  

×