|
| 1 | +Frequently Asked Questions |
| 2 | +============================== |
| 3 | + |
| 4 | +1. :ref:`faq1` |
| 5 | +2. :ref:`faq2` |
| 6 | +3. :ref:`faq3` |
| 7 | +4. :ref:`faq4` |
| 8 | + |
| 9 | +.. _faq1: |
| 10 | + |
| 11 | +How do I get a list of game events (including messages)? |
| 12 | +------------------------------------------------------------ |
| 13 | + |
| 14 | +Here is a minimal example:: |
| 15 | + |
| 16 | + replay = sc2reader.load_replay('path/to/replay.SC2Replay') |
| 17 | + for event in replay.events: |
| 18 | + print '{0} => {1}: {2}'.format(event.pid,event.name, event.time) |
| 19 | + |
| 20 | +Please see the `documentation`_ for a full listing of the information available. |
| 21 | + |
| 22 | +.. _documentation: http://sc2reader.rtfd.org |
| 23 | + |
| 24 | +.. _faq2: |
| 25 | + |
| 26 | +How to I get the game state at a specific time in the game. E.g. at 10:00 how many workers every player has. |
| 27 | +--------------------------------------------------------------------------------------------------------------- |
| 28 | + |
| 29 | +This is difficult. Events are only recorded for player initiated actions and you'll find that both successful and unsuccessful actions are included. That means several things complicates our lives: |
| 30 | + |
| 31 | +1. There is no "unit created" event. Only a "player attempted to use train <unit>" events. |
| 32 | +2. There is no "death" event. You can only tell a unit is alive when it is actively selected. |
| 33 | +3. Game state information: player resources, available supply, etc are unavailable at all times. |
| 34 | + |
| 35 | +It may be possible to overcome these limitations and approximate game state with a series of very smart assumptions and cool algorithms. If you could accurately count workers though, you'd be the first I think. |
| 36 | + |
| 37 | +.. _faq3: |
| 38 | + |
| 39 | +How can I retrieve game summary files? |
| 40 | +----------------------------------------- |
| 41 | + |
| 42 | +s2gs files hashes are not contained inside any other SC2 resources as far as anyone knows. |
| 43 | + |
| 44 | +Make sure you read the `s2gs thread`_ for details. |
| 45 | + |
| 46 | +Aside from manually causing s2gs files to download to your battle.net cache folder you might try set up the `S2GSExtractor`_ to scrape them from the process memory. I can't speak to its legality or effectiveness but it is somewhere to start if you want to automate things. |
| 47 | + |
| 48 | +.. _s2gs thread: http://www.teamliquid.net/forum/viewmessage.php?topic_id=330926 |
| 49 | +.. _S2GSExtractor: https://github.com/gibybo/S2GS-Extractor |
| 50 | + |
| 51 | +.. _faq4: |
| 52 | + |
| 53 | +Script <name here> is broken. What is wrong? |
| 54 | +----------------------------------------------- |
| 55 | + |
| 56 | +It is true that not all the scripts are very well maintained. They were originally intended as mini usage examples. It seems that people are trying to use them as a primary interface for sc2reader though. I'll have to make sure they don't break going forward. |
| 57 | + |
| 58 | +Patches to the scripts are always accepted, just issue a pull request or email me a patch file. |
0 commit comments