Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Cobalt Smelting  (Read 2143 times)

The Scout

  • Bay Watcher
  • ?????
    • View Profile
Cobalt Smelting
« on: June 25, 2011, 07:37:00 pm »

I want to make smelting cobalt make iron some of the time, and nickel msot of the time. How would I do this and would I have to regen the world?
Logged
Whatever you do, don't agree to stop looking at pornography or getting help from Jesus.
"mind if I sig this"
 - Person who isn't actually going to put that in their sig

NecroRebel

  • Bay Watcher
    • View Profile
Re: Cobalt Smelting
« Reply #1 on: June 25, 2011, 07:53:36 pm »

Depends on what numbers you want for "some of the time" and "most of the time." It is doable, however, and I don't think it will require a world regeneration.

Find cobaltite in inorganic_stone_minerals.txt in your data/save/appropriate region/raw folder. Add the following to that entry:

[METAL_ORE:IRON:25]
[METAL_ORE:NICKEL:75]

With these numbers, 25% of the time when you smelt a cobaltite you will get an iron bar, and 75% of the time you will get a nickel bar. Note that these are separate; you will get both or neither, respectively, 18.75% of the time. Change the numbers if you want to change the chances. It is not possible to make it such that it produces only one at a time AFAIK.
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

The Scout

  • Bay Watcher
  • ?????
    • View Profile
Re: Cobalt Smelting
« Reply #2 on: June 25, 2011, 08:00:38 pm »

But one of the copper ore makes copper 100% of the time and silver 10% of the time, or am I being stupid?
Logged
Whatever you do, don't agree to stop looking at pornography or getting help from Jesus.
"mind if I sig this"
 - Person who isn't actually going to put that in their sig

NecroRebel

  • Bay Watcher
    • View Profile
Re: Cobalt Smelting
« Reply #3 on: June 25, 2011, 08:18:35 pm »

But one of the copper ore makes copper 100% of the time and silver 10% of the time, or am I being stupid?
Tetrahedrite, yes. It's actually 100/20, but that's exactly what I did there. Tetrahedrite has [METAL_ORE:COPPER:100][METAL_ORE:SILVER:20]. It will produce copper every time you run the reaction, and 20% of the time when you run the reaction you'll also get silver. With tetrahedrite, there's no chance at all of getting only silver since it's a 100% ore of copper, but if it wasn't a 100% copper ore you could get neither, both, one, or the other, same as the cobaltite mod I suggested.
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

The Scout

  • Bay Watcher
  • ?????
    • View Profile
Re: Cobalt Smelting
« Reply #4 on: June 25, 2011, 08:30:05 pm »

It's just me being stupid then. I thought you meant the chances we're averaged, and you'd either get none or all.
Logged
Whatever you do, don't agree to stop looking at pornography or getting help from Jesus.
"mind if I sig this"
 - Person who isn't actually going to put that in their sig

NecroRebel

  • Bay Watcher
    • View Profile
Re: Cobalt Smelting
« Reply #5 on: June 25, 2011, 08:35:52 pm »

Ah. No, with the numbers I suggested you'd get nothing 18.75% of the time, just nickel 56.25% of the time, just iron 6.25% of the time, and both nickel and iron 18.75% of the time. Different numbers would mean different results of course. It's just 2 completely unrelated random numbers chosen, one for nickel and one for iron, and as long as the chances for neither are 100% you occasionally will get bad rolls on both.
« Last Edit: June 25, 2011, 08:37:42 pm by NecroRebel »
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

Mechanixm

  • Bay Watcher
    • View Profile
Re: Cobalt Smelting
« Reply #6 on: June 25, 2011, 09:18:28 pm »

You will also need the appropriate reaction added to the reaction_smelter.txt file and that same permitted reaction added to your entity_default.txt.

Reaction:

[REACTION:COBALTITE_SMELTING]
[NAME:Smelt Cobaltite]
[BUILDING:SMELTER:NONE]
[REAGENT:A:1:BOULDER:NO_SUBTYPE:INORGANIC:COBALTITE]
[PRODUCT:100:1:BAR:NO_SUBTYPE:METAL:NICKEL][PRODUCT_DIMENSION:150]
[PRODUCT:5:1:BAR:NO_SUBTYPE:METAL:IRON][PRODUCT_DIMENSION:150]
[FUEL]
[SKILL:SMELT]


entity_default:

[PERMITTED_REACTION:COBALTITE_SMELTING]


I'm pretty sure this will need a world regen.

