Home   Help Search Login Register  

Author Topic: Make a group - with objects and units?  (Read 1358 times)

0 Members and 1 Guest are viewing this topic.

Offline GomerPyle

  • Members
  • *
  • OFPEC rocks.....
Make a group - with objects and units?
« on: 01 May 2009, 09:05:54 »
Hi!

I have a problem I have been trying to find a solution to here. I am rubbish at scripting.

But is there anyone in here that can help me?

Not sure if this is possible.

I have an objective in my mission. Find a "downed" UH-60.

The UH-60 is a flammable object from editor update 1.02. I have 5 units with 0 life (so they drop to the ground on mission start). And an ammobox with pipebombs (needed to complete the rest of the mission). They are all located near eachother to simulate a crashsite.

Is there any way I can group these and have them spawn on different locations with use of hidden markers and still be in the same kind of layout? I can get them to spawn on totally different locations one by one. But not as they are now spread around in a little crashtheme.

It is the grouping bit making my head in. But any help with this at all would be really great.

Thanks,

Offline Sparticus76

  • Members
  • *
Re: Make a group - with objects and units?
« Reply #1 on: 02 May 2009, 08:20:34 »
yep
lay everything out how you want it in the editor with the objects..downedhelo, pipebombbox, deadguy1, deadguy2 etc.

use the helo as centre.... _helopos = getpos downedhelo
then work out the offsets... _pipebombboxXoffset = _helopos select 0 - ((getpos Pipebombbox) select 0)
_pipebomboxYoffset = _helopos select 1 - ((getpos Pipebombbox) select 1)

find out all object x and y offsets like this, then when the downedhelo is setpos'd using a random position, offset the objects as follows..

pipebombox setpos [((getpos downedhelo) select 0) - _pipebombboxXoffset, ((getpos downedhelo) select 0) - _pipebombboxYoffset,0]

may work, should work, one way to do it, completely untested.