Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Change Block output  (Read 2109 times)

cainvampyr

  • Escaped Lunatic
    • View Profile
Change Block output
« on: July 08, 2014, 10:58:25 am »

Hi, I'm really new to DF modding, have been looking for the means to change the block amount output, is that possible by editing the raw files at all? if so someone mind telling me how?

Thank you in advance.
Logged

scamtank

  • Bay Watcher
    • View Profile
Re: Change Block output
« Reply #1 on: July 08, 2014, 01:14:49 pm »

No. You cannot alter the original production chain.
Logged

cainvampyr

  • Escaped Lunatic
    • View Profile
Re: Change Block output
« Reply #2 on: July 09, 2014, 03:35:03 am »

How about adding a new recipe/reaction to an existing workshop? is that possible?
Logged

scamtank

  • Bay Watcher
    • View Profile
Re: Change Block output
« Reply #3 on: July 09, 2014, 04:37:14 am »

Sure, you could make a new reaction that produces blocks. Only some workshops accept new reactions, though - use reaction_other.txt as a guide to see which ones.
Logged

cainvampyr

  • Escaped Lunatic
    • View Profile
Re: Change Block output
« Reply #4 on: July 09, 2014, 05:15:09 am »

That i did and had some success but I'm still missing something.

I managed to have a new reaction listed under the CRAFTSMAN workshop, it takes logs as regents wich seems to be working as well, however it doesn't output anything...

This is what i got on the reactions file:

[REACTION:WOOD_BLOCK]
    [NAME:Make blocks out of wood logs]
    [BUILDING:CRAFTSMAN:NONE]
    [REAGENT:log:1:WOOD:NONE:NONE:NONE]
    [PRODUCT:100:10:BLOCKS:NONE:GET_MATERIAL_FROM_REAGENT:log][PRODUCT_DIMENSION:150]
    [SKILL:WOODCRAFT]
    [AUTOMATIC]

What am i doing wrong? anyone knows?
Logged

GavJ

  • Bay Watcher
    • View Profile
Re: Change Block output
« Reply #5 on: July 09, 2014, 03:55:08 pm »

No. You cannot alter the original production chain.
1) For some industries, it is easy to do so. Especially pottery / making clay bricks, that's in the raws and you just change one number on the product.
2) For most or all other industries, you still can. It's just a huge amount of effort. For example, you could interfere with the glassmaking production chain by removing sand from the game and replacing it with a stone called "sand" that occurs in clusters in soil layers, and then adding a bunch of custom reactions for all the glass, as you see fit. Which of course is not worth it for simply changing block outputs, but it IS possible.

edit: for your reaction above, get rid of the [PRODUCT_DIMENSION:150] thing. That's not relevant for blocks. Onlny bars and globs and stuff. Don't see anything else immediately wrong.
« Last Edit: July 09, 2014, 03:58:22 pm by GavJ »
Logged
Cauliflower Labs – Geologically realistic world generator devblog

Dwarf fortress in 50 words: You start with seven alcoholic, manic-depressive dwarves. You build a fortress in the wilderness where EVERYTHING tries to kill you, including your own dwarves. Usually, your chief imports are immigrants, beer, and optimism. Your chief exports are misery, limestone violins, forest fires, elf tallow soap, and carved kitten bone.

scamtank

  • Bay Watcher
    • View Profile
Re: Change Block output
« Reply #6 on: July 09, 2014, 04:01:01 pm »

Jumping through hoops to create a gimped clone reaction, leaving behind weird stockpile shit and a crippled default workshop is the absolute opposite of what "altering the original production chain" is trying to accomplish.

What am i doing wrong? anyone knows?

Try getting rid of the PRODUCT_DIMENSION stuff.
Logged

GavJ

  • Bay Watcher
    • View Profile
Re: Change Block output
« Reply #7 on: July 09, 2014, 04:16:22 pm »

Quote
Jumping through hoops to create a gimped clone reaction, leaving behind weird stockpile shit and a crippled default workshop is the absolute opposite of what "altering the original production chain" is trying to accomplish.
If you're going to add on additional requirements to the phrase "altering the original production chain" other than literally altering the original production chain, then sure.  ::)

Also in not every case does it actually leave behind a mess like you describe anyway.  For example, in the metal industry, if you remove all ores from the raws and make them just plain stones with a metal REACTION_CLASS, the game will automatically remove all the default smelting reactions, and you can put your new ones all in the same building, AND stockpiles for metal were already in the stones section anyway ***AND*** it will automatically add your new "ores" to the economic stone list since they are parts of reactions, making it not really any less intuitive. Thus, none of the three side effects you mention are a problem. Plus you can still have your custom reactions make metal ores, so the forge isn't affected.

