Code Monkey home page Code Monkey logo

Comments (6)

spheenik avatar spheenik commented on August 30, 2024

I had a quick look and it looks like m_hOwnerEntity is the way to go.
You can detect if it's an illusion or not with checking m_hReplicatingOtherHeroModel (equals 16777215 when it is NOT an illusion). I also am not quite sure if it works for all cases though...

from clarity-examples.

cqiaoben avatar cqiaoben commented on August 30, 2024

I have done a test on a demo (matchid = 2026982487). m_hOwnerEntity of CDOTA_BaseNPC_Creep_Neutral, being 16777215 most of the time, has other values as well:

066395: CDOTA_BaseNPC_Creep_Neutral (m_hOwnerEntity = 10945431) has spawned
066395: CDOTA_BaseNPC_Creep_Neutral (m_hOwnerEntity = 10945431) has spawned
072853: CDOTA_BaseNPC_Creep_Neutral (m_hOwnerEntity = 7783822) has spawned
072853: CDOTA_BaseNPC_Creep_Neutral (m_hOwnerEntity = 7783822) has spawned
073819: CDOTA_BaseNPC_Creep_Neutral (m_hOwnerEntity = 1688292) has spawned
073819: CDOTA_BaseNPC_Creep_Neutral (m_hOwnerEntity = 1688292) has spawned

Meanwhile, m_hOwnerEntity 10191233 is mapped to [CDOTA_BaseNPC_Creep, CDOTA_Unit_Hero_Beastmaster_Hawk, CDOTA_Unit_Hero_Beastmaster_Boar]. Beastmaster has another m_hOwnerEntity.

All of those make me wonder what m_hOwnerEntity really is...

from clarity-examples.

cqiaoben avatar cqiaoben commented on August 30, 2024

Just a follow up. To get the owner number of an entity e1, the following code could do the work:
Entity ownerEntity = ctx.getProcessor(Entities.class).getByHandle(e1);
fp = ownerEntity.getDtClass().getFieldPathForName("m_iPlayerID");
return ownerEntity.getPropertyForFieldPath(fp);

I am able to get beastmaster's player position as a result, but I am still unable to interpret m_hOwnerEntity for CDOTA_BaseNPC_Creep_Neutral.

from clarity-examples.

spheenik avatar spheenik commented on August 30, 2024

Of what type are entities 10945431, 7783822, 1688292?

Are they also neutral creeps? If so, the spawned creeps could have been spawned by another neutral creep, making it their owner (for example, Troll Summoner skeletons).

from clarity-examples.

cqiaoben avatar cqiaoben commented on August 30, 2024

Yes you are right. The DtClass type is also neutral creeps. Is there a way to get real replay time based on the time tick? It would be nice if I can verify that.

from clarity-examples.

spheenik avatar spheenik commented on August 30, 2024

The control slider used while playing the replay is directly related to tick. There are 30 ticks per second.

from clarity-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.