[Mod Request] Toggleable Wall Panel / Dwarf Fortress Drawbridge

Started by Riph, November 06, 2014, 08:21:12 PM

Previous topic - Next topic

Riph

One of the things I've been looking for in the mods section is a block which functions like the Dwarf Fortress drawbridge.  For those who don't play dwarf fortress, this is a wall panel that can be toggled by the user to flip up (as a shield) or flip down (as a walkable passage)

The reason for this is that I'd love to have certain areas of my colony protected by improvised turrets, but of course any random passing foe will just snipe them out rather than get in range.  With this item you could wait until the pirates are in range, then surprise them with a wall panel that opens up revealing guns.  I'd also like to be able to 'flip up' a protective armor plate in front of my colonists' pillbox during a firefight if one of them gets badly wounded and needs to withdraw.

The bridge part of the drawbridge is largely unnecessary because Rimworld doesn't feature z levels.  It could be implemented as an 'automatic window' toggleable by the user and it'd be great.

Also if anything like this exists now, please link me!

Coenmcj

I Guess technically there is something similar to that, TechTree minami's blast doors, ( Or whatever subsidiary mod it came from) But those are 2x5 Monstrosities, rather large for hiding turrets I think.

Edit ; If someone does make a smaller one, what would the possibility of something having toggleable cover properties?
Like from something the height of a sandbag to a full blown wall?
For embrasure type pillboxes that turn into full-on bunkers at the click of a button
Moderator on discord.gg/rimworld come join us! We don't bite

skullywag

Technically possible but would be a dll mod. Its trivial to change the properties of a thing on the fly.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Timber

I ask not for a lighter burden but for broader shoulders. -Atlas

Riph

Quote from: Timber on November 07, 2014, 04:28:05 AM
How wide do you want it?
I was thinking 2x1, though that's an excellent question.  I don't suppose it's possible to make it 1x1 so that the user can simply drag out as many as they like to get an exact width?  In my mind that's the best solution, but if there's unexpected difficulty then 2x1 or 3x1 is probably acceptable.

mrofa

This can be done rather easy with dll, and i say easy since my c# nobish self did that :D
Works preety well and its totally op :D
Draggable is preety hard for the animation :/
But its not hard if there is no animation.
Basic concept is that after button is pressed current object get destroy and the other object is spawned.
I dont have walls realesed but i did exackly same method on wierd lamps in clutter realese.
Problem with walls i did encouter is roof, even thrugh both object support roof, when you build a long walls and do switch on them all at once even thrugh its instant to human eye, sometimes roof will calapse .
Which can be fixed by spawning third object after pressing the button but before the first wall gets destroyed.
All i do is clutter all around.

Riph

Quote from: mrofa on November 07, 2014, 03:46:08 PM
Basic concept is that after button is pressed current object get destroy and the other object is spawned.
Are you able to retain the building's HP?  Otherwise wouldn't it get a full heal every time you switch its state?

skullywag

I See this as when gui button press update texture and change passable paramater in def indstance, no need for spawning extra objects or anything. Ill whip up a proof of concept in the next few days.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

mrofa

Quote from: Riph on November 07, 2014, 03:51:33 PM
Quote from: mrofa on November 07, 2014, 03:46:08 PM
Basic concept is that after button is pressed current object get destroy and the other object is spawned.
Are you able to retain the building's HP?  Otherwise wouldn't it get a full heal every time you switch its state?

Oh i didnt even think of that :D
But it can be done reather easily.

Quote from: skullywag on November 07, 2014, 04:15:08 PM
I See this as when gui button press update texture and change passable paramater in def indstance, no need for spawning extra objects or anything. Ill whip up a proof of concept in the next few days.
Oh that would be cool, good luck with that mate :D
All i do is clutter all around.

minami26

You just need to change the <fillPercent> paramter if it is greater than 0.9 then it is considered a wall that blocks line of sight,, i tried only changing textures in dll but it doesnt work for me that is, you need to make a custom Draw() function for that and instantiate the textures there. Oh and the blast doors are mine :) have fun working on it skully!

Lozza

Really liking this idea! Can't help though, but I support it.

Riph

Quote from: Coenmcj on November 06, 2014, 10:50:20 PM

Edit ; If someone does make a smaller one, what would the possibility of something having toggleable cover properties?
Like from something the height of a sandbag to a full blown wall?
For embrasure type pillboxes that turn into full-on bunkers at the click of a button

This sounds fantastic.  The ideal implementation is probably something like a 'blast window' that, when set to the open state allows firing through but provides cover, and when set to the closed state is completely impassable to walking and shooting.

mrofa

Did a example mod with destroy method here.
And with fix to retain hp like Riph stated :D

Changing stuff like fillprocent or traversability on one objects is kinda beyond my abilities so i hope skully will make it so there will be from where to copy/place :D
All i do is clutter all around.

kentauros87


skullywag

Been playing and made some progress, there was some hitches to how I thought this would but work my basic idea was sound.

So images below:

GoingIn.jpg - ive triggered the wall to be lowered (no texture for this yet, still doing the code part) Pawns can pass through no problem.

GoingOut.jpg - they can come back out no problem

CantComeOut.jpg - ive raised the wall with them inside, they cannot path out (one of the bugs is usually youd get "no path" popup, but here it tries to calculate.

As stated I have some bugs to iron out, but if people want to experiment, the place to look is:

Find.Map.pathGrid.

Ill go back to playing and hopefully iron some of these quirks out. To be clear no "thing" was destroyed, its the same object in that tile. ;)

Edit - actually ive found a rather cleverer way while experimenting, seems promising so far, ill post back soon hopefully

[attachment deleted by admin: too old]
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?