[Tutorial] Solution to PickEachX loop

Editor Discussion
Since the release of patch 4.0 many map makers struggle with the change of underlying macros behind actions such as:

Pick Each Integer
Pick Each Player In Player Group
Pick Each Unit In Unit Group


In cases where these loops weren't used as designed, editor fails to recompile map triggers, and error such as the one below is being displayed:
Warning: EDSTR_WARNING_FUNCTIONOUTSIDEPickEachInteger

I might explain later in detail what was changed in definitions of the macros..

But for now I'll just offer a workaroud to this problem. A drop-in library which contains definitions of elements related to these loops from pre v4. This will basically revert the changes Blizzard introduced in the Native library.

Follow these steps:
(this tutorial is meant to be simplest as possible to understand)

1. Go to
https://gist.github.com/Talv/95fd1abb56be023d3b15adc9adb13f15
Download library by clicking Download ZIP, extract the archive.
2. Import downloaded library (legacy-loops.SC2Lib) into your map by going to Data -> Library -> Import Library in the menu (within Trigger Editor).
3. Open find replace window (Edit -> Find/Replace -> Replace) [Ctrl-H]
4. Go to Event/Condition/Action tab. Set the Function Type filter to Action
5. Replace following actions:
Pick Each Integer -> Pick Each Integer (Legacy)
Pick Each Player In Player Group -> Pick Each Player In Player Group (Legacy)
Pick Each Unit In Unit Group -> Pick Each Unit In Unit Group (Legacy)

Repeat Replace All for every one of these tree.
( SEE EXAMPLE: https://i.imgur.com/lrJt8tD.png )
6. Go to Parameter Value tab.
7. Replace following values:
Picked Integer -> Picked Integer (Legacy)
Picked Player -> Picked Player (Legacy)
Picked Unit -> Picked Unit (Legacy)

Repeat Replace All for every one of these tree.
You must set the Script type filter to
- Integer for Picked Integer
- Integer for Picked Player
- Unit for Picked Unit
( SEE EXAMPLE: https://i.imgur.com/Hy25rVB.png )
8. Done.
Wow. This will really help map makers who won't be able to adapt to the newly made system!
Bump to help people

Join the Conversation

Return to Forum