Help with changing the temperature of fluids

Place to get help with not working mods / modding interface.
Liquius
Long Handed Inserter
Long Handed Inserter
Posts: 64
Joined: Tue Nov 04, 2014 12:01 pm
Contact:

Help with changing the temperature of fluids

Post by Liquius »

I am creating a mod with the aim adding in slightly more realistic nuclear fission reactors.

What I want is essential a boiler that doesn't rely on burnable fuel. It seems that the best (or rather the only way) to do it is to create an assembler that outputs a liquid and then use a script that changes the temperature of the fluid.

What I am wondering is whether it's possible to set the outgoing liquid's temperature on completion of a recipe or every few ticks, and how I would go about doing it.

Also, before anyone suggests making a magic energy box, the whole point of this mod is realism.

Thanks for the help.
cartmen180
Filter Inserter
Filter Inserter
Posts: 358
Joined: Fri Jul 25, 2014 2:53 pm
Contact:

Re: Help with changing the temperature of fluids

Post by cartmen180 »

Liquius wrote:I am creating a mod with the aim adding in slightly more realistic nuclear fission reactors.
slightly more realistic then what other nuclear fission reactor?
Liquius wrote:What I want is essential a boiler that doesn't rely on burnable fuel. It seems that the best (or rather the only way) to do it is to create an assembler that outputs a liquid and then use a script that changes the temperature of the fluid.

What I am wondering is whether it's possible to set the outgoing liquid's temperature on completion of a recipe or every few ticks, and how I would go about doing it.

Also, before anyone suggests making a magic energy box, the whole point of this mod is realism.

Thanks for the help.
I would say make a new boiler and set the max temperature of the fluid to the temp you want it to be. Your new boiler will heat it up et voila.
Check out my mods
Liquius
Long Handed Inserter
Long Handed Inserter
Posts: 64
Joined: Tue Nov 04, 2014 12:01 pm
Contact:

Re: Help with changing the temperature of fluids

Post by Liquius »

cartmen180 wrote:
Liquius wrote:I am creating a mod with the aim adding in slightly more realistic nuclear fission reactors.
slightly more realistic then what other nuclear fission reactor?
From what I have seen there are a few other mods that add nuclear power. They pretty much just go from uranium ore to enriched uranium via an assembler, and with that you make some building that puts out energy. Its a shame as the whole real life process is perfectly suited for factorio. My mod includes the full process of mining/processing/enriching from start to finnish.

Seeing as I am going all the way on the industrial process, I want to make my fission reactors as best as I can. I want to be able to alter the energy output with fuel assemblies as modules with greater enrichment meaning more energy.
I would say make a new boiler and set the max temperature of the fluid to the temp you want it to be. Your new boiler will heat it up et voila.
From what I can tell, you would need to add fuel. However fuel can be restricted to certain uses. If I went down that path, people could put fuel assemblies in everything. To me, that would break immersion.

I know that I can alter the tempereture of fluids without too much hassle (https://forums.factorio.com/forum/vie ... ilit=fluid). But what I don't know is how to tell the game so that on every tick (or completion of a set recipe) it finds all buildings of a certain type and then does something to them (ie changing the output fluids temp).
drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: Help with changing the temperature of fluids

Post by drs9999 »

You can easily create a recipe that increase the fluid-temperature.
E.g. water with 30°C goes in and water with 60°C goes out.
Dytech uses this to heat lava
Liquius
Long Handed Inserter
Long Handed Inserter
Posts: 64
Joined: Tue Nov 04, 2014 12:01 pm
Contact:

Re: Help with changing the temperature of fluids

Post by Liquius »

drs9999 wrote:You can easily create a recipe that increase the fluid-temperature.
E.g. water with 30°C goes in and water with 60°C goes out.
Dytech uses this to heat lava
That's just what I am looking for.

Thanks.

Edit: it's not what I am looking for. The temperature isn't increased. Its converting one fluid to another fluid with a higher default temperature. That doesn't help if you want to extract energy.
drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: Help with changing the temperature of fluids

Post by drs9999 »

Oh mea culpa.. I thought it was possible to specify the temperature of the results in the recipe, but actually it isn't.
Rahjital
Filter Inserter
Filter Inserter
Posts: 435
Joined: Thu May 29, 2014 10:44 am
Contact:

Re: Help with changing the temperature of fluids

Post by Rahjital »

What exactly do you want to do, step by step, Liquius? "Slightly more realistic nuclear fission reactors" is rather vague. I imagine you want the reactors to heat up water for steam engines and also need a separate cooling circuit with cold water. You'd probably need more than one entity for that along with some Lua trickery.

As for Dytech, doesn't it have several lava fluids that are identical in everything except temperature?
Liquius
Long Handed Inserter
Long Handed Inserter
Posts: 64
Joined: Tue Nov 04, 2014 12:01 pm
Contact:

Re: Help with changing the temperature of fluids

Post by Liquius »

Rahjital wrote:What exactly do you want to do, step by step, Liquius? "Slightly more realistic nuclear fission reactors" is rather vague. I imagine you want the reactors to heat up water for steam engines and also need a separate cooling circuit with cold water. You'd probably need more than one entity for that along with some Lua trickery.

As for Dytech, doesn't it have several lava fluids that are identical in everything except temperature?
I start with a unique assembler that can only craft a single recipe. That recipe converts water into "super heated water". That product then gets piped into an array of steam engines and generates power. To extract energy means I need to change the temperature (and not the default temperature like in Dytech) of the liquid.

I plan to have the recipe start off as a net loss of energy. You then go onto put in fuel assemblies as modules that dramatically increase the speed/efficiency.

AFAIK the only way to change the temperature of a liquid is either via a boiler or a script. What I am struggling with is the scripting. I just don't know if it's possible. I don't know how to find every entity of a specific type.
Rahjital
Filter Inserter
Filter Inserter
Posts: 435
Joined: Thu May 29, 2014 10:44 am
Contact:

Re: Help with changing the temperature of fluids

Post by Rahjital »

Entity tracking is done through Lua events. Use the onbuiltentity, onentitydied and onpreplayermineditem to track which entities you want to interact with and ontick to raise the temperature of water in your tracked entities. I don't think you can track when an assembler finishes crafting a recipe, but you could script the entire reaction yourself if needed.
Post Reply

Return to “Modding help”