Jump to content

How does one make a mod that changes what the forge accepts as fuel?


Recommended Posts

Posted
9 minutes ago, traugdor said:

Whether we should or should not is the debate, I guess.

I'm inclined to say that it doesn't matter since mods exist and OP originally expressed interest in making one. Discussion should center around that, for which there is already a linked wiki page.

Well just because there is a mod for something doesn't mean it isn't worthy of inclusion in the base game.

Some things should remain mods (or at least optional) and some things really should be in the base game when time permits.

This really should be base game; fuels that produce enough heat should be useable for whatever. I wish the bread oven would take other fuels too.

Do I think Tyrion should drop what he is doing for this? Certainly not, but at some time he should.

Posted

Where does workable temperature show? I don't recall ever seeing it, and I went in and turned an ingot into a saw, pressing Alt-H on everything, and never once in the process did I see anything like that screenshot. Or is that a mod?

Posted
Just now, Thorfinn said:

Where does workable temperature show? I don't recall ever seeing it, and I went in and turned an ingot into a saw, pressing Alt-H on everything, and never once in the process did I see anything like that screenshot. Or is that a mod?

It very well may be a mod. I run with nearly 70 and almost all of them I consider QOL mods. It's really too early in the games lifecycle for content mods for me.

  • Thanks 1
Posted
1 minute ago, Krougal said:

This really should be base game; fuels that produce enough heat should be useable for whatever. I wish the bread oven would take other fuels too.

Doesn't that beg the question, though? I never heard that "1/2 smelting temperature" thing, and it certainly isn't true IRL.

An equally good case can be made that  the longer-term solution should be to substitute in actual values, where peat would plenty for copper or brass, only marginally for bronze (extent of microfracturing would depend on the exact composition) , and essentially not at all for iron and steel.

Personally, I'd be much more in favor of a proper tempering and deformation hardening mechanic, (essentially, low-tech shot peening) and even put a little effort into it before one of the releases broke what I'd done so far. Once we get closer to done, I'll probably revisit it.

  • Like 1
Posted
9 minutes ago, Thorfinn said:

Doesn't that beg the question, though? I never heard that "1/2 smelting temperature" thing

https://wiki.vintagestory.at/index.php/Smithing

Ignite the Forge: Ignite with a torch. Most metals can be worked when they are heated to a temperature above 50% of their melting point. Lead can be smithed at any temperature, iron blooms can be smithed at above 700°C.

Granted, you can't believe everything you read on the wiki.

Another thing that needs to be fixed I think is the speed. Like if I am heating the copper & tin way over the required temperature, I expect them to melt faster. The way it is now seems really flaky to me.

  • Thanks 1
Posted (edited)
1 hour ago, traugdor said:

part of playing games like this is building a stockpile of materials you're going to need.

I think the coolest part is that what you are doing is trading seconds, minutes, hours of your seraph's "existence" to accomplish some end(s). And, yes, most ends will require you to trade that time to accumulate materials. Is a search for purpleheart or ilmenite or borax or salt or marble or bees or iron worth those hours/days of your seraph's life? Certainly you don't need any of that just to establish a thriving farm that is well beyond survival, well into comfort. But just like IRL, you get to decide if it is worth it to you. Charcoal is too much work? It may well limit your ability to do any chiseling on your home, but your seraph can still lead a satisfying, happy, if simpler life.

Edited by Thorfinn
  • Like 1
Posted

Sorry for being a bit terse. When I thought of doing something similar, I thought I could ether copy a snippet from the firepit or brand new pit kiln or delete something from the forge, but they are (or at least were) coded differently. My guess was that either it was legacy code or intentionally done to make it difficult to do multi-fuel. So I tried to come up with options that would be within range of a first mod. Which was somehow annoying, I guess.

On reflection, a recipe that has only an axe in the crafting grid that subtracts 3+ durability, producing 1 charcoal might be the best answer. The assumption here is that all it is doing is getting rid of all the time that a seraph would have to spend between growing a grove, removing all the leaves, logging, replanting, making the pit, waiting, and digging it out by hand. The basis is that 8 logs makes one block of firewood, which produces roughly 5 charcoal. That would take 16 durability off your axe, or roughly 3 durability per piece of charcoal. If you don't usually remove the leaves, it will take about 32 durability per block of firewood, or roughly, a recipe that deducts 5-6 durability per piece of charcoal produced.

  • Like 1
