Don't think this is possible, at least in the galaxy GUI editor. What you can do is create a data table trigger, unfortunately you would have to manually add all regions to a data table and name each one.
Yeah, the lack of being able to call regions/points by name is annoying. I had a league of points set up base0-hatchery, base1-hatchery, ect that I would have loved to just say:
for each n 0 to 10 { array[n] = PointFromStrring("base" + n + "-hatchery") };
I had about 12 buildings with 10 points each. :/ That woulda saved a bunch of time. Luckily, I at least realized a workaround before trying to assign all 120 or so Points and then I deleted 110 of those Points. :p
The only way to do it, is to store all your regions in an array on map initialization. You can then easily iterate through all of your regions, if it is that what you want to do.
... or if the regions only contain hatcheries or other buildings you'd like to loop through, add the buildings to a unit group and use that instead in your for loop.
There's pretty much always another way of doing the same thing (usually without too much "ugly code") when the editor doesn't let you do it the first way.
Okay. This seems like it should be supremely easy, but I cannot find how to do this simply.
I want a function that returns the name of a region.
For example, I want the trigger:
unit enters Any region
set string STRING = name of triggering region
Don't think this is possible, at least in the galaxy GUI editor. What you can do is create a data table trigger, unfortunately you would have to manually add all regions to a data table and name each one.
Then you can do a set variable name from data table.
Untitled Variable 001 is a string btw not a region
Hope this helps
Yeah, the lack of being able to call regions/points by name is annoying. I had a league of points set up base0-hatchery, base1-hatchery, ect that I would have loved to just say:
for each n 0 to 10 { array[n] = PointFromStrring("base" + n + "-hatchery") };
I had about 12 buildings with 10 points each. :/ That woulda saved a bunch of time. Luckily, I at least realized a workaround before trying to assign all 120 or so Points and then I deleted 110 of those Points. :p
still not possible?
Damn, was looking to do the same but with points as well.
The reason this can't be done is that the name of a region isn't stored anywhere except in the map editor - thus it is not available at runtime.
The only way to do it, is to store all your regions in an array on map initialization. You can then easily iterate through all of your regions, if it is that what you want to do.
... or if the regions only contain hatcheries or other buildings you'd like to loop through, add the buildings to a unit group and use that instead in your for loop.
There's pretty much always another way of doing the same thing (usually without too much "ugly code") when the editor doesn't let you do it the first way.