Wolf won't catch arrows in "ARROWROOF WOLF"

Hi, there.
I have written the code by following hints

# Collect mushrooms.

# First, come to the wolf pet and wake up it (say).
pet.moveXY(74, 35)
hero.say("hi")

# Next collect mushrooms just usual items.
while True:
    item = pet.findNearestByType("mushroom")
    if item:
        pet.moveXY(item.pos.x, item.pos.y)
        pet.fetch(item)

        arrow = hero.findNearest(hero.findEnemyProjectiles())
        if arrow:
            pet.catch(arrow)

An alert is shown hero has no method findEnemyProjectiles and my wolf won’t catch arrows…
How can I make my wolf to catch arrows?

All you really have to do is wake the wolf up and then have your hero collect the items. The wolf will just follow you around and every time it says, “woof” he has caught another arrow. The wolf catches arrows as a natural ability of the pet. You don’t need to code it. It’s just something the wolf does.

2 Likes

HI, MunkeyShynes.

All you really have to do is wake the wolf up and then have your hero collect the items.
I am sure I have woke up wolf by hero.say(“Hi”).

The wolf catches arrows as a natural ability of the pet. You don’t need to code it. It’s just something the wolf does.

I understand. But wolf till won’t catch arrows…

you could just define the mushrooms as hero.findNearestItem(). It says to collect the mushrooms, so you should collect them yourself. The wolf will block the arrows automatically.

1 Like

You can code the wolf to catch arrows as in your original code, however there is no hero.findEnemyProjectiles() method. Try hero.findEnemyMissiles() instead. Also, you don’t have time to stand in one place off to the side and wait for your pet to gather 15 mushrooms. You will run out of time. If you want to do it this way, try standing in the middle of the field.

2 Likes

I have made wolf gather mushroom by wolf originally. So I have changed Hero to gather mushrooms, then wolf start to catch arrows!

1 Like

Inspired by the idea to command the wolf to catch the arrows and to fetch the mushrooms I tried but failed because the pet has moveXY and not move. So I posed the wolf ( not the hero) in the middle of the field, as MunkeyShynes suggested.

(Solution removed)

I can delete the code if needed, but it is a pain to be in the same time helpful and cryptic. I cannot forget that the audience are mostly kids…

Did that work? I tried it but it didn’t work for me.

Edit: Nevermind, wrong boots. Yes, it works. Nice. But please don’t post working code. Nice idea though. Those arrows never came close to the hero. Wolf was all over it. Sweet.

1 Like