Mods / Meltcaster

Tags: #Utility
Author: safwyl
Side: Both
Created: Apr 4th at 2:01 AM
Last modified: Jun 10th at 6:15 PM
Downloads: 2848
Follow Unfollow 111

Recommended download (for Vintage Story 1.20.6 - 1.20.7, 1.20.8 - 1.20.10 and 1.20.11 - 1.20.12):
meltcaster_1.0.2.zip  1-click install


🔥Meltcaster🔥(Initial release)


 

The Meltcaster is a smelter-style device used to recycle items like metal-scraps into metal bits and sometimes rare gears. It requires fuel (like charcoal) and input items (like scrap) to begin processing.

The default example recipe includes only the following input:

  • metal-scraps

 

The recipes are fully configurable for both input and output, so feel free to make any recipe you like

To Do:

  • Add folder parsing to separate recipes into individual json files in a custom folder DONE!
  • YAML recipe parsing (for better human readibility)

🧪 Recipe Basics

Each Meltcaster Recipe defines:

  • Input Item: The item you smelt (e.g., metal-scraps)

  • Meltcast Temperature: How hot the furnace needs to be to start processing

  • Meltcast Time: How long it takes to complete smelting

  • Outputs: What you get back, with chances per item

 

The initial release of this mod has a single recipe defined as follows:

Input: Metal Scraps

Meltcast Temperature: 1200 C

Meltcast Time: 60s

Outputs:

    • Metal Bits - Group
      • Chance: 100%
      • Quantity: 1
      • Note: Bit type is weighted roll for all metal bits in the game
    • Rusty Gear
      • Chance: 5%
      • Quantity: 1
    • Temporal Gear
      • Chance: 1%
      • Quantity: 1

⚙️ Simple Outputs

Some recipes have simple outputs like:

  • gear-rusty – 5% chance

  • gear-temporal – 1% chance

 

Each item has a chance defined:

  • On simple outputs this is the chance for that item
  • On group items this is the weighted chance for that item within it's group

🎲 Weighted Output Groups

Outputs can also be part of a group with weighted selection:

  • When the first item of a stack is processed, a random bit from the group is selected based on its weight (rarer bits have lower chances).

  • Each subsequent item will output the same selected bit until the number of items output exceeds the group roll interval defined in the recipe (16 by default).

 

This prevents players from "cherry-picking" rare bits by inserting one item at a time.

 

Weighted group rolls happen separately from non-group items, the chance defined on the group is the overall chance for entire group. Each item's chance is it's relative weight to other items within that group.

🌡️ Fuel & Temperature

  • The furnace must be ignited with fuel (like charcoal or coal).

  • It heats up gradually; once hot enough, the item starts melting.

  • Items visibly heat up and have their own temperature.

🧊 Output & Cooling

  • Finished bits will try to insert into output slots.

  • If no room, they'll drop or flow into a container (like a hopper or chest) below.

  • Bits will retain heat and cool down over time.

 

Meltcaster Block

This new block is the cornerstone of this mod. The meltcaster is a new block that accepts fuel and input items and then melts them down into other objects. The inputs allowed and their corresponding outputs are configurable and dictated by the mod configuration file.

Variants

The meltcaster can be constructed with a variety of metals for decorative effect and a speed bonus.

Variant

Materials

Speed Modifier

Notes

Copper Meltcaster

3x Copper Plate

2x Lead Plate

1x Iron Plate

1x Rusty Gear

1x  
Tin Bronze Meltcaster

3x Tin Bronze Plate

2x Lead Plate

1x Iron Plate

1x Rusty Gear

1.2x  
Black Bronze Meltcaster

3x Black Bronze Plate

2x Lead Plate

1x Iron Plate

1x Rusty Gear

1.2x  
Bismuth Bronze Meltcaster

3x Bismuth Bronze Plate

2x Lead Plate

1x Iron Plate

1x Rusty Gear

1.2x  
Iron Meltcaster

3x Iron Plate

2x Lead Plate

1x Iron Plate

1x Rusty Gear

1.5x  
Steel Meltcaster

3x Steel Plate

2x Lead Plate

1x Iron Plate

1x Rusty Gear

2x  
Corroded Meltcaster 1x Steel Meltcaster 2x Alternate aesthetic for steel meltcasters

 

 

Crafting

Recipes are identical for all variants with the three aesthetic plates being swapped for the variant material.

 

GUI and Behavior

We've built a custom interface for the Meltcaster based a bit on the firepit interface. This GUI consists of a fuel slot, input slot, and four output slots. The burning and progress indicators behave identically to the firepit.

Input slots are heated until reaching the Meltcast Temperature for the input item in its Meltcast Recipe. All output slots are try to heat to the meltcast temperature as well, the success of that heating is dependent on the output items.

 

