Group question

Don

Rise with the Fallens!
Reaction score
52
Is there a trigger-able way to match these conditions:

Create 1 (Random level X unit from unit group)

I just can't find a trigger that does this exactly! Maybe I'm looking at the wrong place?
 

Necrach

You can change this now in User CP.
Reaction score
62
just make another temporary unit group which is the same as the original unit group but then remove all units that's NOT level X! and then use your action for picking a random unit from that variable

eg. you must use variables for the unit groups, if you aren't already
 

Don

Rise with the Fallens!
Reaction score
52
yeah but I wanmna do this for 8 groups... and 10 levels! There must be a shorter way.
 

Necrach

You can change this now in User CP.
Reaction score
62
there is no single GUI action that I know of which can do this. actually, what I suggested is a quite short way, will require like three actions for deciding each random unit, and its possible to make it completely leak-free :)
 

tooltiperror

Super Moderator
Reaction score
231
Don't double post.

there is no single GUI action that I know of which can do this. actually, what I suggested is a quite short way, will require like three actions for deciding each random unit, and its possible to make it completely leak-free :)

There is no way to use GUI Groups without leaking...
 

Don

Rise with the Fallens!
Reaction score
52
Couldn't you just "Pick every unit in (unit group) matching (conditions)"?

Thanks for the help but,

First, this trigger doesn't exist as I can only add the ''matching condition'' part to ''units in region'' or ''units owned by player''.

Second, I'm using the trigger ''create 1 unit in (random unit of level X from unit group)''. I can't really mix pick every unit with that kind of action.
 

tooltiperror

Super Moderator
Reaction score
231
No, you can't, because enumerating a group leaks, and therefore the entire group will leak. You can part of the leak in GUI, but not the whole thing. The only way to use true leakless groups is by using a custom boolexpr.
 

Don

Rise with the Fallens!
Reaction score
52
So there really is no way to get over that situation? I mean, seriously, there must be something!!!
 

Necrach

You can change this now in User CP.
Reaction score
62
Trigger:
  • Actions
    • Unit Group - Pick every unit in UnitGroup and do (Actions)
      • Loop - Actions
        • Set TempUnitGroup1 = UnitGroup
        • Set TempUnitGroup2 = (Units in (Entire map) matching ((Level of (Matching unit)) Not equal to X))
        • Unit Group - Remove all units of TempUnitGroup2 from TempUnitGroup1


Why are you dissing this idea? Here you got the TempUnitGroup1 with all units in UnitGroup with a specific level (X) exactly as you requested.

I do not really get your point, but if you are talking about getting a unit type out of this, you will still need more actions

Trigger:
  • Set UnitTypeVariable = (Unit-type of (Random unit from TempUnitGroup1))
    • Unit - Create 1 UnitTypeVariable etc
 

Don

Rise with the Fallens!
Reaction score
52
Lol, you're a genius, I didn't think that's what you meant with your solution :p Many thanks my friend :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top