Auto filling a generator with a fluid

Place to get help with not working mods / modding interface.
Post Reply
charga600
Inserter
Inserter
Posts: 29
Joined: Sun May 01, 2016 11:04 am
Contact:

Auto filling a generator with a fluid

Post by charga600 »

Hey all,

I'm working on a mod to add a Fusion Reactor into the game. After a bit of trial and error (mostly error) I've settled on the idea of having the fuel crafted into the machine on creation and then when a new entity is spawned into the world adding a liquid fuel which is topped up every couple hundred ticks.
Only issue is, I don't know how to code that :P
I've been looking at Klonan's KS power mod and its components, but I don't know Lua, have really only ever coded in Java. I can understand roughly whats going on but I have no idea how to apply a similar method to my code, any help?

Thanks in advance, charga

der Papst
Burner Inserter
Burner Inserter
Posts: 15
Joined: Sun Mar 20, 2016 6:15 pm
Contact:

Re: Auto filling a generator with a fluid

Post by der Papst »

The Generator-Entity in Factorio transforms hot liquid into electricity.

Every Powerplant-Mod i've seen so far does this too, so for example the Windturbine i have seen creates hot water proportional to the wind speed.
A Generator has a fluidbox, you can simply add fluid to it in the control.lua

Post Reply

Return to “Modding help”