function TerrainChangeInRect takes nothing returns nothing
local real minx = GetRectMinX(gg_rct_YOURRECT) // Replace YOURRECT with the name of your rect. Blanks must be replaced with _
local real miny = GetRectMinY(gg_rct_YOURRECT) // e.g. gg_rct_Rect_Change
local real maxx = GetRectMaxX(gg_rct_YOURRECT)
local real maxy = GetRectMaxY(gg_rct_YOURRECT)
local real x=minx
local real y=maxy
local integer TType
loop
exitwhen y<miny
loop
exitwhen x>maxx
set TType = GetTerrainType(x, y)
if TType == 'Ldrt' then // 'Ldrt' is the TerrainType-Id that should be found
call SetTerrainType(x, y, 'Nice', -1, 1, 0)
// 'Nice' ist the TerrainType-Id that will replace 'Ldrt
elseif TType == 'Lgrd' then
// use more elseif's to add more terrain types that can be found in the rect and replace them with other ones
call SetTerrainType(x, y, 'Bdsr', -1, 1, 0)
endif
set x=x+128
endloop
set x=minx
set y=y-128.0
call TriggerSleepAction(0.01) // The wait could be needed to prevent a small lag and to make the terrain completely change if the rect is too big
endloop
endfunction
function Trig_Unbezeichneter_Ausl__ser_006_Actions takes nothing returns nothing
set udg_TerrainType = 'Ldrt' // 'Ldrt' and 'Lrok' are the integers you searched for
set udg_TerrainType = 'Lrok'
endfunction
function Trig__map_header_Actions takes nothing returns nothing
endfunction
//===========================================================================
function InitTrig__map_header takes nothing returns nothing
set gg_trg__map_header = CreateTrigger( )
call TriggerAddAction( gg_trg__map_header, function Trig__map_header_Actions )
endfunction
function TerrainChangeInRect takes nothing returns nothing
local real minx = GetRectMinX(gg_rct_TERRAIN_1) // Replace YOURRECT with the name of your rect. Blanks must be replaced with _
local real miny = GetRectMinY(gg_rct_TERRAIN_1) // e.g. gg_rct_Rect_Change
local real maxx = GetRectMaxX(gg_rct_TERRAIN_1)
local real maxy = GetRectMaxY(gg_rct_TERRAIN_1)
local real x=minx
local real y=maxy
local integer TType
loop
exitwhen y<miny
loop
exitwhen x>maxx
set TType = GetTerrainType(x, y)
if TType == 'Lgrs' then // 'Ldrt' is the TerrainType-Id that should be found
call SetTerrainType(x, y, 'Dgrs', -1, 1, 0)
// 'Nice' ist the TerrainType-Id that will replace 'Ldrt
elseif TType == 'Lgrd' then
// use more elseif's to add more terrain types that can be found in the rect and replace them with other ones
call SetTerrainType(x, y, 'Bdsr', -1, 1, 0)
endif
set x=x+128
endloop
set x=minx
set y=y-128.0
call TriggerSleepAction(0.01) // The wait could be needed to prevent a small lag and to make the terrain completely change if the rect is too big
endloop
endfunction
function Trig_Terrains_Actions takes nothing returns nothing
set udg_TerrainType[1] = 'Lgrs'
set udg_TerrainType[1] = 'Dgrs'
endfunction
//===========================================================================
function InitTrig_Terrains takes nothing returns nothing
set gg_trg_Terrains = CreateTrigger( )
call TriggerAddAction( gg_trg_Terrains, function Trig_Terrains_Actions )
endfunction
function TerrainChangeInRect takes nothing returns nothing
local real minx = GetRectMinX(gg_rct_YOURRECT)
function TerrainChangeInRect takes rect yourRect returns nothing
local real minx = GetRectMinX(yourRect)
function TerrainChangeInRect takes rect r returns nothing
local real minx = GetRectMinX(r)
local real miny = GetRectMinY(r)
local real maxx = GetRectMaxX(r)
local real maxy = GetRectMaxY(r)
local real x=minx
local real y=maxy
local integer TType
loop
exitwhen y<miny
loop
exitwhen x>maxx
set TType = GetTerrainType(x, y)
if TType == 'Ldrt' then // 'Ldrt' is the TerrainType-Id that should be found
call SetTerrainType(x, y, 'Nice', -1, 1, 0)
// 'Nice' ist the TerrainType-Id that will replace 'Ldrt
elseif TType == 'Lgrd' then
// use more elseif's to add more terrain types that can be found in the rect and replace them with other ones
call SetTerrainType(x, y, 'Bdsr', -1, 1, 0)
endif
set x=x+128
endloop
set x=minx
set y=y-128.0
call TriggerSleepAction(0.01) // The wait could be needed to prevent a small lag and to make the terrain completely change if the rect is too big
endloop
endfunction