Jump to content

Recommended Posts

Hello Guys!

Is it possible to refer to group via group callsign?

I mean I have something like this:

_grpCallsign = (groupId (group _unit));

How to refer to the group from _grpCallsign? Or only through traversing and searching across allGroups?

Share this post


Link to post
Share on other sites

Why? I cant imagine that this is really needed.

 

But you can crawl allGroups using findIf to get the group with the specific ID...

Share this post


Link to post
Share on other sites
3 hours ago, sarogahtyp said:

Why? I cant imagine that this is really needed.

 

But you can crawl allGroups using findIf to get the group with the specific ID...

 

Because need it to store unique string id of the group in assoc. array, but may be will continue to search how to identify the group w/o using it global variable or callsign.

Share this post


Link to post
Share on other sites
5 minutes ago, FoxtrotF said:

 

Because need it to store unique string id of the group in assoc. array, but may be will continue to search how to identify the group w/o using it global variable or callsign.

why not using the group itself instead of the groups ID?

maybe showing some more code of your purpose could help...

Share this post


Link to post
Share on other sites
1 hour ago, sarogahtyp said:

why not using the group itself instead of the groups ID?

maybe showing some more code of your purpose could help...

 

My Implementation of the assoc. array uses "string_key"-> [value or any_object],  then I'm using just string_key to retrieve the value, but key should be the unique string, not object.

Code is spread across different functions and fsm states, but mainly in event handlers, for example to register when members of the group fire, so my idea was to store it in lightweight assoc. array via key as "unique_group_callsign" and "boolean, coordinates" as the value,  for example to send nearest SAD patrol. Without need to worry about duplicating group objects, as array deals with it and stores only the recent one. But now I guees, I need rethink and work around this problem.

Share this post


Link to post
Share on other sites

_group = group anyUnit;   // group

_strGrp = str _group  // stringified callsign of group (more exactly: letter of side, space, callsign. Example:  B Alpha1-1 or O gogol)

 you can get the string of callsign by:   str _group select [2]

 

 

  • Like 2

Share this post


Link to post
Share on other sites
2 hours ago, pierremgi said:

_group = group anyUnit;   // group

_strGrp = str _group  // stringified callsign of group (more exactly: letter of side, space, callsign. Example:  B Alpha1-1 or O gogol)

 you can get the string of callsign by:   str _group select [2] 

 

 

 

Thank you, very appreciate!

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

×