skadistats / clarity-examples

Example code for clarity
BSD 3-Clause "New" or "Revised" License
113 stars 37 forks source link

Getting names associated with m_iUnitNameIndex #26

Closed TodorovicF closed 8 years ago

TodorovicF commented 8 years ago

So I'm looking at CDOTA_BaseNPC_Creep_Neutral entities and I'm looking to get the name of the creep, I'm guessing located at the m_iUnitNameIndex of some stringtable. The problem is, I've tried a couple of the stringtable types that make sense (for @OnStringTableEntry("type")), and none of them seem to be giving me the right names. I've tried "EntityNames" and "CombatLogNames" and I'm getting random names for non-creeps. Is there another stringtable I'm missing or a different place to grab the names from? Thanks!

spheenik commented 8 years ago

iirc, they all have the same index, which means finding out which one it is is difficult. Paging @ykim: Can you add something?

ykim commented 8 years ago

For both S1 and S2, the neutral's name is not stored inside StringTables. To obtain it, you're going to have to do some sort of extrapolation to determine the neutral. It was easy in S1 because you could determine the neutral creep from the name of its model, but for S2, this method is not possible as the model name is obscured. I had success in guessing the neutral type from the properties of the neutral (i.e. hp, mana, abilities, etc).

On Fri, Apr 22, 2016 at 11:31 PM, Martin Schrodt notifications@github.com wrote:

iirc, they all have the same index, which means finding out which one it is is difficult. Paging @ykim https://github.com/ykim: Can you add something?

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/skadistats/clarity-examples/issues/26#issuecomment-213675103

TodorovicF commented 8 years ago

Thank you for looking into it, I really appreciate it! I've created a mapping based on the neutral's properties as well, figured it was the only other way :)