python-sc2
python-sc2 copied to clipboard
Update examples with do_actions
trafficstars
- Update all examples to use
await self.do_actions()instead ofawait self.do(), to encourage users to use the more performant (and futureproof) version
Additional thought: perhaps implement some way of deprecating self.do()?
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
Partially fixed version available in branch do_actions. Still needs some fixes on error handling. I'm hoping to have them ready this week.