Home   Help Search Login Register  

Author Topic: AI squad move, Help!  (Read 549 times)

0 Members and 1 Guest are viewing this topic.

magnar

  • Guest
AI squad move, Help!
« on: 11 Jan 2005, 10:33:56 »
 ??? OK, If I wasnt such a tard with scripting.........anyway.  I want to do a simple MOVE or STOP for AI squad using radio commands.  I have three squads (named them Ugroup1, Ugroup2, and Ugroup3), each with one waypoint to go to once they start moving.  I want the player to tell them to stop, and advance when he wants them to.  Ive read other group command scripts, and searched for something  SIMPLE.......but to no avail.  I just want to activate a script with the radio..........telling all squads to stop,  & all squads to move on command.  I hope this is simple and someone can help. If someone do it with a script for one squad, i could just have each individual squad activiate the script when the radio is used.  I'll take anything at this point!  Thanks in advance.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:AI squad move, Help!
« Reply #1 on: 11 Jan 2005, 12:16:58 »
In init.sqs

stopArray = units grp1 + units grp2 + units grp3
1 setRadioMsg "All groups stop!"
2 setRadioMsg "null"


Trigger1

Activation:   Radio Alpha
On Activation:     "doStop _x" forEach stopArray; hint "Groups stopping"; 1 setRadioMsg "null"; 2 setRadioMsg "Groups go!"


Trigger2

Activation: Radio Beta
On Activation:    "_x doMove getPos _x" forEach stopArray; hint "Moving out"; 2 setRadioMsg "null"; 1 setRadioMsg "All groups stop"


Syntax not guaranteed.    I'm not sure if trigger2 will work at all, but worth a try.    Make sure you understand all the commands and do a bit of experimenting.    

I did this myself once a long time ago when I was a noob and found that the best way was to have them stoppable at waypoints only, but that was only because I couln'd work out how to do it better.
Plenty of reviewed ArmA missions for you to play

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:AI squad move, Help!
« Reply #2 on: 11 Jan 2005, 13:31:35 »
Macca's on the right track, but for the second trigger I suggest this:

Trigger2

Activation: Radio Beta
On Activation:    "_x dofollow (leader _x)" forEach stopArray; hint "Moving out"; 2 setRadioMsg "null"; 1 setRadioMsg "All groups stop"

The dofollow command effectively tells the guys to 'get back in formation', and to move to their current waypoint.

Do move will tell them all to move to that specific position. The same as "2, move to tree, 3 o'clock" etc. So they would move as individuals, rather than as a group ;)

Try that and see how you go.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:AI squad move, Help!
« Reply #3 on: 11 Jan 2005, 16:51:22 »
I thought about doFollow, but I didn't know what that would make the group leaders do and I was afraid they'd just stand there.     If it works it's certainly better.
Plenty of reviewed ArmA missions for you to play

magnar

  • Guest
Re:AI squad move, Help!
« Reply #4 on: 11 Jan 2005, 18:08:53 »
Thanks for your help guys.  I will try each suggestion when I get home from work.  I really appreciate it.   ::)

magnar

  • Guest
Re:AI squad move, Help!
« Reply #5 on: 12 Jan 2005, 02:06:57 »
worked perfectly......I used the suggestions from both replys, and we are now in business.  Thanks again guys. :D ;D