Komaqtion
You can change this now in User CP.
- Reaction score
- 469
Hellu !
Ok, so I just wanted to know, how can I create a region in every square, in a check pattern ? :S
Ok, so with this code below I've created a checked pattern (Like a Chess board, but it isn't ), and I was wondering what the easiest way it to create a region in those squares that are creates :S
I've already "started" with something at the bottow, but I stopped as I didn't know what I was doing XD
Any ideas ?
Ok, so I just wanted to know, how can I create a region in every square, in a check pattern ? :S
Ok, so with this code below I've created a checked pattern (Like a Chess board, but it isn't ), and I was wondering what the easiest way it to create a region in those squares that are creates :S
I've already "started" with something at the bottow, but I stopped as I didn't know what I was doing XD
JASS:
scope TerrainPattern initializer Create_Checked_Pattern
globals
constant real CENTER_X = 0
constant real CENTER_Y = 0
private constant real SQUARE_WIDTH = 8192.
private constant real SQUARE_HEIGHT = 8192.
private constant real COLUMNS = 19.
private constant real ROWS = 19.
private constant integer BORDER_RES = 200
private constant string SFX_PATH = "Abilities\\Spells\\Human\\SpellSteal\\SpellStealMissile.mdl"
endglobals
globals
rect array BoxCol
rect Board = Rect( CENTER_X - ( SQUARE_WIDTH / 2 ), CENTER_Y - ( SQUARE_HEIGHT / 2 ), CENTER_X + ( SQUARE_WIDTH / 2 ), CENTER_Y + ( SQUARE_WIDTH / 2 ) )
endglobals
private function Create_Checked_Pattern takes nothing returns nothing
local real posx
local real posy
local real x
local real y
local real width = SQUARE_WIDTH / COLUMNS
local real height = SQUARE_HEIGHT / ROWS
local integer ic
local integer ir
local integer i = 0
loop
exitwhen i >= 12
call FogModifierStart( CreateFogModifierRect( Player(i), FOG_OF_WAR_VISIBLE, bj_mapInitialPlayableArea, true, true ) )
set i = i + 1
endloop
set i = 1
set posx = CENTER_X - ( SQUARE_WIDTH / 2 )
set posy = CENTER_Y + ( SQUARE_HEIGHT / 2 )
set ic = 0
loop
exitwhen ( ic == COLUMNS + 1 )
set x = posx + ( ic * ( SQUARE_WIDTH / COLUMNS ) )
set y = posy
set ir = 0
loop
exitwhen ( ir == BORDER_RES + 1 )
set y = ( posy - ( ir * ( SQUARE_HEIGHT / BORDER_RES ) ) )
call AddSpecialEffect( SFX_PATH, x, y )
set ir = ir + 1
endloop
set ic = ic + 1
endloop
set ir = 0
loop
exitwhen ( ir == ROWS + 1 )
set x = posx
set y = posy - ( ir * ( SQUARE_HEIGHT / ROWS ) )
set ic = 0
loop
exitwhen ( ic == BORDER_RES + 1 )
set x = ( posx + ( ic * ( SQUARE_WIDTH / BORDER_RES ) ) )
call AddSpecialEffect( SFX_PATH, x, y )
set ic = ic + 1
endloop
set ir = ir + 1
endloop
loop
exitwhen i >= ( ( SQUARE_HEIGHT * SQUARE_WIDTH ) / 2 )
set BoxCol<i> = Rect( ( i - 1 ) * width, ( i - 1 ) * height, i * width, i * height )
call SaveInteger( Boxes, 1, GetHandleId( BoxCol<i> ), BoxData.create( BoxCol<i> ) )
set i = i + 1
endloop
endfunction
endscope</i></i></i>
Any ideas ?