Mods / Thrifty Smithing
Author: Foxcapades
Side: Both
Created: Aug 21st at 4:03 PM
Last modified: Oct 25th at 1:01 AM
Downloads: 4134
Follow Unfollow 124
Latest file for v1.19.8:
thrifty-smithing-1.2.0.zip
1-click install
Gives back scrap metal split off of items being crafted on an anvil.
Once a smithing work is completed, the player who completed it will be given the amount of whole bits that could be formed from the material removed from the work while it was being crafted.
If a smithing work is completed by a helve hammer, the scrap bits will be dropped to the floor at the base of the anvil.
Configuration
The following configuration options are provided in the thrifty-smithing.json
file, with default values based on the base VintageStory experience. Most of these should not be changed unless necessitated by changes from other mods.
{
"voxelsPerIngot": 42,
"voxelsPerPlate": 81,
"materialUnitsPerIngot": 100,
"materialUnitsPerBit": 5,
"materialUnitsRecoveredModifier": 1.0,
"disallowedRecipes": []
}
Option | Type | Description |
---|---|---|
|
|
The number of voxels a single ingot should be worth. Valid value range: |
|
|
The number of voxels a single metal plate should be worth. Valid value range: |
|
|
The amount of material required to craft an ingot. Valid value range: |
|
|
The amount of material represented by a single metal bit. Valid value range: |
|
|
Percentage multiplier used to modify the amount of scrap material returned on completion of a smithing work. The default value of Valid value range: |
|
array of |
Asset locations for recipes that should not reward any scrap on completion. For example setting this to |
Programmatic Extensibility
ThriftySmithing currently offers a limited mechanism through which other mods may alter the inputs used by ThriftySmithing to calculate metal bits returned as scrap after smithing an item.
ThriftySmithing looks for ITreeAttribute
instances in an anvil's work item (BlockEntityAnvil.WorkItemStack
) attributes whose names are prefixed with the string ef:ts:workData:
. These ITreeAttribute
instances may contain sub-attribute integer values under the keys voxels
, ingots
, and/or plates
which may contain positive or negative values that will be applied to the scrap bit calculation.
Scrap Calculation
ThriftySmithing calculates the amount of scrap metal to give back to a player based on the number of voxels removed from a smithing work. By default this is determined by subtracting the number of voxels required by a recipe from the voxels granted based on the number of ingots or metal plates placed onto the anvil.
Example Extension
// Add a bunch of extra voxels to the scrap bit calculation void SetThriftySmithingVoxels(BlockEntityAnvil anvil) { anvil.WorkItemStack.Attributes["ef:ts:workData:myMod"] = new TreeAttribute { ["voxels"] = new IntAttribute(36), } }
Attributes
Key | Type | Notes |
---|---|---|
|
|
A tree attribute that may contain the sub-attributes |
Key | Type | Notes |
---|---|---|
|
|
A positive or negative value in the range |
|
|
A positive or negative value in the range |
|
|
A positive or negative value in the range |
Compatibility
- Thrifty Smithing should be compatible with mod-based smithing recipes that use base game materials.
- Thrifty Smithing may be compatible with mod-based metals, assuming they provide metal bit items with asset locations matching the base game's
metalbit-{material}
scheme. - Thrifty Smithing is not likely compatible with mods that overhaul or make significant changes to the smithing system, especially with regard to anvils.
- Thrifty Smithing is not compatible with mods that allow smithing items without the use of anvils at all (it shouldn't cause a problem, it just won't give back scrap without an anvil).
Known Compatibilities
💚 | Smithing Plus v1.0.1+ | Great together! |
💚 | Knapster v2.x.x | No issues! |
💚 | Ancient Armory v1.x.x | Works fine! |
👾 | Anvil Metal Recovery | Might work but seems silly. |
Version | For Game version | Downloads | Release date | Changelog | Download | 1-click mod install* |
---|---|---|---|---|---|---|
v1.2.0 | 1975 | Oct 25th at 1:01 AM | Show | thrifty-smithing-1.2.0.zip | Install now | |
v1.1.0 | 1624 | Aug 27th at 9:49 PM | Show | thrifty-smithing-1.1.0.zip | Install now | |
v1.0.1 | 149 | Aug 26th at 10:06 PM | Show | thrifty-smithing-1.0.1.zip | Install now | |
v1.0.0 | 386 | Aug 21st at 6:32 PM | Show | thrifty-smithing-1.0.0.zip | Install now |
Found an interesting issue where the metal bits gotten from chiseling broken items from Smithing Plus and the metal bits returned from forging from Thrifty Smithing don't stack. They have the same name and look identical just don't stack.
When smelted down into ingots they turn into regular ingots, and you can even smelt different bits of the same metal type into a single ingot, with the weird exception of iron bits into the bloomery, you need to only use one of the stacks, but then the resulting iron ingots don't stack with normal iron ingots.
Posting this comment on both mods, cause I'm not sure where, or even what, exactly the issue is.
metal recovery for iron bloom would be awesome!
do you plan to add metal recovery for iron blooms and blister steel too?
@Foxcapades Yes I also had Smithing Plus, I went back and disabled it and that fixed the bug. Thanks for the suggestion.
edit: It was Smithing Plus version 1.0.1.
edit 2: I installed the latest version Smithing Plus 1.1.1 and that fixed it.
Oh yeah the chiseling issue is something I faced too, I fixed it for work items like this, although you will probably have to harmony patch the base method of ItemNugget instead of overriding the nugget class with one that inherits like I do. I did forget to fix it for other items too.
Fazule, that is an oversight on my part. I can add a toggleable feature to this mod to reduce the bits returned by chiseling metal items to an amount that makes sense given the metal that was actually used in the smithing recipe.
I do think it is a bit odd that the base game gives back the full input cost when chiselling a metal part in the first place.
I found a bug with which you can dupe more metal. Smithing tin bronze chain consumed 2 ingots and returned 12 bits. You can then break the chain using chisel and get 40 bits. So you end up with 52 bits while starting just with 40 (2 ingots). This can be probably done on other smithed parts as well.
BlackBird90 do you have other smithing plugins enabled? I haven't been able to reproduce the issue myself, I get back 14 bits when putting in 2 iron ingots for 8 nails.
Hi, great mod I really like the idea I found a bug in testing. Making 8x nails and strips out of iron gives back too much metal. Using 2 iron ingots gives back 22 bits of metal, the same recipee using 2 ingots of copper or tin bronze gives back the correct ammount of metal, 14 bits.
Hey, I made a mod that adds an additional use for the bits generated when using this mod. Very useful for steel bits: https://mods.vintagestory.at/smithingplus
Seems compatible from my testing (I just change nuggets to be workable and add code similar to the ingot to add it to existing work items).
Edit: Thanks for the help!
Came here looking for the mod making my iron blooms disappear and found you already fixed it, great work!
Thanks for the quick update! Really appreciate it!
Foxcapades!
1stSlug, while it doesn't give back quite 100% for most recipes, it does presently try and get as close to 100% as it can, so having a general modifier like you suggest is a great idea! That will be going into the next update 👯
It really annoys me that base game wastes so much doubly so considering the effort we players have to go to find these resources, so this is a great mod! 💯
A possible mod branch could involve a config/setting where you only gain back 50-75%, or lower/high, of your waste instead off the full 100%. 🤔
Hunter118 GodlyAnnihilator
Thanks for the bug report! I goofed up a string-splitting function, which threw an error for a handful of items, and had the end result you reported. Should be resolved in v1.0.1
Welp, I'm also having the same bug as Hunter118.
I tried going into Iron Age, and when I placed the bloom into the anvil it was invincible.
Disabled the mod and the bloom became visible again.
Im having a bug that make iron blooms on anvils invisable and unworkable. Not sure if its just the mod or its conflicting with other mods, only that uninstalling it fixs the bug. Otherwise im quite injoying the mod.
Really cool mod. Some items need too little material and so much is lost, and it's frustrating, especially when that material is scarce.
This mod is totally worth it. No errors or mod compatibilities despite using a large amount of mods.
Great job Foxcapades
@NukoSan Effectively, yes. AMR's smithing component does basically the same thing as this mod. This mod does not presently return scrap for broken tools, so if that is a feature you want, AMR might be the way to go.
So either this mod or AMR?