Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Need modding help!  (Read 1258 times)

toster

  • Escaped Lunatic
    • View Profile
Need modding help!
« on: May 10, 2019, 06:43:50 am »

Hello guys! I'd like to obtain water and tallow from render fat proccess in kitchen. I tried to modify reaction_other in \raw\objects like this:

[REACTION:RENDER_FAT]
   [NAME:render fat]
   [BUILDING:KITCHEN:HOTKEY_KITCHEN_RENDER_FAT]
   [REAGENT:A:1:BUCKET:NONE:NONE:NONE][EMPTY][DOES_NOT_ABSORB][PRESERVE_REAGENT][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
   [REAGENT:B:1:BUCKET:NONE:NONE:NONE][EMPTY][DOES_NOT_ABSORB][PRESERVE_REAGENT][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
   [PRODUCT:100:150:GLOB:NONE:GET_MATERIAL_FROM_REAGENT:A:RENDER_MAT][PRODUCT_TO_CONTAINER:A]
   [PRODUCT:100:1:LIQUID_MISC:NONE:WATER:WATER][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:B]
   [SKILL:COOK]

Problem is that my dwarfs produce only water. What I did wrong? :-\
Thank you!
Logged

DerMeister

  • Bay Watcher
    • View Profile
Re: Need modding help!
« Reply #1 on: May 10, 2019, 07:20:38 am »

What only two buckets as reagents?
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Need modding help!
« Reply #2 on: May 10, 2019, 08:31:23 am »

Your glob tries to use the rendermat of your reagent a, which is an empty bucket. Which doesn't have a rendermat, therefore nothing is produced.

Check your first reagent again, it lacks the actual fat component. ;-)
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

toster

  • Escaped Lunatic
    • View Profile
Re: Need modding help!
« Reply #3 on: May 10, 2019, 09:52:10 am »

Thank you guys for your answers!

I'm nobbie in DF modding so I'm not sure I correctly understood some terms. ???
So "rendermat" is material right? Like fat, wood, stone ect? I just try to understand how does it exectly works. F.e. I don't uderstand :NONE:NONE:NONE?  Here - http://dwarffortresswiki.org/index.php/DF2014:Reaction is said that this is just "quantity".  :-\

So can I do that:

[REACTION:RENDER_FAT]
   [NAME:render fat]
   [BUILDING:KITCHEN:HOTKEY_KITCHEN_RENDER_FAT]
   [REAGENT:A:1:BUCKET:NONE:NONE:NONE][EMPTY][DOES_NOT_ABSORB][PRESERVE_REAGENT][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
   [REAGENT:B:1:BUCKET:NONE:NONE:NONE][EMPTY][DOES_NOT_ABSORB][PRESERVE_REAGENT][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
   [PRODUCT:100:150:GLOB:NONE:GLOB:GLOB][PRODUCT_TO_CONTAINER:A]
   [PRODUCT:100:1:LIQUID_MISC:NONE:WATER:WATER][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:B]
   [SKILL:COOK]
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Need modding help!
« Reply #4 on: May 10, 2019, 11:57:52 am »

You are still just using two empty buckets, to create a glob and water, is that what you want?

For reference, a product line typically looks like [PRODUCT:probability:quantity:item type:item subtype:material type:material subtype]. It's slightly confusing because in the wiki it is just listed as item token and material token.

The issue with your first reaction was that it was attempting to get the material type and material subtype from your REAGANT:A which is an empty bucket, which it can't do so it fails.

Your second reaction won't work because GLOB:GLOB is not a valid material type:material subtype combo.
« Last Edit: May 10, 2019, 12:00:27 pm by Roses »
Logged

toster

  • Escaped Lunatic
    • View Profile
Re: Need modding help!
« Reply #5 on: May 10, 2019, 12:33:10 pm »

Thank you Roses! ;)
"You are still just using two empty buckets, to create a glob and water, is that what you want?"
This is just tamplate for workshop so I just ignore that for now. I want to understand how does production works.
For reference, a product line typically looks like [PRODUCT:probability:quantity:item type:item subtype:material type:material subtype].
Thank you.
It's slightly confusing because in the wiki it is just listed as item token and material token.
I've read this article in my native language which was partially translate. Sorry about that.

 [PRODUCT:100:150:GLOB:NONE:NONE:NONE][PRODUCT_TO_CONTAINER:A]
 [PRODUCT:100:1:LIQUID_MISC:NONE:WATER:WATER][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:B]

Is it correct? If not please help me correct it!
P.S. BTW where can I find all item type and item subtype?
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Need modding help!
« Reply #6 on: May 10, 2019, 01:18:15 pm »

Item tokens: http://dwarffortresswiki.org/index.php/DF2014:Item_token
Item subtypes are only used for certain items, for instance, GLOB:NONE is correct because GLOB item types don't have any subtypes, for WEAPON item types you would use WEAPON:ITEM_WEAPON_SWORD_SHORT (as an example for a short sword)

Material tokens: http://dwarffortresswiki.org/index.php/DF2014:Material_token
Again, not all material types have a subtype. As you can see, for your water product, you actually don't need that second WATER because the WATER material type doesn't have a subtype. I'm not sure if it hurts anything, but you may get an error about it printed out in the error log. As for your GLOB, specifying NONE:NONE is going to give you a GLOB made of a random material, and not necessarily a fat. For an example you could replace the NONE:NONE with CREATURE_MAT:DWARF:FAT and you will instead create fat from a dwarf.

The GET_MATERIAL_FROM_REAGENT:A:RENDER_MAT from your original reaction is a special material token that allows you to make a single reaction for processing of many different reagent materials into the correct product material. The reason it didn't work before is that the bucket does not have a MATERIAL_REACTION_PRODUCT, RENDER_MAT. So it simply fails

Logged

toster

  • Escaped Lunatic
    • View Profile
Re: Need modding help!
« Reply #7 on: May 10, 2019, 05:53:52 pm »

Thank you again!

About "second Water" I don't know. That's works for me in game. I checked it. Maybe I should change it to NONE.  :-\

For an example you could replace the NONE:NONE with CREATURE_MAT:DWARF:FAT and you will instead create fat from a dwarf.

So if I want made it from wood f.e it will be

[PRODUCT:100:150:GLOB:NONE:PLANT_MAT:WOOD][PRODUCT_TO_CONTAINER:A]
[PRODUCT:100:1:LIQUID_MISC:NONE:WATER:WATER][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:B]

Hm. :-\
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Need modding help!
« Reply #8 on: May 11, 2019, 02:26:59 pm »

For PLANT_MAT it would need to be something like PLANT_MAT:OAK:WOOD. When using CREATURE_MAT or PLANT_MAT you need to specify which creature or plant you want to use. You could also use, GET_MATERIAL_FROM_REAGENT:A:NONE and it will use whatever wood material the bucket A is made from
Logged

toster

  • Escaped Lunatic
    • View Profile
Re: Need modding help!
« Reply #9 on: May 11, 2019, 05:21:45 pm »

Thank you for help, Roses! ;)

Now I'm experimenting with kitchen. I'd like to make some kind of well. You go to well with bucket - and you have water. Sound simple... So:

1. I put this code to reaction_smelter

[REACTION: WATER_WELL]
        [NAME:make water]
        [BUILDING:KITCHEN:NONE]       
        [REAGENT:A:1:BUCKET:NONE:NONE:NONE][EMPTY][DOES_NOT_ABSORB][PRESERVE_REAGENT][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
        [PRODUCT:100:1:LIQUID_MISC:NONE:WATER:WATER][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:A]

2. And add this line to entity_default

[PERMITTED_REACTION:WATER_WELL]

And... Nothing happend. :-[

P.S. Of course I created a new world. Maybe I put it to the end of file? :-\
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Need modding help!
« Reply #10 on: May 11, 2019, 06:49:01 pm »

Did you put the PERMITTED_REACTION in the MOUNTAIN entity? I can't see anything immediately wrong with the reaction.
Logged

toster

  • Escaped Lunatic
    • View Profile
Re: Need modding help!
« Reply #11 on: May 12, 2019, 03:26:03 am »

Did you put the PERMITTED_REACTION in the MOUNTAIN entity?

Yes. I even changed file and put this code to reaction_other instead of reaction_smelter:

[REACTION: WATER_WELL]
 [NAME:make water]
 [BUILDING:KITCHEN:NONE]       
 [REAGENT:A:1:BUCKET:NONE:NONE:NONE][EMPTY][DOES_NOT_ABSORB][PRESERVE_REAGENT][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
 [PRODUCT:100:1:LIQUID_MISC:NONE:WATER:WATER][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:A]
 [SKILL:COOK]

and this to entity_default:

[PERMITTED_REACTION:WATER_WELL]

(line 291) under [PERMITTED_REACTION:MAKE WOODEN DISPLAY CASE].

Maybe this is wrong place?

I recreated world, build kitchen but there are only four tasks: prepare meal (3) and render fat. :(
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Need modding help!
« Reply #12 on: May 12, 2019, 01:10:19 pm »

Ah, it looks like you have a space in your REACTION and not in your permitted reaction
Logged

toster

  • Escaped Lunatic
    • View Profile
Re: Need modding help!
« Reply #13 on: May 12, 2019, 01:41:45 pm »

Ah, it looks like you have a space in your REACTION and not in your permitted reaction

Anybody told you are the best? Thank you pal!!! :D I've break my mind looking into that code. Few...
Logged