Cloudrip Treasure


#1

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?

#2

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.


#3

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!


#4

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.


#5

Cheers sir, glad i could help.


#6

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:


#7

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.


#8

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


#9

Send a screenshot please


#10


#11

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.


#12

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

Are you using the peasants to gather gold for you?


#13

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


#14

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


#15

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