Skip to content

Commit a131d50

Browse files
committed
howto on how to do the abilities and units nonsense
1 parent 2f7bfcf commit a131d50

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

sc2reader/data/HOWTO

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Sometimes when a new version comes out, such as (3.4.0) 44401, Bliz will update the ids used to identify units and abilities.
2+
3+
See dsjoerg's commits on Jul 13, 2016 to see what you need to modify to handle something like that: https://github.com/ggtracker/sc2reader/commits/upstream
4+
5+
1 use the Galaxy Editor and Export Balance Data.
6+
2 To create the ability CSV file: ```find Balance\ Data -print0 | xargs -0 grep -h '<ability' | sort | uniq | tr '="' ' ' | awk -v OFS=',' '{print $5, $3}' | sort -n```
7+
3 To create the unit CSV file:
8+
```
9+
import os
10+
from xml.etree import ElementTree
11+
balancedir = '/foo/bar/Balance Data'
12+
for i in os.listdir(balancedir):
13+
if i.endswith(".xml"):
14+
xml = ElementTree.parse(open(os.path.join(balancedir, i), 'r'))
15+
print "{},{}".format(xml.findall('meta')[0].attrib['index'], xml.getroot().attrib['id'])
16+
```
17+
4 run `sc2reader/new_units.py` to find out what you need to add to `sc2reader/data/ability_lookup.csv`, and add it
18+
5 modify `sc2reader/data/__init__.py` and `sc2reader/resources.py` accordingly

0 commit comments

Comments
 (0)