Posted
19 hours ago, Krougal said:

Another thing that needs to be fixed I think is the speed. Like if I am heating the copper & tin way over the required temperature, I expect them to melt faster. The way it is now seems really flaky to me.

That's another thing that the devs have simplified to the point that one is justified in thinking, "What the heck is taking so long!"

IRL, it takes time to flux and skim off the dross. Sometimes you have to flux several times. Be glad they didn't follow reality too closely. One of the most common fluxes was potassium chloride, whose only source in-game is sylvite. Yep. You need to find a salt dome before you can make proper copper tooling...

  • Like 1
  • 2 months later...
Posted

I'm trying to do the same thing as OP and make a mod for this, but out of the two pages of replies there wasn't one actual answer that was helpful. No disrespect Thorfinn but if you cant answer the original question being asked then dont reply.

As for the mod I dug around the JSON files a ton but I couldn't find anything relating to how the forge handles fuel, there's no value for forge fuel or whatever in the charcoal or the forge files itself, which leads me to believe that you would have to crack open actual code (which would suck cuz JSON modding is already confusing enough).

Posted

Did you bother to even read any of it? I'm 99% sure that what the OP and you are asking CANNOT be done with .JSON editing. Or at least couldn't in 1.19 or 1.18, I forget.

My replies were giving alternatives to what he was asking for, but which could be done with JSON edits.

No disrespect, @Ikana but if you came to the exact same conclusion I did and I should have remained silent, why did you think it was appropriate for you to post? No, I take that back. That was disrespect, as was yours.

Posted

I've read this entire discussion multiple times, alternatives are nice but its not whats being asked. Since you probably will have to open up code, (which im fully willing to do) a pointer to which file or where the code for blocks is stored would be more helpful than wisecracks.

Posted (edited)

And exactly how many of those helpful answers have you seen in this thread? Do you suppose there might be a reason? That maybe it's not as simple as it might seem? But, fine, I'll point you in the right direction.

Have you at least read the wiki on the subject? https://wiki.vintagestory.at/Special:MyLanguage/Modding:Preparing_For_Code_Mods

[EDIT]

Reason for asking is if you have, I'm not sure why you are asking for help. That has already taken you straight to the API repo.

Edited by Thorfinn
Posted

After some experimenting I've found that the forge bases what fuel it allows by checking if its burn temperature is above 1000 degrees

Spoiler

