Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Help with custom/reaction item [RESOLVED].  (Read 544 times)

sal880612m

  • Bay Watcher
  • [SANITY:OPTIONAL]
    • View Profile
Help with custom/reaction item [RESOLVED].
« on: June 04, 2014, 01:06:08 pm »

I have decided to mod in the ability to cast an anvil but don't want it to be as simple as smelting it. I have tried to set up the following item as a reaction reagent for the process:

Code: [Select]
[ITEM_TOOL:ITEM_TOOL_ANVIL_CAST]
[NAME:anvil cast:anvil casts]
[VALUE:10]
[STONE_MAT]
[TILE:229]
[SIZE:500]
[UNIMPROVABLE]

and have it created in the reaction:

Code: [Select]
[ITEM_TOOL:ITEM_TOOL_ANVIL_CAST]
[REACTION:MAKE_ANVIL_CAST]
[NAME:make anvil cast]
[BUILDING:KILN:CUSTOM_A]
[REAGENT:clay:1:BOULDER:NONE:NONE:NONE]
[HAS_MATERIAL_REACTION_PRODUCT:FIRED_MAT]
[PRODUCT:100:1:anvil cast:NONE:GET_MATERIAL_FROM_REAGENT:clay:FIRED_MAT]
[FUEL]
[SKILL:POTTERY]

but whenever I try to run the reaction in game it crashes. At this point I figure this probably has to do with [STONE_MAT] being a bad/non-existent token or some issue it being a tool. I Only tried it as there are [METAL_MAT] and [WOOD_MAT] tokens. I would use [HARD_MAT] and link it to the Craftdwarf's workshop instead if wood wasn't included in [HARD_MAT]. Basically I am looking for a way to make it so that the anvil cast can only be ceramic, stone, and possibly but preferably not metal.
I also plan on using these for the casting of anvils once I get the above working as intended if I can.

Code: [Select]
[REACTION:CAST_IRON_ANVIL]
[NAME:cast iron anvil]
[BUILDING:SMELTER:NONE]
[REAGENT:A:600:BAR:NO_SUBTYPE:METAL:IRON]
[REAGENT:B:1:TOOL:ITEM_TOOL_ANVIL_CAST:NONE:NONE]
[FUEL]
[PRODUCT:100:1:ANVIL:NONE:METAL:IRON]
[SKILL:SMELT]

[REACTION:CAST_STEEL_ANVIL]
[NAME:cast steel anvil]
[BUILDING:SMELTER:NONE]
[REAGENT:A:600:BAR:NO_SUBTYPE:METAL:STEEL]
[REAGENT:B:1:TOOL:ITEM_TOOL_ANVIL_CAST:NONE:NONE]
[FUEL]
[PRODUCT:100:1:ANVIL:NONE:METAL:STEEL]
[SKILL:SMELT]

I think I have used these before and that they do work but I don't remember whether I should be using 600 [150(bar size)*4] or just 4. I think this should be okay but as far as I can remember no vanilla item uses more than 3 bars if you discount Candy wafers. Also if I wanted to increase the required fuel for the casting process could I add additional [FUEL] tags or would I need to use [REAGENT:C:150:BAR:NO_SUBTYPE:COAL:NO_MATGLOSS]?

My main issue is with creating the anvil cast and I know there are other places people have asked about casting anvils but most of them seemed to be just the smelter reactions.

Edit: I have figured the above out. I used anvil cast instead of TOOL:ITEM_TOOL_ANVIL_CAST then when I first noticed I tried to do ITEM_TOOL:ITEM_TOOL_ANVIL_CAST. Seems like it is going to be an interesting day.

« Last Edit: June 04, 2014, 04:37:34 pm by sal880612m »
Logged
"I was chopping off little bits of 'im till he talked, startin' at the toes."
"You probably should have stopped sometime before his eyes."

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Help with custom/reaction item.
« Reply #1 on: June 04, 2014, 03:09:03 pm »

Well, I spotted one definite error:
[REACTION:MAKE_ANVIL_CAST]
   [NAME:make anvil cast]
   [BUILDING:KILN:CUSTOM_A]
   [REAGENT:clay:1:BOULDER:NONE:NONE:NONE]
   [HAS_MATERIAL_REACTION_PRODUCT:FIRED_MAT]
   [PRODUCT:100:1:ITEM_TOOL_ANVIL_CAST:NONE:GET_MATERIAL_FROM_REAGENT:clay:FIRED_MAT]
   [FUEL]
   [SKILL:POTTERY]
I'm not sure if you can staple :FIRED_MAT onto the end of a material token.  If it works, great.  If not, remove the :FIRED_MAT and the game should let you make a cast out of gooey clay stuff.

I think I have used these before and that they do work but I don't remember whether I should be using 600 [150(bar size)*4] or just 4. I think this should be okay but as far as I can remember no vanilla item uses more than 3 bars if you discount Candy wafers. Also if I wanted to increase the required fuel for the casting process could I add additional [FUEL] tags or would I need to use [REAGENT:C:150:BAR:NO_SUBTYPE:COAL:NO_MATGLOSS]?
The requirement for 4 bars would be 600 units of reagent.  Someone might come by later and mod in Minibars of size 75 or something, and this 600 has you covered.

I don't know about adding multiple FUEL tags, but my guess is that they'd be ignored.  If you add coal as a reagent then it will be required even by a magma smelter (as is the case with steelmaking).

Edit: Why is the tool re-declared at the top of the reaction?  I snipped that bit out.
« Last Edit: June 04, 2014, 03:11:26 pm by Dirst »
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Help with custom/reaction item [].
« Reply #2 on: June 04, 2014, 04:02:21 pm »

Try:
Code: [Select]
[REACTION:MAKE_ANVIL_CAST]
[NAME:make anvil cast]
[BUILDING:KILN:CUSTOM_A]
[REAGENT:clay:1:BOULDER:NONE:NONE:NONE]
[HAS_MATERIAL_REACTION_PRODUCT:FIRED_MAT]
[PRODUCT:100:1:TOOL:ITEM_TOOL_ANVIL_CAST:NONE:GET_MATERIAL_FROM_REAGENT:clay:FIRED_MAT]
[FUEL]
[SKILL:POTTERY]
Everything except the product line is just fine and correct AFAIK.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

sal880612m

  • Bay Watcher
  • [SANITY:OPTIONAL]
    • View Profile
Re: Help with custom/reaction item [RESOLVED].
« Reply #3 on: June 04, 2014, 04:17:52 pm »

Thanks for the replies . I think the re-declartion was just a copy paste error. And it was the fact that I had mis-declared it as anvil cast instead of TOOL:ITEM_TOOL_ANVIL_CAST. You guys kept on ninja'ing me on my edits and post while I did enough testing to be sure this had been resolved.

I think it is all working now. I walked away for a bit and came back with fresh eyes and saw it then spent some time playing around with it. Adding multiple fuel tags does seem to be ignored. I don't want to force the use of coal even in a magma forge and as it is the process is cumbersome and costly enough to discourage it's use except by necessity.


Logged
"I was chopping off little bits of 'im till he talked, startin' at the toes."
"You probably should have stopped sometime before his eyes."