If the inventory slots fill up the Meltcaster will first attempt to place it's output in a container directly below the meltcaster if present, after which it will then drop the items on the ground.

 

 

Recipes

Recipes can be stored directly in the config file's meltcastrecipes array or in individual json files in ModConfig/meltcaster/recipes directory. We recommend the latter.

 

Recipes stored in individual files should be placed inside square brackets (a json array) so the mod can easily parse either single or multiple recipes from a single file.

 

Recipe files take the format of an item stack input, temperature, time, and a list of custom object outputs that contain an item stack and output chance 

 

Simple Recipe:

[
    {
        input: { code: "game:metal-parts", type: "block", stacksize: 1 },
        meltcasttemp: 1200,
        meltcasttime: 60,
        output: [
            { code: "game:gear-rusty", type: "item", stacksize: 1, chance: 0.01 },
            { code: "game:gear-temporal", type: "item", stacksize: 1, chance: 0.02 },
        ],
    },
]

 

Complex Recipe:

Group outputs have an overall chance, and then each group item has it's relative pick chance within the group.

For example, if a group has an overall chance of 0.5, containgin three items that have chances of 1, 0.5, and 0.2. Then when the meltcaster creates outputs it will have a 50% chance to generate an item from that group and within that group the first item has a weight of 1, second has a weight of 0.5, and third has a weight of 0.2. A weighted roll is then taken of the group items to determine which is created. For more information on weighted rolling algorithm check here: https://dev.to/jacktt/understanding-the-weighted-random-algorithm-581p

[
    {
        input: { code: "game:metal-scraps", type: "block", stacksize: 1 },
        meltcasttemp: 1200,
        meltcasttime: 60,
        output: [
            {
                code: "meltcaster:g-metal-bits",
                stacksize: 1,
                chance: 1,
                grouprollinterval: 16,
                group: [
                    { code: "game:metalbit-copper", type: "item", stacksize: 1, chance: 1 },
                    { code: "game:metalbit-tinbronze", type: "item", stacksize: 1, chance: 0.7 },
                    { code: "game:metalbit-bismuthbronze", type: "item", stacksize: 1, chance: 0.6 },
                    { code: "game:metalbit-blackbronze", type: "item", stacksize: 1, chance: 0.5 },
                    { code: "game:metalbit-iron", type: "item", stacksize: 1, chance: 0.5 },
                    { code: "game:metalbit-steel", type: "item", stacksize: 1, chance: 0.4 },
                    { code: "game:metalbit-nickel", type: "item", stacksize: 1, chance: 0.3 },
                    { code: "game:metalbit-lead", type: "item", stacksize: 1, chance: 0.3 },
                    { code: "game:metalbit-zinc", type: "item", stacksize: 1, chance: 0.3 },
                    { code: "game:metalbit-bismuth", type: "item", stacksize: 1, chance: 0.3 },
                    { code: "game:metalbit-molybdochalkos", type: "item", stacksize: 1, chance: 0.3 },
                    { code: "game:metalbit-cupronickel", type: "item", stacksize: 1, chance: 0.2 },
                    { code: "game:metalbit-brass", type: "item", stacksize: 1, chance: 0.2 },
                    { code: "game:metalbit-chromium", type: "item", stacksize: 1, chance: 0.2 },
                    { code: "game:metalbit-silver", type: "item", stacksize: 1, chance: 0.2 },
                    { code: "game:metalbit-leadsolder", type: "item", stacksize: 1, chance: 0.2 },
                    { code: "game:metalbit-silversolder", type: "item", stacksize: 1, chance: 0.1 },
                    { code: "game:metalbit-meteoriciron", type: "item", stacksize: 1, chance: 0.1 },
                    { code: "game:metalbit-gold", type: "item", stacksize: 1, chance: 0.1 },
                    { code: "game:metalbit-electrum", type: "item", stacksize: 1, chance: 0.05 },
                    { code: "game:metalbit-titanium", type: "item", stacksize: 1, chance: 0.05 },
                ],
            },
            { code: "game:gear-rusty", type: "item", stacksize: 1, chance: 0.05 },
            { code: "game:gear-temporal", type: "item", stacksize: 1, chance: 0.01 },
        ],
    }
]

 

Full Default Config

Example default config as of version 1.0.1

{
    recipesPath: "meltcaster/recipes",
    meltcastRecipes: [],
}

Mod Version For Game version Downloads Release date Changelog Download 1-click mod install*
1.0.2
1.20.6 - 1.20.7 1.20.8 - 1.20.10 1.20.11 - 1.20.12
1777 Apr 24th at 11:34 PM meltcaster_1.0.2.zip 1-click install
  • Bugfix in example recipe file creation
