Hey guys, I can call a unit tag from a unit, but how do I call a unit from a unit tag? Would make MUI far more feasible for me
Used to do it in War3, can't imagine they wouldn't put it in SC2, but I can't seem to figure this out, at least not with basic GUI, thus why I came here.
I'm guessing it's pretty simple in galaxy, I just don't know how :(
Rollback Post to RevisionRollBack
Zergling Blood : starcraft://map/1/35684
Game of Thrones : starcraft://map/1/189756
Tacticraft : starcraft://map/1/223625
The best way to achieve this is: Each time you retrieve the unit tag, you store it into the global datatable as key, and the unit as value.
Then you can create a reverse function using datatable lookup with O(1) complexity. :)
Make sure to remove dying or removed units from the datatable again though, otherwise it will get bigger and bigger over time.
Since UnitGetTag returns an int (presumably from an enumerated list of tags defined for the map in the editor), uniqueness of its value cannot be guaranteed; it's rather more like a Preset CustomValue for pre-placed objects.
Since UnitGetTag returns an int (presumably from an enumerated list of tags defined for the map in the editor), uniqueness of its value cannot be guaranteed; it's rather more like a Preset CustomValue for pre-placed objects.
According to the GUI documentation, the int is unique. It also works for non pre-placed units.
Quote:
A unit's tag is a unique integer associated with that unit. The tag will never change and will never be associated with a different unit.
Ah, haha, perhaps there's some confusion on my part; in the editor, there's a Map Tag dialogue for the declaration of Tags and associated difficulties, which then allows them to be assigned to units in the terrain editor. Given the similar "Tag" term and my lack of experience using either feature, my assumption of their relation isn't unreasonable, however faulty.
This is a sad day, I know there was a way back in war3, came in super handy for MUI jass coding and stuffs. I suspose data tables it is then, thanks broski
Rollback Post to RevisionRollBack
Zergling Blood : starcraft://map/1/35684
Game of Thrones : starcraft://map/1/189756
Tacticraft : starcraft://map/1/223625
Hey guys, I can call a unit tag from a unit, but how do I call a unit from a unit tag? Would make MUI far more feasible for me
Used to do it in War3, can't imagine they wouldn't put it in SC2, but I can't seem to figure this out, at least not with basic GUI, thus why I came here.
I'm guessing it's pretty simple in galaxy, I just don't know how :(
@EchoedRequiem: Go
What do you mean by unit tag?
He means the unit tag. It's a unique string for each unit which won't be re-used.
Worst case scenario: grab all units on the map and check their tags. :S
Good question. There is no native way.
The best way to achieve this is: Each time you retrieve the unit tag, you store it into the global datatable as key, and the unit as value.
Then you can create a reverse function using datatable lookup with O(1) complexity. :)
Make sure to remove dying or removed units from the datatable again though, otherwise it will get bigger and bigger over time.
Since UnitGetTag returns an int (presumably from an enumerated list of tags defined for the map in the editor), uniqueness of its value cannot be guaranteed; it's rather more like a Preset CustomValue for pre-placed objects.
According to the GUI documentation, the int is unique. It also works for non pre-placed units.
Ah, haha, perhaps there's some confusion on my part; in the editor, there's a Map Tag dialogue for the declaration of Tags and associated difficulties, which then allows them to be assigned to units in the terrain editor. Given the similar "Tag" term and my lack of experience using either feature, my assumption of their relation isn't unreasonable, however faulty.
I feel honored!
Don't touch it! I take! It's mine now! Goes to my collection:
dammit
Well that escalated quickly.
@Mille25: Go
This is a sad day, I know there was a way back in war3, came in super handy for MUI jass coding and stuffs. I suspose data tables it is then, thanks broski
came in super handy for MUI jass coding and http://www.fifa15coinsok.com/ stuffs. I suspose data tables it is then, thanks broski