Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Feasibility of 'bolt-stack' reaction?  (Read 1906 times)

EveryZig

  • Bay Watcher
  • Adequate Liar
    • View Profile
Feasibility of 'bolt-stack' reaction?
« on: March 21, 2011, 01:39:03 pm »

Would it be possible to make (at a custom workshop) a reaction that takes 10 bones and produces 50 bone bolts? As it is, bones are used individually to make stacks of 5 bolts each, which is extremely inconvenient.

There are two thing I can think (at the moment) of that might make a problem for this:

If you are adding a reaction to produce something pre-existing (like bolts), will the 'AMMO_BOLTS' item's being listed in [entity_default] be sufficient, or will you need to make a new definition?

Can you have a reaction containing several things with sub-types? (Like bone and leather, which are ((creature)) bones or ((creature)) leather)?

Would these prevent you from making such a custom reaction, and if so is there a work-around?
Logged
Soaplent green is goblins!

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: Feasibility of 'bolt-stack' reaction?
« Reply #1 on: March 21, 2011, 01:40:59 pm »

Try and make a stack of bolts first.  Have a reaction that takes no reagent, and produces X bolts.  If you can get them to stack successfully, you can make a bolt stacker or mass-production.

EveryZig

  • Bay Watcher
  • Adequate Liar
    • View Profile
Re: Feasibility of 'bolt-stack' reaction?
« Reply #2 on: March 21, 2011, 06:08:18 pm »

I have a working test version using two wood logs to make 50 wood bolts. They take on the item type of the first log used (if an ash and an oak are used, for example, they all become ash bolts). Making weapon traps with them works (the whole stack of 50 is loaded), though I have not tested them with archers yet.
Logged
Soaplent green is goblins!

EveryZig

  • Bay Watcher
  • Adequate Liar
    • View Profile
A question on using bolts for a custom reaction
« Reply #3 on: March 21, 2011, 06:22:09 pm »

The bolts were working perfectly when I was using wood, but when I changed the reagent tag from    [REAGENT:bone:2:WOOD:NONE:NONE:NONE]

to

[REAGENT:bone:2:BONE:NONE:NONE:NONE]

suddenly (in the next world I genned) the dwarves went from only using two wood logs to using a stack of 4 hooves and a stack of 4 barrels of ale. Is there some requirement I need to add to make bone bolts work? (I am aiming for being able to turn 10 individual bones int oa stack of 50 bone bolts)
Logged
Soaplent green is goblins!

Upright Path

  • Bay Watcher
    • View Profile
Re: Feasibility of 'bolt-stack' reaction?
« Reply #4 on: March 21, 2011, 06:48:33 pm »

Ah, that is because BONE No longer really means anything to system. At least, not in the way it used to. The second 'NONE' should be ANIMAL_MAT:BONE or something like that... I don't remember the exact wording.
Logged

FluidDynamite

  • Bay Watcher
    • View Profile
Re: Feasibility of 'bolt-stack' reaction?
« Reply #5 on: March 21, 2011, 07:04:02 pm »

I've been trying to do the exact same thing for the past couple of days, I have a working reaction, but it still consumes the entire bone stack instead of a single bone (Apparently this has already been reported as a bug: http://mail.bay12games.com/dwarves/mantisbt/view.php?id=3898&history=1)

Code: [Select]
[REACTION:CRAFT_STACKED_BOLTS_BONE]
[NAME:craft stacked bone bolts (25)]
[BUILDING:GRINDER:CUSTOM_A]
[REAGENT:A:5:NONE:NONE:NONE:NONE][USE_BODY_COMPONENT][ANY_BONE_MATERIAL]
[PRODUCT:100:25:AMMO:ITEM_AMMO_BOLTS_STACKEDBONE:GET_MATERIAL_FROM_REAGENT:A:NONE]
[SKILL:BONECARVE]

The reagent amount seems to related to number of stacks instead of items, so the dorf takes 5 stacks of bone and produces only 25 bolts, even if some of the stacks were 17 cow bones or something.