Alem

  • Bay Watcher
    • View Profile
Re: Cobalt Smelting
« Reply #7 on: June 26, 2011, 12:15:58 am »

From what I recall as per Mechanixm's suggestion, while that would be one potential means of accomplishing the task you do not need to implement both. With NecroRebel's suggestion, it will automatically be added to the smelter. All ores, even when of custom metals, have the appropriate reaction automatically produced in game. The only time adding a custom reaction to the smelter is necessary is for alloys or non-standard smelting processes (such as turning balls of cotton candy string into cotton candy wafers)
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Cobalt Smelting
« Reply #8 on: June 26, 2011, 05:21:10 am »

You will also need the appropriate reaction added to the reaction_smelter.txt file and that same permitted reaction added to your entity_default.txt.

Reaction:

[REACTION:COBALTITE_SMELTING]
[NAME:Smelt Cobaltite]
[BUILDING:SMELTER:NONE]
[REAGENT:A:1:BOULDER:NO_SUBTYPE:INORGANIC:COBALTITE]
[PRODUCT:100:1:BAR:NO_SUBTYPE:METAL:NICKEL][PRODUCT_DIMENSION:150]
[PRODUCT:5:1:BAR:NO_SUBTYPE:METAL:IRON][PRODUCT_DIMENSION:150]
[FUEL]
[SKILL:SMELT]


entity_default:

[PERMITTED_REACTION:COBALTITE_SMELTING]


I'm pretty sure this will need a world regen.
You do not need a reaction if you add METAL_ORE to minerals.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

The Scout

  • Bay Watcher
  • ?????
    • View Profile
Re: Cobalt Smelting
« Reply #9 on: June 27, 2011, 02:18:09 pm »

Do I need to regen? It's not showing up in the smelter list.
Logged
Whatever you do, don't agree to stop looking at pornography or getting help from Jesus.
"mind if I sig this"
 - Person who isn't actually going to put that in their sig

Nobbins

  • Bay Watcher
  • Dustland
    • View Profile
Re: Cobalt Smelting
« Reply #10 on: June 27, 2011, 03:34:57 pm »

You got it all wrong. The reaction will work, but it's periodic, not random. 75% nickel will give the smelter 75 nickel, every time. Every time you get 100 nickel, it spits out a bar of nickel and carries over the remainder. So you should get no bars the first smelt, a nickel for the second and third, and nickel and iron on the fourth. This repeats.
Logged
Nobbins's Tileset Shoppe
It would mean that once a year, all of your female cats suddenly explode if there are any male cats around.

NecroRebel

  • Bay Watcher
    • View Profile
Re: Cobalt Smelting
« Reply #11 on: June 27, 2011, 04:23:20 pm »

Do I need to regen? It's not showing up in the smelter list.
I just tested it, and I didn't need a regen. Did you alter the save file's raws? The main raws don't affect saved games.

You got it all wrong. The reaction will work, but it's periodic, not random. 75% nickel will give the smelter 75 nickel, every time. Every time you get 100 nickel, it spits out a bar of nickel and carries over the remainder. So you should get no bars the first smelt, a nickel for the second and third, and nickel and iron on the fourth. This repeats.
Toady One disagrees with you:

Quote from: slink
How do the reactions work at the smelter?  Are they percentage probability or percentage completion?  Popular opinion had it that they are percentage completion but testing by a couple of us in the modding forum indicated that it was percentage probability with some weighting from unknown sources.  It was definitely not percentage completion weighted by same operator/same smelter.  We decided that only Tarn Adams could answer the question.  This is relevant in this thread because the new custom shops will undoubtedly be using the same sorts of reactions.  This is a hugely important feature in the new version, for some of us.

The way it works currently, which is open to additions of course, it to go through each product, and if it clears the chance (a single roll), it gives you all of the number.  It doesn't roll the chance for each individual one of a given product, and no invisible partial products are stored.  If you have odd numbers of reagents coming in (like lots of extra), you can get extra product, but the single chance must be cleared first.  So pretty much the clunkiest, most simple interpretation.
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

_DivideByZero_

  • Bay Watcher
  • Not to be confused with infinity
    • View Profile
Re: Cobalt Smelting
« Reply #12 on: June 27, 2011, 11:58:52 pm »

How about testing it on a quick pocket world? I'm exhausted and I almost maimed myself with power tools trying to fix my crossbow, so I'm not in the mood to test it right now. Good luck!
Logged
Have I now become your enemy by telling you the truth? (Gal 4:16)