Boss Star II problems in Backwoods Brawl (solved enough)

To win Backwoods Brawl, I’m attempting to use my Boss Star II to summon soldiers to defend me as I fight. It works in Kithgard Brawl, but here the soldiers refuse to obey my commands. Here are the relevant parts of my code:

loop:
    enemy = self.findNearest(self.findEnemies())
    while self.gold >= 20:
        self.summon("soldier")
    ...
    if enemy:
        friends = self.findFriends
        friendIndex = 0
        friend = friends[friendIndex]
        for friend in friends:
            self.command(friend, "defend", self)
            friendIndex += 1

I have tried both “(friend, “defend”, self)” and “(friend, “attack”, enemy)” to get them to be of some use other than distracting ogres. When I try unequipping the boss star and re-equip it, it simply disappears instead of moving to my “available” list. What is wrong here?

self.findFriends is a function, not a list.

Also, If you are using the for x in xs syntax to loop over your friends, you shouldn’t have to keep a friendIndex.

1 Like

Good grief. How did I forget to put the parentheses there? I spent lots of time trying to find the problem! :confounded:

It works fine now. The boss star still disappears when unequipped, but this is easily solved by closing and reopening the menu.

Thank you for letting me know how “for x in xs” works. I was still trying to figure that out.