OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: magnar 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.
-
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.
-
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.
-
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.
-
Thanks for your help guys. I will try each suggestion when I get home from work. I really appreciate it. ::)
-
worked perfectly......I used the suggestions from both replys, and we are now in business. Thanks again guys. :D ;D