Home   Help Search Login Register  

Author Topic: This group?  (Read 1196 times)

0 Members and 1 Guest are viewing this topic.

Swaty

  • Guest
This group?
« on: 30 Jan 2005, 13:31:40 »
Hello. I am trying to extensivly copy and paste groups to a mission of mine. What I basicly want to do is to have half the group standing still until the alarm is sounded while the other half patrols an area.

Currently I am looking for some way to not having to type out the groupnumber more then once in the init of the leader of the group(s).

The init looks like this:
ResXXX = group this; "commandstop _x" foreach units ResXXX; this doFollow this
...where ResXXX obviously are the name of the group.

So basicly I would like it to look something like this:
ResXXX = group this; "commandstop _x" foreach units [THIS_GROUP]; this doFollow this

I am also having another problem, wish are actually worse. I want some of the soldiers in the group to follow the leader at once, but I do not want to type in their names in any init. I was trying to put
this doFollow this in their init, but that didn't work.

And while I am still typing, any way of in a waypoint call ResXXX's call the groups groupleader? I want to do a
"_x commandfollow" foreach units GroupXXX; this doFollow [GroupXXX_Leader]

Have I lost you now? It feels pretty clear in my head, I just can't explain it rather well:(

Swaty

Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
Re:This group?
« Reply #1 on: 30 Jan 2005, 14:28:04 »
The group of any soldier is just GROUP THIS. You can use GROUP THIS for any groupname.

Example:

"_x commandfollow" foreach units (group this); this doFollow [leader (group this)]

etc..

Swaty

  • Guest
Re:This group?
« Reply #2 on: 30 Jan 2005, 15:01:29 »
 ??? I am afraid it didn't work for me. I pasted that into the init line of number two in the group and it returned the error "doFollow: Type Any, expected Array,Object

Maybe I did something wrong?

Swaty

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:This group?
« Reply #3 on: 30 Jan 2005, 15:04:43 »
I'm not sure that doFollow commands in an init field actually do anything.    My understanding is that this command makes a unit follow its group leader, which he would do anyway at the start of a mission.    

You'd expect to issue a doFollow command after, say, a doStop command earlier on.

Try it with round brackets ( ) not square [ ].   The plain fact is that most forum answers are fundamentally correct but many contain errors of syntax.    Coping from a forum post directly into a mission without understanding what you are doing and checking the syntax in the comref normally ends in tears.
« Last Edit: 30 Jan 2005, 15:06:14 by macguba »
Plenty of reviewed ArmA missions for you to play

Swaty

  • Guest
Re:This group?
« Reply #4 on: 30 Jan 2005, 15:14:01 »
You'd expect to issue a doFollow command after, say, a doStop command earlier on.

Well, I do have a commandStop _x in the init of the leader... But then I want to get parts of the groups to move with the leader. My idea is that it should be easy to copy the group and use in other parts of the maps with as little typing as possible 8)


Coping from a forum post directly into a mission without understanding what you are doing and checking the syntax in the comref normally ends in tears.

I do often cry alot  :-\

Swaty

Edit:
I did put in "this doFollow (leader (group this))" in the init of one of the soldiers, but he actually does not follow the leader. Could it be becouse the leader got a " "commandstop _x" foreach units Res999" in his init? And the leaders init takes out the other soldiers?
« Last Edit: 30 Jan 2005, 15:22:47 by Swaty »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:This group?
« Reply #5 on: 30 Jan 2005, 16:47:08 »
Ah yes, I see.   Tricky.

You could be right.    I would certainly say that trying to have commands, all placed in init fields, carried out in a particular order is liable to lead to confusion on the part of the game.

Since you want half the group to follow the leader, and half to stay where they are, why not just use doStop commands on the loons you want to stay still?  
Plenty of reviewed ArmA missions for you to play

Swaty

  • Guest
Re:This group?
« Reply #6 on: 30 Jan 2005, 17:29:55 »
Well, because I want them to join up the group when the alarm is sounded.

Basicly, around the bases some members of the groups patroling will be idle by the campfires or whatever while a small part of the group are out on patrol. But then when the alarm is sounded, everyone goes into aware and joins up with the patrols.

And this is the same for most of my patroling groups, thereby I want it to be easy to cut and paste the groups. I did on another try copy them into the map and then replace all the groupnames with uniqe names but that took too long...

So basicly, it would be very neat if I would only have to change the groupname in the leaders init. That is my goal.

Swaty

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:This group?
« Reply #7 on: 30 Jan 2005, 17:48:16 »
Create your group.    In the init fields of the units that you want to keep still write

doStop this

Give the group a bunch of move waypoints, a cycle waypoint, and then whatever waypoints you want for after the enemy is detected.    Synchro the cycle waypoint with a switch trigger:

Activation field:     West (enemy) detected by East (or whatever)
Condition:   this or ("alive _x" count units grp1 < 7)
On activation:   leader grp1 setBehaviour "aware"; "_x doFollow (leader grp1)" forEach units grp1

Syntax not guaranteed.    In the original trigger you'll have to change the 7 to the actual number of group member.     Once you've got it working, copy and paste to your heart's content.    

You have to change the name of the group in the init field of each group leader after you have copied and pasted, and you'll have to change the group name in the trigger.  

Easy peasy lemon squeezy.  :)

« Last Edit: 30 Jan 2005, 17:49:21 by macguba »
Plenty of reviewed ArmA missions for you to play

Swaty

  • Guest
Re:This group?
« Reply #8 on: 30 Jan 2005, 18:36:16 »
I'll test this tomorrow. If it work, I'll carry your babies!  ;D

Swaty