Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Modding Glob of Fat to be a product  (Read 1531 times)

Mechanixm

  • Bay Watcher
    • View Profile
Modding Glob of Fat to be a product
« on: August 29, 2011, 09:09:50 pm »

I've been working for hours on this and am giving up the ghost.  I need help...

I have a reaction at my Crematoriom which takes a corpse or piece of a corpse and burns it to Ash.  The part I'm having trouble with is that I'd like to add a percentage chance to produce a fat glob, which could eventually be rendered in to tallow and later to soap.

Here is what I got:

[REACTION:CREMATE_CORPSES]
   [NAME:Cremate Corpses]
   [BUILDING:CREMATORIUM:NONE]
   [REAGENT:A:1:CORPSE:NONE:NONE:NONE][USE_BODY_COMPONENT]
   [PRODUCT:100:1:BAR:NO_SUBTYPE:ASH:NO_MATGLOSS][PRODUCT_DIMENSION:150]
   [PRODUCT:100:1:GLOB:NONE:GET_MATERIAL_FROM_REAGENT:A:NONE]
   [SKILL:WOOD_BURNING]

Ignore the 100 percent change of producing the materials...I just have that there so I can test it.

My problem is that this doesn't produce a usable Glob of anything.  It will produce a "glob"...of something...but it won't be put in a food stockpile nor can it be rendered at the Kitchen.

All I want is a friggin glob of fat that has the material name of the thing I'm just burning.  If I'm burning a Yak corpse, I'd like to have a Yak Fat glob, etc.

Does anyone have any ideas?

Kweri

  • Bay Watcher
    • View Profile
Re: Modding Glob of Fat to be a product
« Reply #1 on: August 29, 2011, 09:34:40 pm »

The problem is you have no idea what your reagent will be made out of. Right now you're creating a glob of the same material as your corpse (and I don't know how corpse "materials" work).

One thing you could try would be to add a [MATERIAL_REACTION_PRODUCT:FAT_MAT:LOCAL_CREATURE_MAT:FAT] to -every- material a creature could be made out of - skin, bone, muscle, etc. Then in your reaction try [PRODUCT:100:1:GLOB:NONE:GET_MATERIAL_FROM_REAGENT:A:FAT_MAT]

I have no idea if this will work, however. As a last resort you can make a "dummy" animal and assign a fat material to it and just point the reaction to that specific fat material ([PRODUCT:100:1:GLOB:NONE:CREATURE_MAT:DUMMY_ANIMAL:FAT]).

As an aside, I think you want ASH:NONE, not ASH:NO_MATGLOSS - I couldn't find anything on NO_MATGLOSS for the current version.

EDIT: fixed ANIMAL/CREATURE_MAT mix up.
« Last Edit: August 30, 2011, 04:42:10 pm by Kweri »
Logged

Mikey

  • Bay Watcher
    • View Profile
Re: Modding Glob of Fat to be a product
« Reply #2 on: August 29, 2011, 09:53:02 pm »

As an aside, I think you want ASH:NONE, not ASH:NO_MATGLOSS - I couldn't find anything on NO_MATGLOSS for the current version.
I thought this as well, but apparently coal and ash still need NO_MATGLOSS as their subtype.  Using NONE in a reagent line causes an error saying there are no bars available.  I haven't tried it in the product line, but I would imagine you'd get a bar that's not usable by the normal reactions.
Logged

Mechanixm

  • Bay Watcher
    • View Profile
Re: Modding Glob of Fat to be a product
« Reply #3 on: August 29, 2011, 09:58:07 pm »

The ASH:NO_MATGLOSS is there due to a reaction in Genesis mod.  That part is working as it should.

Kweri...that makes sense now that I hear someone say it.  I'm probably just going to give up on this reaction.  I have too many other things I'm working on that I know I can get done.  All of that work for one glob of fat...just not worth it right now...  :)

Mechanixm

  • Bay Watcher
    • View Profile
Re: Modding Glob of Fat to be a product
« Reply #4 on: August 29, 2011, 10:01:33 pm »

Actually...

At the end of the day, I don't really care where the Glob comes from.  How would I word the reaction to just be a glob of cat fat?

