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.
1 Like
Luke10
February 17, 2017, 6:18pm
2
It may have something to do with your inventory. What kind of boots are you using?
1 Like
The Boots of Leaping - the most expensive ones available for not-subscriptors.
1 Like
Luke10
February 17, 2017, 6:27pm
4
Ok…are you sure you’re using the right methods to use them?
1 Like
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…
1 Like
Luke10
February 17, 2017, 6:31pm
6
Oh…ok this may be a bug. I’ll invite @Bryukh
1 Like
For a strange reason I am able to run the code today
1 Like
Luke10
February 18, 2017, 11:05am
8
Is it working now? Or were you not able to run it in the first place?
1 Like
Bryukh
February 18, 2017, 2:36pm
11
Sorry, I’m on the travel now and can’t answer quickly
1 Like
Luke10
February 18, 2017, 2:40pm
12
Its ok. I think the problem may be cleared up.
1 Like