'Defend' command


#1

This may be user error, but it doesn’t seem like the ‘defend’ command does anything in the arena. When I use it, my minions continue to attack the enemy - as though they hadn’t received the command. I know the ‘say’ is getting called, because the message appears onscreen.

this.say("Regroup!", {
    action: 'defend',
    targetPos: this.pos
});

#2

Actually, you have to actually say “Defend” in the string, not “Regroup!”. Is there somewhere where the docs indicated using action in the data argument instead?


#3

Oh, I see–the say() docs include the {action: ‘move’} example. I have updated them to be a little less suggestive that there are any set data parameters.


#4

Wait, so, can I change the code for my minions to actually use those custom data parameters? If not, what’s the point of even having them in the documentation?


#5

The problem is that the this.say() documentation is generic to say, and in other levels (like Brawlwood) you can code the minions’ hear(speaker, message, data) callbacks. What we need is a way to make the documentation specific to each level, or at least to the available methods, because otherwise it either keeps referencing other properties that aren’t relevant to the challenge, or it’s unhelpfully generic.

I’ll track that over here: https://github.com/codecombat/codecombat/issues/742