Ludeon Forums

Ludeon Forums

  • January 20, 2020, 06:52:29 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: [Mod Request] Toggleable Wall Panel / Dwarf Fortress Drawbridge  (Read 7275 times)

Riph

  • Muffalo
  • *
  • Posts: 18
  • Refugee
    • View Profile
[Mod Request] Toggleable Wall Panel / Dwarf Fortress Drawbridge
« on: November 06, 2014, 08:21:12 PM »

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!
Logged

Coenmcj

  • Super Tester
  • Planetologist
  • ***
  • Posts: 2326
  • Corn
    • View Profile
Re: [Mod Request] Toggleable Wall Panel / Dwarf Fortress Drawbridge
« Reply #1 on: November 06, 2014, 10:50:20 PM »

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
« Last Edit: November 06, 2014, 10:53:09 PM by Coenmcj »
Logged
Moderator on discord.gg/rimworld come join us! We don't bite

skullywag

  • Global Moderator
  • Transcendent
  • ***
  • Posts: 5857
  • Engineer
    • View Profile
Re: [Mod Request] Toggleable Wall Panel / Dwarf Fortress Drawbridge
« Reply #2 on: November 07, 2014, 03:31:24 AM »

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

Timber

  • Colonist
  • ***
  • Posts: 128
  • UNKLE
    • View Profile
Re: [Mod Request] Toggleable Wall Panel / Dwarf Fortress Drawbridge
« Reply #3 on: November 07, 2014, 04:28:05 AM »

How wide do you want it?
Logged
I ask not for a lighter burden but for broader shoulders. -Atlas

Riph

  • Muffalo
  • *
  • Posts: 18
  • Refugee
    • View Profile
Re: [Mod Request] Toggleable Wall Panel / Dwarf Fortress Drawbridge
« Reply #4 on: November 07, 2014, 03:16:28 PM »

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.
Logged

mrofa

  • Planetologist
  • ****
  • Posts: 1666
  • Squirrel Hunter
    • View Profile
Re: [Mod Request] Toggleable Wall Panel / Dwarf Fortress Drawbridge
« Reply #5 on: November 07, 2014, 03:46:08 PM »

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.
Logged
All i do is clutter all around.

Riph

  • Muffalo
  • *
  • Posts: 18
  • Refugee
    • View Profile
Re: [Mod Request] Toggleable Wall Panel / Dwarf Fortress Drawbridge
« Reply #6 on: November 07, 2014, 03:51:33 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?
Logged

skullywag

  • Global Moderator
  • Transcendent
  • ***
  • Posts: 5857
  • Engineer
    • View Profile
Re: [Mod Request] Toggleable Wall Panel / Dwarf Fortress Drawbridge
« Reply #7 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.
Logged
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

mrofa

  • Planetologist
  • ****
  • Posts: 1666
  • Squirrel Hunter
    • View Profile
Re: [Mod Request] Toggleable Wall Panel / Dwarf Fortress Drawbridge
« Reply #8 on: November 07, 2014, 04:20:46 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.

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
Logged
All i do is clutter all around.

minami26

  • Colonist
  • ***
  • Posts: 319
  • Create something
    • View Profile
Re: [Mod Request] Toggleable Wall Panel / Dwarf Fortress Drawbridge
« Reply #9 on: November 07, 2014, 08:35:53 PM »

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

  • Muffalo
  • *
  • Posts: 12
  • Help, I'm stuck on the moon!
    • View Profile
Re: [Mod Request] Toggleable Wall Panel / Dwarf Fortress Drawbridge
« Reply #10 on: November 08, 2014, 05:34:20 AM »

Really liking this idea! Can't help though, but I support it.
Logged
I'm having difficulty thinking up a signature.
By describing the problem I have solved it.

Genius.

Riph

  • Muffalo
  • *
  • Posts: 18
  • Refugee
    • View Profile
Re: [Mod Request] Toggleable Wall Panel / Dwarf Fortress Drawbridge
« Reply #11 on: November 09, 2014, 01:53:43 AM »


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.
Logged

mrofa

  • Planetologist
  • ****
  • Posts: 1666
  • Squirrel Hunter
    • View Profile
Re: [Mod Request] Toggleable Wall Panel / Dwarf Fortress Drawbridge
« Reply #12 on: November 09, 2014, 05:24:44 AM »

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
Logged
All i do is clutter all around.

kentauros87

  • Drifter
  • **
  • Posts: 27
  • Refugee
    • View Profile
Re: [Mod Request] Toggleable Wall Panel / Dwarf Fortress Drawbridge
« Reply #13 on: November 09, 2014, 09:16:50 AM »

Urist would be so proud of that
Logged

skullywag

  • Global Moderator
  • Transcendent
  • ***
  • Posts: 5857
  • Engineer
    • View Profile
Re: [Mod Request] Toggleable Wall Panel / Dwarf Fortress Drawbridge
« Reply #14 on: November 09, 2014, 03:25:58 PM »

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]
« Last Edit: November 09, 2014, 04:11:24 PM by skullywag »
Logged
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?
Pages: [1] 2