diff --git a/changelog.txt b/changelog.txt index 32d2e8a..c4d82d1 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,14 @@ --------------------------------------------------------------------------------------------------- +Version: 6.0.1 +Date: 01. 12. 2024 + Features: + - Checkboxes to skip resources on a surface. +--------------------------------------------------------------------------------------------------- +Version: 6.0.0 +Date: 01. 11. 2024 + Features: + - Updated to Factorio 2.0. +--------------------------------------------------------------------------------------------------- Version: 5.0.2 Date: ???? Changes: diff --git a/control.lua b/control.lua index d383e66..705e506 100644 --- a/control.lua +++ b/control.lua @@ -35,7 +35,7 @@ local function set_to_current_map_gen_settings(player) gui.get_preset_dropdown(player).selected_index = 0 --the rest - map_gen_gui.set_to_current(gui.get_map_gen_settings_container(player), map_gen_settings) + map_gen_gui.set_to_current(gui.get_map_gen_settings_container(player), map_gen_settings, true) end local function set_to_current_map_settings(player) @@ -46,7 +46,7 @@ local function set_to_current_map_settings(player) local config_table = gui.get_map_settings_container(player) local map_settings = game.map_settings map_settings_gui.expansion_set_to_current(config_table, map_settings) - map_settings_gui.evolution_set_to_current(config_table, map_settings) + map_settings_gui.evolution_set_to_current(config_table, map_settings, player.surface) map_settings_gui.pollution_set_to_current(config_table, map_settings) end @@ -98,9 +98,11 @@ local function change_map_settings(player) map_settings.enemy_expansion[k] = v end for k, v in pairs(enemy_evolution) do - map_settings.enemy_evolution[k] = v + if k ~= "evolution_factor" then + map_settings.enemy_evolution[k] = v + end end - game.forces["enemy"].evolution_factor = enemy_evolution.evolution_factor + game.forces["enemy"].set_evolution_factor(enemy_evolution.evolution_factor, player.surface) player.print({"msg.change-map-settings-applied"}) @@ -199,7 +201,7 @@ script.on_event(defines.events.on_gui_selection_state_changed, function(event) -- then set up the preset -- {"map-gen-preset-name." .. preset_name} local preset_name = item[1]:sub(string.len("map-gen-preset-name.") + 1) - local preset = game.map_gen_presets[preset_name] + local preset = prototypes.map_gen_preset[preset_name] map_gen_gui.set_to_current(gui.get_map_gen_settings_container(player), preset.basic_settings) end) diff --git a/data.lua b/data.lua index e85ba1c..7e4cb31 100644 --- a/data.lua +++ b/data.lua @@ -31,15 +31,20 @@ data.raw["gui-style"]["default"]["frame_in_deep_frame"] = } } +-- 2.0 removed 'b_inner_frame' so this now defines its 'base' properties +-- instead of inheriting from 'b_inner_frame'. +-- It always changed the shadow. data.raw["gui-style"]["default"]["b_inner_frame_no_border"] = { type = "frame_style", - parent = "b_inner_frame", graphical_set = { base = { + position = {17, 0}, + corner_size = 8, center = {position = {76, 8}, size = {1, 1}}, + draw_type = "outer" }, -- we only show shadow on the top, to solve the problem of it not being casted from the subheader panel above shadow = diff --git a/gui.lua b/gui.lua index 40f3ca5..db8a238 100644 --- a/gui.lua +++ b/gui.lua @@ -60,7 +60,7 @@ gui.make_map_settings = function(parent, surface) local inner_frame = parent.add{ type = "frame", direction = "vertical", - style = "window_content_frame_packed" + style = "inside_shallow_frame_packed" } -- tool buttons @@ -108,7 +108,7 @@ gui.make_map_settings = function(parent, surface) --make different map gen option groups map_settings_gui.make_pollution_settings(config_table, map_settings) map_settings_gui.make_expansion_settings(config_table, map_settings) - map_settings_gui.make_evolution_settings(config_table, map_settings) + map_settings_gui.make_evolution_settings(config_table, map_settings, surface) gui.make_general_map_settings(config_table, surface) end @@ -189,7 +189,7 @@ gui.make_map_gen_settings = function(parent) -- presets local presets = {} - for name, preset in pairs(game.map_gen_presets) do + for name, preset in pairs(prototypes.map_gen_preset) do if not preset.basic_settings then goto continue end diff --git a/info.json b/info.json index 632993f..2a46ecf 100644 --- a/info.json +++ b/info.json @@ -1,7 +1,7 @@ { "name": "ChangeMapSettings", - "version": "5.0.2", - "factorio_version" : "1.1", + "version": "6.0.0", + "factorio_version" : "2.0", "title": "Change Map Settings", "author": "Bilka", "description": "Allows you to change your map and map generation settings at any time you want.", diff --git a/map_gen_settings_gui.lua b/map_gen_settings_gui.lua index 0d74694..671930e 100644 --- a/map_gen_settings_gui.lua +++ b/map_gen_settings_gui.lua @@ -145,7 +145,7 @@ map_gen_gui.create_resource_table = function(parent) } -- resources - for _, control in pairs(game.autoplace_control_prototypes) do + for _, control in pairs(prototypes.autoplace_control) do if control.category == "resource" then map_gen_gui.make_autoplace_options(control.name, table, true, control) end @@ -175,11 +175,8 @@ map_gen_gui.create_controls_with_scale_table = function(parent) } table.children[1].style.horizontally_stretchable = true - -- water - map_gen_gui.make_autoplace_options("water", table, false) - -- trees and custom mod stuff - for _, control in pairs(game.autoplace_control_prototypes) do + for _, control in pairs(prototypes.autoplace_control) do if control.category == "terrain" and control.name ~= "planet-size" then -- planet size is a space exploration thing, we don't want the player to change it map_gen_gui.make_autoplace_options(control.name, table, false, control) end @@ -264,7 +261,7 @@ map_gen_gui.create_enemies_table = function(parent) table.children[1].style.horizontally_stretchable = true -- biter bases - for _, control in pairs(game.autoplace_control_prototypes) do + for _, control in pairs(prototypes.autoplace_control) do if control.category == "enemy" then map_gen_gui.make_autoplace_options(control.name, table, false, control) end @@ -322,23 +319,36 @@ end local autoplace_name_locale = { ["aux"] = {"gui-map-generator.aux"}, - ["cliffs"] = {"gui-map-generator.cliffs"}, + ["cliffs"] = {"autoplace-control-names.nauvis_cliff"}, ["moisture"] = {"gui-map-generator.moisture"}, ["water"] = {"", {"gui-map-generator.water"}, "/", {"gui-map-generator.island-size"}} } -- if autoplace is provided, the localised name is taken from there map_gen_gui.make_autoplace_label = function(name, parent, autoplace) - local label = parent.add{ - type = "label" - } + local label if autoplace then + -- an autoplace has a flow with (checkbox, label) + local flow = parent.add { + type = "flow", + name = ENTIRE_PREFIX .. name .. "-check-wrapper", + direction = "horizontal" + } + flow.add { + type = "checkbox", + name = "check", + state = true + } + label = flow.add{type = "label"} + label.caption = autoplace.localised_name assert(label.caption ~= "nil") return end + -- other things just have a label + label = parent.add{type = "label"} label.caption = autoplace_name_locale[name] if name == "moisture" or name == "aux" then label.tooltip = {"gui-map-generator." .. name .. "-description"} @@ -362,25 +372,39 @@ map_gen_gui.reset_to_defaults = function(parent) map_gen_gui.create_expression_selectors(expression_selectors_flow) - -- water stuff - controls_with_scale_table[ENTIRE_PREFIX .. "water-freq"].text = "1" - controls_with_scale_table[ENTIRE_PREFIX .. "water-size"].text = "1" -- starting area enemies_table[ENTIRE_PREFIX .. "starting-area-size"].text = "1" -- resources and terrain and enemies - local autoplace_control_prototypes = game.autoplace_control_prototypes - for _, control in pairs(autoplace_control_prototypes) do + local autoplace_control_prototypes = prototypes.autoplace_control + for name, control in pairs(autoplace_control_prototypes) do + local check_wrapper_name = ENTIRE_PREFIX .. name .. "-check-wrapper" if control.category == "resource" then - resource_table[ENTIRE_PREFIX .. control.name .. "-freq"].text = "1" - resource_table[ENTIRE_PREFIX .. control.name .. "-size"].text = "1" - resource_table[ENTIRE_PREFIX .. control.name .. "-richn"].text = "1" - elseif control.category == "terrain" and control.name ~= "planet-size" then -- planet size is a space exploration thing, we don't want the player to change it - controls_with_scale_table[ENTIRE_PREFIX .. control.name .. "-freq"].text = "1" - controls_with_scale_table[ENTIRE_PREFIX .. control.name .. "-size"].text = "1" + if resource_table[check_wrapper_name] and not resource_table[check_wrapper_name].check.state then + resource_table[ENTIRE_PREFIX .. name .. "-freq"].text = "" + resource_table[ENTIRE_PREFIX .. name .. "-size"].text = "" + resource_table[ENTIRE_PREFIX .. name .. "-richn"].text = "" + else + resource_table[ENTIRE_PREFIX .. name .. "-freq"].text = "1" + resource_table[ENTIRE_PREFIX .. name .. "-size"].text = "1" + resource_table[ENTIRE_PREFIX .. name .. "-richn"].text = "1" + end + elseif control.category == "terrain" and name ~= "planet-size" then -- planet size is a space exploration thing, we don't want the player to change it + if controls_with_scale_table[check_wrapper_name] and not controls_with_scale_table[check_wrapper_name].check.state then + controls_with_scale_table[ENTIRE_PREFIX .. name .. "-freq"].text = "" + controls_with_scale_table[ENTIRE_PREFIX .. name .. "-size"].text = "" + else + controls_with_scale_table[ENTIRE_PREFIX .. name .. "-freq"].text = "1" + controls_with_scale_table[ENTIRE_PREFIX .. name .. "-size"].text = "1" + end elseif control.category == "enemy" then - enemies_table[ENTIRE_PREFIX .. control.name .. "-freq"].text = "1" - enemies_table[ENTIRE_PREFIX .. control.name .. "-size"].text = "1" + if enemies_table[check_wrapper_name] and not enemies_table[check_wrapper_name].check.state then + enemies_table[ENTIRE_PREFIX .. name .. "-freq"].text = "" + enemies_table[ENTIRE_PREFIX .. name .. "-size"].text = "" + else + enemies_table[ENTIRE_PREFIX .. name .. "-freq"].text = "1" + enemies_table[ENTIRE_PREFIX .. name .. "-size"].text = "1" + end end end @@ -395,7 +419,7 @@ map_gen_gui.reset_to_defaults = function(parent) cliffs_table[ENTIRE_PREFIX .. "cliffs-size"].text = "1" end -map_gen_gui.set_to_current = function(parent, map_gen_settings) +map_gen_gui.set_to_current = function(parent, map_gen_settings, reset_checkboxes) local expression_selectors_flow = parent[ENTIRE_PREFIX .. "gui-frame-2"][ENTIRE_PREFIX .. "expression-selectors-table"][ENTIRE_PREFIX .. "expression-selectors-flow"] local resource_table = parent[ENTIRE_PREFIX .. "gui-frame-1"][ENTIRE_PREFIX .. "resource-scroll-pane"][ENTIRE_PREFIX .."resource-table"] local controls_with_scale_table = parent[ENTIRE_PREFIX .. "gui-frame-2"][ENTIRE_PREFIX .. "terrain-scroll-pane"][ENTIRE_PREFIX .."controls-with-scale-table"] @@ -415,7 +439,7 @@ map_gen_gui.set_to_current = function(parent, map_gen_settings) if property_expression_names then -- can be missing when reading from preset local possible_properties = util.get_possible_noise_expression_properties() local relevant_noise_expressions = util.get_relevant_noise_expressions() - local valid_named_noise_expressions = game.named_noise_expressions + local valid_named_noise_expressions = prototypes.named_noise_expression for property in pairs(possible_properties) do local selected_expression = property_expression_names[property] if selected_expression then @@ -435,28 +459,61 @@ map_gen_gui.set_to_current = function(parent, map_gen_settings) end end - -- water stuff - controls_with_scale_table[ENTIRE_PREFIX .. "water-freq"].text = util.number_to_string(1 / (util.map_gen_size_to_number(map_gen_settings.terrain_segmentation) or 1)) -- inverse - controls_with_scale_table[ENTIRE_PREFIX .. "water-size"].text = util.number_to_string(util.map_gen_size_to_number(map_gen_settings.water) or 1) -- starting area enemies_table[ENTIRE_PREFIX .. "starting-area-size"].text = util.number_to_string(util.map_gen_size_to_number(map_gen_settings.starting_area) or 1) -- resources and terrain and enemies - local valid_autoplace_controls = game.autoplace_control_prototypes - if autoplace_controls then - for name, autoplace_control in pairs(autoplace_controls) do - if valid_autoplace_controls[name] then - if valid_autoplace_controls[name].category == "resource" then - resource_table[ENTIRE_PREFIX .. name .. "-freq"].text = util.number_to_string(util.map_gen_size_to_number(autoplace_control["frequency"]) or 1) - resource_table[ENTIRE_PREFIX .. name .. "-size"].text = util.number_to_string(util.map_gen_size_to_number(autoplace_control["size"]) or 1) - resource_table[ENTIRE_PREFIX .. name .. "-richn"].text = util.number_to_string(util.map_gen_size_to_number(autoplace_control["richness"]) or 1) - elseif valid_autoplace_controls[name].category == "terrain" and name ~= "planet-size" then -- planet size is a space exploration thing, we don't want the player to change it - controls_with_scale_table[ENTIRE_PREFIX .. name .. "-freq"].text = util.number_to_string(1 / (util.map_gen_size_to_number(autoplace_control["frequency"]) or 1)) -- inverse - controls_with_scale_table[ENTIRE_PREFIX .. name .. "-size"].text = util.number_to_string(util.map_gen_size_to_number(autoplace_control["size"]) or 1) - elseif valid_autoplace_controls[name].category == "enemy" then - enemies_table[ENTIRE_PREFIX .. name .. "-freq"].text = util.number_to_string(util.map_gen_size_to_number(autoplace_control["frequency"]) or 1) - enemies_table[ENTIRE_PREFIX .. name .. "-size"].text = util.number_to_string(util.map_gen_size_to_number(autoplace_control["size"]) or 1) - end + local valid_autoplace_controls = prototypes.autoplace_control + for name, control_prototype in pairs(valid_autoplace_controls) do + -- find checkbox + local checkbox + if control_prototype.category == "resource" then + checkbox = resource_table[ENTIRE_PREFIX .. name .. "-check-wrapper"].check + elseif control_prototype.category == "terrain" then + checkbox = controls_with_scale_table[ENTIRE_PREFIX .. name .. "-check-wrapper"].check + elseif control_prototype.category == "enemy" then + checkbox = enemies_table[ENTIRE_PREFIX .. name .. "-check-wrapper"].check + end + -- reset checkbox to match data, if we were told to + if reset_checkboxes and checkbox then + if ( + autoplace_controls and + autoplace_controls[name] and + autoplace_controls[name].size and + util.map_gen_size_to_number(autoplace_controls[name].size) > 0 + ) then + checkbox.state = true + else + checkbox.state = false + end + end + -- defaults to 1,1,1 + local autoplace_control = autoplace_controls and autoplace_controls[name] or {frequency=1, size=1, richness=1} + if control_prototype.category == "resource" then + if checkbox.state then + resource_table[ENTIRE_PREFIX .. name .. "-freq"].text = util.number_to_string(util.map_gen_size_to_number(autoplace_control["frequency"]) or 1) + resource_table[ENTIRE_PREFIX .. name .. "-size"].text = util.number_to_string(util.map_gen_size_to_number(autoplace_control["size"]) or 1) + resource_table[ENTIRE_PREFIX .. name .. "-richn"].text = util.number_to_string(util.map_gen_size_to_number(autoplace_control["richness"]) or 1) + else + resource_table[ENTIRE_PREFIX .. name .. "-freq"].text = "" + resource_table[ENTIRE_PREFIX .. name .. "-size"].text = "" + resource_table[ENTIRE_PREFIX .. name .. "-richn"].text = "" + end + elseif control_prototype.category == "terrain" and name ~= "planet-size" then -- planet size is a space exploration thing, we don't want the player to change it + if checkbox.state then + controls_with_scale_table[ENTIRE_PREFIX .. name .. "-freq"].text = util.number_to_string(1 / (util.map_gen_size_to_number(autoplace_control["frequency"]) or 1)) -- inverse + controls_with_scale_table[ENTIRE_PREFIX .. name .. "-size"].text = util.number_to_string(util.map_gen_size_to_number(autoplace_control["size"]) or 1) + else + controls_with_scale_table[ENTIRE_PREFIX .. name .. "-freq"].text = "" + controls_with_scale_table[ENTIRE_PREFIX .. name .. "-size"].text = "" + end + elseif control_prototype.category == "enemy" then + if checkbox.state then + enemies_table[ENTIRE_PREFIX .. name .. "-freq"].text = util.number_to_string(util.map_gen_size_to_number(autoplace_control["frequency"]) or 1) + enemies_table[ENTIRE_PREFIX .. name .. "-size"].text = util.number_to_string(util.map_gen_size_to_number(autoplace_control["size"]) or 1) + else + enemies_table[ENTIRE_PREFIX .. name .. "-freq"].text = "" + enemies_table[ENTIRE_PREFIX .. name .. "-size"].text = "" end end end @@ -523,36 +580,44 @@ map_gen_gui.read = function(parent, current_map_gen_settings) end end - -- water stuff - map_gen_settings.terrain_segmentation = 1 / util.textfield_to_number_with_error(controls_with_scale_table[ENTIRE_PREFIX .. "water-freq"]) -- inverse - map_gen_settings.water = util.textfield_to_number_with_error(controls_with_scale_table[ENTIRE_PREFIX .. "water-size"]) -- starting area map_gen_settings.starting_area = util.textfield_to_number_with_error(enemies_table[ENTIRE_PREFIX .. "starting-area-size"]) - local autoplace_control_prototypes = game.autoplace_control_prototypes + local autoplace_control_prototypes = prototypes.autoplace_control -- resources and terrain and enemies for _, control in pairs(autoplace_control_prototypes) do + local check_wrapper_name = ENTIRE_PREFIX .. control.name .. "-check-wrapper" if control.category == "resource" then + if resource_table[check_wrapper_name] and not resource_table[check_wrapper_name].check.state then + goto continue + end autoplace_controls_mine[control.name] = { frequency = util.textfield_to_number_with_error(resource_table[ENTIRE_PREFIX .. control.name .. "-freq"]), size = util.textfield_to_number_with_error(resource_table[ENTIRE_PREFIX .. control.name .. "-size"]), richness = util.textfield_to_number_with_error(resource_table[ENTIRE_PREFIX .. control.name .. "-richn"]) } elseif control.category == "terrain" and control.name ~= "planet-size" then -- planet size is a space exploration thing, we don't want the player to change it + if controls_with_scale_table[check_wrapper_name] and not controls_with_scale_table[check_wrapper_name].check.state then + goto continue + end autoplace_controls_mine[control.name] = { frequency = 1 / util.textfield_to_number_with_error(controls_with_scale_table[ENTIRE_PREFIX .. control.name .. "-freq"]), -- inverse size = util.textfield_to_number_with_error(controls_with_scale_table[ENTIRE_PREFIX .. control.name .. "-size"]) } elseif control.category == "enemy" then + if enemies_table[check_wrapper_name] and not enemies_table[check_wrapper_name].check.state then + goto continue + end autoplace_controls_mine[control.name] = { frequency = util.textfield_to_number_with_error(enemies_table[ENTIRE_PREFIX .. control.name .. "-freq"]), size = util.textfield_to_number_with_error(enemies_table[ENTIRE_PREFIX .. control.name .. "-size"]) } end + ::continue:: end -- but space explorations planet size still needs to be set! - if current_map_gen_settings.autoplace_controls["planet-size"] then + if current_map_gen_settings.autoplace_controls and current_map_gen_settings.autoplace_controls["planet-size"] then autoplace_controls_mine["planet-size"] = current_map_gen_settings.autoplace_controls["planet-size"] end diff --git a/map_settings_gui.lua b/map_settings_gui.lua index 6e311df..910bca0 100644 --- a/map_settings_gui.lua +++ b/map_settings_gui.lua @@ -41,7 +41,7 @@ map_settings_gui.make_pollution_settings = function(parent, map_settings) map_settings_gui.make_config_option(table, WIDGET_PREFIX .. "diffusion", {"gui." .. MOD_PREFIX .. "in-unit", {"gui-map-generator.pollution-diffusion-ratio"}, {"gui." .. MOD_PREFIX .. "percent"}}, {"gui-map-generator.pollution-diffusion-ratio-description"}, tostring(map_settings.pollution.diffusion_ratio * 100), 50) end -map_settings_gui.make_evolution_settings = function(parent, map_settings) +map_settings_gui.make_evolution_settings = function(parent, map_settings, surface) local WIDGET_PREFIX = "evolution-" local flow = parent.add{ type = "flow", @@ -71,7 +71,7 @@ map_settings_gui.make_evolution_settings = function(parent, map_settings) state = map_settings.enemy_evolution.enabled, } table.children[1].style.horizontally_stretchable = true - map_settings_gui.make_config_option(table, WIDGET_PREFIX .. "factor", {"gui-map-generator.evolution"}, {"gui." .. MOD_PREFIX .. "evolution-factor-tooltip"}, util.number_to_string(game.forces["enemy"].evolution_factor), 80) + map_settings_gui.make_config_option(table, WIDGET_PREFIX .. "factor", {"gui-map-generator.evolution"}, {"gui." .. MOD_PREFIX .. "evolution-factor-tooltip"}, util.number_to_string(game.forces["enemy"].get_evolution_factor(surface)), 80) map_settings_gui.make_config_option(table, WIDGET_PREFIX .. "time", {"gui-map-generator.evolution-time-factor"}, {"gui-map-generator.evolution-time-factor-description"}, util.number_to_string(map_settings.enemy_evolution.time_factor * 100), 80) map_settings_gui.make_config_option(table, WIDGET_PREFIX .. "destroy", {"gui-map-generator.evolution-destroy-factor"}, {"gui-map-generator.evolution-destroy-factor-description"}, util.number_to_string(map_settings.enemy_evolution.destroy_factor * 100), 80) map_settings_gui.make_config_option(table, WIDGET_PREFIX .. "pollution", {"gui-map-generator.evolution-pollution-factor"}, {"gui-map-generator.evolution-pollution-factor-description"}, util.number_to_string(map_settings.enemy_evolution.pollution_factor * 100), 80) @@ -175,11 +175,11 @@ map_settings_gui.expansion_set_to_current = function(parent, map_settings) table[ENTIRE_PREFIX .. WIDGET_PREFIX .. "max-cd-textfield"].text = tostring(map_settings.enemy_expansion.max_expansion_cooldown / 3600) end -map_settings_gui.evolution_set_to_current = function(parent, map_settings) +map_settings_gui.evolution_set_to_current = function(parent, map_settings, surface) local WIDGET_PREFIX = "evolution-" local table = parent[ENTIRE_PREFIX .. WIDGET_PREFIX .. "flow"][ENTIRE_PREFIX .. WIDGET_PREFIX .. "table"] table[ENTIRE_PREFIX .. WIDGET_PREFIX .. "checkbox"].state = map_settings.enemy_evolution.enabled - table[ENTIRE_PREFIX .. WIDGET_PREFIX .. "factor-textfield"].text = util.number_to_string(game.forces["enemy"].evolution_factor) + table[ENTIRE_PREFIX .. WIDGET_PREFIX .. "factor-textfield"].text = util.number_to_string(game.forces["enemy"].get_evolution_factor(surface)) table[ENTIRE_PREFIX .. WIDGET_PREFIX .. "time-textfield"].text = util.number_to_string(map_settings.enemy_evolution.time_factor * 100) table[ENTIRE_PREFIX .. WIDGET_PREFIX .. "destroy-textfield"].text = util.number_to_string(map_settings.enemy_evolution.destroy_factor * 100) table[ENTIRE_PREFIX .. WIDGET_PREFIX .. "pollution-textfield"].text = util.number_to_string(map_settings.enemy_evolution.pollution_factor * 100) diff --git a/utilities.lua b/utilities.lua index 78f8239..8405a2b 100644 --- a/utilities.lua +++ b/utilities.lua @@ -87,7 +87,7 @@ end -- returns table = {["intended-property"] = {{name = "expression-name", order = "order"}, ...}} util.get_relevant_noise_expressions = function() local expressions = {} - for name, named_noise_expression in pairs(game.named_noise_expressions) do + for name, named_noise_expression in pairs(prototypes.named_noise_expression) do local intended_property = named_noise_expression.intended_property if intended_property ~= "" then expressions[intended_property] = expressions[intended_property] or {} @@ -105,7 +105,7 @@ end util.get_possible_noise_expression_properties = function() local properties = {} - for _, named_noise_expression in pairs(game.named_noise_expressions) do + for _, named_noise_expression in pairs(prototypes.named_noise_expression) do local intended_property = named_noise_expression.intended_property if intended_property ~= "" then properties[intended_property] = true