Code Monkey home page Code Monkey logo

Comments (12)

spheenik avatar spheenik commented on August 30, 2024 1

There is an entity "GameRulesProxy", it has a property:

"m_pGameRules.m_nGameWinner"

2 = Radiant
3 = Dire

iirc.

On 02/18/2016 09:19 PM, Hareide wrote:

Thanks for the quick replay. By looking at the yasp site you pointed
me to, I now almost have everything I need (and more):
new ColumnDef("HeroID", new DefaultResolver("PlayerResource",
"m_vecPlayerTeamData.%i.m_nSelectedHeroID")),
new ColumnDef("Team", new DefaultResolver("PlayerResource",
"m_vecPlayerData.%i.m_iPlayerTeam")),
new ColumnDef("TeamSlot", new DefaultResolver("PlayerResource",
"m_vecPlayerTeamData.%i.m_iTeamSlot")),
new ColumnDef("SteamID", new DefaultResolver("PlayerResource",
"m_vecPlayerData.%i.m_iPlayerSteamID"))

Do you know how I can find what team that won?
I know the ingame console outputs the following line when a local
server lobbygame ends:
good_guys_win: true

I would guess that it should be returned by the parser as a boolean value.


Reply to this email directly or view it on GitHub
#19 (comment).

from clarity-examples.

spheenik avatar spheenik commented on August 30, 2024

Glad you like the example :)

I will consider adding it, but have to admit that I am very time constrained at the moment, with a lot of backlog. So I won't be able to do this quickly.

To implement this, I think you need more knowledge of where to find the data.
Once you know that, it's a cakewalk to add that stuff to the scoreboard.

If you wanna try, I recommend looking at yasps parser.

from clarity-examples.

Hareide avatar Hareide commented on August 30, 2024

Thanks for the quick replay. By looking at the yasp site you pointed me to, I now almost have everything I need (and more):
new ColumnDef("HeroID", new DefaultResolver("PlayerResource", "m_vecPlayerTeamData.%i.m_nSelectedHeroID")),
new ColumnDef("Team", new DefaultResolver("PlayerResource", "m_vecPlayerData.%i.m_iPlayerTeam")),
new ColumnDef("TeamSlot", new DefaultResolver("PlayerResource", "m_vecPlayerTeamData.%i.m_iTeamSlot")),
new ColumnDef("SteamID", new DefaultResolver("PlayerResource", "m_vecPlayerData.%i.m_iPlayerSteamID"))

Do you know how I can find what team that won?
I know the ingame console outputs the following line when a local server lobbygame ends:
good_guys_win: true

I would guess that it should be returned by the parser as a boolean value.

from clarity-examples.

redfish88 avatar redfish88 commented on August 30, 2024

excuse me,do you know how I can find what team that won?
i try the following in skadistats.clarity.examples.matchend.Main ,but return null
getEntity("GameRulesProxy").getDtClass().getFieldPathForName("m_pGameRules.m_nGameWinner")

from clarity-examples.

spheenik avatar spheenik commented on August 30, 2024

Just checked, and m_pGameRules.m_nGameWinner should be there.
Your replay is from Dota 2, right? I think I'd need the replay.

from clarity-examples.

redfish88 avatar redfish88 commented on August 30, 2024

Thank you for your reply,yes,it's Dota2 replay,how to send you my replay ? email ?
image
image

from clarity-examples.

spheenik avatar spheenik commented on August 30, 2024

Best to put it in some dropbox and share the link.
I'm unsure if my mailserver will gobble it, but you can try: [email protected]

from clarity-examples.

redfish88 avatar redfish88 commented on August 30, 2024

I have sent you an e-mail,and i still have the following questions

  1. Can i get the match id 、match start time、end time in matchend ?
  2. How to get the mapping relationship between heroId and heroName? or can i get the heroName from entity's field?
  3. How to get hero_damage、tower_damage 、killed_by and other info?
    Thank you again for your reply!

from clarity-examples.

spheenik avatar spheenik commented on August 30, 2024

Checked your replay: The property is there. It has value 5 up until tick ~56700, then changes to 2 (radiant).
I ran the matchend-example, it spits out values.
Since in your screenshot, you get GameRulesProxy = null, it seems that you did not seek to the end of the replay?

This code here
https://github.com/skadistats/clarity-examples/blob/master/src/main/java/skadistats/clarity/examples/matchend/Main.java#L34-L36
is important!

from clarity-examples.

redfish88 avatar redfish88 commented on August 30, 2024

I'm sure there are no changes elsewhere,because getEntity("PlayerResource") works .
This my code
https://gist.github.com/redfish88/223cbc5f120b2e5942e6684a4627948f#file-main-java-L67-L69

from clarity-examples.

spheenik avatar spheenik commented on August 30, 2024

Found the problem. The getEntity() function does not work, because it looks for CDOTA_GamerulesProxy.
But in this case, the underscore is missing from the entity name (it should be CDOTAGamerulesProxy)

So you can look it up via
runner.getContext().getProcessor(Entities.class).getByDtName("CDOTAGamerulesProxy")

from clarity-examples.

redfish88 avatar redfish88 commented on August 30, 2024

Thank you very much,i get it!

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.