Tile Set Question (Different Walls for Different Heights)

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
vanblam
Posts: 243
Joined: Sun Nov 09, 2014 12:15 am

Tile Set Question (Different Walls for Different Heights)

Post by vanblam »

I had an idea for a tile set, but I don't quite know how to pull it off. I hope someone can help me figure this out :P..
Ok I have 8 wall types, 6 of them I want for ground level and the other 2 I want for any thing higher then ceiling level 1. (or greater then ceiling level 1 ratio)
For example: "I have a tunnel, its is ceiling height is 1 and the walls are 1 through 6. Now it comes to a cavern with a ceiling height of 2 the walls at the bottom are using 1 through 6 and the walls above are using 7 and 8."

Meaning if the distance between the ceiling and the floor is greater then 1, then use this wall type for anything above. ( This way you can use it for ceiling height 6 and floor level 3, but on floor level 3 it will use the walls 1 through 6 and floor levels 4 and 5 use walls 7 through 8.)

Lol I think I explained that right. I just don't how to code that into a tile set, or if you can for that matter :P
User avatar
vanblam
Posts: 243
Joined: Sun Nov 09, 2014 12:15 am

Re: Tile Set Question (Different Walls for Different Heights

Post by vanblam »

Anyone have any ideas?
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Tile Set Question (Different Walls for Different Heights

Post by minmay »

To get this behaviour you'd want to make an object that replaces itself with a new object (chosen based on the height) upon initialization. There are examples of this in the Dungeon Master Resource, in particular look at scripts/objects/ceilings.lua, scripts/objects/pillars.lua, or scripts/objects/walls.lua, then look at scripts/tiles.lua. Many of the objects spawned by the tiles replace themselves with new objects that depend on other conditions such as nearby objects and whether there's a floor underneath. For example, dm_pillar_wood replaces itself with one of 16 different models depending on solid tiles and ceiling beams in the four adjacent squares.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
vanblam
Posts: 243
Joined: Sun Nov 09, 2014 12:15 am

Re: Tile Set Question (Different Walls for Different Heights

Post by vanblam »

minmay wrote:To get this behaviour you'd want to make an object that replaces itself with a new object (chosen based on the height) upon initialization. There are examples of this in the Dungeon Master Resource, in particular look at scripts/objects/ceilings.lua, scripts/objects/pillars.lua, or scripts/objects/walls.lua, then look at scripts/tiles.lua. Many of the objects spawned by the tiles replace themselves with new objects that depend on other conditions such as nearby objects and whether there's a floor underneath. For example, dm_pillar_wood replaces itself with one of 16 different models depending on solid tiles and ceiling beams in the four adjacent squares.
Awesome!! .. thank you very much for pointing me in the right direction :D .. This worked out perfectly.. If anyone else is trying to pull this off just follow minmay's instructions and investigate the scripts he described in that Dungeon Master Resource. In addition I would also recommend taking a look at scripts/objects/base.lua, there is a function called autoDecoDirt that happens on initialize for base_dm_wall. Again thank you minmay :)
Post Reply