Jump to content
Sign in to follow this  
TheJokerMan

forcing ai to eject a vehicle

Recommended Posts

hey whats up? smile_o.gif im stumped, i want an ai soldier to get out of a truck so i put

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">sol9 action ["eject", vehicle sol9]

in a trigger right? but right after he jumps out. he jumps back in! and doesnt come out again, how do i make him stay out of the truck?

Share this post


Link to post
Share on other sites

You must unassign the unit from the vehicle!

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unassignVehicle unit

example

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unassignVehicle sol9

sol9 action ["eject", vehicle sol9]

and if you use it with a trigger remember to seperate the two commands with;

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unassignVehicle sol9; sol9 action ["eject", vehicle sol9];

Hope that helped!

Share this post


Link to post
Share on other sites

If the units are the original crew of the vehicle then even unassigning them does not stop this behaviour.  I have also found in necessary to use the allowGetIn command.  

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_crew = crew tank1

{unassignVehicle _x;_x action ["eject", vehicle _x]} forEach _crew

_crew allowGetIn false

You only need the eject action is you want them to all get out immediately.  If you prefer a more orderly exit - but taking more time then use the following:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{unassignVehicle _x} forEach crew tank1

(crew tank1) allowGetIn false

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  

×