View Full Version : forcing ai to eject a vehicle
TheJokerMan
Aug 18 2006, 09:07
hey whats up? http://forums.bistudio.com/oldsmileys/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][/QUOTE]
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?
MulleDK13
Aug 18 2006, 09:14
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[/QUOTE]
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][/QUOTE]
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];[/QUOTE]
Hope that helped!
THobson
Aug 18 2006, 14:57
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[/QUOTE]
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[/QUOTE]
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.