From 0dde92fa65073c5a1860e5c842f652acb78b90e0 Mon Sep 17 00:00:00 2001 From: protocol-1903 Date: Mon, 15 Dec 2025 01:11:39 -0700 Subject: [PATCH 1/9] first pass updates, only HAWT 1 has been modified so far --- data-updates.lua | 2 +- data.lua | 3 + locale/en/extra.cfg | 12 +++- prototypes/buildings/hawt-turbine-mk01.lua | 11 ++-- prototypes/surface-properties.lua | 28 +++++++++ scripts/wind/variation.lua | 12 ---- scripts/wind/wind.lua | 68 +++++++++++----------- 7 files changed, 82 insertions(+), 54 deletions(-) create mode 100644 prototypes/surface-properties.lua delete mode 100644 scripts/wind/variation.lua diff --git a/data-updates.lua b/data-updates.lua index ef79e829..4588329b 100644 --- a/data-updates.lua +++ b/data-updates.lua @@ -167,7 +167,7 @@ for name, variance in pairs(require "scripts.wind.variation") do end local electric_energy_interfaces = { - "hawt-turbine-mk01", + -- "hawt-turbine-mk01", "hawt-turbine-mk02", "hawt-turbine-mk03", "hawt-turbine-mk04", diff --git a/data.lua b/data.lua index 16968e1b..ed5de36b 100644 --- a/data.lua +++ b/data.lua @@ -303,6 +303,9 @@ require "prototypes.animations.hawt-turbine-mk04" require "prototypes.decay.decay" +--(( OTHER )) +require "prototypes.surface-properties" + data.raw.fluid["crude-oil"].subgroup = "test" data.raw.fluid["gasoline"].subgroup = "test" data.raw.fluid["fatty-acids"].fuel_value = "1MJ" diff --git a/locale/en/extra.cfg b/locale/en/extra.cfg index dd1adeb0..fda92269 100644 --- a/locale/en/extra.cfg +++ b/locale/en/extra.cfg @@ -45,4 +45,14 @@ stranded=An aerial turbine [item=__1__] was stranded @ [gps=__2__,__3__] [entity-status] requires-moonlight=Requires moonlight -requires-sunlight=Requires sunlight \ No newline at end of file +requires-sunlight=Requires sunlight + +[surface-property] +py-wind-speed=Wind speed [kmph] +py-wind-speed-min=Minimum wind speed [kmph] +py-wind-speed-max=Maximum wind speed [kmph] + +[surface-property-unit] +py-wind-speed=__1__ kmph +py-wind-speed-min=__1__ kmph +py-wind-speed-max=__1__ kmph \ No newline at end of file diff --git a/prototypes/buildings/hawt-turbine-mk01.lua b/prototypes/buildings/hawt-turbine-mk01.lua index bbc434c6..aaa40d62 100644 --- a/prototypes/buildings/hawt-turbine-mk01.lua +++ b/prototypes/buildings/hawt-turbine-mk01.lua @@ -33,7 +33,7 @@ ITEM { } local proto = ENTITY { - type = "electric-energy-interface", + type = "solar-panel", name = "hawt-turbine-mk01", icon = "__pyalternativeenergygraphics__/graphics/icons/hawt-turbine-mk01.png", icon_size = 64, @@ -50,13 +50,14 @@ local proto = ENTITY { selection_box = {{-3.5, -3.5}, {3.5, 3.5}}, energy_source = { type = "electric", - usage_priority = "primary-output", + usage_priority = "solar", buffer_capacity = "5MJ", - input_flow_limit = "0W", render_no_power_icon = false }, - energy_production = "5MW", - energy_usage = "0kW", + production = "50kW", + solar_coefficient_property = "py-wind-speed", + performance_at_day = 1, + performance_at_night = 1, impact_category = "metal-large", working_sound = { sound = {filename = "__pyalternativeenergygraphics__/sounds/hawt-turbine-mk01.ogg", volume = 0.85}, diff --git a/prototypes/surface-properties.lua b/prototypes/surface-properties.lua new file mode 100644 index 00000000..b0bd2abb --- /dev/null +++ b/prototypes/surface-properties.lua @@ -0,0 +1,28 @@ +data:extend{ + { -- value modulated at runtime. does nothing when set during data stage + type = "surface-property", + name = "py-wind-speed", + default_value = 1, + }, + { -- minimum wind speed km/h + type = "surface-property", + name = "py-wind-speed-min", + default_value = 0, + }, + { -- maximum wind speed km/h + type = "surface-property", + name = "py-wind-speed-max", + default_value = 0, + }, + { -- speed at which wind speed changes. 0 is disabled, 1 is normal, > 1 is faster changes, < 1 is slower changes + type = "surface-property", + name = "py-wind-speed-variance", + default_value = 1, + hidden = true, + hidden_in_factoriopedia = true + } +} + +data.raw.planet.nauvis.surface_properties = data.raw.planet.nauvis.surface_properties or {} +data.raw.planet.nauvis.surface_properties["py-wind-speed-min"] = 20 -- 20 km/h +data.raw.planet.nauvis.surface_properties["py-wind-speed-max"] = 100 -- 100 km/h \ No newline at end of file diff --git a/scripts/wind/variation.lua b/scripts/wind/variation.lua deleted file mode 100644 index 95176d62..00000000 --- a/scripts/wind/variation.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - ["hawt-turbine-mk01"] = 0.5, - ["hawt-turbine-mk02"] = 0.5, - ["hawt-turbine-mk03"] = 0.5, - ["hawt-turbine-mk04"] = 0.5, - ["vawt-turbine-mk01"] = 0.7, - ["vawt-turbine-mk02"] = 0.7, - ["vawt-turbine-mk03"] = 0.7, - ["vawt-turbine-mk04"] = 0.7, - ["multiblade-turbine-mk01"] = 0.9, - ["multiblade-turbine-mk03"] = 0.8, -} diff --git a/scripts/wind/wind.lua b/scripts/wind/wind.lua index 1ce06f98..c0f3e9fc 100644 --- a/scripts/wind/wind.lua +++ b/scripts/wind/wind.lua @@ -124,7 +124,6 @@ Wind.events.on_built = function(event) end storage.windmill[entry.entity.unit_number] = entry - Wind.update_power_generation(entry, Wind.calculate_wind_speed()) end local function positions_equal(position_a, position_b) @@ -239,46 +238,45 @@ function Wind.calculate_wind_direction(surface) end end +-- double sine wave out of sync, clamped [0, 1] local sin = math.sin local pi = math.pi -function Wind.calculate_wind_speed() - local x = game.tick / 10000 - return (sin(2 * x) + sin(pi * x)) / 2 -end - -function Wind.update_power_generation(windmill_data, wind_speed) - local entity = windmill_data.entity - local power_output = entity.prototype.get_max_energy_production() * (1 + variation[windmill_data.base_name] * wind_speed) - entity.power_production = power_output - entity.electric_buffer_size = power_output +function Wind.calculate_wind_speed(variance) + local x = game.tick / 10000 * variance + return (sin(2 * x) + sin(pi * x)) / 4 + 0.5 end Wind.events[61] = function() - local wind_speed = Wind.calculate_wind_speed() - local direction = Wind.calculate_wind_direction(game.surfaces["nauvis"]) + for _, surface in pairs(game.surfaces) do + -- windspeed calculations + local variance = surface.get_property("py-wind-speed-variance") + local min_speed = surface.get_property("py-wind-speed-min") + local max_speed = surface.get_property("py-wind-speed-max") + local wind_speed = Wind.calculate_wind_speed(variance) * (max_speed - min_speed) + min_speed -- adjusted to [min, max] + surface.set_property("py-wind-speed", wind_speed) - local key, details = storage.last_windmill, nil - local max_iter = 0 - repeat - max_iter = max_iter + 1 - key, details = next(storage.windmill, key) - -- Empty table or end of list - if not key or not details then - break - end - if details.entity.valid then - if animated_turbines[details.turbine_type] then - Wind.draw_windmill(details, direction) + -- wind direction calculations + local direction = Wind.calculate_wind_direction(surface) + local key, details = storage.last_windmill, nil + local max_iter = 0 + repeat + max_iter = max_iter + 1 + key, details = next(storage.windmill, key) + -- Empty table or end of list + if not key or not details then + break end - Wind.update_power_generation(details, wind_speed) - else - _ = details.collision.valid and details.collision.destroy() - if details.anim_id then - local animation = rendering.get_object_by_id(details.anim_id) - if animation then animation.destroy() end + if details.entity.valid and animated_turbines[details.turbine_type] then + Wind.draw_windmill(details, direction) + else + _ = details.collision.valid and details.collision.destroy() + if details.anim_id then + local animation = rendering.get_object_by_id(details.anim_id) + if animation then animation.destroy() end + end + storage.windmill[key] = nil end - storage.windmill[key] = nil - end - until max_iter > 101 - storage.last_windmill = key + until max_iter > 101 + storage.last_windmill = key + end end From 6beaa8c0ff011d0ac3c593fb78a1f1050676c4ca Mon Sep 17 00:00:00 2001 From: protocol-1903 Date: Mon, 15 Dec 2025 01:13:34 -0700 Subject: [PATCH 2/9] dont delete missing visualizations --- scripts/wind/wind.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/wind/wind.lua b/scripts/wind/wind.lua index c0f3e9fc..5c7684d1 100644 --- a/scripts/wind/wind.lua +++ b/scripts/wind/wind.lua @@ -268,7 +268,7 @@ Wind.events[61] = function() end if details.entity.valid and animated_turbines[details.turbine_type] then Wind.draw_windmill(details, direction) - else + elseif not details.entity.valid then _ = details.collision.valid and details.collision.destroy() if details.anim_id then local animation = rendering.get_object_by_id(details.anim_id) From 21f314518f797c8fcef75d0247c71bcb42c4eb04 Mon Sep 17 00:00:00 2001 From: protocol-1903 Date: Mon, 15 Dec 2025 20:53:24 -0700 Subject: [PATCH 3/9] remove references to variation --- scripts/wind/wind.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/wind/wind.lua b/scripts/wind/wind.lua index 5c7684d1..a97d18b5 100644 --- a/scripts/wind/wind.lua +++ b/scripts/wind/wind.lua @@ -26,7 +26,6 @@ local animated_turbines = { ["multiblade"] = true } -local variation = require "scripts.wind.variation" -- TODO check animation changes local draw_animation = rendering.draw_animation From 5e1ff99cd34bdfbefc4cd58e37c1a458758dd0ed Mon Sep 17 00:00:00 2001 From: protocol-1903 Date: Mon, 15 Dec 2025 20:55:47 -0700 Subject: [PATCH 4/9] remove more references --- data-updates.lua | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/data-updates.lua b/data-updates.lua index 4588329b..ba63f6b4 100644 --- a/data-updates.lua +++ b/data-updates.lua @@ -151,20 +151,20 @@ end --ENERGY COSTS-- --ENERGY PRODUCTION DESCRIPTION -- -for name, variance in pairs(require "scripts.wind.variation") do - variance = {"entity-description.variance", tostring(variance * 100)} - -- Handle the surrogate items that show in electric stats, too - for _, suffix in pairs {"", "-blank"} do - local entity = data.raw["electric-energy-interface"][name .. suffix] - if entity then - if entity.localised_description then - entity.localised_description = {"", entity.localised_description, "\n", variance} - else - entity.localised_description = {"?", {"", {"entity-description." .. name}, "\n", variance}, variance} - end - end - end -end +-- for name, variance in pairs(require "scripts.wind.variation") do +-- variance = {"entity-description.variance", tostring(variance * 100)} +-- -- Handle the surrogate items that show in electric stats, too +-- for _, suffix in pairs {"", "-blank"} do +-- local entity = data.raw["electric-energy-interface"][name .. suffix] +-- if entity then +-- if entity.localised_description then +-- entity.localised_description = {"", entity.localised_description, "\n", variance} +-- else +-- entity.localised_description = {"?", {"", {"entity-description." .. name}, "\n", variance}, variance} +-- end +-- end +-- end +-- end local electric_energy_interfaces = { -- "hawt-turbine-mk01", From f37599080ba124243dedc8940ae62026f47de60d Mon Sep 17 00:00:00 2001 From: protocol-1903 Date: Thu, 18 Dec 2025 23:53:41 -0700 Subject: [PATCH 5/9] allow the animation to work, again --- prototypes/buildings/hawt-turbine-mk01.lua | 64 +++++++++++----------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/prototypes/buildings/hawt-turbine-mk01.lua b/prototypes/buildings/hawt-turbine-mk01.lua index aaa40d62..4adf9d1d 100644 --- a/prototypes/buildings/hawt-turbine-mk01.lua +++ b/prototypes/buildings/hawt-turbine-mk01.lua @@ -64,8 +64,7 @@ local proto = ENTITY { idle_sound = {filename = "__pyalternativeenergygraphics__/sounds/hawt-turbine-mk01.ogg", volume = 0.6}, apparent_volume = 2.5 }, - continuous_animation = true, - animations = { + picture = { layers = { { filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk01/r4.png", @@ -75,33 +74,36 @@ local proto = ENTITY { frame_count = 30, shift = util.by_pixel(0, -20), animation_speed = 0.4 - }, { - filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk01/a4.png", - width = 224, - height = 288, - line_length = 6, - frame_count = 30, - shift = util.by_pixel(0, -20), - animation_speed = 0.4 - }, { - filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk01/s4.png", - width = 256, - height = 224, - line_length = 6, - frame_count = 30, - shift = util.by_pixel(0, -20), - animation_speed = 0.4, - draw_as_shadow = true - }, { - filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk01/l4.png", - width = 224, - height = 288, - line_length = 6, - frame_count = 30, - shift = util.by_pixel(0, -20), - animation_speed = 0.13, - draw_as_glow = true - }, + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk01/a4.png", + width = 224, + height = 288, + line_length = 6, + frame_count = 30, + shift = util.by_pixel(0, -20), + animation_speed = 0.4 + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk01/s4.png", + width = 256, + height = 224, + line_length = 6, + frame_count = 30, + shift = util.by_pixel(0, -20), + animation_speed = 0.4, + draw_as_shadow = true + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk01/l4.png", + width = 224, + height = 288, + line_length = 6, + frame_count = 30, + shift = util.by_pixel(0, -20), + animation_speed = 0.13, + draw_as_glow = true + } } }, localised_name = {"entity-name.hawt-turbine-mk01"}, @@ -111,9 +113,9 @@ local proto = ENTITY { -- Make a copy with only the base animation local new_proto = table.deepcopy(proto) new_proto.name = proto.name .. "-blank" -new_proto.picture = table.deepcopy(proto.animations.layers[1]) +new_proto.picture = table.deepcopy(proto.picture.layers[1]) new_proto.picture.filename = new_proto.picture.filename:gsub("r4", "base-mk01") -new_proto.animations = nil +-- new_proto.picture = nil new_proto.render_layer = "lower-object-above-shadow" data:extend {new_proto} From ff4a133e09cd6733722c1c37c5e2ebc603f296fd Mon Sep 17 00:00:00 2001 From: protocol-1903 Date: Fri, 19 Dec 2025 00:11:13 -0700 Subject: [PATCH 6/9] allow mk02-4 to work --- data-updates.lua | 28 +++++++++---------- prototypes/buildings/hawt-turbine-mk01.lua | 16 +---------- prototypes/buildings/hawt-turbine-mk02.lua | 31 ++++++---------------- prototypes/buildings/hawt-turbine-mk03.lua | 27 ++++++------------- prototypes/buildings/hawt-turbine-mk04.lua | 22 ++++++--------- 5 files changed, 39 insertions(+), 85 deletions(-) diff --git a/data-updates.lua b/data-updates.lua index ba63f6b4..6383b137 100644 --- a/data-updates.lua +++ b/data-updates.lua @@ -167,7 +167,7 @@ end -- end local electric_energy_interfaces = { - -- "hawt-turbine-mk01", + "hawt-turbine-mk01", "hawt-turbine-mk02", "hawt-turbine-mk03", "hawt-turbine-mk04", @@ -181,19 +181,19 @@ local electric_energy_interfaces = { "solar-panel-mk03", } -for _, name in pairs(electric_energy_interfaces) do - local item = data.raw.item[name] - local entity = data.raw["electric-energy-interface"][name] - local output = {"entity-description.max-output", tostring(entity.energy_production)} - if item.localised_description then - item.localised_description = {"", item.localised_description, "\n", (output)} - elseif entity.localised_description then - item.localised_description = {"", entity.localised_description, "\n", output} - else - item.localised_description = {"?", {"", {"entity-description." .. name}, "\n", output}, output} - end - entity.energy_source.buffer_capacity = entity.energy_production -end +-- for _, name in pairs(electric_energy_interfaces) do +-- local item = data.raw.item[name] +-- local entity = data.raw["electric-energy-interface"][name] +-- local output = {"entity-description.max-output", tostring(entity.energy_production)} +-- if item.localised_description then +-- item.localised_description = {"", item.localised_description, "\n", (output)} +-- elseif entity.localised_description then +-- item.localised_description = {"", entity.localised_description, "\n", output} +-- else +-- item.localised_description = {"?", {"", {"entity-description." .. name}, "\n", output}, output} +-- end +-- entity.energy_source.buffer_capacity = entity.energy_production +-- end local molten_salt_recipes = { "biomass-molten-salt-0", diff --git a/prototypes/buildings/hawt-turbine-mk01.lua b/prototypes/buildings/hawt-turbine-mk01.lua index 4adf9d1d..c3422349 100644 --- a/prototypes/buildings/hawt-turbine-mk01.lua +++ b/prototypes/buildings/hawt-turbine-mk01.lua @@ -54,7 +54,7 @@ local proto = ENTITY { buffer_capacity = "5MJ", render_no_power_icon = false }, - production = "50kW", + production = "100kW", solar_coefficient_property = "py-wind-speed", performance_at_day = 1, performance_at_night = 1, @@ -70,38 +70,26 @@ local proto = ENTITY { filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk01/r4.png", width = 224, height = 288, - line_length = 6, - frame_count = 30, shift = util.by_pixel(0, -20), - animation_speed = 0.4 }, { filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk01/a4.png", width = 224, height = 288, - line_length = 6, - frame_count = 30, shift = util.by_pixel(0, -20), - animation_speed = 0.4 }, { filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk01/s4.png", width = 256, height = 224, - line_length = 6, - frame_count = 30, shift = util.by_pixel(0, -20), - animation_speed = 0.4, draw_as_shadow = true }, { filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk01/l4.png", width = 224, height = 288, - line_length = 6, - frame_count = 30, shift = util.by_pixel(0, -20), - animation_speed = 0.13, draw_as_glow = true } } @@ -115,8 +103,6 @@ local new_proto = table.deepcopy(proto) new_proto.name = proto.name .. "-blank" new_proto.picture = table.deepcopy(proto.picture.layers[1]) new_proto.picture.filename = new_proto.picture.filename:gsub("r4", "base-mk01") --- new_proto.picture = nil -new_proto.render_layer = "lower-object-above-shadow" data:extend {new_proto} data:extend diff --git a/prototypes/buildings/hawt-turbine-mk02.lua b/prototypes/buildings/hawt-turbine-mk02.lua index 0ee7265d..72942ec3 100644 --- a/prototypes/buildings/hawt-turbine-mk02.lua +++ b/prototypes/buildings/hawt-turbine-mk02.lua @@ -29,7 +29,7 @@ ITEM { } local proto = ENTITY { - type = "electric-energy-interface", + type = "solar-panel", name = "hawt-turbine-mk02", icon = "__pyalternativeenergygraphics__/graphics/icons/hawt-turbine-mk02.png", icon_size = 64, @@ -46,59 +46,46 @@ local proto = ENTITY { selection_box = {{-3.5, -3.5}, {3.5, 3.5}}, energy_source = { type = "electric", - usage_priority = "primary-output", - + usage_priority = "solar", buffer_capacity = "25MJ", - input_flow_limit = "0W", render_no_power_icon = false }, - energy_production = "25MW", - energy_usage = "0kW", + production = "500kW", + solar_coefficient_property = "py-wind-speed", + performance_at_day = 1, + performance_at_night = 1, impact_category = "metal-large", working_sound = { sound = {filename = "__pyalternativeenergygraphics__/sounds/hawt-turbine-mk02.ogg", volume = 1.2}, idle_sound = {filename = "__pyalternativeenergygraphics__/sounds/hawt-turbine-mk02.ogg", volume = 0.8}, apparent_volume = 2.5 }, - continuous_animation = true, - animations = { + picture = { layers = { { filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk02/r4.png", width = 224, height = 352, - line_length = 6, - frame_count = 30, shift = util.by_pixel(0, -64), - animation_speed = 0.35, }, { filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk02/a4.png", width = 224, height = 352, - line_length = 6, - frame_count = 30, shift = util.by_pixel(0, -64), - animation_speed = 0.35, }, { filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk02/s4.png", width = 256, height = 224, - line_length = 6, - frame_count = 30, shift = util.by_pixel(16, 0), - animation_speed = 0.35, draw_as_shadow = true, }, { filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk02/l4.png", width = 224, height = 352, - line_length = 6, - frame_count = 30, shift = util.by_pixel(0, -64), - animation_speed = 0.35, draw_as_glow = true, }, } @@ -110,10 +97,8 @@ local proto = ENTITY { -- Make a copy with only the base animation local new_proto = table.deepcopy(proto) new_proto.name = proto.name .. "-blank" -new_proto.picture = table.deepcopy(proto.animations.layers[1]) +new_proto.picture = table.deepcopy(proto.picture.layers[1]) new_proto.picture.filename = new_proto.picture.filename:gsub("r4", "base-mk02") -new_proto.animations = nil -new_proto.render_layer = "lower-object-above-shadow" data:extend {new_proto} data:extend diff --git a/prototypes/buildings/hawt-turbine-mk03.lua b/prototypes/buildings/hawt-turbine-mk03.lua index 76cc5b2e..ea0e4899 100644 --- a/prototypes/buildings/hawt-turbine-mk03.lua +++ b/prototypes/buildings/hawt-turbine-mk03.lua @@ -29,7 +29,7 @@ ITEM { } local proto = ENTITY { - type = "electric-energy-interface", + type = "solar-panel", name = "hawt-turbine-mk03", icon = "__pyalternativeenergygraphics__/graphics/icons/hawt-turbine-mk03.png", icon_size = 64, @@ -46,49 +46,40 @@ local proto = ENTITY { selection_box = {{-3.0, -3.0}, {3.0, 3.0}}, energy_source = { type = "electric", - usage_priority = "primary-output", + usage_priority = "solar", buffer_capacity = "50MJ", - input_flow_limit = "0W", render_no_power_icon = false }, - energy_production = "50MW", - energy_usage = "0kW", + production = "2.5MW", + solar_coefficient_property = "py-wind-speed", + performance_at_day = 1, + performance_at_night = 1, impact_category = "metal-large", working_sound = { sound = {filename = "__pyalternativeenergygraphics__/sounds/hawt-turbine-mk03.ogg", volume = 0.85}, idle_sound = {filename = "__pyalternativeenergygraphics__/sounds/hawt-turbine-mk03.ogg", volume = 0.6}, apparent_volume = 2.5 }, - continuous_animation = true, - animations = { + picture = { layers = { { filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk03/r4.png", width = 192, height = 416, - line_length = 10, - frame_count = 20, shift = util.by_pixel(0, -112), - animation_speed = 1, }, { filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk03/s4.png", width = 287, height = 160, - line_length = 5, - frame_count = 20, shift = util.by_pixel(44, 16), - animation_speed = 1, draw_as_shadow = true, }, { filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk03/l4.png", width = 192, height = 416, - line_length = 10, - frame_count = 20, shift = util.by_pixel(0, -112), - animation_speed = 1, draw_as_glow = true, }, } @@ -100,10 +91,8 @@ local proto = ENTITY { -- Make a copy with only the base animation local new_proto = table.deepcopy(proto) new_proto.name = proto.name .. "-blank" -new_proto.picture = table.deepcopy(proto.animations.layers[1]) +new_proto.picture = table.deepcopy(proto.picture.layers[1]) new_proto.picture.filename = new_proto.picture.filename:gsub("r4", "base-mk03") -new_proto.animations = nil -new_proto.render_layer = "lower-object-above-shadow" data:extend {new_proto} data:extend diff --git a/prototypes/buildings/hawt-turbine-mk04.lua b/prototypes/buildings/hawt-turbine-mk04.lua index f96298e5..a4f7dc79 100644 --- a/prototypes/buildings/hawt-turbine-mk04.lua +++ b/prototypes/buildings/hawt-turbine-mk04.lua @@ -27,7 +27,7 @@ ITEM { } local proto = ENTITY { - type = "electric-energy-interface", + type = "solar-panel", name = "hawt-turbine-mk04", icon = "__pyalternativeenergygraphics__/graphics/icons/hawt-turbine-mk04.png", icon_size = 64, @@ -44,41 +44,38 @@ local proto = ENTITY { selection_box = {{-4.5, -4.5}, {4.5, 4.5}}, energy_source = { type = "electric", - usage_priority = "primary-output", + usage_priority = "solar", buffer_capacity = "80MJ", - input_flow_limit = "0W", render_no_power_icon = false }, - energy_production = "80MW", - energy_usage = "0kW", + production = "8MW", + solar_coefficient_property = "py-wind-speed", + performance_at_day = 1, + performance_at_night = 1, impact_category = "metal-large", working_sound = { sound = {filename = "__pyalternativeenergygraphics__/sounds/hawt-turbine-mk04.ogg", volume = 1.6}, idle_sound = {filename = "__pyalternativeenergygraphics__/sounds/hawt-turbine-mk04.ogg", volume = 1.4}, apparent_volume = 2.5 }, - continuous_animation = true, - animations = { + picture = { layers = { { filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk04/r4.png", width = 352, height = 416, - frame_count = 1, shift = util.by_pixel(0, -64), }, { filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk04/a4.png", width = 352, height = 416, - frame_count = 1, shift = util.by_pixel(0, -64), }, { filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk04/s4.png", width = 352, height = 256, - frame_count = 1, shift = util.by_pixel(50, 25), draw_as_shadow = true, }, @@ -86,7 +83,6 @@ local proto = ENTITY { filename = "__pyalternativeenergygraphics__/graphics/entity/hawt-turbine-mk04/l4.png", width = 352, height = 416, - frame_count = 1, shift = util.by_pixel(0, -64), draw_as_glow = true, }, @@ -99,10 +95,8 @@ local proto = ENTITY { -- Make a copy with only the base animation local new_proto = table.deepcopy(proto) new_proto.name = proto.name .. "-blank" -new_proto.picture = table.deepcopy(proto.animations.layers[1]) +new_proto.picture = table.deepcopy(proto.picture.layers[1]) new_proto.picture.filename = new_proto.picture.filename:gsub("r4", "base-mk04") -new_proto.animations = nil -new_proto.render_layer = "lower-object-above-shadow" data:extend {new_proto} data:extend From 411e3fa2ef7bac240ca976f43f9710321b6fe550 Mon Sep 17 00:00:00 2001 From: protocol-1903 Date: Sat, 20 Dec 2025 21:38:44 -0700 Subject: [PATCH 7/9] get multiblade turbines to work --- .../buildings/multiblade-turbine-mk01.lua | 30 +++++------------ .../buildings/multiblade-turbine-mk03.lua | 33 +++++-------------- 2 files changed, 18 insertions(+), 45 deletions(-) diff --git a/prototypes/buildings/multiblade-turbine-mk01.lua b/prototypes/buildings/multiblade-turbine-mk01.lua index cd826b0f..3124fce0 100644 --- a/prototypes/buildings/multiblade-turbine-mk01.lua +++ b/prototypes/buildings/multiblade-turbine-mk01.lua @@ -29,7 +29,7 @@ ITEM { } local proto = ENTITY { - type = "electric-energy-interface", + type = "solar-panel", name = "multiblade-turbine-mk01", icon = "__pyalternativeenergygraphics__/graphics/icons/multiblade-turbine-mk01.png", icon_size = 64, @@ -45,44 +45,34 @@ local proto = ENTITY { selection_box = {{-3.5, -3.5}, {3.5, 3.5}}, energy_source = { type = "electric", - usage_priority = "primary-output", - buffer_capacity = "550kW", - input_flow_limit = "0W", + usage_priority = "solar", + buffer_capacity = "550kJ", render_no_power_icon = false }, - energy_production = "550kW", - energy_usage = "0kW", + production = "120kW", + solar_coefficient_property = "py-wind-speed", + performance_at_day = 1, + performance_at_night = 1, impact_category = "metal-large", - continuous_animation = true, - animations = { + picture = { layers = { { filename = "__pyalternativeenergygraphics__/graphics/entity/multiblade-turbine-mk01/base-fishturbine.png", width = 224, height = 224, - line_length = 1, - frame_count = 1, - repeat_count = 30, - --shift = util.by_pixel(0, -64), animation_speed = 0.5, }, { filename = "__pyalternativeenergygraphics__/graphics/entity/multiblade-turbine-mk01/r4.png", width = 288, height = 352, - line_length = 6, - frame_count = 30, shift = util.by_pixel(0, -64), - animation_speed = 0.5, }, { filename = "__pyalternativeenergygraphics__/graphics/entity/multiblade-turbine-mk01/s4.png", width = 288, height = 352, - line_length = 6, - frame_count = 30, shift = util.by_pixel(0, -64), - animation_speed = 0.5, draw_as_shadow = true }, } @@ -94,9 +84,7 @@ local proto = ENTITY { -- Make a copy with only the base animation local new_proto = table.deepcopy(proto) new_proto.name = proto.name .. "-blank" -new_proto.picture = proto.animations.layers[1] -new_proto.animations = nil -new_proto.render_layer = "floor-mechanics" +new_proto.picture = table.deepcopy(proto.picture.layers[1]) data:extend {new_proto} data:extend {{ diff --git a/prototypes/buildings/multiblade-turbine-mk03.lua b/prototypes/buildings/multiblade-turbine-mk03.lua index 0bc5e9fc..05942e5f 100644 --- a/prototypes/buildings/multiblade-turbine-mk03.lua +++ b/prototypes/buildings/multiblade-turbine-mk03.lua @@ -29,7 +29,7 @@ ITEM { } local proto = ENTITY { - type = "electric-energy-interface", + type = "solar-panel", name = "multiblade-turbine-mk03", icon = "__pyalternativeenergygraphics__/graphics/icons/multiblade-turbine-mk03.png", icon_size = 64, @@ -45,58 +45,45 @@ local proto = ENTITY { selection_box = {{-4.5, -4.5}, {4.5, 4.5}}, energy_source = { type = "electric", - usage_priority = "primary-output", - buffer_capacity = "34MW", - input_flow_limit = "0W", + usage_priority = "solar", + buffer_capacity = "34MJ", render_no_power_icon = false }, - energy_production = "34MW", - energy_usage = "0kW", + production = "7MW", + solar_coefficient_property = "py-wind-speed", + performance_at_day = 1, + performance_at_night = 1, impact_category = "metal-large", working_sound = { sound = {filename = "__pyalternativeenergygraphics__/sounds/multiblade-turbine-mk03.ogg", volume = 0.85}, idle_sound = {filename = "__pyalternativeenergygraphics__/sounds/multiblade-turbine-mk03.ogg", volume = 0.6}, apparent_volume = 2.5 }, - continuous_animation = true, - animations = { + picture = { layers = { { filename = "__pyalternativeenergygraphics__/graphics/entity/multiblade-turbine-mk03/ground.png", width = 288, height = 288, - line_length = 1, - frame_count = 1, - repeat_count = 30, - animation_speed = 0.5, }, { filename = "__pyalternativeenergygraphics__/graphics/entity/multiblade-turbine-mk03/r4.png", width = 288, height = 352, - line_length = 6, - frame_count = 30, shift = util.by_pixel(0, -32), - animation_speed = 0.25, }, { filename = "__pyalternativeenergygraphics__/graphics/entity/multiblade-turbine-mk03/s4.png", width = 320, height = 224, - line_length = 6, - frame_count = 30, shift = util.by_pixel(44, 16), - animation_speed = 0.25, draw_as_shadow = true, }, { filename = "__pyalternativeenergygraphics__/graphics/entity/multiblade-turbine-mk03/l4.png", width = 288, height = 352, - line_length = 6, - frame_count = 30, shift = util.by_pixel(0, -32), - animation_speed = 0.25, draw_as_glow = true, }, } @@ -108,9 +95,7 @@ local proto = ENTITY { -- Make a copy with only the base animation local new_proto = table.deepcopy(proto) new_proto.name = proto.name .. "-blank" -new_proto.picture = proto.animations.layers[1] -new_proto.animations = nil -new_proto.render_layer = "floor-mechanics" +new_proto.picture = table.deepcopy(proto.picture.layers[1]) data:extend {new_proto} data:extend {{ From 5a2ce2937bd26cf8437f8f0194f9de56d6b9446a Mon Sep 17 00:00:00 2001 From: protocol-1903 Date: Sat, 20 Dec 2025 21:38:55 -0700 Subject: [PATCH 8/9] update entity descriptions --- data-updates.lua | 48 ++++++++++++++++++++++++++------------------ locale/en/entity.cfg | 2 +- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/data-updates.lua b/data-updates.lua index 6383b137..8da631d0 100644 --- a/data-updates.lua +++ b/data-updates.lua @@ -166,34 +166,42 @@ end -- end -- end -local electric_energy_interfaces = { +-- add wind data to entity descriptions +for _, name in pairs{ "hawt-turbine-mk01", "hawt-turbine-mk02", "hawt-turbine-mk03", "hawt-turbine-mk04", - "vawt-turbine-mk01", - "vawt-turbine-mk02", - "vawt-turbine-mk03", - "vawt-turbine-mk04", + -- "vawt-turbine-mk01", + -- "vawt-turbine-mk02", + -- "vawt-turbine-mk03", + -- "vawt-turbine-mk04", "multiblade-turbine-mk01", "multiblade-turbine-mk03", +} do + local entity = data.raw["solar-panel"][name] + local output = {"entity-description.output-per-kmph", entity.production} + if entity.localised_description then + entity.localised_description = {"", entity.localised_description, "\n", output} + else + entity.localised_description = {"?", {"", {"entity-description." .. name}, "\n", output}, output} + end +end + +-- add relevant data to custom solar panel descriptions +for _, name in pairs{ "solar-panel-mk02", "solar-panel-mk03", -} - --- for _, name in pairs(electric_energy_interfaces) do --- local item = data.raw.item[name] --- local entity = data.raw["electric-energy-interface"][name] --- local output = {"entity-description.max-output", tostring(entity.energy_production)} --- if item.localised_description then --- item.localised_description = {"", item.localised_description, "\n", (output)} --- elseif entity.localised_description then --- item.localised_description = {"", entity.localised_description, "\n", output} --- else --- item.localised_description = {"?", {"", {"entity-description." .. name}, "\n", output}, output} --- end --- entity.energy_source.buffer_capacity = entity.energy_production --- end +} do + local entity = data.raw["electric-energy-interface"][name] + local output = {"entity-description.max-output", entity.energy_production} + if entity.localised_description then + entity.localised_description = {"", entity.localised_description, "\n", output} + else + entity.localised_description = {"?", {"", {"entity-description." .. name}, "\n", output}, output} + end + entity.energy_source.buffer_capacity = entity.energy_production +end local molten_salt_recipes = { "biomass-molten-salt-0", diff --git a/locale/en/entity.cfg b/locale/en/entity.cfg index ac4b1889..568d04c5 100644 --- a/locale/en/entity.cfg +++ b/locale/en/entity.cfg @@ -205,6 +205,6 @@ simik-boiler=Uses the natural heat of these creatures to generate steam. py-rtg=Great use of isotopes to power distant outposts or small builds. mova=Weird GMO plant that mature their seeds in low gravity. max-output=[font=default-semibold][color=255,230,192]Avg. output: [/color][/font]__1__ -variance=[font=default-semibold][color=255,230,192]Variance: [/color][/font]__1__% +output-per-kmph=[font=default-semibold][color=255,230,192]Output per kmph: [/color][/font]__1__ multiblade-turbine-mk01=A primitive design for a wind turbine. Cheap, but effective. multiblade-turbine-mk03=Advanced wind generator based on the original fish turbine design. \ No newline at end of file From 23f489dbc8bab7c6bd78dd4f1af3b04a2bbca97a Mon Sep 17 00:00:00 2001 From: protocol-1903 Date: Sat, 20 Dec 2025 22:52:34 -0700 Subject: [PATCH 9/9] vawts, entity tooltips --- data-updates.lua | 54 ++-- locale/en/entity.cfg | 4 +- locale/nl/entity.cfg | 3 +- locale/ru/entity.cfg | 3 +- locale/uk/entity.cfg | 3 +- locale/zh-CN/pyalternativeenergy.cfg | 3 +- prototypes/buildings/hawt-turbine-mk01.lua | 55 ++-- prototypes/buildings/hawt-turbine-mk02.lua | 55 ++-- prototypes/buildings/hawt-turbine-mk03.lua | 55 ++-- prototypes/buildings/hawt-turbine-mk04.lua | 55 ++-- prototypes/buildings/vawt-turbine-mk01.lua | 135 +++++---- prototypes/buildings/vawt-turbine-mk02.lua | 120 ++++---- prototypes/buildings/vawt-turbine-mk03.lua | 220 +++++++------- prototypes/buildings/vawt-turbine-mk04.lua | 315 +++++++++++---------- 14 files changed, 537 insertions(+), 543 deletions(-) diff --git a/data-updates.lua b/data-updates.lua index 8da631d0..b770f113 100644 --- a/data-updates.lua +++ b/data-updates.lua @@ -150,42 +150,31 @@ end --ENERGY COSTS-- ---ENERGY PRODUCTION DESCRIPTION -- --- for name, variance in pairs(require "scripts.wind.variation") do --- variance = {"entity-description.variance", tostring(variance * 100)} --- -- Handle the surrogate items that show in electric stats, too --- for _, suffix in pairs {"", "-blank"} do --- local entity = data.raw["electric-energy-interface"][name .. suffix] --- if entity then --- if entity.localised_description then --- entity.localised_description = {"", entity.localised_description, "\n", variance} --- else --- entity.localised_description = {"?", {"", {"entity-description." .. name}, "\n", variance}, variance} --- end --- end --- end --- end - --- add wind data to entity descriptions +-- add wind data to entity tooltip fields for _, name in pairs{ "hawt-turbine-mk01", "hawt-turbine-mk02", "hawt-turbine-mk03", "hawt-turbine-mk04", - -- "vawt-turbine-mk01", - -- "vawt-turbine-mk02", - -- "vawt-turbine-mk03", - -- "vawt-turbine-mk04", + "hawt-turbine-mk01-blank", + "hawt-turbine-mk02-blank", + "hawt-turbine-mk03-blank", + "hawt-turbine-mk04-blank", + "vawt-turbine-mk01", + "vawt-turbine-mk02", + "vawt-turbine-mk03", + "vawt-turbine-mk04", "multiblade-turbine-mk01", "multiblade-turbine-mk03", + "multiblade-turbine-mk01-blank", + "multiblade-turbine-mk03-blank", } do local entity = data.raw["solar-panel"][name] - local output = {"entity-description.output-per-kmph", entity.production} - if entity.localised_description then - entity.localised_description = {"", entity.localised_description, "\n", output} - else - entity.localised_description = {"?", {"", {"entity-description." .. name}, "\n", output}, output} - end + entity.custom_tooltip_fields = entity.custom_tooltip_fields or {} + entity.custom_tooltip_fields[#entity.custom_tooltip_fields+1] = { + name = {"entity-description.output-per-kmph"}, + value = entity.production + } end -- add relevant data to custom solar panel descriptions @@ -194,12 +183,11 @@ for _, name in pairs{ "solar-panel-mk03", } do local entity = data.raw["electric-energy-interface"][name] - local output = {"entity-description.max-output", entity.energy_production} - if entity.localised_description then - entity.localised_description = {"", entity.localised_description, "\n", output} - else - entity.localised_description = {"?", {"", {"entity-description." .. name}, "\n", output}, output} - end + entity.custom_tooltip_fields = entity.custom_tooltip_fields or {} + entity.custom_tooltip_fields[#entity.custom_tooltip_fields+1] = { + name = {"entity-description.max-output"}, + value = entity.energy_production + } entity.energy_source.buffer_capacity = entity.energy_production end diff --git a/locale/en/entity.cfg b/locale/en/entity.cfg index 568d04c5..2ce9d72f 100644 --- a/locale/en/entity.cfg +++ b/locale/en/entity.cfg @@ -204,7 +204,7 @@ aerial-blimp-mk04=Generates energy while flying high in the atmosphere. simik-boiler=Uses the natural heat of these creatures to generate steam. py-rtg=Great use of isotopes to power distant outposts or small builds. mova=Weird GMO plant that mature their seeds in low gravity. -max-output=[font=default-semibold][color=255,230,192]Avg. output: [/color][/font]__1__ -output-per-kmph=[font=default-semibold][color=255,230,192]Output per kmph: [/color][/font]__1__ +max-output=Avg. output +output-per-kmph=Output per kmph multiblade-turbine-mk01=A primitive design for a wind turbine. Cheap, but effective. multiblade-turbine-mk03=Advanced wind generator based on the original fish turbine design. \ No newline at end of file diff --git a/locale/nl/entity.cfg b/locale/nl/entity.cfg index ddbd8c67..90293983 100644 --- a/locale/nl/entity.cfg +++ b/locale/nl/entity.cfg @@ -204,7 +204,6 @@ aerial-blimp-mk04=Genereert energie terwijl het hoog in de atmosfeer vliegt. simik-boiler=Gebruik de natuurlijke warmte van deze wezens om stoom mee te genereren. py-rtg=Goed gebruik van isotopen om afgelegen buitenposten of kleine bouwprojecten mee van stroom te voorzien. mova=Rare GGO plant waarvan de zaden volwassen worden als die zich in lage zwaartekracht bevinden. -max-output=[font=default-semibold][color=255,230,192]Gem. vermogen: [/color][/font]__1__ -variance=[font=default-semibold][color=255,230,192]Variantie: [/color][/font]__1__% +max-output=Gem. vermogen multiblade-turbine-mk01=Een primitief ontwerp voor een windturbine. Goedkoop maar effectief. multiblade-turbine-mk03=Geavanceerde windgenerator gebaseerd op het orginele visturbineontwerp. \ No newline at end of file diff --git a/locale/ru/entity.cfg b/locale/ru/entity.cfg index 30a74e61..d829c937 100644 --- a/locale/ru/entity.cfg +++ b/locale/ru/entity.cfg @@ -206,5 +206,4 @@ hawt-turbine-mk01-hidden=Ветряная турбина с горизонтал hawt-turbine-mk02-hidden=Ветряная турбина с горизонтальной осью МК2.\n[font=default-semibold]Я пришёл. Я раскрутился. Я победил.[/font] hawt-turbine-mk03-hidden=Ветряная турбина с горизонтальной осью МК3.\n[font=default-semibold]Небо взорвано.[/font] hawt-turbine-mk04-hidden=Ветряная турбина с горизонтальной осью МК4.\n[font=default-semibold]Преследовали мое электричество? Это злоупотребление властью.[/font] -max-output=[font=default-semibold][color=255,230,192]Средний выход: [/color][/font]__1__ -variance=[font=default-semibold][color=255,230,192]Расхождение: [/color][/font]__1__% +max-output=Средний выход diff --git a/locale/uk/entity.cfg b/locale/uk/entity.cfg index 28d7f87f..e4c16775 100644 --- a/locale/uk/entity.cfg +++ b/locale/uk/entity.cfg @@ -204,7 +204,6 @@ aerial-blimp-mk04=Виробляє енергію під час польоту simik-boiler=Використовує природне тепло цих істот для створення пари. py-rtg=Чудове використання ізотопів для живлення віддалених аванпостів або невеликих будівель. mova=Дивна ГМО рослина, насіння якої дозріває в умовах низької гравітації. -max-output=[font=default-semibold][color=255,230,192]Сер. вихід: [/color][/font]__1__ -variance=[font=default-semibold][color=255,230,192]Відхилення: [/color][/font]__1__% +max-output=Сер. вихід multiblade-turbine-mk01=Примітивна конструкція для вітрової турбіни. Дешево, але ефективно. multiblade-turbine-mk03=Удосконалений вітрогенератор на основі оригінальної конструкції турбіни "Риба". \ No newline at end of file diff --git a/locale/zh-CN/pyalternativeenergy.cfg b/locale/zh-CN/pyalternativeenergy.cfg index d301bd1b..4411ad0e 100644 --- a/locale/zh-CN/pyalternativeenergy.cfg +++ b/locale/zh-CN/pyalternativeenergy.cfg @@ -202,8 +202,7 @@ aerial-blimp-mk04=在高空飞行时产生能量。 simik-boiler=利用这些生物的天然热量来产生蒸汽。 py-rtg=大量使用同位素为远方前哨站或小型建筑提供动力。\n[font=default-small][color=green]【注】RTG:Radioisotope Thermoelectric Generator[/color][/font] mova=奇怪的转基因植物,它们的种子在低重力下成熟。 -max-output=[font=default-semibold][color=255,230,192]均值:[/color][/font]__1__ -variance=[font=default-semibold][color=255,230,192]方差: [/color][/font]__1__% +max-output=均值 multiblade-turbine-mk01=风力涡轮机的原始设计。廉价,却有效。 multiblade-turbine-mk03=基于原始鱼式涡轮机设计的先进风力发电机。 diff --git a/prototypes/buildings/hawt-turbine-mk01.lua b/prototypes/buildings/hawt-turbine-mk01.lua index c3422349..88c188ac 100644 --- a/prototypes/buildings/hawt-turbine-mk01.lua +++ b/prototypes/buildings/hawt-turbine-mk01.lua @@ -105,35 +105,32 @@ new_proto.picture = table.deepcopy(proto.picture.layers[1]) new_proto.picture.filename = new_proto.picture.filename:gsub("r4", "base-mk01") data:extend {new_proto} -data:extend -{ - { - type = "simple-entity-with-force", - name = "hawt-turbine-mk01-collision", - render_layer = "wires-above", - icon = "__pyalternativeenergygraphics__/graphics/icons/hawt-turbine-mk01.png", - icon_size = 64, - flags = {"placeable-neutral", "player-creation", "not-on-map"}, - collision_box = {{-13.4, -13.4}, {13.4, 13.4}}, +data:extend {{ + type = "simple-entity-with-force", + name = "hawt-turbine-mk01-collision", + render_layer = "wires-above", + icon = "__pyalternativeenergygraphics__/graphics/icons/hawt-turbine-mk01.png", + icon_size = 64, + flags = {"placeable-neutral", "player-creation", "not-on-map"}, + collision_box = {{-13.4, -13.4}, {13.4, 13.4}}, + collision_mask = {layers = {wind_layer = true}}, + selection_box = {{-3.5, -3.5}, {3.5, 3.5}}, + selectable_in_game = false, + picture = { + filename = "__pyalternativeenergygraphics__/graphics/icons/filler.png", + width = 4, + height = 4, + }, + created_effect = { + type = "area", + radius = 13.4, collision_mask = {layers = {wind_layer = true}}, - selection_box = {{-3.5, -3.5}, {3.5, 3.5}}, - selectable_in_game = false, - picture = { - filename = "__pyalternativeenergygraphics__/graphics/icons/filler.png", - width = 4, - height = 4, - }, - created_effect = { - type = "area", - radius = 13.4, - collision_mask = {layers = {wind_layer = true}}, - action_delivery = { - type = "instant", - target_effects = {{ - type = "script", - effect_id = "turbine-area" - }} - } + action_delivery = { + type = "instant", + target_effects = {{ + type = "script", + effect_id = "turbine-area" + }} } } -} +}} diff --git a/prototypes/buildings/hawt-turbine-mk02.lua b/prototypes/buildings/hawt-turbine-mk02.lua index 72942ec3..9f1c4087 100644 --- a/prototypes/buildings/hawt-turbine-mk02.lua +++ b/prototypes/buildings/hawt-turbine-mk02.lua @@ -101,35 +101,32 @@ new_proto.picture = table.deepcopy(proto.picture.layers[1]) new_proto.picture.filename = new_proto.picture.filename:gsub("r4", "base-mk02") data:extend {new_proto} -data:extend -{ - { - type = "simple-entity-with-force", - name = "hawt-turbine-mk02-collision", - render_layer = "wires-above", - icon = "__pyalternativeenergygraphics__/graphics/icons/hawt-turbine-mk02.png", - icon_size = 64, - flags = {"placeable-neutral", "player-creation", "not-on-map"}, - collision_box = {{-13.4, -13.4}, {13.4, 13.4}}, +data:extend {{ + type = "simple-entity-with-force", + name = "hawt-turbine-mk02-collision", + render_layer = "wires-above", + icon = "__pyalternativeenergygraphics__/graphics/icons/hawt-turbine-mk02.png", + icon_size = 64, + flags = {"placeable-neutral", "player-creation", "not-on-map"}, + collision_box = {{-13.4, -13.4}, {13.4, 13.4}}, + collision_mask = {layers = {wind_layer = true}}, + selection_box = {{-3.5, -3.5}, {3.5, 3.5}}, + selectable_in_game = false, + picture = { + filename = "__pyalternativeenergygraphics__/graphics/icons/filler.png", + width = 4, + height = 4, + }, + created_effect = { + type = "area", + radius = 13.4, collision_mask = {layers = {wind_layer = true}}, - selection_box = {{-3.5, -3.5}, {3.5, 3.5}}, - selectable_in_game = false, - picture = { - filename = "__pyalternativeenergygraphics__/graphics/icons/filler.png", - width = 4, - height = 4, - }, - created_effect = { - type = "area", - radius = 13.4, - collision_mask = {layers = {wind_layer = true}}, - action_delivery = { - type = "instant", - target_effects = {{ - type = "script", - effect_id = "turbine-area" - }} - } + action_delivery = { + type = "instant", + target_effects = {{ + type = "script", + effect_id = "turbine-area" + }} } } -} +}} diff --git a/prototypes/buildings/hawt-turbine-mk03.lua b/prototypes/buildings/hawt-turbine-mk03.lua index ea0e4899..2c52452c 100644 --- a/prototypes/buildings/hawt-turbine-mk03.lua +++ b/prototypes/buildings/hawt-turbine-mk03.lua @@ -95,35 +95,32 @@ new_proto.picture = table.deepcopy(proto.picture.layers[1]) new_proto.picture.filename = new_proto.picture.filename:gsub("r4", "base-mk03") data:extend {new_proto} -data:extend -{ - { - type = "simple-entity-with-force", - name = "hawt-turbine-mk03-collision", - render_layer = "wires-above", - icon = "__pyalternativeenergygraphics__/graphics/icons/hawt-turbine-mk03.png", - icon_size = 64, - flags = {"placeable-neutral", "player-creation", "not-on-map"}, - collision_box = {{-12.9, -12.9}, {12.9, 12.9}}, +data:extend {{ + type = "simple-entity-with-force", + name = "hawt-turbine-mk03-collision", + render_layer = "wires-above", + icon = "__pyalternativeenergygraphics__/graphics/icons/hawt-turbine-mk03.png", + icon_size = 64, + flags = {"placeable-neutral", "player-creation", "not-on-map"}, + collision_box = {{-12.9, -12.9}, {12.9, 12.9}}, + collision_mask = {layers = {wind_layer = true}}, + selection_box = {{-3.0, -3.0}, {3.0, 3.0}}, + selectable_in_game = false, + picture = { + filename = "__pyalternativeenergygraphics__/graphics/icons/filler.png", + width = 4, + height = 4, + }, + created_effect = { + type = "area", + radius = 12.9, collision_mask = {layers = {wind_layer = true}}, - selection_box = {{-3.0, -3.0}, {3.0, 3.0}}, - selectable_in_game = false, - picture = { - filename = "__pyalternativeenergygraphics__/graphics/icons/filler.png", - width = 4, - height = 4, - }, - created_effect = { - type = "area", - radius = 12.9, - collision_mask = {layers = {wind_layer = true}}, - action_delivery = { - type = "instant", - target_effects = {{ - type = "script", - effect_id = "turbine-area" - }} - } + action_delivery = { + type = "instant", + target_effects = {{ + type = "script", + effect_id = "turbine-area" + }} } } -} +}} diff --git a/prototypes/buildings/hawt-turbine-mk04.lua b/prototypes/buildings/hawt-turbine-mk04.lua index a4f7dc79..3ae29c3b 100644 --- a/prototypes/buildings/hawt-turbine-mk04.lua +++ b/prototypes/buildings/hawt-turbine-mk04.lua @@ -99,35 +99,32 @@ new_proto.picture = table.deepcopy(proto.picture.layers[1]) new_proto.picture.filename = new_proto.picture.filename:gsub("r4", "base-mk04") data:extend {new_proto} -data:extend -{ - { - type = "simple-entity-with-force", - name = "hawt-turbine-mk04-collision", - render_layer = "wires-above", - icon = "__pyalternativeenergygraphics__/graphics/icons/hawt-turbine-mk04.png", - icon_size = 64, - flags = {"placeable-neutral", "player-creation", "not-on-map"}, - collision_box = {{-13.4, -13.4}, {13.4, 13.4}}, +data:extend {{ + type = "simple-entity-with-force", + name = "hawt-turbine-mk04-collision", + render_layer = "wires-above", + icon = "__pyalternativeenergygraphics__/graphics/icons/hawt-turbine-mk04.png", + icon_size = 64, + flags = {"placeable-neutral", "player-creation", "not-on-map"}, + collision_box = {{-13.4, -13.4}, {13.4, 13.4}}, + collision_mask = {layers = {wind_layer = true}}, + selection_box = {{-4.5, -4.5}, {4.5, 4.5}}, + selectable_in_game = false, + picture = { + filename = "__pyalternativeenergygraphics__/graphics/icons/filler.png", + width = 4, + height = 4, + }, + created_effect = { + type = "area", + radius = 13.4, collision_mask = {layers = {wind_layer = true}}, - selection_box = {{-4.5, -4.5}, {4.5, 4.5}}, - selectable_in_game = false, - picture = { - filename = "__pyalternativeenergygraphics__/graphics/icons/filler.png", - width = 4, - height = 4, - }, - created_effect = { - type = "area", - radius = 13.4, - collision_mask = {layers = {wind_layer = true}}, - action_delivery = { - type = "instant", - target_effects = {{ - type = "script", - effect_id = "turbine-area" - }} - } + action_delivery = { + type = "instant", + target_effects = {{ + type = "script", + effect_id = "turbine-area" + }} } } -} +}} diff --git a/prototypes/buildings/vawt-turbine-mk01.lua b/prototypes/buildings/vawt-turbine-mk01.lua index efeac33d..7b429be7 100644 --- a/prototypes/buildings/vawt-turbine-mk01.lua +++ b/prototypes/buildings/vawt-turbine-mk01.lua @@ -35,7 +35,7 @@ ITEM { } ENTITY { - type = "electric-energy-interface", + type = "solar-panel", name = "vawt-turbine-mk01", icon = "__pyalternativeenergygraphics__/graphics/icons/vawt-turbine-mk01.png", icon_size = 64, @@ -51,85 +51,84 @@ ENTITY { continuous_animation = true, energy_source = { type = "electric", - usage_priority = "primary-output", - + usage_priority = "solar", buffer_capacity = "4MJ", - input_flow_limit = "0W", render_no_power_icon = false }, - energy_production = "4MW", - energy_usage = "0kW", + production = "800kW", + solar_coefficient_property = "py-wind-speed", + performance_at_day = 1, + performance_at_night = 1, working_sound = { sound = {filename = "__pyalternativeenergygraphics__/sounds/vawt-turbine-mk01.ogg", volume = 0.55}, idle_sound = {filename = "__pyalternativeenergygraphics__/sounds/vawt-turbine-mk01.ogg", volume = 0.35}, apparent_volume = 2.5 }, - -- This should be the same as any animation on the assembler style buildings so if it doesnt work right just copy the animation section from one of them. - animation = - { - layers = - { - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk01/r.png", - width = 192, - height = 320, - line_length = 10, - frame_count = 30, - shift = util.by_pixel(0, -64), - animation_speed = 0.3, - }, - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk01/a.png", - width = 192, - height = 320, - line_length = 10, - frame_count = 30, - shift = util.by_pixel(0, -64), - animation_speed = 0.3, - }, - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk01/sh.png", - width = 192, - height = 96, - line_length = 10, - frame_count = 30, - shift = util.by_pixel(32, 16), - animation_speed = 0.3, - draw_as_shadow = true - }, + stateless_visualisation = { + animation = { + sheets = { + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk01/r.png", + width = 192, + height = 320, + line_length = 10, + frame_count = 30, + shift = util.by_pixel(0, -64), + animation_speed = 0.3, + variation_count = 1 + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk01/a.png", + width = 192, + height = 320, + line_length = 10, + frame_count = 30, + shift = util.by_pixel(0, -64), + animation_speed = 0.3, + variation_count = 1 + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk01/sh.png", + width = 192, + height = 96, + line_length = 10, + frame_count = 30, + shift = util.by_pixel(32, 16), + animation_speed = 0.3, + draw_as_shadow = true, + variation_count = 1 + } + } } } } -data:extend -{ - { - type = "simple-entity-with-force", - name = "vawt-turbine-mk01-collision", - render_layer = "wires-above", - icon = "__pyalternativeenergygraphics__/graphics/icons/vawt-turbine-mk01.png", - icon_size = 64, - flags = {"placeable-neutral", "player-creation", "not-on-map"}, - collision_box = {{-17.9, -17.9}, {17.9, 17.9}}, +data:extend {{ + type = "simple-entity-with-force", + name = "vawt-turbine-mk01-collision", + render_layer = "wires-above", + icon = "__pyalternativeenergygraphics__/graphics/icons/vawt-turbine-mk01.png", + icon_size = 64, + flags = {"placeable-neutral", "player-creation", "not-on-map"}, + collision_box = {{-17.9, -17.9}, {17.9, 17.9}}, + collision_mask = {layers = {wind_layer = true}}, + selection_box = {{-2.0, -2.0}, {2.0, 2.0}}, + selectable_in_game = false, + picture = { + filename = "__pyalternativeenergygraphics__/graphics/icons/filler.png", + width = 4, + height = 4, + }, + created_effect = { + type = "area", + radius = 17.9, collision_mask = {layers = {wind_layer = true}}, - selection_box = {{-2.0, -2.0}, {2.0, 2.0}}, - selectable_in_game = false, - picture = { - filename = "__pyalternativeenergygraphics__/graphics/icons/filler.png", - width = 4, - height = 4, - }, - created_effect = { - type = "area", - radius = 17.9, - collision_mask = {layers = {wind_layer = true}}, - action_delivery = { - type = "instant", - target_effects = {{ - type = "script", - effect_id = "turbine-area" - }} - } + action_delivery = { + type = "instant", + target_effects = {{ + type = "script", + effect_id = "turbine-area" + }} } } -} +}} diff --git a/prototypes/buildings/vawt-turbine-mk02.lua b/prototypes/buildings/vawt-turbine-mk02.lua index 1d9cc49f..6e08da6a 100644 --- a/prototypes/buildings/vawt-turbine-mk02.lua +++ b/prototypes/buildings/vawt-turbine-mk02.lua @@ -35,8 +35,10 @@ ITEM { stack_size = 10 } +local frame_sequence = py.range(1, 50) + ENTITY { - type = "electric-energy-interface", + type = "solar-panel", name = "vawt-turbine-mk02", icon = "__pyalternativeenergygraphics__/graphics/icons/vawt-turbine-mk02.png", icon_size = 64, @@ -52,76 +54,76 @@ ENTITY { continuous_animation = true, energy_source = { type = "electric", - usage_priority = "primary-output", - + usage_priority = "solar", buffer_capacity = "20MJ", - input_flow_limit = "0W", render_no_power_icon = false }, - energy_production = "20MW", - energy_usage = "0kW", + production = "4MW", + solar_coefficient_property = "py-wind-speed", + performance_at_day = 1, + performance_at_night = 1, working_sound = { sound = {filename = "__pyalternativeenergygraphics__/sounds/vawt-turbine-mk02.ogg", volume = 0.75}, idle_sound = {filename = "__pyalternativeenergygraphics__/sounds/vawt-turbine-mk02.ogg", volume = 0.55}, apparent_volume = 2.5 }, - -- This should be the same as any animation on the assembler style buildings so if it doesnt work right just copy the animation section from one of them. - animation = - { - layers = - { - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk02/r.png", - width = 224, - height = 320, - line_length = 9, - frame_count = 50, - shift = util.by_pixel(0, -48), - animation_speed = 0.3, - }, - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk02/sh.png", - width = 64, - height = 224, - line_length = 9, - frame_count = 50, - shift = util.by_pixel(144, 0), - animation_speed = 0.3, - --draw_as_shadow = true - }, + stateless_visualisation = { + animation = { + sheets = { + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk02/r.png", + width = 224, + height = 320, + line_length = 9, + frame_count = 54, + shift = util.by_pixel(0, -48), + animation_speed = 0.3, + variation_count = 1, + frame_sequence = frame_sequence + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk02/sh.png", + width = 64, + height = 224, + line_length = 9, + frame_count = 54, + shift = util.by_pixel(144, 0), + animation_speed = 0.3, + variation_count = 1, + frame_sequence = frame_sequence + --draw_as_shadow = true + } + } } } } -data:extend -{ - { - type = "simple-entity-with-force", - name = "vawt-turbine-mk02-collision", - render_layer = "wires-above", - icon = "__pyalternativeenergygraphics__/graphics/icons/vawt-turbine-mk02.png", - icon_size = 64, - flags = {"placeable-neutral", "player-creation", "not-on-map"}, - collision_box = {{-17.4, -17.4}, {17.4, 17.4}}, +data:extend {{ + type = "simple-entity-with-force", + name = "vawt-turbine-mk02-collision", + render_layer = "wires-above", + icon = "__pyalternativeenergygraphics__/graphics/icons/vawt-turbine-mk02.png", + icon_size = 64, + flags = {"placeable-neutral", "player-creation", "not-on-map"}, + collision_box = {{-17.4, -17.4}, {17.4, 17.4}}, + collision_mask = {layers = {wind_layer = true}}, + selection_box = {{-3.5, -3.5}, {3.5, 3.5}}, + selectable_in_game = false, + picture = { + filename = "__pyalternativeenergygraphics__/graphics/icons/filler.png", + width = 4, + height = 4, + }, + created_effect = { + type = "area", + radius = 17.4, collision_mask = {layers = {wind_layer = true}}, - selection_box = {{-3.5, -3.5}, {3.5, 3.5}}, - selectable_in_game = false, - picture = { - filename = "__pyalternativeenergygraphics__/graphics/icons/filler.png", - width = 4, - height = 4, - }, - created_effect = { - type = "area", - radius = 17.4, - collision_mask = {layers = {wind_layer = true}}, - action_delivery = { - type = "instant", - target_effects = {{ - type = "script", - effect_id = "turbine-area" - }} - } + action_delivery = { + type = "instant", + target_effects = {{ + type = "script", + effect_id = "turbine-area" + }} } } -} +}} diff --git a/prototypes/buildings/vawt-turbine-mk03.lua b/prototypes/buildings/vawt-turbine-mk03.lua index a917f2a7..f1ce0a59 100644 --- a/prototypes/buildings/vawt-turbine-mk03.lua +++ b/prototypes/buildings/vawt-turbine-mk03.lua @@ -36,8 +36,10 @@ ITEM { stack_size = 10 } +local frame_sequence = py.range(1, 50) + ENTITY { - type = "electric-energy-interface", + type = "solar-panel", name = "vawt-turbine-mk03", icon = "__pyalternativeenergygraphics__/graphics/icons/vawt-turbine-mk03.png", icon_size = 64, @@ -53,121 +55,131 @@ ENTITY { continuous_animation = true, energy_source = { type = "electric", - usage_priority = "primary-output", - + usage_priority = "solar", buffer_capacity = "50MJ", - input_flow_limit = "0W", render_no_power_icon = false }, - energy_production = "50MW", - energy_usage = "0kW", + production = "20MW", + solar_coefficient_property = "py-wind-speed", + performance_at_day = 1, + performance_at_night = 1, working_sound = { sound = {filename = "__pyalternativeenergygraphics__/sounds/vawt-turbine-mk02.ogg", volume = 0.75}, idle_sound = {filename = "__pyalternativeenergygraphics__/sounds/vawt-turbine-mk02.ogg", volume = 0.55}, apparent_volume = 2.5 }, - -- This should be the same as any animation on the assembler style buildings so if it doesnt work right just copy the animation section from one of them. - animation = - { - layers = - { - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk03/ground.png", - width = 256, - height = 224, - line_length = 8, - frame_count = 50, - shift = util.by_pixel(0, 20), - animation_speed = 0.3, - }, - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk03/r1.png", - width = 128, - height = 416, - line_length = 15, - frame_count = 50, - shift = util.by_pixel(-64, -76), - animation_speed = 0.3, - }, - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk03/r2.png", - width = 128, - height = 416, - line_length = 15, - frame_count = 50, - shift = util.by_pixel(64, -76), - animation_speed = 0.3, - }, - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk03/l1.png", - width = 256, - height = 256, - line_length = 8, - frame_count = 50, - shift = util.by_pixel(0, -156), - animation_speed = 0.3, - draw_as_glow = true, - }, - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk03/a1.png", - width = 128, - height = 416, - line_length = 15, - frame_count = 50, - shift = util.by_pixel(-64, -76), - animation_speed = 0.3, - }, - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk03/a2.png", - width = 128, - height = 416, - line_length = 15, - frame_count = 50, - shift = util.by_pixel(64, -76), - animation_speed = 0.3, - }, - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk03/sh.png", - width = 64, - height = 224, - line_length = 8, - frame_count = 50, - shift = util.by_pixel(160, 20), - animation_speed = 0.3, - }, + stateless_visualisation = { + animation = { + sheets = { + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk03/ground.png", + width = 256, + height = 224, + line_length = 8, + frame_count = 56, + shift = util.by_pixel(0, 20), + animation_speed = 0.3, + variation_count = 1, + frame_sequence = frame_sequence + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk03/r1.png", + width = 128, + height = 416, + line_length = 15, + frame_count = 60, + shift = util.by_pixel(-64, -76), + animation_speed = 0.3, + variation_count = 1, + frame_sequence = frame_sequence + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk03/r2.png", + width = 128, + height = 416, + line_length = 15, + frame_count = 60, + shift = util.by_pixel(64, -76), + animation_speed = 0.3, + variation_count = 1, + frame_sequence = frame_sequence + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk03/l1.png", + width = 256, + height = 256, + line_length = 8, + frame_count = 56, + shift = util.by_pixel(0, -156), + animation_speed = 0.3, + draw_as_glow = true, + variation_count = 1, + frame_sequence = frame_sequence + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk03/a1.png", + width = 128, + height = 416, + line_length = 15, + frame_count = 60, + shift = util.by_pixel(-64, -76), + animation_speed = 0.3, + variation_count = 1, + frame_sequence = frame_sequence + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk03/a2.png", + width = 128, + height = 416, + line_length = 15, + frame_count = 60, + shift = util.by_pixel(64, -76), + animation_speed = 0.3, + variation_count = 1, + frame_sequence = frame_sequence + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk03/sh.png", + width = 64, + height = 224, + line_length = 8, + frame_count = 56, + shift = util.by_pixel(160, 20), + animation_speed = 0.3, + variation_count = 1, + frame_sequence = frame_sequence + } + } } } } -data:extend -{ - { - type = "simple-entity-with-force", - name = "vawt-turbine-mk03-collision", - render_layer = "wires-above", - icon = "__pyalternativeenergygraphics__/graphics/icons/vawt-turbine-mk03.png", - icon_size = 64, - flags = {"placeable-neutral", "player-creation", "not-on-map"}, - collision_box = {{-17.4, -17.4}, {17.4, 17.4}}, +data:extend {{ + type = "simple-entity-with-force", + name = "vawt-turbine-mk03-collision", + render_layer = "wires-above", + icon = "__pyalternativeenergygraphics__/graphics/icons/vawt-turbine-mk03.png", + icon_size = 64, + flags = {"placeable-neutral", "player-creation", "not-on-map"}, + collision_box = {{-17.4, -17.4}, {17.4, 17.4}}, + collision_mask = {layers = {wind_layer = true}}, + selection_box = {{-3.5, -3.5}, {3.5, 3.5}}, + selectable_in_game = false, + picture = { + filename = "__pyalternativeenergygraphics__/graphics/icons/filler.png", + width = 4, + height = 4, + }, + created_effect = { + type = "area", + radius = 17.4, collision_mask = {layers = {wind_layer = true}}, - selection_box = {{-3.5, -3.5}, {3.5, 3.5}}, - selectable_in_game = false, - picture = { - filename = "__pyalternativeenergygraphics__/graphics/icons/filler.png", - width = 4, - height = 4, - }, - created_effect = { - type = "area", - radius = 17.4, - collision_mask = {layers = {wind_layer = true}}, - action_delivery = { - type = "instant", - target_effects = {{ - type = "script", - effect_id = "turbine-area" - }} - } + action_delivery = { + type = "instant", + target_effects = {{ + type = "script", + effect_id = "turbine-area" + }} } } -} +}} diff --git a/prototypes/buildings/vawt-turbine-mk04.lua b/prototypes/buildings/vawt-turbine-mk04.lua index bb55e10d..ebdb0fcb 100644 --- a/prototypes/buildings/vawt-turbine-mk04.lua +++ b/prototypes/buildings/vawt-turbine-mk04.lua @@ -37,7 +37,7 @@ ITEM { } ENTITY { - type = "electric-energy-interface", + type = "solar-panel", name = "vawt-turbine-mk04", icon = "__pyalternativeenergygraphics__/graphics/icons/vawt-turbine-mk04.png", icon_size = 64, @@ -53,170 +53,179 @@ ENTITY { continuous_animation = true, energy_source = { type = "electric", - usage_priority = "primary-output", - + usage_priority = "solar", buffer_capacity = "85MJ", - input_flow_limit = "0W", render_no_power_icon = false }, - energy_production = "85MW", - energy_usage = "0kW", + production = "40MW", + solar_coefficient_property = "py-wind-speed", + performance_at_day = 1, + performance_at_night = 1, working_sound = { sound = {filename = "__pyalternativeenergygraphics__/sounds/vawt-turbine-mk04.ogg", volume = 0.65}, idle_sound = {filename = "__pyalternativeenergygraphics__/sounds/vawt-turbine-mk04.ogg", volume = 0.45}, apparent_volume = 2.5 }, - -- This should be the same as any animation on the assembler style buildings so if it doesnt work right just copy the animation section from one of them. - animation = - { - layers = - { - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/r1.png", - width = 224, - height = 192, - line_length = 7, - frame_count = 70, - shift = util.by_pixel(0, 16), - animation_speed = 0.2, - }, - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/r2.png", - width = 224, - height = 192, - line_length = 7, - frame_count = 70, - shift = util.by_pixel(0, -176), - animation_speed = 0.2, - }, - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/r3.png", - width = 224, - height = 192, - line_length = 7, - frame_count = 70, - shift = util.by_pixel(0, -368), - animation_speed = 0.2, - }, - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/r4.png", - width = 224, - height = 64, - line_length = 7, - frame_count = 70, - shift = util.by_pixel(0, -496), - animation_speed = 0.2, - }, - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/a1.png", - width = 224, - height = 192, - line_length = 7, - frame_count = 70, - shift = util.by_pixel(0, 16), - animation_speed = 0.2, - }, - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/a2.png", - width = 224, - height = 192, - line_length = 7, - frame_count = 70, - shift = util.by_pixel(0, -176), - animation_speed = 0.2, - }, - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/a3.png", - width = 224, - height = 192, - line_length = 7, - frame_count = 70, - shift = util.by_pixel(0, -368), - animation_speed = 0.2, - }, - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/a4.png", - width = 224, - height = 64, - line_length = 7, - frame_count = 70, - shift = util.by_pixel(0, -496), - animation_speed = 0.2, - run_mode = "backward", - }, - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/l1.png", - width = 224, - height = 192, - line_length = 7, - frame_count = 70, - shift = util.by_pixel(0, 16), - animation_speed = 0.2, - draw_as_glow = true, - }, - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/l2.png", - width = 224, - height = 192, - line_length = 7, - frame_count = 70, - shift = util.by_pixel(0, -176), - animation_speed = 0.2, - draw_as_glow = true, - }, - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/l3.png", - width = 224, - height = 192, - line_length = 7, - frame_count = 70, - shift = util.by_pixel(0, -368), - animation_speed = 0.2, - draw_as_glow = true, - }, - { - filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/sh.png", - width = 320, - height = 160, - line_length = 6, - frame_count = 70, - shift = util.by_pixel(48, -0), - animation_speed = 0.2, - draw_as_shadow = true - }, + stateless_visualisation = { + animation = { + sheets = { + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/r1.png", + width = 224, + height = 192, + line_length = 7, + frame_count = 70, + shift = util.by_pixel(0, 16), + animation_speed = 0.2, + variation_count = 1 + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/r2.png", + width = 224, + height = 192, + line_length = 7, + frame_count = 70, + shift = util.by_pixel(0, -176), + animation_speed = 0.2, + variation_count = 1 + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/r3.png", + width = 224, + height = 192, + line_length = 7, + frame_count = 70, + shift = util.by_pixel(0, -368), + animation_speed = 0.2, + variation_count = 1 + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/r4.png", + width = 224, + height = 64, + line_length = 7, + frame_count = 70, + shift = util.by_pixel(0, -496), + animation_speed = 0.2, + variation_count = 1 + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/a1.png", + width = 224, + height = 192, + line_length = 7, + frame_count = 70, + shift = util.by_pixel(0, 16), + animation_speed = 0.2, + variation_count = 1 + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/a2.png", + width = 224, + height = 192, + line_length = 7, + frame_count = 70, + shift = util.by_pixel(0, -176), + animation_speed = 0.2, + variation_count = 1 + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/a3.png", + width = 224, + height = 192, + line_length = 7, + frame_count = 70, + shift = util.by_pixel(0, -368), + animation_speed = 0.2, + variation_count = 1 + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/a4.png", + width = 224, + height = 64, + line_length = 7, + frame_count = 70, + shift = util.by_pixel(0, -496), + animation_speed = 0.2, + run_mode = "backward", + variation_count = 1 + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/l1.png", + width = 224, + height = 192, + line_length = 7, + frame_count = 70, + shift = util.by_pixel(0, 16), + animation_speed = 0.2, + draw_as_glow = true, + variation_count = 1 + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/l2.png", + width = 224, + height = 192, + line_length = 7, + frame_count = 70, + shift = util.by_pixel(0, -176), + animation_speed = 0.2, + draw_as_glow = true, + variation_count = 1 + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/l3.png", + width = 224, + height = 192, + line_length = 7, + frame_count = 70, + shift = util.by_pixel(0, -368), + animation_speed = 0.2, + draw_as_glow = true, + variation_count = 1 + }, + { + filename = "__pyalternativeenergygraphics__/graphics/entity/vawt-turbine-mk04/sh.png", + width = 320, + height = 160, + line_length = 6, + frame_count = 72, + shift = util.by_pixel(48, -0), + animation_speed = 0.2, + draw_as_shadow = true, + variation_count = 1, + frame_sequence = py.range(1, 70) + } + } } } } -data:extend -{ - { - type = "simple-entity-with-force", - name = "vawt-turbine-mk04-collision", - render_layer = "wires-above", - icon = "__pyalternativeenergygraphics__/graphics/icons/vawt-turbine-mk04.png", - icon_size = 64, - flags = {"placeable-neutral", "player-creation", "not-on-map"}, - collision_box = {{-17.4, -17.4}, {17.4, 17.4}}, +data:extend {{ + type = "simple-entity-with-force", + name = "vawt-turbine-mk04-collision", + render_layer = "wires-above", + icon = "__pyalternativeenergygraphics__/graphics/icons/vawt-turbine-mk04.png", + icon_size = 64, + flags = {"placeable-neutral", "player-creation", "not-on-map"}, + collision_box = {{-17.4, -17.4}, {17.4, 17.4}}, + collision_mask = {layers = {wind_layer = true}}, + selection_box = {{-2.5, -2.5}, {2.5, 2.5}}, + selectable_in_game = false, + picture = { + filename = "__pyalternativeenergygraphics__/graphics/icons/filler.png", + width = 4, + height = 4, + }, + created_effect = { + type = "area", + radius = 17.4, collision_mask = {layers = {wind_layer = true}}, - selection_box = {{-2.5, -2.5}, {2.5, 2.5}}, - selectable_in_game = false, - picture = { - filename = "__pyalternativeenergygraphics__/graphics/icons/filler.png", - width = 4, - height = 4, - }, - created_effect = { - type = "area", - radius = 17.4, - collision_mask = {layers = {wind_layer = true}}, - action_delivery = { - type = "instant", - target_effects = {{ - type = "script", - effect_id = "turbine-area" - }} - } + action_delivery = { + type = "instant", + target_effects = {{ + type = "script", + effect_id = "turbine-area" + }} } } -} +}}