{
                        CombustibleProperties combustibleProps = obj.CombustibleProps;
                        if (combustibleProps != null && combustibleProps.BurnTemperature > 1000)
                        {
                            List<ItemStack> stacks2 = obj.GetHandBookStacks(capi);
                            if (stacks2 != null)
                            {
                                this.coalStacklist.AddRange(stacks2);
                            }

I just need to learn how to make a mod that patches the code to accept fuels that are 900 degrees

  • Like 1
Posted
10 hours ago, Ikana said:

I'm trying to do the same thing as OP and make a mod for this, but out of the two pages of replies there wasn't one actual answer that was helpful. No disrespect Thorfinn but if you cant answer the original question being asked then dont reply.

As for the mod I dug around the JSON files a ton but I couldn't find anything relating to how the forge handles fuel, there's no value for forge fuel or whatever in the charcoal or the forge files itself, which leads me to believe that you would have to crack open actual code (which would suck cuz JSON modding is already confusing enough).

Yea, i agree. This is why i called him a forum troll the other time and blocked him. He's simply just a pain in the gnards to deal with.

I dug around in the jsons aswell and gave up after checking everything that might have it. I didnt know how to check the actual code

9 hours ago, Ikana said:

I've read this entire discussion multiple times, alternatives are nice but its not whats being asked. Since you probably will have to open up code, (which im fully willing to do) a pointer to which file or where the code for blocks is stored would be more helpful than wisecracks.

Its thorfinn. Welcome to the forums. Its actually a nice place, with some outliers

7 hours ago, Ikana said:

After some experimenting I've found that the forge bases what fuel it allows by checking if its burn temperature is above 1000 degrees

  Hide contents

{
                        CombustibleProperties combustibleProps = obj.CombustibleProps;
                        if (combustibleProps != null && combustibleProps.BurnTemperature > 1000)
                        {
                            List<ItemStack> stacks2 = obj.GetHandBookStacks(capi);
                            if (stacks2 != null)
                            {
                                this.coalStacklist.AddRange(stacks2);
                            }

I just need to learn how to make a mod that patches the code to accept fuels that are 900 degrees

Where did you find this? How did you even dig into the code of the game? I wanna know aswell because this is a handy skill. Reading the github source code?

  • Like 1
Posted (edited)
53 minutes ago, NastyFlytrap said:

Where did you find this? How did you even dig into the code of the game? I wanna know aswell because this is a handy skill. Reading the github source code?

I was able to find this code by using dnSpy and opening the VSSurvival.dll file.

 

Spoiler

filelocation.thumb.PNG.adeaae0aa3125cc858f147780f396e0c.PNG

 

From there you can go through these files to find all the blocks and most items in the game:

Spoiler

dlspy.PNG.37125c38cb5ec0b393c5eae70a59b2c6.PNG

 

The forge is kinda hard to spot so you can just use the search function and double click the first entry that pops up when you search forge and it will bring you to the code for the forge

Spoiler

forgesearch.thumb.PNG.140ea8bee805efbd311ba772392ec3f0.PNG

 

Scroll down a tiny bit in the center code panel and you'll find the code that I believe controls its fuel selection.

Spoiler

finaldestination.thumb.PNG.3e8df9fff5fad121220f296c2db94392.PNG

 

From my own research I think you would need to make a transpile harmony patch in visual studio, but that's way out of my depth right now unfortunately. For all I know, I could be completely wrong about this value controlling what you can use as fuel, so take what I say with a grain of salt, this is just the conclusion I came to from spending the whole day looking around at the wiki and digging inside the code.

Hopefully this is more helpful than throwing ingots and coal in a pit and cheating your iron tools in with creative

 

Edited by Ikana
Posted
21 minutes ago, Ikana said:

I was able to find this code by using dnSpy and opening the VSSurvival.dll file.

 

  Hide contents

filelocation.thumb.PNG.adeaae0aa3125cc858f147780f396e0c.PNG

 

From there you can go through these files to find all the blocks and most items in the game:

  Hide contents

dlspy.PNG.37125c38cb5ec0b393c5eae70a59b2c6.PNG

 

The forge is kinda hard to spot so you can just use the search function and double click the first entry that pops up when you search forge and it will bring you to the code for the forge

 

  Reveal hidden contents

forgesearch.thumb.PNG.140ea8bee805efbd311ba772392ec3f0.PNG

 

Scroll down a tiny bit in the center code panel and you'll find the code that I believe controls its fuel selection.

 

  Reveal hidden contents

finaldestination.thumb.PNG.3e8df9fff5fad121220f296c2db94392.PNG

 

From my own research I think you would need to make a transpile harmony patch in visual studio, but that's way out of my depth right now unfortunately. For all I know, I could be completely wrong about this value controlling what you can use as fuel, so take what I say with a grain of salt, this is just the conclusion I came to from spending the whole day looking around at the wiki and digging inside the code.

Hopefully this is more helpful than throwing ingots and coal in a pit and cheating your iron tools in with creative

 

Maybe try monkey patching?

 

https://wiki.vintagestory.at/Modding:Monkey_patching

 

The wiki is a bit hard to navigate because it has many pages that arent linked to, from other pages, bug i found this and it might just work. Although, i am not a coder so i feel out of my depth here

Posted
22 minutes ago, NastyFlytrap said:

 i am not a coder so i feel out of my depth here

You and me both lol. Maybe sometime this week Ill sit down and watch some c# tutorials but for now im just gonna hope someone with actual coding experience can help us

Posted
Just now, Ikana said:

You and me both lol. Maybe sometime this week Ill sit down and watch some c# tutorials but for now im just gonna hope someone with actual coding experience can help us

I actually have some very basic C# experience but its been almost a decade since i learned it so im probably rusted to hell and back. That being said, if we can do the monkey patching thing, that'd be much easier than editing the DLL itself and having to recompile it and everything

Posted
6 minutes ago, NastyFlytrap said:

I actually have some very basic C# experience but its been almost a decade since i learned it so im probably rusted to hell and back. That being said, if we can do the monkey patching thing, that'd be much easier than editing the DLL itself and having to recompile it and everything

I was messing around with making a monkey patch a little bit but I didn't really know what I was doing. Tomorrow Ill take another crack at it and see if I can something working

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.