Bit if a complicated issue

0 favourites
  • 2 posts
From the Asset Store
11 loops of RPG, chiptune/8-bit music. Suitable for any pixel art game.
  • My game has a feature that 2 NPCs can attack eachother. I have it set up so there's an "NPC" family and a "food" family. Certain NPCs can also come under the food category. NPC family can attack the food family, but as trying to reference both of the same family in the instance overlap condition, I am not sure about. So using 2 different families was my way around it if that makes sense?

    Anyway, if 1 NPC can attack, one cant and both are food, everything works as it should and the one that can attack destorys the one that cant. But if both NPCs can attack, then regardless of health and speed differences, they both get destroyed at once, which shouldn't be happening. I also have it dropping bones when the Food family member gets destroyed, and it only creates 1 bone instance suggesting that one of them got destroyed wrong.

    Just wondering if there's a way to reference the families separately between the 2 attacking?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ok I have figured it out. I set a local variable to hold one of the NPC family UID, and ran a for each loop to find that one, then performed destroy, and it seems to have worked a charm!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)