'Defend' command


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


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?


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.


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?


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