1.0.1
1.20.6 - 1.20.7
401 Apr 18th at 5:30 PM meltcaster_1.0.1.zip 1-click install
  • Fix missing recipes path in default config file
1.0.0 30 Apr 18th at 5:05 PM meltcaster_1.0.0.zip 1-click install
  • Support for individual recipe files in ModConfig/meltcaster/recipes
  • Example recipe file generated if recipes folder is missing
  • Removed recipes from default config and moved to separate files
  • Jonas Parts recipes are not copied to recipe folder by default, but remain in the assets folder of the mod for reference
  • Improved logging
  • Moved group roll attributes into the itemstack attributes
    • This helps ensure correct behavior when swapping stacks
    • Allows for multiple group outputs in a recipe
0.9.3 435 Apr 11th at 12:37 AM meltcaster_0.9.3.zip 1-click install
  • Rework particle effects
    • Fire is now contained inside the chamber
    • Smoke emits from the chimney
    • Embers occasionally come out of the chimney
  • Reset animation on block change to avoid the windows going dim after lighting (or staying lit after extinquishing)
0.9.2 189 Apr 9th at 10:41 PM meltcaster_0.9.2.zip 1-click install
  • Initial beta release
0.9.0 16 Apr 4th at 9:31 PM meltcaster_0.9.0.zip 1-click install
  • Initial Beta Release

14 Comments (oldest first | newest first)

💬 MechaWarrior, Jun 1st at 8:01 PM

Having a issue with the meltcaster causing me to get a client side exception with some sort of phantom steel nugget not sure why this is occuring but when i broke the melter it didnt drop the nugget and it seems the scrap isnt getting consumed so its just eternally smelting. might be a mod conflict though as there are other mods.

💬 safwyl , May 10th at 6:56 PM

Vigilance at the moment no support for wildcards in the recipes unfortunately, it's something I want to add but haven't yet. At the moment I'm using the game's built in jsonstack parsing for items and it doesn't seem to support wildcards natively so I'll have to extend it first. But it is on my to-do list

💬 Vigilance, May 9th at 7:44 PM

From some initial poking around, I suppose I'm right to assume I can't do "wildcard" recipes, for instance, recovering plates from armor, using input "game:armor-legs-plate-*" and output "game:metalplate-{metal}"? Is there any elegant way to do this, or will I need to hard code a dozen recipes for each metal variant?

💬 SigynL, Apr 27th at 4:41 PM

This is a masterclass on adding new machines to VS!  Seeing the meltcaster open was a very nice touch.  I love that it has 4 output slots.  I hope other modders will learn from the well-documented example you provided (& I say that as someone who can't code but even I understand how to create a recipe now!).  I have my meltcaster running 24/7 to meltdown my huge collection of mostly useless scrap metal :D

💬 AceScorpion142, Apr 25th at 11:53 PM

safwyl

Thanks dude, now it works perfectly fine. 

💬 safwyl , Apr 24th at 10:36 PM

AceScorpion142

It looks like this is a bug with the default recipe not getting properly generated after my latest change to use independent recipe files. You can create a new json file in ModConfig/meltcaster/recipes with the following for now or wait until I have it fixed (should be later today) UPDATED, should be fixed in v1.0.2

Default Recipe
 

 

💬 AceScorpion142, Apr 24th at 10:12 PM

Mod simply doesn't work: meltcaster's heated up to 1200°C, but the scraps ain't melting. Sad, cause the concept's quite good, and would give another use to the scraps.

💬 MrSandman, Apr 23rd at 3:05 AM

So, if I'm understanding this correctly, there are no recipes at all. Would I have to manually add the recipes to the recipes folder?

💬 Caliess, Apr 15th at 5:39 AM

yknow this would be really funny with alchemical refinement to get rid of all those fake ores (antimony manganese etc) and recycle them into any of the real ores (copper, tin, iron, etc). could maybe even add the vanilla ores to it as well just for even more gambling away your infinite copper supply

💬 umbrage, Apr 10th at 10:22 PM

Now I'm imagining if this were a multi-block structure that had you place molds on the four sides and smelted whatever you put in the middle to fill the molds automatically. It would take up a lot of floor space, but to automatically smelt and mold four casts at a time would be worth it.

I could definitely see this useful for broken tool heads from Smithing Plus with the right recipes added.


Downloading just because it looks cool either way. :)

💬 Deicide, Apr 10th at 12:38 PM

Honestly Im just going to download this because I really like the meltcaster model

💬 safwyl , Apr 10th at 3:47 AM

Aloy AgentOfChaos

thank you! 🙏

💬 Aloy, Apr 9th at 11:47 PM

feels vanilla worthy tbh

💬 AgentOfChaos, Apr 9th at 11:45 PM

I like. has a lot of potential.

 

 (edit comment delete)