Breaking a Pick Every Unit And do etc. Function

Zealot

Member
Reaction score
11
Is there a different break for the "Pick every unit in unit group and do actions" function than there is for the "For every integer etc." function?
Because
Trigger:
  • Custom script: exitwhen true
doesn't allow my map to run if placed in a "Pick every unit etc." function.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
This, maybe?
Trigger:
  • ---- ----
    • For Each Integer from 1 to (Number of units in TempUnitGroup)
      • Set TempUnit = Random unit from TempUnitGroup
      • Unit Group - Remove TempUnit from TempUnitGroup
      • ----Insert actions here, with TempUnit replacing (Picked unit)----
      • Custom script: exitwhen true
 

Zealot

Member
Reaction score
11
This, maybe?
Trigger:
  • ---- ----
    • For Each Integer from 1 to (Number of units in TempUnitGroup)
    • Set TempUnit = Random unit from TempUnitGroup
    • Unit Group - Remove TempUnit from TempUnitGroup
    • ----Insert actions here, with TempUnit replacing (Picked unit)----
    • Custom script: exitwhen true

I can't remove the units from the unit group though. I have specific units put in the unit group and depending on the unit group they are in the behave differently because I triggered their AI.
 

Solu9

You can change this now in User CP.
Reaction score
216
Set TempUnit = Triggering Unit
Pick every unit in (TempUnitGroup)
Loop
If - Picked unit = TempUnit
Then - something and exitwhen true
Else -

Won't that work?

Edit:
Assuming that "exitwhen true" is the same as "Skip remaining actions".
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
I can't remove the units from the unit group though. I have specific units put in the unit group and depending on the unit group they are in the behave differently because I triggered their AI.

You can just add them all to another, temporary unit group, and remove them from that. Then the original unit group won't be lost.
 

Zealot

Member
Reaction score
11
Set TempUnit = Triggering Unit
Pick every unit in (TempUnitGroup)
Loop
If - Picked unit = TempUnit
Then - something and exitwhen true
Else -

Won't that work?

Edit:
Assuming that "exitwhen true" is the same as "Skip remaining actions".

exitwhen true actually takes you out of the nearest loop only, unlike Skip RA which takes you out of the trigger.

You can just add them all to another, temporary unit group, and remove them from that. Then the original unit group won't be lost.

It might work, I'll have to try that when I get the chance.
 
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