Page 1 of 1

Generator without water

Posted: Sun Aug 10, 2014 7:42 pm
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.

Re: Generator without water

Posted: Sun Aug 10, 2014 7:59 pm
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 :))

Re: Generator without water

Posted: Tue Aug 12, 2014 6:28 pm
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.

Re: Generator without water

Posted: Tue Aug 12, 2014 6:54 pm
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...

Re: Generator without water

Posted: Tue Aug 12, 2014 7:38 pm
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)

Re: Generator without water

Posted: Wed Aug 13, 2014 10:01 am
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.

Re: Generator without water

Posted: Mon Sep 08, 2014 6:38 am
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.