Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: A few modding questions  (Read 1084 times)

Metalax

  • Bay Watcher
    • View Profile
    • Steam Profile
A few modding questions
« on: November 25, 2014, 09:06:19 am »

I've looked through the wiki and did a few searches of the forum, but haven't spotted the answer to a few of my modding questions.

Is there any way to have a reaction use one item out of a stack?

Is it possible to have more than one type of plant produce the same processed material, eg a powder, such that it only shows up as a single entry on the stocks screen? I suspect I can work around this via use of specific reactions, but I'd prefer to be able to use the basic mill job.

Does the [SPECIAL] token work for plants/trees, or is there an equivalent? It is useful to be able to use place-holders to indicate categories in the stocks list when sorting the raws, but I don't want to risk having dwarves with a preference for a place-holder material.
Logged
In the beginning was the word, and the word was "Oops!"

Rydel

  • Bay Watcher
    • View Profile
Re: A few modding questions
« Reply #1 on: November 25, 2014, 01:40:58 pm »

For the material thing, I'd look at how Accelerated Dwarf Fortress and Masterwork Dwarf Fortress handle wood, leather, etc, since it does that.

Malecus

  • Bay Watcher
    • View Profile
Re: A few modding questions
« Reply #2 on: November 25, 2014, 10:27:31 pm »

If I'm recalling the work on Masterwork correctly, their wood & leather lacks subtypes because the material templates for them have been modified with tags to explicitly forbid subtypes.  Unless you create a custom powder that does the same, you won't be able to have two different plants produce the same product with the basic mill job (not sure about your modding skill, but the millstone is a valid location for new reactions, so creating as many near-identical reactions to produce your product might be the easiest way).
Logged

UnicodingUnicorn

  • Bay Watcher
  • Competent at Incompetency.
    • View Profile
Re: A few modding questions
« Reply #3 on: November 25, 2014, 11:16:50 pm »

Is there any way to have a reaction use one item out of a stack?
Just use [REAGENT:A:1:STUFF:STUFF:STUFF:STUFF][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]. Replace STUFF with whatever you want.

Is it possible to have more than one type of plant produce the same processed material, eg a powder, such that it only shows up as a single entry on the stocks screen? I suspect I can work around this via use of specific reactions, but I'd prefer to be able to use the basic mill job.
Instead of using GET_MATERIAL_FROM_REAGENT in the PRODUCT line, replace it with the material of a single type of plant. Sorry, but I kinda forgot the syntax.
Logged
I do stuff, I guess

Metalax

  • Bay Watcher
    • View Profile
    • Steam Profile
Re: A few modding questions
« Reply #4 on: November 26, 2014, 09:56:45 am »

For the material thing, I'd look at how Accelerated Dwarf Fortress and Masterwork Dwarf Fortress handle wood, leather, etc, since it does that.
If I'm recalling the work on Masterwork correctly, their wood & leather lacks subtypes because the material templates for them have been modified with tags to explicitly forbid subtypes.  Unless you create a custom powder that does the same, you won't be able to have two different plants produce the same product with the basic mill job (not sure about your modding skill, but the millstone is a valid location for new reactions, so creating as many near-identical reactions to produce your product might be the easiest way).
Thanks, I'll check those out, though if they do work via changing the material template that's likely beyond what I'm looking for.

Yeah, I know I could do it via setting up the large number of reactions, but was hoping to be able to set it up for the general mill command for when you don't care what exactly is getting milled.

Is there any way to have a reaction use one item out of a stack?
Just use [REAGENT:A:1:STUFF:STUFF:STUFF:STUFF][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]. Replace STUFF with whatever you want.
Ah, has the behaviour of those tokens changed then? When I originally did modding with reactions when I played several years ago that would cause the reaction to use one stack of the reagant.

Is it possible to have more than one type of plant produce the same processed material, eg a powder, such that it only shows up as a single entry on the stocks screen? I suspect I can work around this via use of specific reactions, but I'd prefer to be able to use the basic mill job.
Instead of using GET_MATERIAL_FROM_REAGENT in the PRODUCT line, replace it with the material of a single type of plant. Sorry, but I kinda forgot the syntax.
That looks like you are referring to setting up a separate reaction, which yeah should work with that, while what I'm looking for is being able to set it from the plants definition in the raws.
Logged
In the beginning was the word, and the word was "Oops!"

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: A few modding questions
« Reply #5 on: November 28, 2014, 03:55:17 am »

Yeah, it's a simple material reaction product switch; in fact, it's almost exactly as described, except you replace the LOCAL_PLANT_MAT:x with the specific PLANT_MAT:x.