Closed ElKrist closed 4 years ago
I've found a "trick" to make it work. I replaced (error, see comments below):
If(lambda ctx: ctx.selected > 0x01, Array(
lambda ctx: ctx.selected, "unit_ids"/Int32ul
))
by
"unit_ids"/If(lambda ctx: ctx.selected < 0xff, Array(lambda ctx: ctx.selected, Int32ul))
If selected < 255
it gives for example: 'unit_ids': [1910]
When selected=255
it gives 'unit_ids': None
Hi, do you mean ai_move
or move
?
move
I'm looking at the code and it already uses selected < 0xff
: https://github.com/happyleavesaoc/aoc-mgz/blob/master/mgz/body/actions.py#L63
Oh sorry when I said I replaced that code:
If(lambda ctx: ctx.selected > 0x01, Array(
lambda ctx: ctx.selected, "unit_ids"/Int32ul
))
I made a mistake (the code above does not exist). I meant I replaced this code:
If(lambda ctx: ctx.selected < 0xff, Array(
lambda ctx: ctx.selected, "unit_ids"/Int32ul
))
The trick was to add "unit_ids"/
in front of the If
Steps to reproduce:
Recorded game used (I've tried with many others and there is the same problem): https://www.voobly.com/files/view/53123676/qnc2045gpo3x3vkyyqks5h526pu725er
Code used:
if name == "main": pp = pprint.PrettyPrinter(indent=4)
For each input filename