How to filter groups through events

How do I fix my basic player attack event?

I have two object groups: Morphs and Enemies. For the attack event, I need to select enemies whose player variable is false (not the currently active player morph) and morphs whose player variable is true.

The problem is that the Blacksmith belongs to both groups. This seems to cause the conditions to interfere with each other, so the event never runs. If I remove either condition, however, the Blacksmith ends up attacking itself.

I can’t remove the Blacksmith from the Enemies group because other events rely on it being there.

What I want is to filter each group independently, so the event selects enemies with player = false and morphs with player = true, without the conditions interfering with each other.

I’ve also tried using an OR condition, but that just results in the Blacksmith attacking itself again. Is there a way to achieve this?

Yeah, that’s not going to work.

If Blacksmith is in both groups, then you are essentially checking:

Is Player of Blacksmith true & Is Player of Blacksmith false - this condition will never work.

Why is Blacksmith in both groups? I would need more context about the logic behind this mechanic.

Basically the main thing of the game is that you , the player can morph into different creatures/objects in the game meaning the same object eg:blacksmith is used as both the player and a wild enemy. I use the group enemies to run events exclusive to wild enemies and the group morphs for events for the player and so the blacksmith is present in both groups. I use the object variable “player” to identify wether the object is used as player or enemy.
Basically the goal is to just be able to use the same object as both player and enemy

Okay, then a couple of things:

  1. If you’re not morphed, you cannot attack? You have the condition in the attack “Player of Morphs is true”, so I assume you have to be morphed to attack?
  2. I don’t know if you need this attack check at all. When you press Attack, you draw the AreaOfAtk circle, which means, if circle is drawn, the attack is triggered. So instead of a sub-event, I would do a standalone event:
  • For each “enemies”, where “Player” is false, and “enemies” is in collision with AreaOfAtk - do the damage

it was an incorrect idea that having two groups one for morph and one for enemies, would seperate the state of the object. as groups are defined before initialization, and a defined object that is in both groups will always still be in both groups. blacksmiths will always be morphs and enemies. never can you treat it as not one or the other. (don’t get me wrong, having different groups is an amazing decision. and yes it’s perfectly normal to assign many groups to objects)

when you want to do something to the player specifically and non-players. you do that with a variable (player) that you switch on and off to know who is the player. the problem arise when you think that groups alone can filter instances. no. you have the same problem than, (hypothetical example): checking collisions with itself.

for you it goes like this:

i do filter enemy first, and then player later because the bullet extension requires an object to be shot from. (normally i do reverse)