Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Modding Help: Beds  (Read 850 times)

Dragonchampion

  • Bay Watcher
    • View Profile
Modding Help: Beds
« on: December 12, 2010, 07:52:00 pm »

I was thinking and I noticed a minor discrepancy with beds: They can only be made of wood.

Do we not have brass beds? Iron Beds? Cots?

I would like to know how to mod the raws so that I can make metal beds, and make TRUE dwarven bedrooms, not mamby-pamby Elvin wood beds.

« Last Edit: December 12, 2010, 07:53:38 pm by Dragonchampion »
Logged

3

  • Bay Watcher
    • View Profile
Re: Modding Help: Beds
« Reply #1 on: December 12, 2010, 07:55:48 pm »

Logged

Dragonchampion

  • Bay Watcher
    • View Profile
Re: Modding Help: Beds
« Reply #2 on: December 12, 2010, 07:59:49 pm »

That's... kind of helpful. I guess...
Logged

3

  • Bay Watcher
    • View Profile
Re: Modding Help: Beds
« Reply #3 on: December 12, 2010, 08:03:04 pm »

It explains the exact process you'll have to go through to get non-wood beds. The other half of things is custom workshops, which (it appears) nobody's made any significant documentation on and tend to confuse a lot of people. Including me.
Logged

NecroRebel

  • Bay Watcher
    • View Profile
Re: Modding Help: Beds
« Reply #4 on: December 12, 2010, 08:56:27 pm »

The easiest way to start modding, usually, is to look into other mods that do something similar to what you want, then modify those mods to do exactly what you want. For instance, in Kobold Camp, there's this reaction that makes beds from leather:

[REACTION:PRODUCE_LEATHER_BEDDING]
[NAME:create leather bedding]
   [BUILDING:FURRIER:NONE]
   [REAGENT:A:1:SKIN_TANNED:NONE:NONE:NONE]
   [PRODUCT:100:1:BED:NONE:GET_MATERIAL_FROM_REAGENT:A:NONE]
   [PRODUCT_DIMENSION:150]
   [SKILL:LEATHERWORK]

You want a few things to change. Going through the reaction, first, you probably don't want it to be made at a Furrier, since you likely don't have such a building. Second, you want the reagent to be a metal bar, not a tanned hide. Third, you probably want it to use a metalworking skill, not Leather Working. Fourth, you probably want it to take fuel. So, how do we make these changes?

Well, let's next reference pre-existing reactions. First, the building. Change the second line in that reaction to be the same one as the one from any of the smelter reactions, and the reaction will be done in the smelter.

[REACTION:PRODUCE_LEATHER_BEDDING]
[NAME:create leather bedding]
   [BUILDING:SMELTER:NONE]
   [REAGENT:A:1:SKIN_TANNED:NONE:NONE:NONE]
   [PRODUCT:100:1:BED:NONE:GET_MATERIAL_FROM_REAGENT:A:NONE]
   [PRODUCT_DIMENSION:150]
   [SKILL:LEATHERWORK]

Second, reagent. Again, the smelter reaction file gives examples of what a reaction that takes a metal bar looks like, but we don't want this to take any metal bar, we want it to take a specific type of metal bar, let's say iron. So, we swap the reagent line here to the corresponding one from the Steel-making reaction. I also took the liberty of changing the reaction reference and name lines here, to make it clear that this is the reaction for an iron bed.

[REACTION:PRODUCE_IRON_BEDDING]
[NAME:create iron bed]
   [BUILDING:SMELTER:NONE]
   [REAGENT:A:150:BAR:NO_SUBTYPE:METAL:IRON]
   [PRODUCT:100:1:BED:NONE:GET_MATERIAL_FROM_REAGENT:A:NONE]
   [PRODUCT_DIMENSION:150]
   [SKILL:LEATHERWORK]

Third, the skill. Not quite as easy, here, as there's no easy reference anywhere, but that's what the wiki is for. The Skill Token page, specifically. It tells us that the token for the Blacksmith skill, used for making all metal furniture, is FORGE_FURNITURE. That's probably the appropriate skill here, too, so let's replace that LEATHERWORK.

[REACTION:PRODUCE_IRON_BEDDING]
[NAME:create iron bed]
   [BUILDING:SMELTER:NONE]
   [REAGENT:A:150:BAR:NO_SUBTYPE:METAL:IRON]
   [PRODUCT:100:1:BED:NONE:GET_MATERIAL_FROM_REAGENT:A:NONE]
   [PRODUCT_DIMENSION:150]
   [SKILL:FORGE_FURNITURE]

Last, fuel. That's simple enough; just add [FUEL] to the end. Since it's at the smelter, we don't need anything special to make the game ignore the need for fuel at a magma workshop, so just add that, and we're done.

[REACTION:PRODUCE_IRON_BEDDING]
[NAME:create iron bed]
   [BUILDING:SMELTER:NONE]
   [REAGENT:A:150:BAR:NO_SUBTYPE:METAL:IRON]
   [PRODUCT:100:1:BED:NONE:GET_MATERIAL_FROM_REAGENT:A:NONE]
   [PRODUCT_DIMENSION:150]
   [SKILL:FORGE_FURNITURE]
   [FUEL]

And there we go. Add that to a reaction file, add [PERMITTED_REACTION:PRODUCE_IRON_BEDDING] to your Dwarf entry, and then you'll be able to create iron beds at a smelter for 1 iron bar. You would need to make an additional reaction for each other material bed you want to make, but if you're just swapping metal types, that's relatively easy.

Just remember: it's a lot quicker and easier to get the raw structures right if you're cribbing most of your work from someone else who has already got it working! Useful premade raws are the main reason for a modder to look through major mod works, even if they don't ever intend to use the mod.
« Last Edit: December 12, 2010, 08:58:09 pm by NecroRebel »
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

Dragonchampion

  • Bay Watcher
    • View Profile
Re: Modding Help: Beds
« Reply #5 on: December 12, 2010, 09:49:09 pm »

Well, I would like it to be in the Forge with the other furniture... how would I do that?
Logged

JoRo

  • Bay Watcher
    • View Profile
Re: Modding Help: Beds
« Reply #6 on: December 12, 2010, 10:48:34 pm »

You can't do that; only a few workshops accept custom reactions.
Logged
You have been struck down.
The giant cave spider spits out your head.