Trying to create a simple Enemy encounter where the Enemy checks if it has more stats than you, it chooses to attack that stat. This BP checks four different X-Y and creates MakeArray from their results, to get the Index with Max value. I want to ignore an index when a Y’s value is equal to 0. So that the linked Enum won’t be selected when Y is equal to 0. Can’t figure out how to do it. Or should I approach this differently?
If I understand correctly, you only want to select a body part to attack if the value difference is positive (Enemy stat stricly greater than player stat).
Obviously I don’t have access to your exact nodes, but you get the logic behind this example.
You can have a branch node (if statement) to check the max value of the array and only set your body part if it is positive.
Ty for the response! I don’t want Enemy to attack Player only if the difference is Positive, because it’s a chance-based attack so the Enemy could decide to attack even when all the results are negative. It will choose the max value from those Negative indexes. If they are -2, -2 ,-2, -1, it will choose the -1 one. But it shouldn’t attack a Body part when its related attribute hits 0, because their values don’t go negative. That is why Enemy should ignore a body part when its related attribute is 0.
So if one of the Attributes hit 0, an index from the Array should be ignored.
Edit: I think I worded incorrectly in my initial post. Apologies.
I must say your clear understanding of my messed up core mechanics amazes me because you got it completely correct
And I think what you come up with will work just fine because In the case that they are all 0, I’ll give the turn to the Player again just for now.
But in the actual game, this scenario will probably end in Player loss. It’s hard to come back from there. But even if you are alive there it means Enemy will go defensive mode, executing other mechanics.
Thank you for all your help. I’ll be implementing this right now.