Lets say you have 100 enemies and you want to find the highest health of all of them.
You can achieve this two ways:
Start loop "find highest health" number of enemies times
On loop "find highest health"
- ID of Enemy = loopindex("find highest health")
- Health(Enemy) > Global Value A
Set Global Value A to Health(Enemy)
or
On loop "find highest health"
- ID of Enemy = loopindex("find highest health")
Set Global Value A to max(Health(Enemy), Global Value A)
Obviously as this loop can scale up depending on the number of enemies, I want it to be as efficient as possible. So is it faster to test for a condition or just always set a value.