• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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

Zwiebelchen

Hosted Project GR
Level 35
Joined
Sep 17, 2009
Messages
7,236
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