Ludeon Forums

RimWorld => Mods => Topic started by: Bazkur on October 15, 2016, 01:00:25 PM

Title: Floors as a Bridge
Post by: Bazkur on October 15, 2016, 01:00:25 PM
Is there already a mod that will allow you to draw a floor (or possibly furniture/building) over all terrain, specifically water, as a bridge?  I've looked around and can't find anything so I attempt to try to make something myself but I can't find any way to cause a floor to draw over water.

Thoughts?  Impossible?
Title: Re: Floors as a Bridge
Post by: Dingo on October 15, 2016, 01:20:47 PM
You might be able to use the terrain allowance def to allow certain types of structures/tiles to be paved over water. That's actually a very neat idea. If you don't want to mess with it any more let me know and I'll give it a try.
Title: Re: Floors as a Bridge
Post by: Bazkur on October 15, 2016, 02:18:13 PM
Quote from: Dingo on October 15, 2016, 01:20:47 PM
You might be able to use the terrain allowance def to allow certain types of structures/tiles to be paved over water. That's actually a very neat idea. If you don't want to mess with it any more let me know and I'll give it a try.

Go for it.  I tried the allowance tag(s) but didn't get anywhere.  I saw on forum posts what the possible options were and one of them was "Any" but when I use that Rimworld gets an error stating that isn't a valid option. 

I'm pretty sure it is possible to do in some fashion but I have no modding experience (though I am a programmer).  I know the fishing pier mod does this to an extent because it reaches over the water and they can stand on the pier over the water.  I thought even maybe a combo of whatever happens in the fishing pier mod and how the Modular Table works for drawing furniture might be the solution but it is beyond me at the moment.
Title: Re: Floors as a Bridge
Post by: Dingo on October 15, 2016, 03:05:22 PM
"Any" isn't an option for terrain allowance, I'm pretty sure of that. I took a look and it might need DLL modding to make water terrain "changeable" but only to specific floors (bridges).
Title: Re: Floors as a Bridge
Post by: kaptain_kavern on October 15, 2016, 03:17:04 PM
I really don't know how it is done, but rikiki's mod Fish industry (https://ludeon.com/forums/index.php?topic=13172.msg133445#msg133445), have buildings that can be build on certain water tile (piers). I think I saw xml files for terrain def in the mod but it was long ago in prior version
Title: Re: Floors as a Bridge
Post by: Rikiki on October 15, 2016, 04:18:59 PM
You cannot build any thing on mud or water tile without overriding their description because it does not contain any allowance tag.
Fishing pier uses a trick: you only build a small building on allowed terrain (river bank for example ;) )which "deploys" a bigger building on spawn.
The XML terrain defs are just here to modify the pier's tiles so pawns walk normally on it (not slowed as if they were swimming in water).

Anyway, what you want to do is possible but will be far easier using a DLL.
A rough version would override the vanilla def of water/marsh/mud by adding an allowance tag. Be warned! This WILL create incompatibilities!!! >:(
Title: Re: Floors as a Bridge
Post by: Dingo on October 15, 2016, 04:23:43 PM
You could theoretically make an assembly for it that uses a custom allowance check, making anything that uses the DLL buildable on specific TerrainDefs. That way you don't create incompatibilities because you don't mod the water terrain itself, you just have a custom worker checking for it.

Not that I know how to do all that, of course. It's all wizards and brooms to me.
Title: Re: Floors as a Bridge
Post by: Bazkur on October 15, 2016, 04:53:02 PM
Yeah this looks like it is going to be way more complicated to do than the amount of time I'd have to learn how to do it  :o

If anyone wants to run with this, please feel free to steal the idea.  I'd love to have a bridge system in the game.