Changing Terrain Help

Hello Hive

So I have encountered a problem while trying to change the terrain in my map through triggers/scripts.

I have used all 16 tiles, so I thought I could just change the terrain through triggers but it still just changes to an already existing terrain type.

First I tried this:

  • GUI
    • Events
      • Player - Player 1 (Red) types a chat message containing 1 as An exact match
    • Conditions
    • Actions
      • Environment - Change terrain type at (Center of Region 000 <gen>) to Cityscape - Grass Trim using variation -1 in an area of size 5 and shape Circle

Then I tried this:

Code:
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, 'Jsqd', -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, 'Jsqd', -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

  • JASS
    • Events
      • Player - Player 1 (Red) types a chat message containing 2 as An exact match
    • Conditions
    • Actions
      • Custom script: call TerrainChangeInRect(gg_rct_Region_000)


Both of the attempts changes the terrain to an already existing terrain type.

Do you know of any way at all to exceed the 16 tile limit?
 
There are bits allocated for the tiles in your map, you can only use 16 tiles, you cannot bypass it with triggers or using third party World Editors. Adding new tiles with triggers will not work, instead it will just reuse the tiles that exist in your map.

WC3 only supports 16 tilesets. This is because the map data file only allocates 4 bits (a nibble) to tileset.
 
Last edited:
There is a bit allocated for your tiles on a single map, you can only use 16 tiles, adding new tiles with triggers will not work, instead it will just reuse the tiles that exist in your mao.
I see. Thanks, I will try to imitate the same effects with doodads. Should be fairly simple as it's mostly flat surfaces I need it on.
 
You weren’t able to create a hybrid tile? The tool I was thinking of is called Wc3 Tile Maker.
I reconsidered what tiles I was using and changed out one that wasn't strictly speaking necessary.

Nooo he's trying to use more than 16 tiles, not creating new tile textures lol.
@Pyrogasm suggested I edit a tile to contain two different tiles. So 1 tile with say 4 variations where 2 of the variations is the tile I want, and the other 2 is the original tile. By following this it's possible to exceed the 16 tile limit by far but you will still lose some variation in the hybrid tiles.
 

Dr Super Good

Spell Reviewer
Level 58
Joined
Jan 18, 2005
Messages
26,538
One could try ubersplats (images). One would have to design the terrain elements around the behaviour and limitations of these so it might not translate directly to tiles.

Another approach would be to use separate models for the terrain, however people report technical difficult with this but they never really explained in what way. The idea would be to make the terrain in a model editor like blender and then port it as models to WC3. The models could then be made walkable and an invisible terrain mesh roughly placed under them.
 
Another approach would be to use separate models for the terrain, however people report technical difficult with this but they never really explained in what way. The idea would be to make the terrain in a model editor like blender and then port it as models to WC3. The models could then be made walkable and an invisible terrain mesh roughly placed under them.
I can imagine that a really good model maker can create som extremely good looking terrains this way, but unfortunately I have no idea how to make even the simplest of models..

Anyway, I have accomplished what I tried to do by reworking my terrain a bit. Let's just hope Blizzard removes tile, doodad, destructible and all other kinds of limitations in future patches :p
 
Top