Skip to content

Commit 4acfb6b

Browse files
authored
Add files via upload
Fixed passive energy void and active energy source to use EEI.
1 parent dd1b529 commit 4acfb6b

File tree

5 files changed

+79
-121
lines changed

5 files changed

+79
-121
lines changed

changelog.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22
Version: 1.8.1
33
Date: 2023-02-22
44
Changes:
5-
- Added a recipe for the vanilla infinity chest. It can be configured to void items by checking the box, or to provide an infinite amount of items by setting the appropriate filters. Several items now use this kind of chest to avoid needing any scripting.
5+
- Added a recipe for the vanilla infinity chest. It's use can replace creative chests, duplicating chests, and void chests with proper configuration and much lower UPS costs, as they'll be handled in engine rather than via LUA.
66
- Removed belt immunity equipment. This is a vanilla item now, no need for a recipe. We don't have one for all the other regular items.
77
- Removed fluid-unknown from fluid source recipes. It's not a real fluid and there's no need for it.
88
Bugfixes:
99
- Added script_raised_built and script_raised_destroy event handlers for creative mod items.
1010
- Updated the description for Heat Void to clarify it's always 0C, not room temp.
1111
Optimizations:
12-
- Removed all scripting for fluid-source, fluid-void, super-radar, super-beacon, super-roboport, energy-void, passive-energy-source. They no longer require it. See details below.
12+
- Removed all scripting for fluid-source, fluid-void, super-radar, super-beacon, super-roboport, energy-void, energy-source, passive-energy-void, passive-energy-source. They no longer require it. See details below.
1313
- Changed all creative entities requiring power to use a void energy source, rather than a burner source. Scripting is no longer required to keep these entities powered, and they're less apt to break if moved via script.
1414
- Removed fuel scripting for creative-lab, item-source, item-duplicator, item-void.
15-
- Changed Heat Source and Heat void to use the Heat Interface prototype instead.
15+
- Changed Heat Source and Heat Void to use the Heat Interface prototype instead.
1616
- Removed all on-tick scripting for Heat Source and Heat void. There is only a quick script ran on placement that sets the temperature.
1717
- These look different now due to the differences in how heat-interfaces work - they don't have separate connection sprites like heat pipes do, so they are locked into the 4 way sprite.
1818
- Changed creative-chest, creative-provider-chest, void chest, void storage chest, and void requester chest to use the vanilla infinity chest. No changes in usage should be present.
1919
- Removed all on-tick scripting for these entities. There is a quick script ran on placement that sets them up.
20-
creative-chest and creative-provider-chest have two minor regressions:
20+
- creative-chest and creative-provider-chest have two minor regressions:
2121
- Copy/paste no longer works since the base game considers them non-operable. As it appears this only set the group number, and not the filters, this is fairly minor.
2222
- The inventory display mode also doesn't do anything for them, since infinity chests sort their contents. Technically it DOES have a slight change in how the filters are set, but as those are only viewable in the editor this isn't particularly useful.
2323
- Energy void no longer produces an item. Removed scripting related to the item.
2424
- The scripting to remove it's energy was also removed as it did nothing - it'll always run constantly and drain power as long as there is a supply.
25-
- Passive energy source is now an electric interface and requires no LUA scripting to function.
26-
- It no longer has a circuit connection due to this change.
25+
- Active and Passive Energy Sources and Passive Energy Void are now electric interfaces and require no LUA scripting to function.
26+
- They no longer have a circuit connection due to this change.
2727
---------------------------------------------------------------------------------------------------
2828
Version: 1.8.0
2929
Date: 2022-08-03

control.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ require("scripts.duplicating-chest")
1313
require("scripts.duplicating-chest-util")
1414
require("scripts.duplicating-provider-chest")
1515
require("scripts.duplicator")
16-
require("scripts.energy-source")
1716
require("scripts.equipments")
1817
require("scripts.events")
1918
require("scripts.fluid-providers-util")
@@ -32,7 +31,6 @@ require("scripts.magic-wand-creator")
3231
require("scripts.magic-wand-healer")
3332
require("scripts.magic-wand-modifier")
3433
require("scripts.mod-compatibler")
35-
require("scripts.passive-energy-void")
3634
require("scripts.random-item-source")
3735
require("scripts.remote-interface")
3836
require("scripts.rights")