Other industries are more difficult or less sleek. Food industry is also one that you can make with very little mess left behind (kitchen and still and mill and quern are all custom reaction buildings, etc.) It varies. *shrug*
« Last Edit: July 09, 2014, 04:19:08 pm by GavJ »
Logged
Cauliflower Labs – Geologically realistic world generator devblog

Dwarf fortress in 50 words: You start with seven alcoholic, manic-depressive dwarves. You build a fortress in the wilderness where EVERYTHING tries to kill you, including your own dwarves. Usually, your chief imports are immigrants, beer, and optimism. Your chief exports are misery, limestone violins, forest fires, elf tallow soap, and carved kitten bone.

cainvampyr

  • Escaped Lunatic
    • View Profile
Re: Change Block output
« Reply #8 on: July 10, 2014, 04:31:21 am »

That i did and had some success but I'm still missing something.

I managed to have a new reaction listed under the CRAFTSMAN workshop, it takes logs as regents wich seems to be working as well, however it doesn't output anything...

This is what i got on the reactions file:

[REACTION:WOOD_BLOCK]
    [NAME:Make blocks out of wood logs]
    [BUILDING:CRAFTSMAN:NONE]
    [REAGENT:log:1:WOOD:NONE:NONE:NONE]
    [PRODUCT:100:10:BLOCKS:NONE:GET_MATERIAL_FROM_REAGENT:log][PRODUCT_DIMENSION:150]
    [SKILL:WOODCRAFT]
    [AUTOMATIC]

What am i doing wrong? anyone knows?

thanks guys but i figured it out on my own.. sort of...
[PRODUCT:100:10:BLOCKS:NONE:GET_MATERIAL_FROM_REAGENT:log][PRODUCT_DIMENSION:150] was missing a none after the 'log', so it's working version is:
[PRODUCT:100:10:BLOCKS:NONE:GET_MATERIAL_FROM_REAGENT:log:NONE][PRODUCT_DIMENSION:150]

Still wondering why it has to have that extra NONE parameter though...
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Change Block output
« Reply #9 on: July 10, 2014, 03:24:21 pm »

Still wondering why it has to have that extra NONE parameter though...
Every reaction product/reagent has to include a subtype, and NONE is a wildcard.  If there are no subtypes, it will correctly identify the item you wanted.  If there are subtypes, a NONE for a reagent will take any subtype that matches other constraints (e.g., reaction classes) and NONE for a product will give you a random subtype.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

GavJ

  • Bay Watcher
    • View Profile
Re: Change Block output
« Reply #10 on: July 10, 2014, 04:46:18 pm »

GET_MATERIAL_FROM_REAGENT has two arguments:
1st) The id of the reagent to get the material from ("log")
2nd) The specific part of the reagent that you are targeting.  A bit confusing, but the reason for this is that all of the default reactions (almost all of them) that use this tag, use it for creature body parts, like skin into leather, for instance. Therefore, the "material of this corpse" isn't specific enough to let the game know you're talking about skin in particular. So there's a place for an ID here to specify which tissues. And then that lines up with matching tags in the tissue definitions, to help it target the right part of the corpse. Otherwise it would just always use bones.

In cases where there are no complications like that--such as when the reagent is simply a log--the easiest syntax is just "NONE"  which is the wildcard for "any of the materials of that reagent" but there is only one material for a log, so it always chooses that one.

Technically, if you wanted to, you could put in "wood_mat" there and then go add "MATERIAL_REACTION_PRODUCT:wood_mat" to the wood part of every tree definition, and it would also work (maybe??), I think, but that's a lot of unnecessary work versus just using a wildcard variable to refer to the only choice of material.
Logged
Cauliflower Labs – Geologically realistic world generator devblog

Dwarf fortress in 50 words: You start with seven alcoholic, manic-depressive dwarves. You build a fortress in the wilderness where EVERYTHING tries to kill you, including your own dwarves. Usually, your chief imports are immigrants, beer, and optimism. Your chief exports are misery, limestone violins, forest fires, elf tallow soap, and carved kitten bone.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Change Block output
« Reply #11 on: July 10, 2014, 05:16:45 pm »

2nd) The specific part of the reagent that you are targeting.  A bit confusing, but the reason for this is that all of the default reactions (almost all of them) that use this tag, use it for creature body parts, like skin into leather, for instance. Therefore, the "material of this corpse" isn't specific enough to let the game know you're talking about skin in particular. So there's a place for an ID here to specify which tissues. And then that lines up with matching tags in the tissue definitions, to help it target the right part of the corpse. Otherwise it would just always use bones.
The second parameter is not a "specific part of the reagent" - it is a MATERIAL_REACTION_PRODUCT identifier (i.e. so it knows to convert Fire Clay into Stoneware, Cassiterite to Tin Glaze, Cow Milk to Cow Cheese, or Cat Skin to Cat Leather); "NONE" just happens to be a special value that it accepts and interprets as "use the reagent's actual material".
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.