Hector is the peasant, he won’t attack, he just tries to evade ogres. You don’t need to give him any commands.
self.command(soldier, "attack", enemy)
Yes, self is Anya. Who is soldier?
def commandSoldiers(): soldiers=self.findByType("soldier") for soldier in soldiers: enemy = soldier.findNearestEnemy() self.command(soldier, "attack", enemy)