_pi_ 10 Posted March 3, 2010 Hello, I am building a new mission for Multiplayer and I have some questions for you all. I have placed a group of players on a map, and I was looking "how" to name that group, for example "Team Alpha" but I can't see where to place the group name with the editor so I have been looking at the code and came to something like that: Being for example a soldiers editor name like "soldier1" (leader of group) soldier2, soldier3, ... group soldier1 setVariable ["Team","Alpha"]; Its ok with any soldier? If any of that group members die will keep the variable with him? Cos at later stages of the game I want to check if any player, being soldier1, soldier2, etc. is a member of that group with this: if (group player getVariable["Team"] == "Alpha") then {....}; will work? I am not at my arma2 computer right now so I can't test it but have been reading a lot and can't find any other way to name groups. Thanks :bounce3: Share this post Link to post Share on other sites
Egosa-U 10 Posted March 3, 2010 Put into leaders init: Alpha = group this Should work even after the leaders death. Share this post Link to post Share on other sites
_pi_ 10 Posted March 3, 2010 Put into leaders init: Alpha = group this Should work even after the leaders death. mm Also maybe It should work this init on leader of group? group this setVariable ["Team","Alpha"]; But how can I check later if a soldier is a member of Alpha group? in your example Alpha is a var name? is just a "text" it looks to me like a var name not a var value. In my example I set the "Team" var (public) a value of "Alpha" (text) so late in game I can check the "Team" variable. Share this post Link to post Share on other sites
Egosa-U 10 Posted March 3, 2010 Mission Editing and Scripting Information -> Comref -> Group obj Share this post Link to post Share on other sites
_pi_ 10 Posted March 3, 2010 Did read it already before asking but I assume I will have to figure it by myself. Thanks for the help anyway. Share this post Link to post Share on other sites
Bon 12 Posted March 3, 2010 mm Also maybe It should work this init on leader of group? group this setVariable ["Team","Alpha"]; But how can I check later if a soldier is a member of Alpha group? in your example Alpha is a var name? is just a "text" it looks to me like a var name not a var value. In my example I set the "Team" var (public) a value of "Alpha" (text) so late in game I can check the "Team" variable. I don't think that this setVariable will work. AFAIK "group" is not an object you can set variables to. For checking whether a unit is of a certain group, you could proceed as Egosa described it, i.e. putting Alpha = group this; into the leaders init line, so that the groupname will be stored into the Variable Alpha, the check then would be simply group <unit> == Alpha; (that's what Egosa tried to point to I think) Share this post Link to post Share on other sites
W0lle 1052 Posted March 3, 2010 §22) Use descriptive thread titles If you start a new thread, please make sure your thread title explains what you want without forcing people to read through your post first. Thread titles such as "How in the world do I...", "Need help!" or "Will we ever see..." are anything but descriptive. We do not allow these kind of titles and threads with such titles are subject to be closed. Share this post Link to post Share on other sites