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

LotV base datapack #186

Closed StoicLoofah closed 9 years ago

StoicLoofah commented 9 years ago

I did a straight copy from the last HotS datapack and basically just modified linked code until it stopped crashing. Not sure if I did this right or wrong, but I would hope that it at least is not a regression.

Also have another commit with the fix from

https://github.com/GraylinKim/sc2reader/issues/185#issuecomment-104150265

GraylinKim commented 9 years ago

Other than the above this looks good. I spent a few minutes looking through your website and noticed that you have the new units in the build orders already. How is that working right now (since they aren't part of the LotV data yet)?

StoicLoofah commented 9 years ago

Added the comment.

As far as how LotV units work, I think it is because spawningtool doesn't rely on the event.unit to get the name since that varies as the unit changes and retains the final version, and I want the current name. As such, I go straight for the event.unit_type_name first if possible.

https://github.com/StoicLoofah/spawningtool/blob/32-lotv/spawningtool/parser.py#L194-L203

Maybe it's not the most proper way for the library to work, but it seems to function flexibly for new unit types.