Dentosal / python-sc2

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

outdated starport techlab addon example code in examples/terran/onebase_battlecruiser.py #191

Closed ceacar closed 5 years ago

ceacar commented 5 years ago

below code does not work: """ for sp in self.units(STARPORT).ready: if sp.add_on_tag == 0: await self.do(sp.build(STARPORTTECHLAB)) """ it seems ai will stuck at trying to land the techlab

ceacar commented 5 years ago

ERROR:sc2.bot_ai:Error: ActionResult.Error (action: UnitCommand(AbilityId.BUILD_TECHLAB, Unit(name='Starport', tag=4352638978), None, False))

issue seems caused by inpropriate landing position of addon;

ceacar commented 5 years ago

how do i find a good placement for addon building for terran? below code returns error because MOVE, LAND with a position seems not work. if self.units(UnitTypeId.FACTORY).ready.exists: fac = self.units(UnitTypeId.FACTORY).ready.first if fac: await self.do(fac(AbilityId.LIFT)) print("try moving to landing point:", fac.add_on_land_position)

await self.do(fac(AbilityId.MOVE, fac.add_on_land_position))

            await self.do(fac(AbilityId.LAND, fac.add_on_land_position))
ceacar commented 5 years ago

creating a new issue off this one