Page 1 of 1
How do I make a power producer?
Posted: Wed Jul 08, 2015 11:56 am
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!
Re: How do I make a power producer?
Posted: Wed Jul 08, 2015 12:10 pm
by kiba
Did you took a look at the
modding tutorial?
Re: How do I make a power producer?
Posted: Wed Jul 08, 2015 1:55 pm
by Arcanecast
Yes but it does not say how to make an entity produce power.
Re: How do I make a power producer?
Posted: Wed Jul 08, 2015 4:23 pm
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.
Re: How do I make a power producer?
Posted: Wed Jul 08, 2015 4:52 pm
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?
Re: How do I make a power producer?
Posted: Wed Jul 08, 2015 6:42 pm
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.
Re: How do I make a power producer?
Posted: Wed Jul 08, 2015 7:36 pm
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.
Re: How do I make a power producer?
Posted: Thu Jul 09, 2015 3:54 am
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.
Re: How do I make a power producer?
Posted: Wed Jul 15, 2015 4:37 am
by GotLag
What entity type would you recommend to create hot water? Would you be creating it from an onTick event in control.lua?
Re: How do I make a power producer?
Posted: Wed Jul 15, 2015 7:15 pm
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.