GraylinKim / sc2reader

A python library that extracts data from various Starcraft II resources to power tools and services for the SC2 community. Who doesn't want to hack on the games they play?
http://sc2reader.readthedocs.org
MIT License
413 stars 85 forks source link

1.5 seems to still not work #67

Closed smazurov closed 12 years ago

smazurov commented 12 years ago

Hey I installed sc2reader and was playing around with it, i couldn't get it to work with the 1.5 replay i tried

$ sc2printer test-replays/1v1-1.5.0-us.SC2Replay

--------------------------------------
test-replays/1v1-1.5.0-us.SC2Replay

Traceback (most recent call last):
  File "/usr/local/bin/sc2printer", line 8, in <module>
    load_entry_point('sc2reader==0.3.3', 'console_scripts', 'sc2printer')()
  File "build/bdist.macosx-10.7-intel/egg/sc2reader/scripts/sc2printer.py", line 93, in main
  File "build/bdist.macosx-10.7-intel/egg/sc2reader/scripts/sc2printer.py", line 15, in doFile
  File "build/bdist.macosx-10.7-intel/egg/sc2reader/factories.py", line 269, in load_replay
  File "build/bdist.macosx-10.7-intel/egg/sc2reader/resources.py", line 177, in read_data
  File "build/bdist.macosx-10.7-intel/egg/sc2reader/readers.py", line 265, in __call__
sc2reader.exceptions.ReadError: Unknown event code, Type: 0, Code: 28

replay in question can be found at http://drop.sc/234236

GraylinKim commented 12 years ago

Yeah, that is true. I'll have the fix in the next couple days. I have a working parser running locally but there are still a couple integration issues I need to address. In the meantime you can run with load_level=2 and disable game event parsing.

import sc2reader
replay = sc2reader.load_replay(filename, load_level=2)

This will still have basic replay, player, team, and winner information.

GraylinKim commented 12 years ago

The v15 branch now parses v1.0-1.5 replays with no known problems. I'll be cleaning this up and merging to master soon but you can check it out if you are in a hurry.

smazurov commented 12 years ago

Thank you! I'll try to take a look at it as soon as I get some free time.

GraylinKim commented 12 years ago

v15 support is now in master.