Bay 12 Games Forum

Please login or register.

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

Author Topic: Create a new workshop able item?  (Read 4947 times)

supified

  • Bay Watcher
    • View Profile
Create a new workshop able item?
« on: July 07, 2012, 10:35:04 am »

How difficult is it to create an object that can be made in a workshop?

For instance, I would like to make 'planks' of wood, that could be created from logs, like wood blocks, only planks.  The idea is through wood refining, these planks could be used to make some wood objects that do not make sense using an entire log.

I assume I would need to make a custom reaction and add that to the entity, but for instance, I want this object to be used in building things like walls, floors and so on. Is this possible?
Logged

RanDomino

  • Bay Watcher
    • View Profile
Re: Create a new workshop able item?
« Reply #1 on: July 07, 2012, 11:08:05 am »

I'm pretty sure this is right but I probably screwed up the PRODUCT line
Code: [Select]
[REACTION:WOOD_PLANKS]
[NAME:mill wood planks]
[BUILDING:CRAFTSMAN:NONE]
[REAGENT:A:1:WOOD:NONE:NONE:NONE]
[PRODUCT:100:4:BLOCKS:GET_MATERIAL_FROM_REAGENT:A]
[SKILL:CARPENTRY]
Assuming that works, it should put a new reaction called "mill wood planks" in the craftsdwarf's workshop, which should turn one piece of wood into four wood blocks which are suitable for building.  You can't use them for crafts or for making products out of wood in workshops even though you'd think a plank would be big enough to get some arrows out of.  But you could make a custom reaction for that...

the best way to learn to mod is to read teh wiki, dig around in your raws, and try stuff.
« Last Edit: July 07, 2012, 11:11:33 am by RanDomino »
Logged

Delioth

  • Bay Watcher
  • Mass Gauntlet Wizard
    • View Profile
Re: Create a new workshop able item?
« Reply #2 on: July 07, 2012, 11:48:40 am »

@RanDomino: Yeah, your product line should be:

   [PRODUCT:100:4:BLOCKS:NONE:GET_MATERIAL_FROM_REAGENT:A]
Logged
Help us write a story!
We're currently setting the scene and world- characters, civilizations, flora/fauna, cities, places, anything setting!
Products of my Boredom (Old)
Quote from: Shawtay
Delioth, you sir, are a wonderful, wonderful person.
When in doubt, Apply Magma

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Create a new workshop able item?
« Reply #3 on: July 07, 2012, 12:04:28 pm »

There is two ways to get what you want:

1. add a second WOOD material in every tree/WOOD bearing plant, then add [MATERIAL_REACTION_CLASS:PLANK_MAT:LOCAL_PLANT_MAT:WOOD2] on every vanilla WOOD call
Spoiler (click to show/hide)

2.
Add [BLOCK_NAME:plank:planks] to the WOOD_TEMPLATE so all wooden blocks are called planks
« Last Edit: July 12, 2012, 09:00:14 pm by Hugo_The_Dwarf »
Logged

RanDomino

  • Bay Watcher
    • View Profile
Re: Create a new workshop able item?
« Reply #4 on: July 07, 2012, 12:24:34 pm »

2.
Add [BLOCK_NAME:plank:planks] to the WOOD_TEMPLATE so all wooden blocks are called planks
That is such a crazy good idea that I just did it.
Logged

supified

  • Bay Watcher
    • View Profile
Re: Create a new workshop able item?
« Reply #5 on: July 07, 2012, 03:35:03 pm »

I tried adding the mill planks reaction.  The result appears to be the wood vanishes and becomes nothing. 

I also tried adding the [BLOCK_NAME:plank:planks] to the wood_template and it didn't seem to have any effect.

Am I missing something?
Logged

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Create a new workshop able item?
« Reply #6 on: July 07, 2012, 05:16:09 pm »

option 1.
the long hard road outta hell

requires alot of raw editing to add WOOD2 to every tree and adding the material_reaction_product to each WOOD in the trees

Option 2.
is the quick and easy way out

BLOCK_NAME 
singular
plural
 Specifies the name of blocks made from this material. 

