Help request for possible bug with "Attack Wisely" (Kithgard Dungeon) [Python]


#1

Hi All,

Not sure if it’s just me or if it’s an actual bug, but I’m having trouble with “Attack Wisely” on Kithgard Dungeon using Python.

I’ve tried and replicated the issue twice using both Chrome (slow) and Edge (faster) and each time the same problem occurs.

I’ve whittled down the code to the smallest possible amount to demonstrate the bug; note this is not enough code to demonstrate the whole level, I know that:

# Avoid all the fire-traps
# If you step on a fire-trap, you will get blown up
self.moveUp(2);
self.attack("Door A")
self.moveUp(2)
enemy = self.findNearestEnemy()
self.attack(enemy)
self.attack(enemy)
self.attack(enemy)

What happens is that the character will move up, attack the door, move up again, attack once, then the code skips over as though it’s not waiting for the previous code to complete. I’ve tried approaching this different ways and each time the result is the same; the code seems to start running rampant and skips over actions.

Is this just me or is anyone else experiencing this issue too?

Thanks in advance!


[SOLVED] How to write a loop-type method that will attack an enemy until they are dead
#2

Played on edge, and I can’t replicated it.

Try to see if:

while enemy.health > 0:
    self.attack(enemy)

works


#3

That worked, thank you, although “technically” I haven’t been exposed to enemy.health yet (but know and understand how it works).

I think the problem comes primarily from the yellow ogres when using lower grade weapons, in this case the “RoughEdge”, the animation isn’t quite keeping up with the code, de-syncing if you will, so where I was putting 3 attacks in, the loop processed 4 or 5 times before the yellow died. Visually it appeared it was only hitting twice and therefore not having an effect, as every other mob except the other yellow worked fine without the loop.


#4

Well there is a decent work around for now.

If you have seen the Code Combat GitHub you can post the bug there with your console log, OS, and browser info to help the devs isolate and fix it.

I am also going to:

@nick bug with the attack method


#5

Thanks Hinkle,

I actually duplicated my post here on there at the time, so it is live. https://github.com/codecombat/codecombat/issues/3360#issuecomment-175818260