I’m attempting to complete “Woodland Cleaver”, but it continues to call my target “enemy” null, despite the fact that the enemy is identified at the beginning of the loop and the code runs properly for half the level before locking down and failing because of this issue.
The code I have is as follows, including the sample code and text.
# Use your new "cleave" skill as often as you can. self.moveXY(23, 23) loop: enemy = self.findNearestEnemy() if self.isReady("cleave"): # Cleave the enemy! self.cleave(enemy) else: # Else (if cleave isn't ready), do your normal attack. self.attack(enemy)
I’ve looked around and based on the posts in the main topic for Woodland Cleaver, and the sample text of the level, this seems like it should be the proper solution.
EDIT: I’ve managed to bypass this by creating a larger “if” and putting it around the if/else statements already in place so that it only performs them if an enemy is present.