aka [BLOCK_NAME:plank:planks]
add that to WOOD_TEMPLATE in "material_template_default.txt" I have no idea if that requires a Regen, so make sure you are making these changes in the right places.
Logged

supified

  • Bay Watcher
    • View Profile
Re: Create a new workshop able item?
« Reply #7 on: July 08, 2012, 10:27:11 am »

Quick question, if I'm reading this right, it will change wood blocks to wood planks.  It's a great cosmetic change, but would this allow me to make a single log into multiple 'planks'?
Logged

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Create a new workshop able item?
« Reply #8 on: July 08, 2012, 11:38:25 am »

Number 2 will just be cosmetic

Number 1 will be not only more flavourful (carpenter's workshop can make two wood blocks, where a saw mill can make 6 planks)

You can butcher 1 and 2
read up on reactions here http://www.bay12forums.com/smf/index.php?topic=55259.msg3419616#msg3419616 (note to self save this link)

By butcher I mean take and alter the reaction #1 and using the change BLOCK_NAME in #2.
Logged

supified

  • Bay Watcher
    • View Profile
Re: Create a new workshop able item?
« Reply #9 on: July 11, 2012, 10:44:38 am »

I'm a little confused.

So I gather that the intended way this is to work is that the wood itself is what ends up being used in the reaction.  Except what I don't get is how to do it.  Is the wood logs cut down supposed to be like a workshop you can que a job on?  How do you actually use this? 
Logged

supified

  • Bay Watcher
    • View Profile
Re: Create a new workshop able item?
« Reply #10 on: July 11, 2012, 11:01:29 am »

Oh I'm getting the impression (from your spoiler) That the order of these things actually matters a lot in the plant file, is that correct?
Logged

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Create a new workshop able item?
« Reply #11 on: July 11, 2012, 11:19:12 am »

yes option 1 does

it involves adding a WOOD2 material in the plant/tree and adding a MRP in the first WOOD material
then in the WOOD2 material you add [BLOCK_NAME:plank:planks]
then you make a reaction that takes WOOD logs (since cutting a tree down will make WOOD logs) and makes WOOD2 blocks which would be called "planks" but the vanilla carpenters shop will still make 2 blocks instead of 6 planks.

Option 2
is just making all wooden blocks called planks and going to bed. Easy
Logged

supified

  • Bay Watcher
    • View Profile
Re: Create a new workshop able item?
« Reply #12 on: July 11, 2012, 11:42:22 am »

So for example one of my plants looks like this:
[PLANT:MANGROVE]
   [NAME:mangrove][NAME_PLURAL:mangroves][ADJ:mangrove]
   [USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE]
   [BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL]
   [USE_MATERIAL_TEMPLATE:WOOD:WOOD_TEMPLATE]
      [MATERIAL_REACTION_PRODUCT:PLANK_MAT:LOCAL_PLANT_MAT:WOOD2]
      [STATE_NAME:ALL_SOLID:mangrove]
      [STATE_ADJ:ALL_SOLID:mangrove]
[USE_MATERIAL_TEMPLATE:WOOD2:WOOD_TEMPLATE]
      [PREFIX:NONE]
[BLOCK_NAME:plank:planks]
   [TREE:LOCAL_PLANT_MAT:WOOD][TREE_TILE:5]
   [PREFSTRING:roots]
   [WET]
   [BIOME:SWAMP_MANGROVE]
   [SAPLING]

I'm pretty sure I have the placement wrong, or that's my best guess for why it isn't working.

I have the reaction in the reaction_other file

And then permitted the reaction in entity.
Logged

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Create a new workshop able item?
« Reply #13 on: July 11, 2012, 11:51:03 am »

WOOD2 is almost right :P you might want to put those [STATE_NAME....] stuff in it too :P
or you might just get " planks" intead of "mangrove planks"
Logged

supified

  • Bay Watcher
    • View Profile
Re: Create a new workshop able item?
« Reply #14 on: July 11, 2012, 12:59:38 pm »

I'm missing something, when you say add the reaction class to every vanilla wood call are you talking about just in the plant's file or something else?
Logged
Pages: [1] 2 3