Removing USE_BODY_COMPONENT ends up with the dorf creating a huge stack of bolts out of the bone bolts just created, remove USE_BODY_COMPONENT and you get silly stuff like cow nervous tissue bolts, but still consumes stacks of 4 cow hooves as if they were single items. My searching around hasn't revealed ways around this bug.
« Last Edit: March 21, 2011, 07:07:30 pm by FluidDynamite »
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Feasibility of 'bolt-stack' reaction?
« Reply #6 on: March 22, 2011, 03:29:58 am »

Yeah, currently the game does not read the amount of bones in reaction. Those 1,3,14 etc. bone piles all act as a single item. I think for throwing too, but I may be wrong. It was a change back in some .40 versions or maybe 2010, and this change made me sad.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

FluidDynamite

  • Bay Watcher
    • View Profile
Re: Feasibility of 'bolt-stack' reaction?
« Reply #7 on: March 22, 2011, 06:03:17 am »

I think I found out something quite interesting, I messed around with the reaction a bit, changing it to create cheese bolts:

Code: [Select]
[REACTION:CRAFT_BOLTS_CHEESE]
[NAME:craft cheese bolts (25)]
[BUILDING:GRINDER:CUSTOM_A]
[REAGENT:A:1:CHEESE:NONE:NONE:NONE]
[PRODUCT:100:25:AMMO:ITEM_AMMO_BOLTS_CHEESE:GET_MATERIAL_FROM_REAGENT:A:NONE]
[SKILL:CHEESEMAKING]

This time the dwarf carried a stack of 5 yak cheese to the workshop, and created one stack of 125 yak cheese bolts and consuming the entire stack of 5 cheese.

And changing the last reaction to this (removed [USE_BODY_COMPONENT] tag and changed reagent amount to 1) :
Code: [Select]
[REACTION:CRAFT_STACKED_BOLTS_BONE]
[NAME:craft stacked bone bolts (25)]
[BUILDING:GRINDER:CUSTOM_A]
[REAGENT:1:5:NONE:NONE:NONE:NONE][ANY_BONE_MATERIAL]
[PRODUCT:100:25:AMMO:ITEM_AMMO_BOLTS_STACKEDBONE:GET_MATERIAL_FROM_REAGENT:A:NONE]
[SKILL:BONECARVE]

First the dwarf creates a stack of 25 bone bolts out of any stack of bone. If the reaction is repeated, the dwarf uses the 25 bone bolts stack, and creates a stack of 625 bone bolts out of it.

So I'm guessing the treating-stack-as-one-item problem only exists on bone/shell/tooth/horn stacks? At least cheese stacks work correctly (Well, not exactly correctly, but the game recognizes the number of items in the stack). I... have absolutely no idea what to make of this. :P

EDIT: Perhaps making a reaction to take up 5 stacks of basic bone bolts and output 1 stack of 25 bone bolts (using another item token) will work? It's a bit of a lousy solution, and I don't know if you can actually distinguish between items like that. I'll probably try it out later.
« Last Edit: March 22, 2011, 06:06:53 am by FluidDynamite »
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Feasibility of 'bolt-stack' reaction?
« Reply #8 on: March 22, 2011, 06:28:24 am »

Yes, it's a problem with bones which appear after butchering.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Desgeretjin

  • Bay Watcher
    • View Profile
Re: Feasibility of 'bolt-stack' reaction?
« Reply #9 on: February 01, 2013, 12:45:45 pm »

This here restacks your bone bolts. It'd take any stack size and uses exactly 25 bolts to make a single stack of 25 bolts.

Code: [Select]
[REACTION:CRAFT_STACKED_BOLTS_BONE]
[REACTION:CRAFT_STACKED_BOLTS_BONE]
[NAME:craft stacked bone bolts]
[BUILDING:CRAFTSMAN:CUSTOM_A]
[REAGENT:A:25:AMMO:ITEM_AMMO_BOLTS:MATERIAL_TEMPLATE:BONE_TEMPLATE]
[PRODUCT:100:25:AMMO:ITEM_AMMO_BOLTS:GET_MATERIAL_FROM_REAGENT:A:NONE]
[SKILL:BONECARVE]
[SKILL:BONECARVE]

Only problem is that it'd take the [25] stack that it'd just made to make a stack again if you let it, so a bit of management is needed ie need to link the workshop to a quantum autodumped stockpile that doesn't have stacks larger than 25.
Logged