Dentosal / python-sc2

A StarCraft II bot api client library for Python 3
MIT License
586 stars 182 forks source link

Update examples with do_actions #177

Closed aatkin closed 2 years ago

aatkin commented 5 years ago

Additional thought: perhaps implement some way of deprecating self.do()?

tweakimp commented 5 years ago

cyclone push is not building any units. I also got these errors:

ERROR:sc2.bot_ai:Error: ActionResult.NotSupported (action: UnitCommand(AbilityId.TERRANBUILD_BARRACKS, Unit(name='SCV', tag=4350279681), (141, 34), False))
ERROR:sc2.bot_ai:Error: ActionResult.NotSupported (action: UnitCommand(AbilityId.TERRANBUILD_BARRACKS, Unit(name='SCV', tag=4344512513), (141, 32), False))
ERROR:sc2.bot_ai:Error: ActionResult.NotSupported (action: UnitCommand(AbilityId.TERRANBUILD_BARRACKS, Unit(name='SCV', tag=4342415361), (137, 36), False))
ERROR:sc2.bot_ai:Error: ActionResult.NotSupported (action: UnitCommand(AbilityId.TERRANBUILD_BARRACKS, Unit(name='SCV', tag=4350279681), (141, 32), False))
ERROR:sc2.bot_ai:Error: ActionResult.NotSupported (action: UnitCommand(AbilityId.TERRANBUILD_BARRACKS, Unit(name='SCV', tag=4343726081), (141, 36), False))

In zerg_rush.py:

File "/python-sc2-update-examples/examples/zerg/zerg_rush.py", line 37
for queen in self.units(QUEEN).idle:
SyntaxError: invalid syntax

Probably a missing ) in every actions.append. Also:

File "/python-sc2-update-examples/examples/zerg/zerg_rush.py", line 87, in on_step
if not err:
NameError: name 'err' is not defined
Dentosal commented 5 years ago

Partially fixed version available in branch do_actions. Still needs some fixes on error handling. I'm hoping to have them ready this week.