Burner generator entity for modded

Post Reply
Hexicube
Fast Inserter
Fast Inserter
Posts: 204
Joined: Wed Feb 24, 2016 9:50 pm
Contact:

Burner generator entity for modded

Post 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".

Bilka
Factorio Staff
Factorio Staff
Posts: 3129
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Burner generator entity for modded

Post by Bilka »

Moved to Modding interface requests
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Burner generator entity for modded

Post 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)
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Burner generator entity for modded

Post 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.)

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Burner generator entity for modded

Post 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.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

Bilka
Factorio Staff
Factorio Staff
Posts: 3129
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Burner generator entity for modded

Post 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
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Implemented mod requests”