Most tiles work by spawning entities. For example:
Code: Select all
defineTile{
name = "dungeon_floor",
editorIcon = 192,
color = {150,150,150,255},
builder = "dungeon",
floor = {
"dungeon_floor_dirt_01", 1,
},
ceiling = {
"dungeon_ceiling", 1,
},
wall = {
"dungeon_wall_01", 35,
"dungeon_wall_02", 35,
"dungeon_wall_drain", 2,
},
pillar = {
"dungeon_pillar", 1,
},
ceilingEdgeVariations = true,
ceilingShaft = "dungeon_ceiling_shaft",
}
A "dungeon_floor_dirt_01" entity is spawned on dungeon_floor tile to provide the floor model. You can turn this floor into a pit with no problem; just destroy the dungeon_floor_dirt_01 entity and spawn your pit.
But if you look at the definition for a heightmapped tile:
Code: Select all
defineTile{
name = "forest_ground",
editorIcon = 200,
color = {70,150,70,255},
builder = "dungeon",
-- floor geometry is generated by heightmap
heightmapMaterial = "forest_ground_01",
diggable = true,
moveSound = "party_move_grass",
automapTile = "grassy_ground",
}
Notice that this tile doesn't spawn any entities. Instead, it specifies a heightmap material. The level's heightmap object effectively builds a contiguous mesh out of all the heightmapped tiles on the level. There is no longer a floor entity to destroy, so you cannot modify the heightmapped squares at runtime.
As for why it works if you place the pit in the editor:
Code: Select all
defineObject{
name = "base_pit",
components = {
{
class = "Pit",
},
},
replacesFloor = true,
killHeightmap = true,
placement = "floor",
editorIcon = 40,
automapIcon = 108,
}
If an entity has "killHeightmap", the heightmap mesh will not be built over that tile.
As far as I know, the heightmap mesh can never change after the dungeon has been loaded. If you add heightmap or killHeightmap objects after the dungeon is loaded, they will have no effect on the heightmap until the player saves and reloads their game.