dotabuff / manta

Dotabuff's Dota 2 Source 2 Replay Parser in Go
MIT License
622 stars 103 forks source link

How to get permanent buffs? #134

Open steakscience opened 3 years ago

steakscience commented 3 years ago

Example:

steakscience commented 3 years ago

@jcoene Would you happen to know this?

jacobxy commented 3 years ago

There are buffs generated and disappeared in the "CombatLog". The permanent buff is that only the generated state does not disappear!

steakscience commented 3 years ago

@jacobxy How do you access CombatLog using Manta?

jacobxy commented 3 years ago

func (c Callbacks) OnCMsgDOTACombatLogEntry(fn func(dota.CMsgDOTACombatLogEntry) error) { c.onCMsgDOTACombatLogEntry = append(c.onCMsgDOTACombatLogEntry, fn) }

steakscience commented 3 years ago

@jacobxy Another question now that you're here:

Ability Upgrades seem to be skipping stats?

Example: lvl 16 mirana takes Leap, lvl 17 mirana auto takes Stats, lvl 18 Mirana takes Moonlight Shadow

the parser will output this: [..., lvl 16 leap, lvl 17 moonlight shadow]

Any way to work around this?

jacobxy commented 3 years ago

I don't know how to write your parsing process, so I can't judge whether there is a problem. At present, the data I parse doesn't have such a problem.

steakscience commented 3 years ago

@jacobxy We are writing it like this:

for level, ability := range player.GetAbilityUpgrades() {
    matchData.Players[index].AbilityUpgrades = append(matchData.Players[index].AbilityUpgrades, AbilityData{
        Level:        level,
        AbilityIndex: ability,
    })  
}
jacobxy commented 3 years ago

It seems that this interface is post game data. At present, the return is an array, so it is impossible to jump the output level, because the data has the frame number of upgrade time, which needs to be combined with the player's level at that time, and the game process data needs to be analyzed.

steakscience commented 3 years ago

I see, how would you recommend fetching this data instead?

jacobxy commented 3 years ago

One of the methods of this library is to obtain process data by parsing DEM video files.

steakscience commented 3 years ago

@jacobxy Thank you! 🤗