Jump to content
Sign in to follow this  
CarlGustaffa

How to getGroupId?

Recommended Posts

Anyone knows any tricks to obtain a groups "name" after having used setGroupId on it?

I'm doing the BIS trick where a group joins another empty one (civilian with grpwpa = group this; deleteVehicle this) but with defined waypoints to reduce clutter, instead of a ton of waypoints and switch triggers for all groups. But when whatever group was closest at the time comes to that position and reports in, they report as "1-1-A" instead of whatever groupId I gave them.

So, are there any tricks available to getGroupId so I can give this to the group they join? I.e. some kind of _id = format ["%1",magictrick]; :)

Edit: Joining a preplaced civilian, will make them join side Civilian. And this one really got me going - preplace an opfor unit, will make them join Opfor. But they still saw eachother as the enemy and tried to kill off each other, as well as other BluFor units in the area. LOOL. Probably why we don't have a setSide that works for units :D

hint "Someone joins new wps"; xxx = [] spawn {_dist=0; _cs=""; _leader=objNull; if (leader gAlpha distance tt < leader gBravo distance tt) then {_cs="NewAlpha"; _leader=leader gAlpha} else {_cs="NewBravo"; _leader=gBravo}; {[_x] joinSilent wpgrp} forEach units _leader; wpgrp setGroupid [_cs]}

where tt is just a trigger.

Came up with the above, which kind of helps at least for only two groups, but a quick oneliner, maybe in macro format, would be very helpful.

Edited by CarlGustaffa

Share this post


Link to post
Share on other sites

Quick and nasty way to get a GID:

_grp = group player;
_grp setGroupID ["November"];

_text = toArray(str(_grp));
_text set[0,"**DELETE**"];
_text set[1,"**DELETE**"];
_text = _text - ["**DELETE**"];
_txt = toString(_text);

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×