HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Creating arrays using strings?

10-16-2003, 03:37 AM#1
Klownkiller
Does any one know if it is possible to create an array of regions with out actualy defining each of them specifically

for instance a regiona array?

set PlayerZone[1]=gg_rct_Player_Zone_1
set PlayerZone[2]=gg_rct_Player_Zone_2
set PlayerZone[3]=gg_rct_Player_Zone_3

is there any way to use an Integer loop function to set the variable to the specified region? Maybe using a string that defines the region by using the repeaeted portions and only changing the numbers on the end? This would keep on from repeating the same actions and could greatly reduce map sizes? Does any on eeven know what i am talking about?


:////
10-16-2003, 07:07 AM#2
element_5
I understand what you mean, but unfortunately, it's not possible with JASS. It would only be possible if there was a String to Rectangle conversion. For those who don't know what he's talking about, he wants something like this:

Code:
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 3
loop
    exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
    set PlayerZone[GetForLoopIndexA()] = S2RECT("gg_rct_Player_Zone_" + I2S(GetForLoopIndexA()))
    set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop

As noted, the needed feature would be the S2RECT (String to Rectangle) conversion, which doesn't exist AFAIK.
10-16-2003, 12:14 PM#3
Klownkiller
well thanks anyway. iwas 99% sure it was impossible. I'm just always looking for something easier faster and more eficient.