Dummy generator for power production

Place to get help with not working mods / modding interface.
Post Reply
Gotbread
Inserter
Inserter
Posts: 26
Joined: Wed Mar 11, 2015 11:14 pm
Contact:

Dummy generator for power production

Post by Gotbread »

Hello :)

Im trying to convert my mod "Transformator" to 0.12, but have trouble doing so.

Behind the scenes i use a dummy building which can be charged by one network. In the script i exctract power from it.
With this power the amount of hot water is calculated, to make a dummy steam engine run. This worked fine in 0.11,
but not in 0.12

For debugging purposes, i gave the dummy-steam-engine some fixed amount of liquid at the beginning. I expected the
fluid box to quickly empty. It does empty, however it provides unlimited power.

powerproducer:

Code: Select all

type = "generator",
    name = "powerproducer",
    icon = "__Transformator__/graphics/icons/trafoicon.png",
    flags = {"placeable-neutral","player-creation"},
    max_health = 300,
    corpse = "big-remnants",
    dying_explosion = "medium-explosion",
    effectivity = 1,
    fluid_usage_per_tick = 16.666,
    collision_mask = {"ghost-layer"},
    collision_box = {{-0.9, -0.9}, {0.9, 0.9}},
    selection_box = {{-1.0, -1.0}, {1.0, 1.0}},
    fluid_box =
    {
      base_area = 2,
      pipe_covers = pipecoverspictures(),
      pipe_connections =
      {
      },
    },
    energy_source =
    {
      type = "electric",
      usage_priority = "solar"
    },
    horizontal_animation = transparent_pic,
    vertical_animation = transparent_pic,
    working_sound =
    {
      sound =
      {
        filename = "__Transformator__/sound/MainsBrum50Hz.ogg",
        volume = 0.6
      },
      max_sounds_per_type = 3
    },
    min_perceived_performance = 0.25,
    order = "z",
    selectable_in_game = false
  },
control.lua @ init:

Code: Select all

...
local producer = create{name = "powerproducer", position =
			tarpos, force = entity.force}
...
producer.fluidbox[1] = {type="water", amount=5, temperature=25}
...
10 degree temperature difference with 5 UOL water should give an energy of 10*5*1e3 = 50kJ, but i can drain
megajoule after megajoule out of it.

When i print the amount of liquid in the fluidbox it starts at 5 but one tick later its gone to zero?
I assume the steam engine has an output buffer and converts the 5 UOL water directly to this buffer, but why
do i get more energy than it should?

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

Re: Dummy generator for power production

Post by johanwanderer »

There is some thing wonky going on with power generation and storage in 0.12. This may be part of that bug.

Gotbread
Inserter
Inserter
Posts: 26
Joined: Wed Mar 11, 2015 11:14 pm
Contact:

Re: Dummy generator for power production

Post by Gotbread »

After several tests i narrowed it down to the type of generator.

if i set the usage_priority to "solar", no luqid inside the steam engine gets used.

if i set the usage_priority to "secondary-output", the liquid gets used as normal.

if i set the usage_priority to "primary-output" the liquid gets used as normal, and the device gets prioritised above steam engines.

I think this has to do with the merge of the solarpanels and accumulators

Post Reply

Return to “Modding help”