How do I make a power producer?

Place to get help with not working mods / modding interface.
Arcanecast
Burner Inserter
Burner Inserter
Posts: 6
Joined: Wed Jun 24, 2015 9:39 pm
Contact:

How do I make a power producer?

Post by Arcanecast »

I'm working on my first mod. What I'm trying to do is make a Wind Turbine. I want it to check to make sure there is wind and then produce a set amount of electricity. I have been looking for a good tutorial for quite some time now and can't find one. So if someone could help me that would be great. Thanks!
AC

kiba
Filter Inserter
Filter Inserter
Posts: 344
Joined: Thu Jun 11, 2015 5:32 am
Contact:

Re: How do I make a power producer?

Post by kiba »

Did you took a look at the modding tutorial?

Arcanecast
Burner Inserter
Burner Inserter
Posts: 6
Joined: Wed Jun 24, 2015 9:39 pm
Contact:

Re: How do I make a power producer?

Post by Arcanecast »

kiba wrote:Did you took a look at the modding tutorial?
Yes but it does not say how to make an entity produce power.
AC

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

Re: How do I make a power producer?

Post by orzelek »

Power production is not currently supported directly AFAIK.

You need to derive from accumulator and then set it's amount of available energy from script to "produce" power.

Arcanecast
Burner Inserter
Burner Inserter
Posts: 6
Joined: Wed Jun 24, 2015 9:39 pm
Contact:

Re: How do I make a power producer?

Post by Arcanecast »

orzelek wrote:Power production is not currently supported directly AFAIK.

You need to derive from accumulator and then set it's amount of available energy from script to "produce" power.
And how do I do that?
AC

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

Re: How do I make a power producer?

Post by orzelek »

Arcanecast wrote:
orzelek wrote:Power production is not currently supported directly AFAIK.

You need to derive from accumulator and then set it's amount of available energy from script to "produce" power.
And how do I do that?
Someone who has more experience with those would need to help - or you can find the wind power mod - I don't remember exact name of it tho.

Arcanecast
Burner Inserter
Burner Inserter
Posts: 6
Joined: Wed Jun 24, 2015 9:39 pm
Contact:

Re: How do I make a power producer?

Post by Arcanecast »

orzelek wrote:
Arcanecast wrote:
orzelek wrote:Power production is not currently supported directly AFAIK.

You need to derive from accumulator and then set it's amount of available energy from script to "produce" power.
And how do I do that?
Someone who has more experience with those would need to help - or you can find the wind power mod - I don't remember exact name of it tho.
Thanks I will try to find that mod and look it over.
AC

johanwanderer
Fast Inserter
Fast Inserter
Posts: 157
Joined: Fri Jun 26, 2015 11:13 pm

Re: How do I make a power producer?

Post by johanwanderer »

Arcanecast wrote:I'm working on my first mod. What I'm trying to do is make a Wind Turbine. I want it to check to make sure there is wind and then produce a set amount of electricity. I have been looking for a good tutorial for quite some time now and can't find one. So if someone could help me that would be great. Thanks!
Can you base your wind turbine on the steam turbine instead, and then automatically supply it with hot liquid "from the wind"? I assume(1) that if you have a connected steam turbine and mess with its fluid box to add hot fluid, it would produce power. See the wiki or my "electric boiler" mod (in signature) for an example of messing with an entity's fluid box.

1. Not really an assumption, since you can connect a steam turbine to a hot water tank and it will produce power.

Edit: Now that I think about it, you can just have your wind turbine produces hot water, and use steam turbine to generate electricity from that. The mod can then use the onBuild event to place both steam turbine and wind turbine object together when the wind turbine is built.

GotLag
Filter Inserter
Filter Inserter
Posts: 532
Joined: Sat May 03, 2014 3:32 pm
Contact:

Re: How do I make a power producer?

Post by GotLag »

What entity type would you recommend to create hot water? Would you be creating it from an onTick event in control.lua?

johanwanderer
Fast Inserter
Fast Inserter
Posts: 157
Joined: Fri Jun 26, 2015 11:13 pm

Re: How do I make a power producer?

Post by johanwanderer »

GotLag wrote:What entity type would you recommend to create hot water? Would you be creating it from an onTick event in control.lua?
Anything that has a fluidbox (which is pretty much everything in the game, but a pipe is a good example) can be used to produce water. And yes, I would use ontick() to add water into the fluidbox.

Post Reply

Return to “Modding help”