OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: klavan on 15 Dec 2004, 21:39:20

Title: XXX = group this (for all units in a group?)
Post by: klavan on 15 Dec 2004, 21:39:20
Hi all.
I've got a 4-men team and I want to group 'em. In the init field of the leader I type the XXX= group this (and that's OK). What I need to know is if I have to type the same command in the init field of each squad member or if is sufficient doing this only in the leader's one...
This dubt came up after the examine of a mission by toadlife (operation lojack).
Thanks in advance for any help! Bye.
Title: Re:XXX = group this (for all units in a group?)
Post by: Homefry31464 on 15 Dec 2004, 21:41:40
Should work with just the commander of the group, for example I put this code in the leader's Init. field all the time....

grp = group this; "_x moveincargo helo" foreach units grp

So to answer your question, it just has to be in the leaders field only.
Title: Re:XXX = group this (for all units in a group?)
Post by: Triggerhappy on 15 Dec 2004, 21:46:55
doesn't even need to be the leader, just any group member
Title: Re:XXX = group this (for all units in a group?)
Post by: klavan on 15 Dec 2004, 22:04:10
Ok, I'm very happy to know that I don't have to paste about 200 time the same command in my mission.... :)
Thank you, guys!
Title: Re:XXX = group this (for all units in a group?)
Post by: Kilo11 on 15 Dec 2004, 22:33:53
What command do you use to call that specific group up inside a script/trigger?
Title: Re:XXX = group this (for all units in a group?)
Post by: klavan on 15 Dec 2004, 23:02:07
What command do you use to call that specific group up inside a script/trigger?

It depends:
If you want to fire a trigger when the entire group is dead you have to type in the trigger's condition field:
count units grp == "not alive _x" count units grp
Where "grp" is the name of the group
I suggest you to take a look at the editors depot: it's an invaluable source of examples for this kind of problems.
Hope this help. ;)