Jump to content
Sign in to follow this  
Chop

AI disembark when i land in a zone

Recommended Posts

Hi

in my mission i fly a helicopter and i want the AI units to disembark when i land in a marked zone ( trigger area ), i can`t get the condition right. how do i set the condition so they disembark when i land in the trigger area? thanks for the help :)

Share this post


Link to post
Share on other sites

You can add this to the conditions field:

((getpos (thislist select 0)) select 2 < 1)

It will check if the vehicle is on the ground.

EDIT:

To make them get out, try this in the on activation field"

{unassignVehicle _x} forEach crew _vehicleName

Edited by UltimateBawb

Share this post


Link to post
Share on other sites

works great! thanks

Share this post


Link to post
Share on other sites

I have another question.

You can add this to the conditions field:

((getpos (thislist select 0)) select 2 < 1)

It will check if the vehicle is on the ground.

the trigger activates when any BLUFOR is in the TriggerArea, how can i limit the activation to the player and/or Helicopter? Thanks.

Share this post


Link to post
Share on other sites

Can I just clarify; does - {unassignVehicle _x} forEach crew _vehicleName - translate to

{unassignVehicle NAME OF PASSENGER} forEach crew NAME OF VEHICLE?

And is this going onto the activation field in a trigger with the init code? Sorry, stupid question, but I'm still learning! Is this how you make multiple passengers disembark?

Share this post


Link to post
Share on other sites

Exactly Kydoimos. crew _vehicleName returns and array of all the units in the vehicle. Then the { } forEach steps through that array replacing the _x with each value of the crew array in turn, unassigning each. _x is the magic variable that is replaced like that in things like forEach.

That code would probably go in a trigger near your landing spot that you know you'll pass by perhaps or a waypoint of the vehicle on the way.

You could also just use:

commandGetOut units grp1;

Share this post


Link to post
Share on other sites

I've tried the commandGetout command, and the ai in the helicopter reply 'negative' to disembarking. The chopper is on the ground and the doors are open. Bit strange. I'll try the script above again. Any chance for an example script for that? Not sure I'm doing it correctly. Let's say we have a chopper called 'heli1' and four passengers 's1,s2,s3,s4'. Would the script be

{unassignVehicle s1} forEach crew heli1

? And then would I just repeat that for passenger, just replacing the s1 with s2, s3, and s4? If so, I can't get it to work. Sorry, know it's probably not right. I get a bit confused with 'returns', 'arrays', and 'variables' etcs.

Share this post


Link to post
Share on other sites
I have another question.
You can add this to the conditions field:

((getpos (thislist select 0)) select 2 < 1)

It will check if the vehicle is on the ground.

the trigger activates when any BLUFOR is in the TriggerArea, how can i limit the activation to the player and/or Helicopter? Thanks.

player in thislist && this - this will only trigger when the player is in trigger area and the condition of the trigger is met (ie blufor present).

Replace player for the name of the helo, to get the helo to trigger it.

Note if you want to detect the player and he is in a vehicle, use 'vehicle player'.

Cheers

GC

Share this post


Link to post
Share on other sites
I've tried the commandGetout command, and the ai in the helicopter reply 'negative' to disembarking. The chopper is on the ground and the doors are open. Bit strange.

Are you doing the same thing as the OP? Player pilot dropping off AI units? Do the AI units have somewhere to go after they disembark, more waypoints?

Share this post


Link to post
Share on other sites

It's an AI pilot dropping off a group. Everything is fine unless the player is the group team leader. I am automatically pushed out of the heli but my team stays inside. I order them to get out but they won't. I haven't added extra group waypoints - do you think this might be the issue?

Share this post


Link to post
Share on other sites

Sorry if this has already been asked but I couldn't find it in the search, only this thread. How do I make an AI unit that I have already picked up disembark when he reaches the trigger from a ground vehicle? I followed some steps to make the unit embark using a synchronised waypoint and trigger but how do I use waypoints and triggers to disembark him? When I tried just adding a 3rd waypoint (Get Out) at the trigger zone nothing happened :/

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  

×