- Joined
- Sep 11, 2013
- Messages
- 220
Hey guys, I want to change the terrain into different ones through triggers.
The 2nd is (Ashenvale Grassy Dirt to Lordaeron Grassy Dirt)
But it only changes the 1st and the 2nd does not happen.
And it does not change in the ENTIRE MAP. my map size is (192 x 192) can someone help me?? xO
- Harvest Moon (3D).w3x
-
function RT2 takes real X, real Y, integer T returns nothing
- call SetTerrainType(X, Y, T, -1, 1, 1)
- endfunction
-
function RT1 takes real MinX, real MaxX, real Y, integer OldTerrain, integer Terrain returns nothing
-
loop
-
exitwhen MinX > MaxX
-
if GetTerrainType(MinX, Y) == OldTerrain then
- call RT2 (MinX, Y, Terrain)
- endif
-
if GetTerrainType(MinX, Y) == OldTerrain then
- set MinX = MinX + 128
-
exitwhen MinX > MaxX
- endloop
-
loop
- endfunction
-
function ReplaceTerrainTypeEx takes integer OldTerrain, integer NewTerrain, rect WhichRect returns nothing
- local real MinX = GetRectMinX(WhichRect)
- local real MaxX = GetRectMaxX(WhichRect)
- local real MinY = GetRectMinY(WhichRect)
- local real MaxY = GetRectMaxY(WhichRect)
-
loop
-
exitwhen MinY > MaxY
- call RT1 (MinX, MaxX, MinY, OldTerrain, NewTerrain)
- set MinY = MinY + 128
-
exitwhen MinY > MaxY
- endloop
- endfunction
-
function ReplaceGlobalTerrain takes integer OldTerrain, integer NewTerrain returns nothing
- call ReplaceTerrainTypeEx(OldTerrain, NewTerrain, GetWorldBounds())
- endfunction
-
function ReplaceGlobalTerrainReversed takes integer NewTerrain, integer OldTerrain returns nothing
- call ReplaceTerrainTypeEx(OldTerrain, NewTerrain, GetWorldBounds())
- endfunction
- SET when Player press ESC
- call ReplaceGlobalTerrain ('Agrs', 'Lgrs')
- call ReplaceGlobalTerrain ('Adrg', 'Ldrg')
The 2nd is (Ashenvale Grassy Dirt to Lordaeron Grassy Dirt)
But it only changes the 1st and the 2nd does not happen.
And it does not change in the ENTIRE MAP. my map size is (192 x 192) can someone help me?? xO