Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Gather stone reaction  (Read 771 times)

watfordj

  • Bay Watcher
    • View Profile
Gather stone reaction
« on: October 26, 2012, 09:34:19 pm »

im trying to make a crafting reactions mod for dwarf fortress. Does anyone know how to make a reaction that gives you a random piece of stone?

EDIT: I've figured out how to make specific rocks, but i dont know how to randomize it.

Code: [Select]
[NAME:gather stone]
[ADVENTURE_MODE_ENABLED]
[PRODUCT:100:1:ROCK:NONE:INORGANIC:DOLOMITE:NONE]
« Last Edit: October 26, 2012, 10:57:54 pm by watfordj »
Logged

NecroRebel

  • Bay Watcher
    • View Profile
Re: Gather stone reaction
« Reply #1 on: October 27, 2012, 01:05:42 am »

Short answer: You don't.

Long answer: It's not possible to create an item of a random material. Reactions only allow the production of either items of a particular material or items of the same material as a reagent used in the reaction. The best you can do is to create multiple PRODUCT lines, each with a <100 chance of working and each with a different material produced. The trouble is that each line is checked separately, so you'd have a chance of producing nothing and a chance of producing more than one, or even all, of the products with a single run of the reaction. This may be undesirable depending on the particular application, and for this one it probably is.

In 40d, if you gave a creature the ITEMCORPSE token with an argument for the item type but not a specific material, the creature would turn into an item of that type but a random suitable material on death. This may still be possible, though the generalization of material categories makes this more troublesome. In addition, AFAIK it's still impossible to produce creatures that die with reactions, so that's problematic as well. This whole paragraph is thus practically irrelevant, albeit possibly interesting  ;)
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

GreatWyrmGold

  • Bay Watcher
  • Sane, by the local standards.
    • View Profile
Re: Gather stone reaction
« Reply #2 on: October 27, 2012, 08:31:52 am »

You could have a syndrome that turns you into a creature with a hand that falls off and an interaction to raise it and turn it into an instadying creature, but that's really complex.
Logged
Sig
Are you a GM with players who haven't posted? TheDelinquent Players Help will have Bay12 give you an action!
[GreatWyrmGold] gets a little crown. May it forever be his mark of Cain; let no one argue pointless subjects with him lest they receive the same.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Gather stone reaction
« Reply #3 on: October 27, 2012, 12:32:29 pm »

You could have a syndrome that turns you into a creature with a hand that falls off and an interaction to raise it and turn it into an instadying creature, but that's really complex.

It's not really complex, only mildly. There are only two parts two it!

It's complicated as hell, though :P