LaihoE / Python-demoparser

CS:GO demo parser
37 stars 2 forks source link

Feature request: parse teams related props #11

Closed ChetdeJong closed 1 year ago

ChetdeJong commented 1 year ago

Hi,

Thank you so much for this parser and also for making source2 version!

Is it possible for you by any chance to implement parsing not only for players related props, but also for teams?

Would be useful to get data for teams like team name, team score, etc. It's all listed here as part of team entity (I guess?)

I know that we can get winning team from round_end event and then we can calculate score, but it's not so handy and we don't know team name and can't get this data when parsing other events.

Ideally would like to get something like this: parser.parse_events('round_officially_ended',team_props=['m_szTeamname','m_iRoundsWon'])

output:

               event_name   tick  round    team_2_name    team_3_name  team_2_rounds_won  team_3_rounds_won
0  round_officially_ended  14453      1  Team Vitality         Cloud9                 10                  5
1  round_officially_ended  30361      2  Team Vitality         Cloud9                 11                  5
2  round_officially_ended  49517      3  Team Vitality         Cloud9                 12                  5
3  round_officially_ended  66577      4  Team Vitality         Cloud9                 13                  5
4  round_officially_ended  78687      5  Team Vitality         Cloud9                 13                  6
5  round_officially_ended  99232      6  Team Vitality         Cloud9                 13                  7
LaihoE commented 1 year ago

Good and bad news. Unfortunately I don't think ill be adding any bigger changes to this version anymore. This would require quite some extra work to add here.

On the bright side, I really like the idea and so I added it to the CS2 version. There you can now use:

df = parser.parse_events("player_death", extra_player=["last_place_name"], extra_other=["team_rounds_total"])

You can now also request values from the "rules" entity, not just from teams. The rules entity has all kinds of settings, see the bottom of the S2 parsers README.md see (rules are called there match_info)

ChetdeJong commented 1 year ago

ye, makes sense since CS2 will be released soon. For CSGO version I just counted it separately without team names, not big deal, that's works for me too. Well, anyway thanks for CS2 version, great work