prototypes/entity.lua

Lines changed: 71 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,7 +1980,7 @@ data:extend({
19801980
creative_mode_defines.names.entities.passive_electric_energy_interface}),
19811981
-- Energy Source
19821982
{
1983-
type = "generator",
1983+
type = "electric-energy-interface",
19841984
enable_gui = true,
19851985
name = creative_mode_defines.names.entities.energy_source,
19861986
icon_size = 32,
@@ -1995,46 +1995,55 @@ data:extend({
19951995
fast_replaceable_group = creative_mode_defines.names.fast_replaceable_groups.energy_source_void,
19961996
collision_box = {{-0.9, -0.9}, {0.9, 0.9}},
19971997
selection_box = {{-1, -1}, {1, 1}},
1998-
vehicle_impact_sound = {
1999-
filename = "__base__/sound/car-metal-impact.ogg",
2000-
volume = 0.65
2001-
},
2002-
effectivity = 1,
2003-
fluid_usage_per_tick = 1000000000, -- This value affects the maximum energy output. Currently it is 5.4PW (GUI shows 5.1PW)
2004-
maximum_temperature = 500,
2005-
fluid_box = {
2006-
base_area = 1,
2007-
filter = "water",
2008-
pipe_connections = {}
2009-
},
2010-
fluid_input = {
2011-
name = "water",
2012-
amount = 0.0,
2013-
minimum_temperature = 0
2014-
},
20151998
energy_source = {
20161999
type = "electric",
2017-
usage_priority = "primary-output"
2000+
buffer_capacity = "5.4PW",
2001+
usage_priority = "primary-output",
2002+
input_flow_limit = "0W",
2003+
output_flow_limit = "5.4PW"
20182004
},
2019-
min_perceived_performance = 1,
2020-
performance_to_sound_speedup = 0.5,
2021-
horizontal_animation = {
2005+
energy_production = "5.4PW",
2006+
picture = {
20222007
filename = creative_mode_defines.mod_directory .. "/graphics/entity/energy-source.png",
2008+
priority = "extra-high",
20232009
width = 124,
20242010
height = 103,
20252011
frame_count = 1,
20262012
line_length = 1,
20272013
shift = {0.6875, -0.203125}
20282014
},
2029-
vertical_animation = {
2015+
charge_animation = {
2016+
filename = creative_mode_defines.mod_directory .. "/graphics/entity/energy-source.png",
2017+
width = 124,
2018+
height = 103,
2019+
frame_count = 1,
2020+
line_length = 1,
2021+
shift = {0.6875, -0.203125},
2022+
animation_speed = 0.5
2023+
},
2024+
charge_cooldown = 30,
2025+
charge_light = {
2026+
intensity = 0.3,
2027+
size = 7
2028+
},
2029+
discharge_animation = {
20302030
filename = creative_mode_defines.mod_directory .. "/graphics/entity/energy-source.png",
20312031
width = 124,
20322032
height = 103,
20332033
frame_count = 1,
20342034
line_length = 1,
2035-
shift = {0.6875, -0.203125}
2035+
shift = {0.6875, -0.203125},
2036+
animation_speed = 0.5
2037+
},
2038+
discharge_cooldown = 60,
2039+
discharge_light = {
2040+
intensity = 0.7,
2041+
size = 7
2042+
},
2043+
vehicle_impact_sound = {
2044+
filename = "__base__/sound/car-metal-impact.ogg",
2045+
volume = 0.65
20362046
},
2037-
smoke = {},
20382047
working_sound = {
20392048
sound = {
20402049
filename = "__base__/sound/accumulator-working.ogg",
@@ -2123,25 +2132,8 @@ data:extend({
21232132
},
21242133
max_sounds_per_type = 5
21252134
},
2126-
circuit_wire_connection_point = {
2127-
shadow = {
2128-
red = {0.984375, 1.10938},
2129-
green = {0.890625, 1.10938}
2130-
},
2131-
wire = {
2132-
red = {0.6875, 0.59375},
2133-
green = {0.6875, 0.71875}
2134-
}
2135-
},
2136-
circuit_connector_sprites = circuit_connector_definitions[creative_mode_defines.names.entities.passive_energy_source]
2137-
.sprites,
2138-
circuit_wire_max_distance = 1000,
2139-
default_output_signal = {
2140-
type = "virtual",
2141-
name = "signal-A"
2142-
}
21432135
},
2144-
-- Energy Void
2136+
-- Energy void
21452137
{
21462138
type = "assembling-machine",
21472139
name = creative_mode_defines.names.entities.energy_void,
@@ -2202,8 +2194,10 @@ data:extend({
22022194
ingredient_count = 0,
22032195
module_specification = {},
22042196
allowed_effects = {"pollution"}
2205-
}, {
2206-
type = "accumulator",
2197+
},
2198+
-- Passive energy void
2199+
{
2200+
type = "assembling-machine",
22072201
name = creative_mode_defines.names.entities.passive_energy_void,
22082202
icon_size = 32,
22092203
icon = creative_mode_defines.mod_directory .. "/graphics/icons/passive-energy-void.png",
@@ -2218,35 +2212,8 @@ data:extend({
22182212
fast_replaceable_group = creative_mode_defines.names.fast_replaceable_groups.energy_source_void,
22192213
collision_box = {{-0.9, -0.9}, {0.9, 0.9}},
22202214
selection_box = {{-1, -1}, {1, 1}},
2221-
energy_source = {
2222-
type = "electric",
2223-
buffer_capacity = "5.4PW",
2224-
usage_priority = "tertiary",
2225-
input_flow_limit = "5.4PW",
2226-
output_flow_limit = "0W"
2227-
},
2228-
picture = {
2229-
filename = creative_mode_defines.mod_directory .. "/graphics/entity/passive-energy-void.png",
2230-
priority = "extra-high",
2231-
width = 124,
2232-
height = 103,
2233-
shift = {0.6875, -0.203125}
2234-
},
2235-
charge_animation = {
2236-
filename = creative_mode_defines.mod_directory .. "/graphics/entity/passive-energy-void-working.png",
2237-
width = 147,
2238-
height = 128,
2239-
line_length = 8,
2240-
frame_count = 24,
2241-
shift = {0.390625, -0.53125},
2242-
animation_speed = 0.5
2243-
},
2244-
charge_cooldown = 30,
2245-
charge_light = {
2246-
intensity = 0.3,
2247-
size = 7
2248-
},
2249-
discharge_animation = {
2215+
fluid_boxes = {},
2216+
animation = {
22502217
filename = creative_mode_defines.mod_directory .. "/graphics/entity/passive-energy-void-working.png",
22512218
width = 147,
22522219
height = 128,
@@ -2255,15 +2222,18 @@ data:extend({
22552222
shift = {0.390625, -0.53125},
22562223
animation_speed = 0.5
22572224
},
2258-
discharge_cooldown = 60,
2259-
discharge_light = {
2260-
intensity = 0.7,
2261-
size = 7
2262-
},
22632225
vehicle_impact_sound = {
22642226
filename = "__base__/sound/car-metal-impact.ogg",
22652227
volume = 0.65
22662228
},
2229+
open_sound = {
2230+
filename = "__base__/sound/machine-open.ogg",
2231+
volume = 0.85
2232+
},
2233+
close_sound = {
2234+
filename = "__base__/sound/machine-close.ogg",
2235+
volume = 0.75
2236+
},
22672237
working_sound = {
22682238
sound = {
22692239
filename = "__base__/sound/accumulator-working.ogg",
@@ -2273,26 +2243,23 @@ data:extend({
22732243
filename = "__base__/sound/accumulator-idle.ogg",
22742244
volume = 0.4
22752245
},
2276-
max_sounds_per_type = 5
2246+
apparent_volume = 1.5
22772247
},
2278-
circuit_wire_connection_point = {
2279-
shadow = {
2280-
red = {0.984375, 1.10938},
2281-
green = {0.890625, 1.10938}
2282-
},
2283-
wire = {
2284-
red = {0.6875, 0.59375},
2285-
green = {0.6875, 0.71875}
2286-
}
2248+
crafting_categories = {creative_mode_defines.names.recipe_categories.energy_absorption},
2249+
fixed_recipe = creative_mode_defines.names.recipes.energy_absorption,
2250+
crafting_speed = 0.01,
2251+
energy_source = {
2252+
type = "electric",
2253+
usage_priority = "tertiary",
2254+
emissions_per_minute = 0
22872255
},
2288-
circuit_connector_sprites = circuit_connector_definitions[creative_mode_defines.names.entities.passive_energy_void]
2289-
.sprites,
2290-
circuit_wire_max_distance = 1000,
2291-
default_output_signal = {
2292-
type = "virtual",
2293-
name = "signal-A"
2294-
}
2295-
}, {
2256+
energy_usage = "5.4PW",
2257+
ingredient_count = 0,
2258+
module_specification = {},
2259+
allowed_effects = {"pollution"}
2260+
},
2261+
-- Super electric pole
2262+
{
22962263
type = "electric-pole",
22972264
name = creative_mode_defines.names.entities.super_electric_pole,
22982265
icon_size = 32,
@@ -2376,7 +2343,9 @@ data:extend({
23762343
height = 12,
23772344
priority = "extra-high-no-scale"
23782345
}
2379-
}, {
2346+
},
2347+
-- Super substation
2348+
{
23802349
type = "electric-pole",
23812350
name = creative_mode_defines.names.entities.super_substation,
23822351
icon_size = 32,
@@ -2476,7 +2445,9 @@ data:extend({
24762445
g = 0,
24772446
b = 1,
24782447
a = 0.4
2479-
}), radar(creative_mode_defines.names.entities.super_radar, creative_mode_defines.names.items.super_radar,
2448+
}),
2449+
-- Super radar
2450+
radar(creative_mode_defines.names.entities.super_radar, creative_mode_defines.names.items.super_radar,
24802451
"super-radar.png", "super-radar.png", 14),
24812452
-- Super radar MK2
24822453
radar(creative_mode_defines.names.entities.super_radar_2, creative_mode_defines.names.items.super_radar_2,
@@ -2548,4 +2519,5 @@ data:extend({
25482519
module_info_multi_row_initial_height_modifier = -0.3
25492520
}
25502521
}
2522+
25512523
})

scripts/events.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ function events.on_configuration_changed(data)
119119
global.creative_mode.super_radar = nil
120120
global.creative_mode.super_beacon = nil
121121
global.creative_mode.energy_void = nil
122+
global.creative_mode.passive_energy_void = nil
122123
global.creative_mode.passive_energy_source = nil
124+
global.creative_mode.energy_source = nil
123125
-- Ensure the tables for the new creative/providers chests exist.
124126
if not global.creative_mode.new_creative_chest then
125127
global.creative_mode.new_creative_chests = {}
@@ -320,8 +322,6 @@ function events.on_tick()
320322
duplicator.tick()
321323
item_void.tick()
322324
random_item_source.tick()
323-
--energy_source.tick()
324-
--passive_energy_void.tick()
325325
equipments.tick()
326326
end
327327

scripts/global-util.lua

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,6 @@ function global_util.initialize_or_update_global()
9999
if not global.creative_mode.creative_lab_next_update_index then
100100
global.creative_mode.creative_lab_next_update_index = 1
101101
end
102-
if not global.creative_mode.energy_source then
103-
global.creative_mode.energy_source = {}
104-
end
105-
if not global.creative_mode.passive_energy_void then
106-
global.creative_mode.passive_energy_void = {}
107-
end
108102

109103
-- Table for storing the equipments that need to be refilled with energy.
110104
if not global.energy_refill_equipments then
@@ -792,12 +786,6 @@ local register_entity_look_up_functions = {
792786
[creative_mode_defines.names.entities.void_lab] = function(entity)
793787
table.insert(global.creative_mode.void_lab, entity)
794788
end,
795-
[creative_mode_defines.names.entities.energy_source] = function(entity)
796-
table.insert(global.creative_mode.energy_source, entity)
797-
end,
798-
[creative_mode_defines.names.entities.passive_energy_void] = function(entity)
799-
table.insert(global.creative_mode.passive_energy_void, entity)
800-
end,
801789
[creative_mode_defines.names.entities.alien_attractor_proxy_small] = function(entity)
802790
entity.surface.build_enemy_base(entity.position, 5)
803791
end,

0 commit comments

Comments
 (0)