Jump to content
Sign in to follow this  
m16a2m203

Create group then group movement

Recommended Posts

Posted this at OFPEC but have yet to recieve an answer ...

How would I go about making a script to create a group once another unit from the opposite side sets off a trigger. I've found an example in the forums but it doesn't show how to then get the new units to move to a location near the unit that caused the trigger.

Example - I set off an alarm (trigger) and automatically elsewhere on the map in a large radius a group is randomly placed. That group then moves to the direction of the trigger area. The trigger loops so that lets say every few minutes a new enemy unit is created and moves again until finally I move out of the trigger area. I want all of this to use area radius placement to make things radom instead of "scripted" everytime.

Any examples out there or someone can point me in the right direction?

Thanks.

Share this post


Link to post
Share on other sites

I you want ingame created units to follow waypoints, you must create a unit, give this unit waypoints that the newly created units must follow and in the init line of the unit write:

GroupAlpha = group this; deleteVehicle this;

The ingame created units you assign to group "GroupAlpha" and the new units will follow the waypoints.

Good luck, I have some test missions if you want I can sent you.

Ottie

Share this post


Link to post
Share on other sites

Try :

trigger : activated by west, repeatly

condition : this and now

on activation : [thislist select 0] exec "respawn.sqs";[time in minutes] exec "wait.sqs"

respawn.sqs

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

; 1)You must enter your own x,y and random values. These are example

"here" setMarkerPos [1000+random 5000,1500+random 3000]

;2)here put respawn script that creates new group at "here" marker position

;name newly created group or at least one man so you can use move command

;3)move command :

(leader newgroup) move position (_this select 0)

;or : leader (group newunit) move position (_this select 0)

;then you can add:

; newgroup setBehaviour "aware"

; newgroup setCombatMode "yellow"

; newgroup setFormation "wedge"

exit

<span id='postcolor'>

Move command(3) creates move waypoint at position of activating unit.

You also need another script that will change variable now to true after several minutes.

script : wait.sqs

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

now=false

_w=_this select 0

~(_w*60)

now=true

exit

<span id='postcolor'>

Some respawn scripts were posted on this forum or maybe somebody else help you with it.

Probably you will have to modify existing one because of group naming and names recycling.

With good names recycling you can have infinity waves of incoming enemy forces.

Of course there shoud be some easiest way I don't know about. smile.gif

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  

×