Cloudrip Treasure

I’m using Twilight Glasses and I have the Boss Star 2 in this level. According to the latter I should be able to command peasants. But I’m having trouble making peasants collect coins.

For example the following code:

   item = peasants.findNearestItem()```

displays a mistake "peasants has no method findNearestItem".

Am I missing something?

Yes. You are defining find by type peasants. Which finds more than 1 peasant. Try using a for statement like such : For peasant in peasants: because, this does the command for each peasant individually, instead of just trying to send them all that once.

Thx a lot! For some reason I got stuck here. I’ve used the “for” statement, but did it incorrectly. You’ve stated the obvious, but it really helped me a lot. Thx again!

There is no such thing as “obvious” in coding, i can’t tell you how many times i was stuck for 30 minutes because i didn’t put a stupid parenthesis.

Cheers sir, glad i could help.

i need help with my code, my hero makes it to the end, but only collects around 170 coins, not anywhere near the needed amount. Do i need to upgrade my speed?
Code:

So is there a reason he only collects this amount like did you run out of time because it seems your code is correct. Please post the error message.

2 Likes

There is no error message, my hero just doesnt collect the needed amount.

Send a screenshot please

I think the problem is every time you have enough gold to summon, you waste it all and then command them to attack the fang rider, which takes too much time. Instead of summoning so many soldiers, use an if statement such as if there is an enemy within for example 5 meters, attack it, otherwise, ignore it and finish collecting your 256 coins.

It looks like you’re surviving but not collecting enough gold.

Are you using the peasants to gather gold for you?

1 Like

Use the peasants to help you collect gold and avoid attacking until the unit is close to your hero. These two techs should help you pass the level

No i forgot how you do that, can you tell me how?

Nevermind I kept typing in different things and went back to older levels and found out how, thanks for you help!