Closed B204L closed 5 years ago
In await self.distribute_workers(self)
it appears you pass in your bot object as a function argument.
Instead, you should pass in a number, e.g.
await self.distribute_workers(resource_ratio=2)
or just leave it empty await self.distribute_workers()
Feel free to join the discord, questions like these could be much more quickly answered there.
Thanks, will do in the future.
Using the latest
develop
branch and forking the template for overmind-challenge and using the same folder / file structure. I am using therun_locally.py
script in the root folder for testing, my bot files are inside thebot
directory and I'm using the defaultMyBot
class.Traceback (most recent call last):
File "C:\Program Files (x86)\Python37-32\lib\site-packages\sc2\main.py", line 166, in _play_game_ai await ai.on_step(iteration)
File "C:\Users\justin\Documents\sc2ai\overmind-challenge\bot\main.py", line 50, in on_step await self.distribute_workers(self)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\sc2\bot_ai.py", line 357, in distribute_workers if self.vespene and self.minerals / self.vespene < resource_ratio:
TypeError: '<' not supported between instances of 'float' and 'MyBot'
ERROR:sc2.main:Error: '<' not supported between instances of 'float' and 'MyBot'
I am using
await self.distribute_workers(self)
in theon_step
, TypeError occurs momentarily after geysers are built.Python 3.7.3