Kelvintaph Defiler - Help!

Sorry I took so long.

4 Likes

Sorry that I stop helping you. Here is one tip your units can attack in mid air but not while the shaman casting fear on them.

3 Likes

I finished it long ago

1 Like

Congratulation. I haven’t so can you give me some tip please because I haven’t finish it.:slightly_smiling_face:

3 Likes

@Chaboi_3000 im not getting this… what’s the **** u are talking about…?

Check here:

even with that hint i can’t figure it out :rofl::joy:

A commandable unit would mean a unit on team human, but if a human dies, then u dont get the bonus, so it’s not on team human…
but how else could it be commandable…?

Bonus is not neccecary.

so… wut’s the ****? i still can’t figure it out
lol
rip me

If I get him right he suggests you to do some kind of hack\trick.

I suggest you to to as required for the first run.
This level is artificially hard.
It is more about game mechanics than programming

All you need to know for beat this level

  1. archers can place some hits on shamans before they cast fling\fear on them.
  2. soldiers and archers can attack while in the air.
  3. paladin shield mitigates spells
2 Likes

i know how to code this thing, but i want to figure out how to do it without doing 200 loc
im trying to see if there’s simpler solutions, so i dont spend 24 hours beating this level
btw why is the discourse so slo today

I created this code so my soldiers in Kelvintaph defiler can free the archer so they can free the paladin together

def findEnemy(name, friend):
    enemies = friend.findEnemies()
    id = name
    i = 0
    for i in range(len(enemies)):
        enemy = enemies[i]
        if id == enemy.id:
            return i
        else:
            i += 1

I’m inputting “Drun” for name and the soldier’s variable for friend.
But when i run my full code, it won’t attack its enemy… Why?

def CommandSoldier(soldier):
    if step < 4:
        target = findEnemy("Drun", soldier)
        if "Drun".health > 0:
            hero.command(soldier, "attack", "Drun")
        elif soldier.pos.x < 74:
            moveStep = 0
            if moveStep == 0:
                hero.command(soldier, "move", {"x": 6, "y": 74})
                moveStep += 1
                target = findEnemy("Drun", soldier)
                if target:
                    while target.health > 0:
                        hero.command(soldier, "attack", target)
            if moveStep == 1:
                hero.command(soldier, "move", {"x": 22, "y": 67})
                moveStep += 1
                target = findEnemy("Drun", soldier)
                if target:
                    while target.health > 0:
                        hero.command(soldier, "attack", target)
            if moveStep == 2:
                hero.command(soldier, "move", {"x": 39, "y": 62})
                moveStep += 1
                target = findEnemy("Drun", soldier)
                if target:
                    while target.health > 0:
                        hero.command(soldier, "attack", target)
        else:
            enemy = soldier.findNearestEnemy()
            if enemy:
                hero.command(soldier, "attack", enemy)

that’s the code for commanding my soldier.

Never mind…
I finally beated the level!! :slight_smile:
but i can’t figure out how to keep my entire squad alive…
it’s weird!!
i can finish the level if i sacrifice my soldiers to the yeti, but i cant if i dont sacrifice them…

If you are talking about the moment when Nalfar flees from you.
It is relatively easy.
Just think where is the yeti came from and what you can do about it beforehand.

1 Like

basically, i get my archers freed so they can free the soldiers.
Before Nalfar even got close to fleeing, i have to sacrafice my soldiers…
so like… when the soldiers get freed, i sacrifice them to the yeti, then i get my 2 archers to nalfar, and get him to swap.
and that = success.
But if i get my soldiers to stay at a specific point without sacrificing them for nothing, the level fails.

i have to command them to attack the yeti, or the level fails.
that’s what i mean.

Interesting
I just take care of the yeti beforehand.
So no one hurt.

Could you please send that version of your code:
“But if i get my soldiers to stay at a specific point without sacrificing them for nothing, the level fails.”

It is interesting to see what is going on.

1 Like

nah it’s okay
i figured it out
i changed it so that instead of 2 archers fighting the necromancer, i send the 2 soldiers to attack him with the paladin helping.
the archers basically just sit there and do nothing :stuck_out_tongue:

woo!
i finally beated everything in glacier! :slight_smile: yay