• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Using Index 0

Status
Not open for further replies.
if i read u correctly you should increase max index in the loop after finishing the first indexing

and yeah that way u can use index 0 as well

This is not the best way as you would need to have maxIndex - 1 in the loop to keep from using the unused index.

The best way is to start off the maxIndex number from -1.
That way your spell trigger still starts off with maxIndex = maxIndex + 1
Your loop will be from 0 to maxIndex
Your turn on condition for the loop trigger will be greater than -1.
Your turn off condition for the loop trigger will be less than 0.

You can do it but it doesn't really matter. If you have that many instances that you actually need the index at 0 then your thread will crash from hitting the op-limit long before you get all the indexes searched through.
 
Level 12
Joined
Oct 16, 2010
Messages
680
This is not the best way as you would need to have maxIndex - 1 in the loop to keep from using the unused index.

The best way is to start off the maxIndex number from -1.
That way your spell trigger still starts off with maxIndex = maxIndex + 1
Your loop will be from 0 to maxIndex
Your turn on condition for the loop trigger will be greater than -1.
Your turn off condition for the loop trigger will be less than 0.

You can do it but it doesn't really matter. If you have that many instances that you actually need the index at 0 then your thread will crash from hitting the op-limit long before you get all the indexes searched through.

really good point, 1 out of 8000+ indexes is nothing.
 
Status
Not open for further replies.
Top