In the process of building my castle I’ve come across the conundrum of deciding whether or not I want a moat and it has dawn on to me that drawbridges don’t really exist. I can just use vehicles as a proxy but unfortunately I cannot drive over them and manually hauling things via overloaded personal inventory is a pain. Amphibious ferries are also an option, though they’re not the style of living I’m aiming for.
Is it possible to hook the same system as the pulley gate and so on to something that changes tiles from a deep water state to something you can walk and drive over and vice versa and make it so that the player can build it if they had the resources?
There are some limitations in the game’s engine that makes drawbridges really, really hard to do. I’ve looked into implementing it, and it’s not trivial.
If you just want a single tile long drawbridge, it’s fairly tricky but possibly do-able. Longer drawbridges are super weird and may not be possible.
I see. No drawbridge for the castle of Ardensvelt then. Thanks for the response regardless!
Still though, it makes me wonder if an array could be used via all similar connected tiles or some sort of zoning function. For now I’ll have to make do with a remote controlled vehicle physically blocking the path across the bridge like a plug while giving the bridge impassable walls.
Oh, hey, a zone! That’s actually a really clever idea. It would get around the limits of attaching data to terrain - which you basically can’t.
I think I’d have to torture the zone interface a bit, but I’ve done worse things.
Is the winch stuff in gates.cpp not able to be adapted to creating a moat feature?
It’s fine, as long as you want your moat to be one tile wide. Otherwise, the mechanics of detecting the size of the moat when lowering the drawbridge and raising it back get really complicated.
Which is why the zone idea is great. You could build a 4x5 drawbridge and that would create a hidden zone that would tell the game where to swap the terrain from uncovered to covered pits and vise versa.
I still need to iron the details, but it’s basically solid.
Do I even dare ask about boat travel? Not trying to be a pest on the topic. Boats were the first thing I thought of when I read draw bridge. Not that I even live long enough to get a boat going, but…well, anyway. if you can hack-foo a draw bridge. I’m still keen with new stuff
I know I wouldn’t mind every generated road bridge over water in the game being one where you can flip a switch and have it split to allow your boat through.
Pardon my bringing this thread back from the dead, but for drawbridges…
I’m not a coder, but could they work the same way as garage doors / barn doors do? A switch would activate/deactivate the drawbridge, just like the rope & pulley does for a barn door.
Pure food for thought. I don’t know if that’d help or not - I don’t know game code beyond rudimentary save file editing.
Thank you for the suggestion, but that’s the obvious and easy part. The two hard parts are detecting that when you press the switch at 6 below, the line of Ds should convert to clear terrain and the 3x5 array of pits should become covered pits:
and that when you hit the switch again, that same area of covered pits should go back to being normal pits.
There’s a very limited amount of information you can store in a terrain data structure. The zone idea is a way around that limitation, but I haven’t had a chance to go take another swing at coding it.
Could you somehow utilize z-levels? Say, there are two parts, one a “ground level pulley” (GLP) and one a “below it pulley” (BIP) where, if the GLP is used, it automatically triggers the BIP? Or it somehow destroys the BIP which would then trigger it?
Pardon my throwing ideas at the wall here. I’m an office drone at work… not much else to ponder. Hope this works out someday! That zone idea sounds good.