Max regions and setting?
Moderator: Cheaters
-
- Forum Staff
- Posts: 506
- Joined: November 17th, 2008, 3:49 pm
Max regions and setting?
So, ive started a little side project which ive been wanting to create for a while now. But before i put a lot of work into it i need to know if there is a cap on how many regions can be set. And if there is no cap, is there and easy way to set regions up in an variable array? Cause the map that im creating needs to have regions over the entire map, and they have to be 1x1 squares..talking about thousands of regions and setting them one by one is a very, very huge task.
If there is no way, can anyone think of another way to create units in a grid lined up right next to and under each other?
If there is no way, can anyone think of another way to create units in a grid lined up right next to and under each other?
-
- Super Moderator
- Posts: 3197
- Joined: February 24th, 2009, 1:31 pm
- Location: JEW LAND
- Been thanked: 1 time
Re: Max regions and setting?
I never made a region, but from the maps Ive cheated ive noticed globals variables of regions I belive. So if it can be a global variable I belive I can make a loop system in jass for you. But since I never made a region I don't know how it works and I don't have a wc3 at my mobile so I don't wont to make a false code.
Although, if you open the w/e, make a sample region at the top left map (x=0 and y=0) with the size that you want (I think it will be rects only) -> convert it to custom text and post here the relevant code. Ill be able to help you.
Also Ill need the map size.
Although, if you open the w/e, make a sample region at the top left map (x=0 and y=0) with the size that you want (I think it will be rects only) -> convert it to custom text and post here the relevant code. Ill be able to help you.
Also Ill need the map size.
-
- Forum Staff
- Posts: 506
- Joined: November 17th, 2008, 3:49 pm
Re: Max regions and setting?
Perhaps im not fully understanding, but converting the trigger turns it into this.
Map size is 128x128 or x -8192, y -8192
Code: Select all
function Trig_Untitled_Trigger_004_Actions takes nothing returns nothing
set udg_Dirt[0] = gg_rct_Region_000
endfunction
//===========================================================================
function InitTrig_Untitled_Trigger_004 takes nothing returns nothing
set gg_trg_Untitled_Trigger_004 = CreateTrigger( )
call TriggerAddAction( gg_trg_Untitled_Trigger_004, function Trig_Untitled_Trigger_004_Actions )
endfunction
-
- Super Moderator
- Posts: 3197
- Joined: February 24th, 2009, 1:31 pm
- Location: JEW LAND
- Been thanked: 1 time
Re: Max regions and setting?
Ythe code you posted has gave the array the same value as the normal global variqble.
Can you see what is the data of gg_rect_region_000?
Can you see what is the data of gg_rect_region_000?
-
- Forum Staff
- Posts: 506
- Joined: November 17th, 2008, 3:49 pm
Re: Max regions and setting?
Code: Select all
set gg_rct_Region_000 = Rect( -8192.0, 8064.0, -8064.0, 8192.0 )
-
- Super Moderator
- Posts: 3197
- Joined: February 24th, 2009, 1:31 pm
- Location: JEW LAND
- Been thanked: 1 time
Re: Max regions and setting?
This should work... There are a total of 128^2 regions.. buti cant test.
Also i didn't quite understand how the wc3 x,y work.
From a logical prespective, top left = 0,0
and bottom right = max_x,max_y
where your max_x and max_y = 8192.
But, your function says the X starts at -8192 and the Y at 8064. I assume you used the top left for that example, and even if you didn't. What is the meaning of the -X here? odd, very odd.
Ill need some more information on how it works so I can fully get it work, but the following code should work if it is working as I described (from 0,0 to max_x,max_y).
Also i didn't quite understand how the wc3 x,y work.
From a logical prespective, top left = 0,0
and bottom right = max_x,max_y
where your max_x and max_y = 8192.
But, your function says the X starts at -8192 and the Y at 8064. I assume you used the top left for that example, and even if you didn't. What is the meaning of the -X here? odd, very odd.
Ill need some more information on how it works so I can fully get it work, but the following code should work if it is working as I described (from 0,0 to max_x,max_y).
Spoiler:
-
- Forum Staff
- Posts: 506
- Joined: November 17th, 2008, 3:49 pm
Re: Max regions and setting?
Thanks for your help, but it didn't work. Im not too good at inserting jass into the triggers so maybe i did something wrong at that end. After putting it in i got four errors in the syntax check.
"Undeclared variable: REGSIZE"
"Undeclared variable: currently"
"Cannot convert rect to region"
"Undeclared variable: loopexr"
I put the first part under globals, and the second under endglobals. Not sure if it helps any, but 0,0 is the very middle of the map. And wc declares that everything has to be a multiple of 32 so even the region at zero is actually.
Also, apparently after i put the code into the jass file then opened it back up in World Edit, the code completely disappeared, as if i've never put it in. But im sure that after i put the code in, i saved the jass and inserted it back into the map. So i don't know what happened there.
"Undeclared variable: REGSIZE"
"Undeclared variable: currently"
"Cannot convert rect to region"
"Undeclared variable: loopexr"
I put the first part under globals, and the second under endglobals. Not sure if it helps any, but 0,0 is the very middle of the map. And wc declares that everything has to be a multiple of 32 so even the region at zero is actually
Code: Select all
set gg_rct_Region_040 = Rect( 0.0, -32.0, 32.0, 0.0 )
Also, apparently after i put the code into the jass file then opened it back up in World Edit, the code completely disappeared, as if i've never put it in. But im sure that after i put the code in, i saved the jass and inserted it back into the map. So i don't know what happened there.