Bay 12 Games Forum

Dwarf Fortress => DF Modding => Utilities and 3rd Party Applications => Topic started by: Jazz Cat on April 07, 2018, 12:05:13 am

Title: Updating map tiles with Tiletypes
Post by: Jazz Cat on April 07, 2018, 12:05:13 am
So, I've been using dfhack's Tiletypes plugin lately (because I'm a dirty cheater) and I've noticed a few abnomalities in it. Specifically, things don't update after you change the tiles. For example, liquid won't flow through a hole you've made with Tiletypes, newly exposed tiles won't become revealed, and—most annoyingly—tiles painted with an aquifer flag don't flood your fortress produce water.

Is there a way around this? A script to force a map update on a tile maybe?
Title: Re: Updating map tiles with Tiletypes
Post by: PatrikLundell on April 07, 2018, 01:23:16 am
When it comes to the water it's probably a property of water flowing. If you use a ballista to disintegrate a cavern tree standing in water you'll get a hole in the water where the stem was, and that hole won't be filled until something causes ripples in the water. There are similar issues with water that should be pushed upwards by pressure sometimes isn't, until you cause a ripple. It's also said reclaiming fortresses partially under an ocean finds the ocean part filled with water, with a vertical wall of water at the boundary. As far as I understand, the water would start flowing if it was disturbed...

What's missing is something to trigger DF to recalculate, but I have no idea how to do that.

I suspect the aquifer part is a trigger issue as well: Have you tried to mark a tile surrounded by walls as an aquifer and then remove the walls (through channeling/digging if natural). I suspect building walls around your hacked tile and then removing one of them would cause the water to flow (actually, a single wall built and removed might be enough, at least for that direction). Note that this is speculation only: I have no actual knowledge and haven't tried it.
Title: Re: Updating map tiles with Tiletypes
Post by: Jazz Cat on April 07, 2018, 11:35:13 am
I did indeed try that, to no avail.
Title: Re: Updating map tiles with Tiletypes
Post by: Atomic Chicken on April 07, 2018, 12:46:28 pm
I threw together this quick fix to deal with your liquids/aquifer issue based on some research I carried out for a script I was writing a couple of weeks ago. However, I've got no idea how to force the revelation of exposed tiles; you can get around the problem by mining out tiles in the vicinity if no one comes up with a solution.

Code: (update-liquids) [Select]
if df.global.cursor.x < 0 then qerror('The cursor must first be placed on the screen!') end
local blockFlags = dfhack.maps.getTileBlock(pos2xyz(df.global.cursor)).flags
blockFlags.update_liquid = true
blockFlags.update_liquid_twice = true
blockFlags.update_temperature = true
blockFlags.designated = true

See if this works for your purpose.

(Save this as a .lua file in hack\scripts and use by entering the file's name into the console with the cursor pointed at the problematic tile.)
Title: Re: Updating map tiles with Tiletypes
Post by: Jazz Cat on April 07, 2018, 01:43:41 pm
It worked! Praise the modders.

As for the revealing, that's not a problem—tiletypes (and builder) can set the hidden flag of a tile so I can do that manually.

It looks like your script updates the temperature, too. I wonder—if you ran this between a frozen river and a magmaduct, could you thaw the river without having to keep the magma flowing?
Title: Re: Updating map tiles with Tiletypes
Post by: lethosor on April 11, 2018, 09:18:13 am
I'm pretty sure gui/liquids (or liquids) can change the "updating" status of a block, and do this by default even if you set the liquid level on a tile to what it already is.