The Master of names level is broken


#1

Well,i know im new here but the Master of names levels auto code is wrong it says


#2

What did it say about the code? Was it just that you had equipped some more advanced gear that it wasn’t expecting, or…?


#3

Welcome to the forum oaberut but we are not mind-readers so you have to post your code and tell us what is going on


#4

sorry,im dumb,i bought some advanced glasses when i just got the ones for the level


#5

I am also experiencing problems with the level- the 2nd line of default code has an error, but for the life of me, I cannot get the game to let me proceed beyond line 9.

enemy1 = self.findNearestEnemy()
self.attack(enemy1)
self.attack(enemy1)

enemy2 = self.findNearestEnemy()
self.attack(enemy2)
self.attack(enemy2)

enemy3 = self.findNearestEnemy()
self.attack(enemy3)
self.attack(enemy3)

Any suggestions at all?


#6

Your program is sound. It’s the level that is the problem, I believe. Just so you can get through it, do this for all three enemies:

if enemy1:
    self.attack(enemy1)
    self.attack(enemy1)

Also, just for future reference, please post your code in between triple back ticks, like so:

` ` `
Your code goes here.
` ` `

except, no spaces between them.


#7

I ended up getting it to work with:

loop:
    
    enemy1 = self.findNearestEnemy()
    if enemy1:
    self.attack(enemy1)
    self.attack(enemy1)
    else:
    self.say("Come Closer!")
    

Althought I’m not completely sure I still understand why that worked!

*Edit- I’ve figured it out. I’m telling the character to keep attacking the closest enemy if there is one to be found. If not, make noise and repeat.


#8

For some reason you can’t see the second enemy right away, and so “enemy2” is empty or “null”. (why that is happening is a good question.)

This most recent code handles that problem by using a say (which uses up time) while waiting for more enemies to become visible.

What Hero/boots/sword are you using? are you wearing the speed ring?

Because this level works perfectly when I am using the starter hero wearing the simple boots and wielding the simple sword. (and doesn’t work if I move to fast…)


#9

I was using Anya with the speed ring, simple boots and short sword . I really think the key was to just take up some time!