skadistats / clarity-examples

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

How to get position in combat log #16

Closed cqiaoben closed 8 years ago

cqiaoben commented 8 years ago

For example if Hero A killed unit B, how to get position of A and B?

spheenik commented 8 years ago

Code for getting position:

https://gist.github.com/spheenik/3766744d47c170f25cf5

The code is from Source 1, the property m_cellbits is not existing anymore in Source 2, and can be replaced by the constant value 7.

spheenik commented 8 years ago

...and there is no more Vector2f in current clarity, there is now m_cell[XYZ] and m_vec[XYZ]

cqiaoben commented 8 years ago

Thanks for the reply! Sorry I didn't make my question clear. I am more interested in getting the unit B or hero A as an entity, so that I could retrieve its location. I know getAttackerNameCompiled(cle) could get the name of the attacker, but it's not a Dtname.

spheenik commented 8 years ago

There is no direct correlation from combat log to entity in the replay unfortunately.