Jump to content
Sign in to follow this  
person915

Spawning AI in Vehicles?

Recommended Posts

I'm trying to insert a USMC Fireteam group into a UH-1Y. The helicopter is flying when the mission starts.

Grouping the chopper and the team won't work, because if they are grouped together when I set the fireteam's waypoints, the chopper will follow the same waypoints. For instance, the fireteam is supposed to ride in the chopper, and the chopper transports them to a specific location, where it lands momentarily while the fireteam gets out, then flies off as the fireteam follows a different direction of waypoints. What happens when they're grouped is that the pilots of the chopper end up getting out with them, and I don't want that. They need to be their own groups.

I know there is a command that will let you insert units into vehicles without grouping them, but I can't remember or find it around here, which is a shame, because I know it's somewhere. I also don't know if I'll have to (when using the command I just mentioned, the one I don't remember) give the chopper a name and use the command in the units' init field, or if I name the units and use the command in the chopper's init field.

Hopefully that will be comprehensible. Can anyone help?

Share this post


Link to post
Share on other sites

Name the UH-1Y

Name your group in the leaders init:

Group1 = group this

Put this in a trigger:

{_x moveInCargo vehicleName} forEach units group1;

Or this in the group leaders init:

{_x moveInCargo vehicleName} forEach units group this;

Share this post


Link to post
Share on other sites

Oh, thanks, you simultaneously answered another one of my questions of how to name a group! Some concepts of naming in the editor are a bit difficult for me as I just don't know WHERE they go, like naming a group, but if I put that logic to other scripts I might be able to figure it out, thanks.

As for the cargo problem, I just used your MoveInCargo script in each of the units' init fields, and named the UH-1Y. I couldn't remember what the script was, but that reminded me of it. I will try to use the concept you're using in your suggestion here, as in naming the group and moving the entire group as cargo in just one command, but I might try it a different way at first, as that script is a bit confusing to me and playing with it might help me get a feel for what it does. Actually, the only things that really confuse me about that script are the use of brackets, and the _x. Why are they like that?

Share this post


Link to post
Share on other sites

Actually I have no idea why its set up that way but I have used the command for a while now. It works in Trig Activ: on waypoints, in scripts and init files so its really reliable.

You only have to have the command in a group leader's init, not on every soldier. Also if you use {_x AssignAsCargo vehicleName} forEach units group1; they will dynamically run and get in which is good for missions where the player is meant to see the event happen.

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  

×