[PRODUCT:100:1:GLOB:NONE:ANIMAL_MAT:CAT:FAT]  ?

Cat soap is the dwarfiest of soaps.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Modding Glob of Fat to be a product
« Reply #5 on: August 29, 2011, 10:17:26 pm »

I thought this as well, but apparently coal and ash still need NO_MATGLOSS as their subtype.  Using NONE in a reagent line causes an error saying there are no bars available.  I haven't tried it in the product line, but I would imagine you'd get a bar that's not usable by the normal reactions.
Both NONE and NO_MATGLOSS are valid - reaction_smelter.txt uses NO_MATGLOSS because it was mostly migrated from 40d (it also uses METAL instead of INORGANIC), while reaction_other.txt exclusively uses NONE (and in the case of LYE, it omits the :NONE entirely).
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.

Mikey

  • Bay Watcher
    • View Profile
Re: Modding Glob of Fat to be a product
« Reply #6 on: August 29, 2011, 11:28:29 pm »

Both NONE and NO_MATGLOSS are valid - reaction_smelter.txt uses NO_MATGLOSS because it was mostly migrated from 40d (it also uses METAL instead of INORGANIC), while reaction_other.txt exclusively uses NONE (and in the case of LYE, it omits the :NONE entirely).
Practically speaking, COAL:NONE did not work in the reagent line for another reaction requiring coal/coke bars.  I had hundreds of bars of both coal and coke, and it reported 'needs coal/coke bars'.  Changing the subtype to NO_MATGLOSS like the existing smelter reactions fixed the problem immediately.  I don't know if this is because the existing wood furnace/smelter reactions specify NO_MATGLOSS, or because it's actually required, but either way you need to use NO_MATGLOSS in the reagent and product lines for at least any coal/coke/ash reactions, and it's clearly not equivalent to NONE.  It may be that changing the existing smelter reactions fixes the problem for coke, but the coal-from-wood reaction is hardcoded, so using NO_MATGLOSS is pretty much required if you want your reactions to be compatible with the wood furnace products.
Logged

Conrad

  • Bay Watcher
    • View Profile
Re: Modding Glob of Fat to be a product
« Reply #7 on: August 30, 2011, 12:26:20 am »

Actually...

At the end of the day, I don't really care where the Glob comes from.  How would I word the reaction to just be a glob of cat fat?

[PRODUCT:100:1:GLOB:NONE:ANIMAL_MAT:CAT:FAT]  ?

Cat soap is the dwarfiest of soaps.

I would try [PRODUCT:100:1:GLOB:NONE:CREATURE_MAT:CAT:FAT]. I've never seen ANIMAL_MAT but I might just be looking at old files.
Logged
"College? Dude, I played Dwarf Fortress. My diploma menaces with spikes of knowledge."

Kraos

  • Bay Watcher
    • View Profile
Re: Modding Glob of Fat to be a product
« Reply #8 on: August 30, 2011, 03:04:30 am »

You can try to make you own inorganic material called fat and give it
   [MATERIAL_REACTION_PRODUCT:RENDER_MAT:LOCAL_CREATURE_MAT:TALLOW]
   [STOCKPILE_GLOB]
   [REACTION_CLASS:FAT]

Give it a name like FAT2 and make the product

 [PRODUCT:100:1:GLOB:NONE:INORGANIC:FAT2]

Haven't tried it tho
Logged

Mechanixm

  • Bay Watcher
    • View Profile
Re: Modding Glob of Fat to be a product
« Reply #9 on: August 30, 2011, 04:40:25 pm »

Actually...

At the end of the day, I don't really care where the Glob comes from.  How would I word the reaction to just be a glob of cat fat?

[PRODUCT:100:1:GLOB:NONE:ANIMAL_MAT:CAT:FAT]  ?

Cat soap is the dwarfiest of soaps.

I would try [PRODUCT:100:1:GLOB:NONE:CREATURE_MAT:CAT:FAT]. I've never seen ANIMAL_MAT but I might just be looking at old files.

By Armok's Blood Beard it works!  Cat Soap for all!