wc3edit.net

United Warcraft 3 map hacking!
It is currently March 28th, 2024, 4:17 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Max regions and setting?
PostPosted: January 27th, 2013, 4:02 pm 
Offline
Forum Staff
User avatar

Joined: November 17th, 2008, 3:49 pm
Posts: 610
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?

_________________
Image


Top
 Profile  
 
PostPosted: January 27th, 2013, 6:45 pm 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
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.

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
PostPosted: January 28th, 2013, 12:59 am 
Offline
Forum Staff
User avatar

Joined: November 17th, 2008, 3:49 pm
Posts: 610
Perhaps im not fully understanding, but converting the trigger turns it into this.
Code:
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


Map size is 128x128 or x -8192, y -8192

_________________
Image


Top
 Profile  
 
PostPosted: January 28th, 2013, 8:19 am 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
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?

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
PostPosted: January 28th, 2013, 9:49 am 
Offline
Forum Staff
User avatar

Joined: November 17th, 2008, 3:49 pm
Posts: 610
Code:
set gg_rct_Region_000 = Rect( -8192.0, 8064.0, -8064.0, 8192.0 )
I hope this is what you were asking for, otherwise ive really got no good idea how to get that information. This region is in the top-left corner of the map.

_________________
Image


Top
 Profile  
 
PostPosted: January 28th, 2013, 10:14 pm 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
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).

Spoiler:
Code:
globals
region array RegsArray
constant integer REG_SIZE=128
constant integer MAP_SIZE_X=8192
constant integer MAP_SIZE_Y=8192
endglobals


function initRegs takes nothing returns nothing
local integer currentX=0
local integer currentY=0
local integer looperx=0
local integer loopery=0
local integer sum=0
loop
exitwhen loopery>=MAP_SIZE_Y / REGSIZE
loop
exitwhen looperx>= MAP_SIZE_X / REG_SIZE
set RegsArray[sum]= Rect(currentX,currenty,currentX+REG_SIZE,currentY+REG_SIZE)
set currentX=currentX+REG_SIZE
set looperx=loopexr+1
endloop
set currentY=currentY+REG_SIZE
set currentX=0
set looperx=0
set sum=sum+1
endloop
endfunction

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
PostPosted: January 29th, 2013, 1:03 am 
Offline
Forum Staff
User avatar

Joined: November 17th, 2008, 3:49 pm
Posts: 610
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
Code:
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.

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)