• 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.

[General] Looping through Rects

Status
Not open for further replies.
Level 9
Joined
Apr 23, 2011
Messages
460
What are my choices for looping through various rects. I'm haven't renamed any of them so they're all "Region_00X" where x is any integer between 0 and 5. I was wondering how I could concatenate the integer in a loop to the "Region_00" or if it would be just as easy to do this by storing the regions in an array, as they won't change during game-play.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
What are my choices for looping through various rects. I'm haven't renamed any of them so they're all "Region_00X" where x is any integer between 0 and 5. I was wondering how I could concatenate the integer in a loop to the "Region_00" or if it would be just as easy to do this by storing the regions in an array, as they won't change during game-play.

Storing them in an array is the best solution.
 
I think he is talking about preplaced rects. Looping through preplaced rects is not possible, unfortunately, without manually registering them to an array.
(Actually, there IS a solution which abuses handle IDs and a certain function that is used to convert a handle ID back to a handle variable, but it's not recommended if you can just put your rects in an array manually at map init)
 
Status
Not open for further replies.
Top