GeorgeZaharia that's interesting... so just saying Resources != "pp" won't actually pick them?
So I have a few state changes where I need to check if there are resources out (minus the "pp" ones), and I'm checking every tick. Maybe its better to make "pp" resources be a different object type? There are 4 other resource types in the game, "pp" are just production points "coins" that only the player can collect. The AI should ignore those...
ehm yes? .... just saying Resources !="pp" won't actually pick them, i mean it will pick them all , indifferently if they have value of "pp" or not. since you didn't mentioned which of them?
Edited: and while it picks all of them, the conditions you added bellow, will get you nan or it will count as 100 or what max number of instances you have since you are not looping trough all of them, picking 1 by 1 and checking their values, i think the pick all a temporary array and checks all instances. then counts them based on the comparison inserted.
but yea if you don't use the solution in my capx bellow and you want to use a custom method like above, you have to use a loop, so it checks every item at a time, otherwise the systems counting overwrites and picks all with the last value of the last object.
so here is my example capx... in C3 i used picked by comparison system expression and you won't need the 2 other functions you used there
also in C3 != is actually <>
example picking instances based on value
event line 8 is what you need to replace your conditioning in the picture.