Jump to content
Sign in to follow this  
AnimalMother92

Lock an AI squad to an object's position

Recommended Posts

Hi all,

I'm making a combat search and rescue mission where a downed helo (the UH1 wreck model) is spawned randomly within a 200m radius. I want to have a squad (the pilots and marines aboard) to spawn next to the location of the chopper and hold there wherever they start. Any help is appreciated. Thanks!

Share this post


Link to post
Share on other sites

I have a mission template on compa where a heli is spwaned with a group of soliders attached to it. I will post when I get a chance.

Share this post


Link to post
Share on other sites

Perhaps something like this in the init of each soldier?

this setpos [(getpos myCrashedHelo select 0) + (random 20) - 10, (getpos myCrashedHelo select 1) + (random 20) - 10, 0]

This should teleport each soldier to a random position near the chopper. (And maybe sometimes inside the chopper? You'd have to test to see whether this was a big problem or not.)

Share this post


Link to post
Share on other sites

You got me thinking about this, so I started working on a similar mission. But I'm stuck on how to spawn the wreck. Can anyone suggest a better way to do this than what I have below?

; Generate random positions in 500m diameter from marker1

x = round(random 1000) -500;

y = round(random 1000) -500;

SpawnPos = setPos [ (getPos Marker1 select 0) + x, (getPos Marker1 select 1) +y, (getPos Marker1 select 2) +0.2];

; Create Vehicle at the randomly generated position

wreck = "UH1Wreck" createVehicle (getMarkerPos "Spawnpos");

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  

×