Page 1 of 1

Burner generator entity for modded

Posted: Fri Jun 22, 2018 7:24 pm
by Hexicube
Re-suggesting this in light of FFF #248, and also since there's no clean way to do this with the entities available.

Right now if I want to implement a burner generator in modded I have to create the following:

- A water generator
- A steam engine
- If I want a burn result, an extra entity to extract that with
- Lua code to ensure those entities are made to look like a single entity to the player, and to handle that burn result

This is extremely inefficient, and annoying to boot. This is made worse when you realise what I'm actually trying to do with this is remove unwanted functionality from steam engines by simplifying it directly to fuel->power instead of using water as an intermediate. I would imagine this is an extremely simple thing to do code-wise, since you'd effectively be copying parts of boilers and engines.

I already have a use-case for such an entity in a mod, which is to have rechargeable batteries as a compact power source for outposts and to also create more powerful laser turrets that uses these batteries as "ammo".

Re: Burner generator entity for modded

Posted: Fri Jun 22, 2018 8:48 pm
by Bilka
Moved to Modding interface requests

Re: Burner generator entity for modded

Posted: Mon Jun 25, 2018 9:56 am
by bobingabout
the generator can burn fluids now.

but this is one of the things I want myself. "An entity that takes any energy input, but outputs electricity", and same again with outputting heat.

Currently, this is a bit limited, since the only fuel sources are Burner, Heat, and Electricity. Heat and Electricity can be outputs, but Burner is input only.
I want to add Fluid, Solar, Wind and None (free energy) to that list of power inputs too.
Having an entity that takes any fuel input and outputs electricity is a project in itself, as are the additional fuel types.

I am hoping to see such a thing in 0.17, even if I have to try and program it myself. (Source access modder here)

Re: Burner generator entity for modded

Posted: Mon Jun 25, 2018 6:00 pm
by orzelek
bobingabout wrote:the generator can burn fluids now.

but this is one of the things I want myself. "An entity that takes any energy input, but outputs electricity", and same again with outputting heat.

Currently, this is a bit limited, since the only fuel sources are Burner, Heat, and Electricity. Heat and Electricity can be outputs, but Burner is input only.
I want to add Fluid, Solar, Wind and None (free energy) to that list of power inputs too.
Having an entity that takes any fuel input and outputs electricity is a project in itself, as are the additional fuel types.

I am hoping to see such a thing in 0.17, even if I have to try and program it myself. (Source access modder here)
You make me regret I did not make it to the source access modders at any point.
Since things like this would be very useful and I do C/C++ for living :)

(Not to mention I was tempted to redo RSO in C++ and try to get it into base game as an option. It would be so much better then lua.)

Re: Burner generator entity for modded

Posted: Tue Jun 26, 2018 8:33 am
by bobingabout
orzelek wrote:
bobingabout wrote:the generator can burn fluids now.

but this is one of the things I want myself. "An entity that takes any energy input, but outputs electricity", and same again with outputting heat.

Currently, this is a bit limited, since the only fuel sources are Burner, Heat, and Electricity. Heat and Electricity can be outputs, but Burner is input only.
I want to add Fluid, Solar, Wind and None (free energy) to that list of power inputs too.
Having an entity that takes any fuel input and outputs electricity is a project in itself, as are the additional fuel types.

I am hoping to see such a thing in 0.17, even if I have to try and program it myself. (Source access modder here)
You make me regret I did not make it to the source access modders at any point.
Since things like this would be very useful and I do C/C++ for living :)

(Not to mention I was tempted to redo RSO in C++ and try to get it into base game as an option. It would be so much better then lua.)
if I'm not mistaken, RSO is the top of the list of mods when sorted by most downloaded. It's the only mod that beats bob's mods. I think you'd have a fair case for requesting Source access.

Re: Burner generator entity for modded

Posted: Mon Aug 13, 2018 8:02 am
by Bilka
I have changed the generator to accept the burner property, and the fluid_box property is now optional, so you can make an entity that consumes fuel and produces power in 0.17. Here is a code example:

Code: Select all

local burner_generator = util.table.deepcopy(data.raw["generator"]["steam-engine"])
burner_generator.name = "burner-generator"
burner_generator.fluid_box = nil
burner_generator.max_power_output = "1.5MW"
burner_generator.minable = {mining_time = 1, result = "burner-generator"}
burner_generator.burner =
{
  fuel_category = "chemical",
  effectivity = 0.5,
  fuel_inventory_size = 1
}
data.raw["generator"][burner_generator.name] = burner_generator