I was playing the level “Peasant Protection” and I got the message scene in the image. I have written nothing along the lines of “_aetherShouldSkipFlow” in the code, so does anyone know what’s going on here?
Yeah, that’s an internal function of CodeCombat’s compiler (Aether). Aether does quite a bit of magic to your code behind-the-scenes in order to be able to report errors, measure and time-travel the code execution. In an ideal world this magic would be transparent to the player, but there are a few cases where this leaks and you have found one of them.
Ultimately, although the error message is not good, there is an error in your code that would prevent it from running anyway. You have:
enemies = self.findNearest(self.findEnemies()) for enemy in enemies:
findNearest returns a single instance, so your
enemies variable does not hold an array. For this reason,
for-in will iterate over properties of the enemy instance. This is not what you want.
I’d say you can just drop the for-in loop and work with the nearest enemy only. Check if its distance is < 10 and attack it twice as you’re already doing. So:
- Remove the for-in loop;
- Rename the “enemies” variable (and all of its references) to “enemy”.
I believe your code should work then.
Oh, so that’s what was going on. Thank you!