Generator without water

tdzl2003
Burner Inserter
Burner Inserter
Posts: 12
Joined: Wed Apr 30, 2014 10:40 am
Contact:

Generator without water

Post by tdzl2003 »

Currently there is only one generator in game: steam-engine.
It requires heated water as input.

Is there any way to build a generator without water? like fusion-reactor or wind-generator.

There is fusion-reactor for equipment. But I don't know how to use it as a entity.
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Generator without water

Post by FreeER »

tdzl2003 wrote:Is there any way to build a generator without water? like fusion-reactor or wind-generator.
technically, no. But see this (and the post I'd linked to there).
tdzl2003 wrote:There is fusion-reactor for equipment. But I don't know how to use it as a entity.
You can't, technically, the equipment types are different from the entity types (and they are both different from the "item" type). You could give the equipment item (prototypes\item\equipment.lua) a place_result for an entity (alongside the placed_as_equipment_result for the equipment in prototypes\equipment\equipment.lua) and have it work for both placing in-world and in-armor but they are different types and the entity "generator" types require fluid.

Examples: The power limiter mod adds a dark matter generator (essentially a fusion reactor without fuel), I believe one of the MoMods has a wind generator (MoPower), there was a modding help request for a wind generator that I provided some code for, and there are likely a few more mods that do similar things that you can look at if you don't want to wait on the devs to make this available (or use instead). Shouldn't be too difficult to search for those (I don't personally feel like finding and linking to them right now :))
tdzl2003
Burner Inserter
Burner Inserter
Posts: 12
Joined: Wed Apr 30, 2014 10:40 am
Contact:

Re: Generator without water

Post by tdzl2003 »

Thanks for reply.
I posted my final solution on the post you suggested.
But I think it will be much better if there's some way to define a custom entity type.
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Generator without water

Post by FreeER »

tdzl2003 wrote:But I think it will be much better if there's some way to define a custom entity type.
Absolutely would :) see this.
I like to remind myself every now and then that you could name all of your fingers after the people working on Factorio and still have fingers unnamed and that they are focused on making their game rather than how easy it is to mod their 'unfinished' game.

As to your code: I'd suggest having a 'debug' variable and checking if it's true in your logging function, that way it's easy to turn off when it's release time :)
edit: oh, and if you wanted to go slightly overboard with a logging function then you could do something like the writeDebug function I have in Extra Utilities which allows for passing a table of booleans to the function and all of them must be be true for it to print (the 'master' debug boolean must also be false, that may change at some point since it's just the debug variable I'd been using before starting EU). Or if you really wanted to go crazy you could work out how to make a logging function that actually wrote it's output into a file with game.makefile...
Nirahiel
Filter Inserter
Filter Inserter
Posts: 351
Joined: Mon Sep 23, 2013 2:18 pm
Contact:

Re: Generator without water

Post by Nirahiel »

tdzl2003 wrote:Currently there is only one generator in game: steam-engine.
It requires heated water as input.

Is there any way to build a generator without water? like fusion-reactor or wind-generator.

There is fusion-reactor for equipment. But I don't know how to use it as a entity.
Technically a fusion reactor requires water :) (more technically hydrogen isotopes but w/e)
scrangos
Burner Inserter
Burner Inserter
Posts: 10
Joined: Mon Apr 21, 2014 6:27 pm
Contact:

Re: Generator without water

Post by scrangos »

Arent fusion reactors a type of boiler per se? You use the reaction heat to warm up water for a steam engine to generate electricity with.
tdzl2003
Burner Inserter
Burner Inserter
Posts: 12
Joined: Wed Apr 30, 2014 10:40 am
Contact:

Re: Generator without water

Post by tdzl2003 »

In a fusion reactor, water will be used repeatly, not just discharged to air. So fusion reactor can use less water for much more power.

But this is very hard to emulate in game, so I think the simplest way is just let some building "generate" power.
Post Reply

Return to “Implemented mod requests”