Page 1 of 1

Auto filling a generator with a fluid

Posted: Wed May 25, 2016 11:41 pm
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

Re: Auto filling a generator with a fluid

Posted: Fri May 27, 2016 4:08 pm
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