Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

[SOLVED] Restless Dead(summoning the undead)

Hii, I’m currently stuck of the restless dead level and I don’t know where to summon the undeads, I always run out of time is it something wrong with my code or I’m I not summoning the right thing? Heres the code.

# This level is supposed to be VERY hard! You may need a great strategy and or gear to complete it!

# Find and defeat the yeti then gather its essence for the ritual.
# You might want to gather the coins the yeti leaves behind, you'll need them to summon an army
# Stand at the summoning stone (red x) to begin summoning
# Now you just have to survive the undead hoard
def summonSoldiers():
    if hero.gold >= hero.costOf("soldier"):
        hero.summon("soldier")
def commandSoldiers():
    enemy = hero.findNearestEnemy()
    soldiers = hero.findByType("soldier")
    for index in range(len(soldiers)):
        nearestEnemy = soldiers[index].findNearestEnemy()
        hero.command(soldiers[index], "attack", nearestEnemy)
def pickUpNearestCoin():
    coin = hero.findNearestItem()
    if coin:
        hero.move(coin.pos)

while True:
    hero.moveXY(17, 46)
    enemy = hero.findNearestEnemy()
    while True:
        pickUpNearestCoin()
        summonSoldiers()
        commandSoldiers()
        if enemy:
            if hero.canCast("summon-burl"):
                hero.cast("summon-burl")
            if hero.canCast("summon-undead"):
                hero.cast("summon-undead")
            if hero.canCast("fear", enemy):
                hero.cast("fear", enemy)
            if hero.canCast("raise-dead"):
                corposes = hero.findCorpses()
                if corposes > 5:
                    hero.cast("raise-dead")
        


And heres the image location for hero.moveXY(17, 46)


And this happens when I run of time…

Thanks

1 Like

If you are talking about the general’s army, you can summon them at the gate to the graveyard.

I’m missing 2 goals which is summoning undead at ritual stones and defeat the rotting general and his minions, I’m pretty sure I summoned undead at the ritual stone but some how it didnt show?

It really isn’t summoning as it is more moving to the gate entrance. That is at (55, 48)

Well it didnt work unfortunately

Try moving inside the graveyard. I don’t think you were supposed to summon skeletons on your side, as the undead are the rotting general’s army, but if it will work for you then do it. At (19, 45) you should be summoning whatever you want to summon to help you.

I honestly don’t think that well work either cause I moved to 17, 45 before and the Rotting General summoned the minions, but the code was wrong and got defeated so I had to delete it and change it and then it didnt work. so I dont think it will work if I move in the graveyard.

Try (19,45) at least. I’ll summon @dedreous, @AnSeDra, and @Deadpool198 to see if there is something else that could be wrong.

Ufy, let’s see a current copy of your code please.

3 Likes

Yes, the other one seems to be a little not updated.
Gtg, sorry!

Andrei

2 Likes
# This level is supposed to be VERY hard! You may need a great strategy and or gear to complete it!

# Find and defeat the yeti then gather its essence for the ritual.
# You might want to gather the coins the yeti leaves behind, you'll need them to summon an army
# Stand at the summoning stone (red x) to begin summoning
# Now you just have to survive the undead hoard
def summonSoldiers():
    if hero.gold >= hero.costOf("soldier"):
        hero.summon("soldier")
def commandSoldiers():
    enemy = hero.findNearestEnemy()
    soldiers = hero.findByType("soldier")
    for index in range(len(soldiers)):
        nearestEnemy = soldiers[index].findNearestEnemy()
        hero.command(soldiers[index], "attack", nearestEnemy)
def pickUpNearestCoin():
    coin = hero.findNearestItem()
    if coin:
        hero.move(coin.pos)

while True:
    hero.moveXY(19, 45)
    enemy = hero.findNearestEnemy()
    while True:
        pickUpNearestCoin()
        summonSoldiers()
        commandSoldiers()
        if enemy:
            if hero.canCast("summon-burl"):
                hero.cast("summon-burl")
            if hero.canCast("summon-undead"):
                hero.cast("summon-undead")
            if hero.canCast("fear", enemy):
                hero.cast("fear", enemy)
            if hero.canCast("raise-dead"):
                corposes = hero.findCorpses()
                if corposes > 5:
                    hero.cast("raise-dead")
        


I tried moving to 19, 45 this error occured. Moving to 19, 45 helped but the soldiers arent attacking beacause of this error which is causing me to loose the battle.

Before this check if nearestEnemy exists and only then command to attack.

Andrei

What if there is no enemy?

For the rest, I used Anya, so some of the advice will be speculation. The first thing that comes to mind is fix the second goal first…for now, ignore going after the general. Once you are getting credit for summoning, the work on the next part.

My ‘stopping point’ is 19, 40. I used a range to summon troops, paladins in my case. Since you are using Nalfor, perhaps summoning soldiers (or pallies) at the stone is all it will take. Then move towards the gate and then summons your burls and such.

I moved to 55, 48 and then started my ‘while True’, which consists of only 3 lines…attack () which covers the hero attack code, commandTroops() which is ignored until I actually have troops to command and collectItems() which is only used at the beginning, after killing the yeti.

3 Likes

AnSeDra I already did that.

But, what if it comes back as nearestEnemy = null?

1 Like

I’m confused


Nvm I got it
3 Likes

So have you finished the level?

Not yet but I’m pretty sure I got it I’m just changing the codes

2 Likes

Excellent!..please do let us know :slight_smile:

2 Likes