Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Building workshops under water  (Read 1252 times)

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Building workshops under water
« on: July 26, 2015, 06:49:31 am »

I dug this up from an older forum post:

Quote
One of the biggest things I need done before alpha is sorting out my diff patch to enable water building.  If anyone has experience creating dif files from IDA, I'd really love some help.  Details in spoiler - 
[spoiler]Two things need to be changed -
Code: [Select]
F7 C1 00 00 20 00 75 1C F6 C1
A9 00 00 20 00 75 19 A8 01
Changed to:
Code: [Select]
F7 C1 00 00 20 00 74 1C F6 C1
A9 00 00 20 00 74 19 A8 01
Basically just escaping the loop for checking water height, and instead of returning if not zero, return if zero.  I have tested, and this has no ill effects that I have seen, other than voiding all the water in any tile of a building when its built, which can be a problem with water flowing over the building as soon as its built. 

Still, I created this in IDA:
Code: [Select]
Dwarf Fortress.exe
00E4454E: 75 74
00E73033: 75 74
which was the offset that IDA gave those two AoBs, but the patcher won't accept that dif file, so I don't know what I did wrong.

Eko, who is inactive, was working on a water-based civ and managed to allow them to build workshops in water. But he never uploaded anything... I was wondering if someone can decipher the stuff above. Seems to be a patch for the DF.exe in hex format; as far as I know dfhack could add those, but require a plugin in C to be written first (?)

On the same topic: Does anyone know if it's possible to make a binpatch  that allows amphibious/aquatic civ-members to path through water? Currently they only accept 3/7, everything else is "dangerous terrain", even if the creature can breathe underwater.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: Building workshops under water
« Reply #1 on: July 26, 2015, 08:14:29 am »

I tried doing exactly this. However had very little success. Buildings worked (quite easily) but did not figure out the pathing at all.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Building workshops under water
« Reply #2 on: July 26, 2015, 09:34:05 am »

Even in 1,2 and 3/7 water? That should be fine, right?
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

lethosor

  • Bay Watcher
    • View Profile
Re: Building workshops under water
« Reply #3 on: July 26, 2015, 11:55:25 am »

Seems to be a patch for the DF.exe in hex format; as far as I know dfhack could add those, but require a plugin in C to be written first (?)
Not at all. There is a binpatch lua script and an external binpatch executable, both of which can work with that format. It's likely that there's a discrepancy between file and memory offsets that Eko wasn't accounting for, but whatever the issue was, that patch almost certainly won't work in 0.40.24 as-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.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Building workshops under water
« Reply #4 on: July 26, 2015, 02:06:10 pm »

In lua would be even better, because I could make it civ-specific. So in theory it's possible, but his data is outdated. I guess I have to wait and see if Quietust or expwnent or ag will come by and find the right ones.
« Last Edit: July 26, 2015, 02:12:43 pm by Meph »
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::