HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

hmm trying to use SetTerrainType, crashing though

10-17-2006, 07:59 AM#1
Fr0zenLord
Trying to use SetTerrainType(L[0], 'Lgrs', -1, 1, 1 )

But its not working

Can anyone help? (heres my trigger)

Collapse JASS:
function Trig_Terrain_Actions takes nothing returns nothing
 local location array L
     set L[0] = Location(10800.00, 400.00 )
     if GetRandomInt(0,1) == 1 then
     call SetTerrainTypeBJ(L[0], 'Lgrs' -1, 1, 1 )
     endif
endfunction

//===========================================================================
function InitTrig_Terrain takes nothing returns nothing
    set gg_trg_Terrain = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Terrain, function Trig_Terrain_Actions )
endfunction
im trying to use "Coordinates" instead of rects, to reduce map size
10-17-2006, 05:00 PM#2
oNdizZ
What are you trying to do? do some random terrain?
Your problem is your location, it's way out of map area, atleast i assume it is since a 128x128 map only got about a max x of ~6000.
Locations and rects are something completely different, even if your map would have a max x of 10800 then it would still just change 1 dot instead of an area.

you will have to loop through both the x axis and the y axis by 128 terrain units at a time. be aware of the x limits (and y limits of course)

edit: forgot to mention that you'll probably hit the threadlimit. one easy way to solve this is to throw in some triggersleeps here and there, or make.. for instance 4 functions which would take a forth of the map each and use ExecuteFunc() for them. ExecuteFunc() creates it's own thread.
10-17-2006, 08:12 PM#3
Fr0zenLord
Uuhh my maps 32x32, lol :P
Oops?

Loop x and y o_O nvm sounds complex, i think using rects is better lol