Timber turncoat help!


#1

The soldiers I summon are too slow, causing the ogres to kill the peasant faster that the soldier can reach. Soldiers have small amounts of health; means that the warlock will appear faster. I am now trying my smartest strategy:
connecting the if statement is:. The reason why I did the screenshots is because I didn’t want to type out all that code again.


#2

Two tips:

Do you know the difference between move and moveXY? Try to find out which should be used in this situation. Read the topics in this forum to find out about the differences between the two. Remember there is a search-function.

Monitor the health of your soldiers. If it is too low, send them back so they don’t die. Check friend.health < friend.maxHealth (or a similar value, I wouldn’t use this 1-to-1).


#3

I know the diff between move an moveXY. Move moves one step at a time. So you can track your target. MoveXY gets 1 target but won’t do anything else until it is gone; not good for tracking your target.


#4

This is what happened in
post1
:


In the screenshot, it showed that the soldiers were still trying to get to the ogre but it was too late.


#5

Are you sending the soldiers out as soon as you summon them?


#6

Do you summon the first soldier as soon as possible, that is at level start?
Or do you summon it maybe a bit later, because you are first using a blocking moveXY-command?

I already asked you if you know the difference and what it means.


#7

right but you are forgetting the fact that you will loop through all the other functions before taking the next step so it is beneficial in almost all situations except a few


#8

I just could win it with griffin riders, but with them very easy lol


#9

Yes but at this point you might not have Griffin riders


#10

My code is below, I can’t really see where I am going wrong, the ogres will always overwhelm my soldiers to the point that one will die and boom, trouble! Any thoughts?

                self.command(friend, "move", {"x": 11, "y": 45})

                self.command(friend, "move", {"x": 93, "y": 45})

#11

I removed the other lines 'cause your code is good. :smiley:

I would suggest changing the remaining two lines.

The first one (x 11, y 45) is your “retreat if low health” position, and an ‘x’ of ‘11’ is inside the coin area at that location the hurt soldiers could get in your way collecting coins. Make ‘x’ say ‘30’ then they are out of the way for both you and your healthy soldiers.

The second one is very far out there . . . it takes a long time for the new soldiers to walk all the way out to 93 to help the old ones. “lowering” this to even 80, should make a big difference in when your reinforcements arrive to relieve the previous crew.


#12

Thanks for the advice, combined with a fresh seed, this worked a treat.


#13

Yeah. I am. The only problem is, that soldiers are way too slow.


#14

It is impossible to solve this level with soldiers.
Archers are solution.