Pick All Units/Players/Items

Cloud_FF

New Member
Reaction score
5
Somewhere I found a link to a tutorial which explained why and how to replace Pick All XXXXX with variables. The thing is that I lost the link and I need to redo some triggers of that type. Can someone either link it or explain in details how to redo the triggers?

(Referring to Pick All XXXX and do Actions)
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Some memory leak tutorial, I assume, would help here.


Set UnitGroup = Units in ...
Pick every unit in UnitGroup and do
- ... some actions with "Picked unit"
Custom script: call DestroyGroup( udg_UnitGroup )

Set Players = All allies of Player 1 (or whatever you need here)
Pick every player in Players and do
- ... some actions on "Picked player"
Custom script: call DestroyForce( udg_Players )

Note: don't destroy "all players"!


Pick every item in ... does not leak as there are no item groups.
 

Drunken_God

Hopes to get back into Mapmaking with SC2 :)
Reaction score
106
i think you want to replace pick every... with for each integer a do
then you would have to set the variables first e.g.

Set Unit[1] = Footman 001 <gen>
Set Unit[2] = Footman 002 <gen>
Set Unit[3] = Footman 003 <gen>

then in your trigger where you pick the units use
for each integer a from 1 to 3 do
kill unit[integer a]
 

Cloud_FF

New Member
Reaction score
5
Not exactly. The pick all units and players is used in certain events.

Unit dies - Pick all units in rects/in range and do something with them.
Unit dies - Pick all players allies with player 12 and set allegiance to allied.
Pick items - and move them. This is a command triggered by a chatted text.
Periodic - Pick every unit in rect(s) and do something.

The thing is that these are triggers which affect a lot of units.
 
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