Make Advances have not existing command

I was trying to complete this level for 3 days but it seemed like im not experienced enought yet. But then i just changed one line of code that i should use according to Tips.

It says :

Some important things to note:
hero.findNearestMissiles() finds all missiles that they can see.

But hero.findNearestMissiles() its not working any way that i was trying to use it
After countless try i just changed it to

var NearestMissiles = hero.findNearest(projectiles);

So either im very stupid and cant understand the hero.findNearestMissiles() or either its not working and just missleading people(including me :P)

EDIT//

// NOT WORKING CODE

while(true) {
    var friends = hero.findFriends();
    // findEnemyMissiles finds all dangerous projectiles.
    var projectiles = hero.findEnemyMissiles();
    for(var i = 0; i < friends.length; i++) {
        var friend = friends[i];
        if(friend.type == "paladin") {
            // Find the projectile nearest to the friend:
           var NearestMissiles = hero.findNearestMissiles(projectiles);
           if(NearestMissiles){
            var distance = friend.distanceTo(NearestMissiles);
           }
            // If the projectile exists
            // AND is closer than 10 meters to the paladin:
            if(NearestMissiles&&distance<10){
                // Command the friend to "shield":
                hero.command(friend, "shield");
            }
            // ELSE, when there is no potential danger:
            else {
                // Advance the paladin:
                hero.command(friend, "move", ({x:friend.pos.x+1,y:friend.pos.y}));
            }
        } else {
            // If not a paladin, just advance:
            if(friend.type != "paladin"){
                hero.command(friend, "move", ({x:friend.pos.x+1,y:friend.pos.y}));
            }
        }
    }
}
1 Like

What glasses are you using?

provide full code

1 Like

I pasted the code to main post (not working one).

Im using the best available glasses for 34 Level. (I have Polish version so if you really need name of them i can change it to english and tell you but i think this is not issue since they are the best available).

I already done this level just didnt used the provided code as tips are telling to do. And i think its impossible to do with the code sample from tips.

1 Like
var NearestMissiles = friend.findNearest( hero.findEnemyMissiles() );
1 Like

Do you even read what i said?
Im not saying i cant done this level, im saying TIPS that the game is providing are wrong and missleading.
I dont need help with this level as i already done it few hours ago.
But anyway thanks for interest :slight_smile: .

1 Like

:slight_smile:
You are right
Somehow
I overlooked your point

Can anyone take a look at this code and tell me that i was either doing something wrong or is it a Mistake that its only missleading people?

The problem is

Some important things to note:
hero.findNearestMissiles() finds all missiles that they can see.

But there is not such a command as hero.findNearestMissiles()

1 Like
hero.findNearestMissiles()

It is mistake for sure

If check dedicated topic

https://discourse.codecombat.com/t/adventurer-make-advances/9516

Level is about .findEnemyMissiles

In any case you must waite for
@Serg – designer of level

1 Like