Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to map from m_abilLink to the actual hero ability? #27

Open
crorella opened this issue Feb 12, 2016 · 10 comments
Open

How to map from m_abilLink to the actual hero ability? #27

crorella opened this issue Feb 12, 2016 · 10 comments

Comments

@crorella
Copy link

Hello,

I'm trying to retrieve abilities casted by heroes, in gameevents I see a SCmdEvent is created every time a hero uses an ability:

{'_bits': 264,
 '_event': 'NNet.Game.SCmdEvent',
 '_eventid': 27,
 '_gameloop': 108,
 '_userid': {'m_userId': 9},
 'm_abil': {'m_abilCmdData': None, 'm_abilCmdIndex': 0, 'm_abilLink': 173},
 'm_cmdFlags': 256,
 'm_data': {'TargetUnit': {'m_snapshotControlPlayerId': 12,
                           'm_snapshotPoint': {'x': 849167,
                                               'y': 420404,
                                               'z': 32304},
                           'm_snapshotUnitLink': 938,
                           'm_snapshotUpkeepPlayerId': 12,
                           'm_tag': 46137345,
                           'm_targetUnitFlags': 111,
                           'm_timer': 0}},
 'm_otherUnit': None,
 'm_sequence': 1,
 'm_unitGroup': None}

Is there any way to determine what ability was the hero using?

Thanks in advance

@tenarsis
Copy link
Member

That index is a relative index into that specific build's ability data. To map it properly you would either need to read the ability data from that build, or we could add the mapping into the replay file (which could unfortunately increase the replay file size in a non trivial way). Thanks for bringing it up though I don't have much useful suggestions at the moment.

@crorella
Copy link
Author

Thanks for the reply.
Instead of adding the mappings to each replay, why not just create a file and place it on the website or here at github?
Thanks

@crorella
Copy link
Author

@tenarsis can you please explain how to get this info?

@crorella
Copy link
Author

@tenarsis any update?

@crorella
Copy link
Author

crorella commented Mar 25, 2017

@tenarsis I was finally able to get the list of abilities for each build in an automated way. Can you please explain how to create the mapping?

@Sancus
Copy link

Sancus commented Oct 31, 2018

@crorella Did you ever figure out how to relate ability lists to the m_abilLink ID? There's a bunch of parsers that will output ability lists nowadays, but I can't find any information on what the IDs actually signify or how to derive them.

@yretenai
Copy link

yretenai commented Oct 31, 2018

You can get an array of all heroes by parsing ConfigData (mods/heroesdata.stormmod/base.stormdata/gamedata/configdata.xml) and iterating the <HeroArray value=""/> values, I'm assuming that's how it determines the load order for m_abilLink.

In SC2, you can use the map editor to export a balance data file, which has all of these links.

@Sancus
Copy link

Sancus commented Nov 1, 2018

Yeah that seems roughly correct, but very roughly. m_AbilLink index numbers do correspond with the order abilities appear in each of the XML files at mods\heroesdata.stormmod\base.stormdata\gamedata\heroes. However, the loading order seems more complex than the list in ConfigData.

"New" heroes(the ones in mods/heromods rather than mods/heroesdata.stormmod) seem to be tacked on in a different order. For example, Valeera comes right before Valla('demonhunter'), but her Sinister Strike is 953. Valla's Q is 307, Xul, being an old hero who comes after Valla, has the much lower indices, using 490 for his 1(Bone Shield). There are also some generic things not in these XML files, such as Mount(Z) which is 112, and loading order+xml files for these non-specific-hero abilities are not listed in that ConfigData either.

Sure would be nice if we had an easy way to export like SC2 :)

@MGatner
Copy link

MGatner commented Nov 1, 2018

@koliva8245 has done a lot of great work making an easy, automated way of parsing all this with https://github.com/koliva8245/HeroesDataParser. I don't see m_AbilLink specifically but koliva might be willing to explain how to get it from the parsed output and/or add it.

@koliva8245
Copy link

Sorry can't, no easy way. I think the way it was done for StarCraft 2 was that the map editor had an export data option or something. So either blizzard would have to export the data or maybe someone could import all the Hots data in the SC2 editor and export it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants