Closed VirenDias closed 1 year ago
Each neutral token creates an entity (e. g. CDOTA_Item_Tier1Token
for tier 1 token) when dropped and deletes the entity when activated. The entity contains player Id in the m_iPlayerOwnerID
property (it doesn't change when another hero takes the token).
And there is DOTA_COMBATLOG_NEUTRAL_ITEM_EARNED combatlog type, but apparently it's not working now.
For Rapiers I'd probably go like this:
@OnEntityCreated
. I think you need to use StringTable here to check if an entity is actually a Rapier, because entity for Rapier is called like generic CDOTA_Item
. Save entity handle of every Rapier.m_iPlayerOwnerID
property of the saved entities with @OnEntityPropertyChanged
(get the first owner when entity created, other owners when this property changes).Feel free to ask any questions.
Each neutral token creates an entity (e. g.
CDOTA_Item_Tier1Token
for tier 1 token) when dropped and deletes the entity when activated. The entity contains player Id in them_iPlayerOwnerID
property (it doesn't change when another hero takes the token).And there is DOTA_COMBATLOG_NEUTRAL_ITEM_EARNED combatlog type, but apparently it's not working now.
Thank you so much! How do I map m_iPlayerOwnerID
to a hero or steam ID?
So PlayerId is a relative Id of a player in the given replay. It can only be an even number and goes from 0 to 18. 0 2 4 6 8 for radiant, 10-18 for dire, in the same order as you can see in Dota HUD at the top.
I know 2 ways to map PlayerId to a hero:
m_iPlayerID
property.getPlayerInfo(id)
method, but id
here is twice smaller than in entities' properties (valve 🤡), so e. g. getPlayerInfo(4)
will get you info about the player with PlayerId = 8. Then this player info object has getHeroName()
method that returns the name in "npc_dota_hero_antimage" format. This way is better if you wanna get the hero Id, because it returns names in the same format as the /IEconDOTA2_570/GetHeroes/v0001
Steam API method. UPD: player info object also has getSteamid()
method.Thank you, you've been very helpful! I've managed to get the data I need :).
Thank you @reacheight for helping him out! Much appreciated!
Hi, I'm looking to get the data for item drop events, more specifically:
I've been trying to figure it out for a while, but I've been unsuccessful. Can anyone help me out?