Dynamic ForGroup and GroupEnumUnits solutions.

Sooda

Diversity enchants
Reaction score
318
I would like to know what people use when they want to manipulate with function when using ForGroup or GroupEnumUnits natives. You can' t directly add arguments nor refer to them somehow.
I haven' t encountered need to do so until now. Goal is that it would be MUI. What solutions there are so far ?
 

Waaaaagh

I lost all my rep and my title being a jerk
Reaction score
70
A 0.00 Timer with a group attached that calls your ForGroup function.

Of course, what I usually do is just loop through the group where the ForGroup function would be.
 

Waaaaagh

I lost all my rep and my title being a jerk
Reaction score
70
Mehk HAM!

Doesn't ForGroup start a new thread? Or did I imagine that...

Da best way to do this is TEXTMACRO-INLINING.
 

Sim

Forum Administrator
Staff member
Reaction score
534
Well, do you really need that ForGroup call?

If not, loop through the group. You can take as many arguments as you want ;)
 

Sooda

Diversity enchants
Reaction score
318
> just use a temp global.

How instant would be using globals ? Can' t they be overwritten by new values if new function runs ?

> A 0.00 Timer with a group attached that calls your ForGroup function.

attached ? Sounds like a system ? What system I need to use for that ?

> If not, loop through the group. You can take as many arguments as you want

You mean our old trusted FirstOfGroup loop ?
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
Can' t they be overwritten by new values if new function runs ?
Only if you have a wait in the ForGroup callback, and since that it impossible to have you don't have to worry. ForGroup + globals is safe and faster than a FirstOfGroup loop, and ForGroup doesn't empty the group as FirstOfGroup loop does.
 

Sooda

Diversity enchants
Reaction score
318
phyrex1an said:
Only if you have a wait in the ForGroup callback, and since that it impossible to have you don't have to worry. ForGroup + globals is safe and faster than a FirstOfGroup loop, and ForGroup doesn't empty the group as FirstOfGroup loop does.

Does that apply to boolexpr also ?
 

SFilip

Gone but not forgotten
Reaction score
634
filter from GroupEnumUnits*? Yeah, it does.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top