I think you can use the "point from name" function and check if it is a valid point, maps usually have the same starting point naming convention like "Start Location 001" etc.
hhhm, thats a good backup plan, but wont work on every map
i just checked on iron fortress, and the starting positions are named in korean :(
they still end in "001" tho - can i use wildcards when picking points by name?
because, come to think of it - starting points are the only points on melee maps anyways, so i could just use any defined point and get the starting locations
edit: i cant even copy/paste the korean characters into the point name: field :(
Another (not-100%-reliable) solution might be to use PointFromId(int id). This is a native function that returns a pre-placed point with the given ID. It's used behind the curtains when you pick a pre-placed point in the UI trigger editor and there's no corresponding UI trigger action for it, but you could easily make one yourself.
It's not foolproof because some melee maps could have pre-placed points other than starting locations and there's no way to distinguish between normal points and starting locations in script. Also, the IDs don't necessarily correspond with the starting location numbers if they weren't placed in sequential order (i.e. point 1 == starting location 001, point 2 == starting location 002, etc).
So at best, this approach can give you points which are probably starting locations and maaaybe in the right order.
Another random idea that won't always be correct... Could probably use positioning of minerals/resources to find base locations. Would grab expansions too though. Main bases tend to be on the highest cliff level though (but not in all maps...).
Perhaps you could have the map pre-place town halls at all the start locations and generate the points based on the positions of the players, then subsequently remove them?
Perhaps you could have the map pre-place town halls at all the start locations and generate the points based on the positions of the players, then subsequently remove them?
If this is for an extension mod which should work for standard ladder maps like Iron Fortress then that's not an option.
I must point out that there is no 001 at the end of your string there
Edit: Had to pause testing of this, but I've learned that I can produce the same characters as the point's name, but it won't find the point. Will resume testing later.
So I think this may be a bug by blizzard, however with my testing I have been unable to figure out why it is acting like it is. I have found other stuff that I may have screwed up on. However you should make this bug report to blizzard.
What I think may be causing this is that the name of the point is rendered as a text but the ASCII string never converts and then it tries to match strings, but they don't match.
What I think may be causing this is that the name of the point is rendered as a text but the ASCII string never converts and then it tries to match strings, but they don't match.
If that were the case, then trying to do this with a point named with basic Latin letters would also fail, which it doesn't.
The reason it doesn't work is because the GUI doesn't allow backslash escape sequences. Escape sequences do work in Galaxy script, but the GUI automatically escapes backslashes so that they're interpreted as literal characters and not part of escape sequences.
E.g.
gv_startK1="\xec\x8b\x9c\xec\x9e\x91\x20\xec\x9e\xa5\xec\x86\x8c\x20\x30\x30\x31";// custom script - worksgv_startK1="\\xec\\x8b\\x9c\\xec\\x9e\\x91\\x20\\xec\\x9e\\xa5\\xec\\x86\\x8c\\x20\\x30\\x30\\x31";// generated by the GUI - doesn't work
If you want to go with this approach, you'll have to switch to the Custom Script option when you set the string value in the GUI, and add quotation marks around it.
But be aware that this isn't a 100% reliable solution either. Some map-makers may rename starting locations to suit their preferences, especially in team-based maps, like "Start Location - Top 1" for example.
I did use the Custom Script option, one of my checks was to display what i was processing, however I do think that the editor tries to compare the point's name and the ASCII string as strings, not text.
Another fun thing I did was use substring of string and display it, and which despite what i thought should happen (displaying that many characters), what happens is if you set the length of the substring to
"\xec\x"
it processes this instead
"\xec\x8b"
which shows that it automatically closes out characters strings.
However in the end i was still unable to get "\xec\x8b\x9c\xec\x9e\x91\x20\xec\x9e\xa5\xec\x86\x8c\x20\x30\x30\x31"
to correctly link up a point when using get point from name.
Edit: Also if you compare ASCII character strings, it doesn't compare the resulting characters, but the characters of the string for each character, this causes "\x8b" and "\x8B" to result as not the same (if you validate capitalization), even though they return the same character.
is there a way to get the points/locations of potential starting positions, not the actual ones the players got?
for example, when playing a 1on1 on a 4 player map, is there a way to use the starting locations not used by either player in triggers?
@summerloud: Go
I think you can use the "point from name" function and check if it is a valid point, maps usually have the same starting point naming convention like "Start Location 001" etc.
hhhm, thats a good backup plan, but wont work on every map
i just checked on iron fortress, and the starting positions are named in korean :(
hhhm, thats a good backup plan, but wont work on every map
i just checked on iron fortress, and the starting positions are named in korean :(
they still end in "001" tho - can i use wildcards when picking points by name?
because, come to think of it - starting points are the only points on melee maps anyways, so i could just use any defined point and get the starting locations
edit: i cant even copy/paste the korean characters into the point name: field :(
No.
Another (not-100%-reliable) solution might be to use PointFromId(int id). This is a native function that returns a pre-placed point with the given ID. It's used behind the curtains when you pick a pre-placed point in the UI trigger editor and there's no corresponding UI trigger action for it, but you could easily make one yourself.
It's not foolproof because some melee maps could have pre-placed points other than starting locations and there's no way to distinguish between normal points and starting locations in script. Also, the IDs don't necessarily correspond with the starting location numbers if they weren't placed in sequential order (i.e. point 1 == starting location 001, point 2 == starting location 002, etc).
So at best, this approach can give you points which are probably starting locations and maaaybe in the right order.
You can use this ( https://www.sc2mapster.com/forums/resources/third-party-tools/126614-sc2-unicode-translate/#p1 ) to convert the korean characters into ASCII, then you can use that to create a generic starting point from name tool.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Another random idea that won't always be correct... Could probably use positioning of minerals/resources to find base locations. Would grab expansions too though. Main bases tend to be on the highest cliff level though (but not in all maps...).
Perhaps you could have the map pre-place town halls at all the start locations and generate the points based on the positions of the players, then subsequently remove them?
Custom Campaign Initiative | Mapster Community Project: Data Wizards
Starcraft II: Unsung Rebels, a custom campaign for Starcraft II
SC2Saver, a way to create saved games via trigger
Frustrated with the editor and would like answers in real time? Join the SC2Mapster Discord!
If this is for an extension mod which should work for standard ladder maps like Iron Fortress then that's not an option.
@willuwontu: Go
that seems like the best solution, but i cant really get it to work
i just copy what the transcoding text into the string value for find point by name, or is something else needed?
It should just be copy paste ... reference this post for details https://www.sc2mapster.com/forums/development/galaxy-scripting-and-trigger-lib/88792-non-english-strings/#p13
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
hhhm, cant get it to work :(
my triggers still work on maps with english starting points, but not on the korean ones
i copy/pasted the korean starting point names out of the map and put them in converter
시작 장소 001
equals
\xec\x8b\x9c\xec\x9e\x91\x20\xec\x9e\xa5\xec\x86\x8c\x20\x30\x30\x31
then i set my point variable to that point and try to create a unit there - doesnt work:
I must point out that there is no 001 at the end of your string thereEdit: Had to pause testing of this, but I've learned that I can produce the same characters as the point's name, but it won't find the point. Will resume testing later.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
So I think this may be a bug by blizzard, however with my testing I have been unable to figure out why it is acting like it is. I have found other stuff that I may have screwed up on. However you should make this bug report to blizzard. What I think may be causing this is that the name of the point is rendered as a text but the ASCII string never converts and then it tries to match strings, but they don't match.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
too bad :(
If that were the case, then trying to do this with a point named with basic Latin letters would also fail, which it doesn't.
The reason it doesn't work is because the GUI doesn't allow backslash escape sequences. Escape sequences do work in Galaxy script, but the GUI automatically escapes backslashes so that they're interpreted as literal characters and not part of escape sequences.
E.g.
If you want to go with this approach, you'll have to switch to the Custom Script option when you set the string value in the GUI, and add quotation marks around it.
But be aware that this isn't a 100% reliable solution either. Some map-makers may rename starting locations to suit their preferences, especially in team-based maps, like "Start Location - Top 1" for example.
I did use the Custom Script option, one of my checks was to display what i was processing, however I do think that the editor tries to compare the point's name and the ASCII string as strings, not text.
Another fun thing I did was use substring of string and display it, and which despite what i thought should happen (displaying that many characters), what happens is if you set the length of the substring to
it processes this instead
which shows that it automatically closes out characters strings.
However in the end i was still unable to get "\xec\x8b\x9c\xec\x9e\x91\x20\xec\x9e\xa5\xec\x86\x8c\x20\x30\x30\x31" to correctly link up a point when using get point from name.
Edit: Also if you compare ASCII character strings, it doesn't compare the resulting characters, but the characters of the string for each character, this causes "\x8b" and "\x8B" to result as not the same (if you validate capitalization), even though they return the same character.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)