Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

Library Tactitian: probable bug (Javascript)


I am stuck with the library tactitian level. I have completed the requested lines of code, tried to run and I am getting an error message:

Line 11: Defend takes no arguments. Must defend a target or an {x,y} position.

The line, however, conatins predefined code, unmodified be me:

    hero.command(soldier, "defend", defendPos);

for reference, the full predefined function is

function commandSoldier(soldier, soldierIndex, numSoldiers) {
    var angle = Math.PI * 2 * soldierIndex / numSoldiers;
    var defendPos = {x: 41, y: 40};
    defendPos.x += 10 * Math.cos(angle);
    defendPos.y += 10 * Math.sin(angle);
    hero.command(soldier, "defend", defendPos);

I guess this is a bug, however I would like to check before submitting to GitHub.


It may have something to do with your inventory. What kind of boots are you using?


The Boots of Leaping - the most expensive ones available for not-subscriptors.


Ok…are you sure you’re using the right methods to use them?


I apologize - I don’t understand: To use what? The boots? The boots do not provide a “defend” method, nor does any other available part of my equipment.

The code was not written by me, the whole function is predefined by the system and not intended to be modified…


Oh…ok this may be a bug. I’ll invite @Bryukh


For a strange reason I am able to run the code today


Is it working now? Or were you not able to run it in the first place?


Yes, it is working well.


Oh…ok glad to here it!:smile:


Sorry, I’m on the travel now and can’t answer quickly :frowning:


Its ok. I think the problem may be cleared up.:smile: