Clash of Clones help


#1

I am on clash of clones ive been stuck on it for almost a month my hero used to survive then he would go for a sand yak and get killed by it now he dies cause of the enemy troops and knight/ogres i have 1935 health please help me.

loop:
    enemyIndex = 0
    enemies = self.findEnemies()
    while enemyIndex < len(enemies) and self.health > self.maxHealth / 4:
        enemy = enemies[enemyIndex]
        enemyIndex += 1
        if enemy.type != 'sand-yak':
          while enemy.health > 0:
            if self.isReady("cleave"):
                    self.cleave(enemy)
             else: 
                 self.attack(enemy)
    if self.health <= self.maxHealth / 4:
        enemy = enemies[enemyIndex]
        distance = self.distanceTo(enemy)
        enemyIndex += 1
        if distance > 2:
           if self.isReady("cleave"):
                                 self.cleave(enemy)
            else:
                self.attack(enemy)

Library Tactician Summoning Problem
#2

can you tell me what im doing wrong


#3

i need help chronist please help


#4

I will help. Please be patient in the future. Contrary to popular belief, I am not omnipotent, nor is anyone else on this forum.


#5

i need help asap i have been stuck for so long i give up


#6

Did I not say to be patient? I was typing a response to your problem. Wait for a few more minutes.


#7

Honestly, there isn’t anything wrong with your code at all. You could always try a different strategy. For example, the enemy hero has a very basic program: Look for enemy. If enemy, attack. The clone will not bash or use any other special attacks. What do you think would happen when you don’t equip a weapon? Remember that the clone has the exact same gear as you do.


#8

so what should i do to figure it out


#9

I have just given you a completely viable solution. What do you think you should do?


#10

i just tried and all of my men were killed

[merged triple post]

i unequipped my long sword and then nothing happend my troops all died

what does the level editor do?


#13

That is a completely unrelated question. Let’s try to stay on topic here.


#14

ok so what do i do now


#15

Well, you’ll notice that your clone doesn’t do anything. You’ve just gotten rid of the most powerful enemy. Now, do you have a bashing shield, e.g Steel Striker?


#16

i dont have the steel striker nor do i have enough i think i used to and then i asked nick to reset my gems so i could get better gear


#17

How about you make a list of the gear you have right now, along with the gems you currently have?


#18

i have 227 gems and these
basic flags
programmaticons 1,2,and 3
bronze sheild
long sword
simple wristwatch
softened leather boots
fine telephoto glasses
worn dragon sheild
quartz sense stone
engraved obsidian helmet
obsidian breastplate
crude builders hammer-restricted
wooden builders hammer-restricted
leather boots
wooden sheild
simple sword
crude glasses
faux fur cap
wooden glasses
sundial wristwatch
simple boots


#19

he now survives but then goes for the sand yak and is killed


#20

Your initial code has an “while” loop which iterates over all the enemies and attacks them if they are not yak

and a “if” block in which you attack the ?? last enemy in the list ?? if you are low on health

You are not checking for yak in the if block, so if you are low on health you might attack the yak.

What is the “if” block for anyway?


#21

i beat it i got a simple code which is just bashing


#22

when defining your enemy/target variable, you should ensure that you are not allowing the script to select a yak. Also be careful with Cleave, as it is an area attack. If you’re standing to close too a Yak and you attempt to cleave. There will be trouble. (I used a sword with a power-up instead of a cleave weapon)