Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Updating map tiles with Tiletypes  (Read 3135 times)

Jazz Cat

  • Bay Watcher
  • Adept stringed instrumentalist
    • View Profile
Updating map tiles with Tiletypes
« 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?
Logged
Give your dwarves a pet
My holiday mod (only offensive to elves)
The check-laundry script

Quote
Just give the Crossbow weapon the [AMMO:CROSSBOW] tag in the raws. You can make a crossbow that shoots crossbows.

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Updating map tiles with Tiletypes
« Reply #1 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.
Logged

Jazz Cat

  • Bay Watcher
  • Adept stringed instrumentalist
    • View Profile
Re: Updating map tiles with Tiletypes
« Reply #2 on: April 07, 2018, 11:35:13 am »

I did indeed try that, to no avail.
Logged
Give your dwarves a pet
My holiday mod (only offensive to elves)
The check-laundry script

Quote
Just give the Crossbow weapon the [AMMO:CROSSBOW] tag in the raws. You can make a crossbow that shoots crossbows.

Atomic Chicken

  • Bay Watcher
    • View Profile
Re: Updating map tiles with Tiletypes
« Reply #3 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.)
« Last Edit: May 02, 2018, 12:06:03 pm by Atomic Chicken »
Logged
As mentioned in the previous turn, the most exciting field of battle this year will be in the Arstotzkan capitol, with plenty of close-quarter fighting and siege warfare.  Arstotzka, accordingly, spent their design phase developing a high-altitude tactical bomber. 

Jazz Cat

  • Bay Watcher
  • Adept stringed instrumentalist
    • View Profile
Re: Updating map tiles with Tiletypes
« Reply #4 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?
Logged
Give your dwarves a pet
My holiday mod (only offensive to elves)
The check-laundry script

Quote
Just give the Crossbow weapon the [AMMO:CROSSBOW] tag in the raws. You can make a crossbow that shoots crossbows.

lethosor

  • Bay Watcher
    • View Profile
Re: Updating map tiles with Tiletypes
« Reply #5 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.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.