diff --git a/changelog.txt b/changelog.txt index 6573ea7..eb5f91c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,7 +2,7 @@ Version: 2.1.13 Date: ???? Major Features: - - Adding support for secondary spawns on Gleba and Vulcanus. This is still VERY experimental and will likely have some hidden issues. Please report any bugs you find. If you want to use this feature, you must go into the in game GUI and check the enable secondary spawns checkbox for Gleba and Vulcanus specifically. + - Adding support for secondary spawns on Gleba, Vulcanus and Aquilo. This is still experimental and will likely have some issues. Please report any bugs you find. If you want to use this feature, you must go into the in game GUI and check the enable secondary spawns checkbox for the other planets specifically. Changes: - Stop regrowth deleting cargo pods at center of map. (By marking the center chunks as permanent.) - Change surface regrowth checkboxes to be enabled/disabled by the global setting to make it obvious that they are dependent on the global setting. diff --git a/lib/config.lua b/lib/config.lua index 5e4634b..0ee1096 100644 --- a/lib/config.lua +++ b/lib/config.lua @@ -19,6 +19,7 @@ require("lib/planet_configs/nauvis") require("lib/planet_configs/fulgora") require("lib/planet_configs/vulcanus") require("lib/planet_configs/gleba") +require("lib/planet_configs/aquilo") ---@alias SpawnShapeChoice "circle" | "octagon" | "square" SPAWN_SHAPE_CHOICE_CIRCLE = "circle" @@ -377,10 +378,10 @@ OCFG = { starting_items = GLEBA_STARTER_ITEMS, spawn_config = GLEBA_SPAWN_CONFIG }, - -- ["aquilo"] = { - -- starting_items = AQUILO_STARTER_ITEMS, - -- spawn_config = AQUILO_SPAWN_CONFIG - -- } + ["aquilo"] = { + starting_items = AQUILO_STARTER_ITEMS, + spawn_config = AQUILO_SPAWN_CONFIG + } }, -- Surfaces blacklist (Ignore these surfaces completely for spawning and regrowth!) diff --git a/lib/gui_tabs/mod_info_faq.lua b/lib/gui_tabs/mod_info_faq.lua index cc74128..760737c 100644 --- a/lib/gui_tabs/mod_info_faq.lua +++ b/lib/gui_tabs/mod_info_faq.lua @@ -19,6 +19,7 @@ function CreateModInfoTab(tab_container, player) CreateFAQEntry(scroll_pane, { "oarc-mod-faq-what-is-this-mod" }, { "oarc-mod-faq-what-is-this-mod-answer" }) CreateFAQEntry(scroll_pane, { "oarc-mod-faq-other-surfaces" }, { "oarc-mod-faq-other-surfaces-answer" }) CreateFAQEntry(scroll_pane, { "oarc-mod-faq-secondary-spawns" }, { "oarc-mod-faq-secondary-spawns-answer" }) + CreateFAQEntry(scroll_pane, { "oarc-mod-faq-enemy-scaling" }, { "oarc-mod-faq-enemy-scaling-answer" }) CreateFAQEntry(scroll_pane, { "oarc-mod-faq-what-are-teams" }, { "oarc-mod-faq-what-are-teams-answer" }) CreateFAQEntry(scroll_pane, { "oarc-mod-faq-shared-spawn" }, { "oarc-mod-faq-shared-spawn-answer" }) CreateFAQEntry(scroll_pane, { "oarc-mod-faq-buddy-spawn" }, { "oarc-mod-faq-buddy-spawn-answer" }) diff --git a/lib/oarc_utils.lua b/lib/oarc_utils.lua index bc4d4f3..1d99800 100644 --- a/lib/oarc_utils.lua +++ b/lib/oarc_utils.lua @@ -1495,37 +1495,6 @@ function GenerateResourcePatch(surface, resourceName, diameter, position, amount end end ---- Function to generate a resource patch, of a certain size/amount at a pos. ----@param surface LuaSurface ----@param position MapPosition ----@return nil -function PlaceRandomEntities(surface, position) - local spawn_config = storage.ocfg.surfaces_config[surface.name].spawn_config - local random_entities = spawn_config.random_entities - if (random_entities == nil) then return end - - local tree_width = storage.ocfg.spawn_general.tree_width_tiles - local radius = storage.ocfg.spawn_general.spawn_radius_tiles * spawn_config.radius_modifier - tree_width - - --Iterate through the random entities and place them - for _, entry in pairs(random_entities) do - local entity_name = entry.name - - for i = 1, entry.count do - - local random_pos = GetRandomPointWithinCircle(radius, position) - local open_pos = surface.find_non_colliding_position(entity_name, random_pos, tree_width, 0.5) - - if (open_pos ~= nil) then - surface.create_entity({ - name = entity_name, - position = open_pos - }) - end - end - end -end - --- Randomly place lightning attractors specific for Fulgora. This should space them out so they don't overlap too much. ---@param surface LuaSurface ---@param position MapPosition diff --git a/lib/planet_configs/aquilo.lua b/lib/planet_configs/aquilo.lua new file mode 100644 index 0000000..4d2058a --- /dev/null +++ b/lib/planet_configs/aquilo.lua @@ -0,0 +1,72 @@ +-- This config is used as the default config for the planet aquilo. + +---@type OarcConfigStartingItems +AQUILO_STARTER_ITEMS = table.deepcopy(NO_STARTER_ITEMS) + +---@type OarcConfigSpawn +AQUILO_SPAWN_CONFIG = table.deepcopy(NAUVIS_SPAWN_CONFIG) +AQUILO_SPAWN_CONFIG.fill_tile = "snow-crests" +AQUILO_SPAWN_CONFIG.liquid_tile = "ammoniacal-ocean-2" +AQUILO_SPAWN_CONFIG.tree_entity = nil +AQUILO_SPAWN_CONFIG.random_entities = { + {name = "crude-oil", count = 3, amount = 2000000}, + {name = "lithium-brine", count = 3, amount = 500000}, + {name = "fluorine-vent", count = 3, amount = 500000}, + {name = "lithium-iceberg-big", count = 25}, + {name = "lithium-iceberg-huge", count = 25}, +} + +-- Ignore warn/danger areas, essentially disable them because the danger radius is used for resource scaling. +AQUILO_SPAWN_CONFIG.safe_area.warn_radius = AQUILO_SPAWN_CONFIG.safe_area.safe_radius +AQUILO_SPAWN_CONFIG.safe_area.danger_radius = AQUILO_SPAWN_CONFIG.safe_area.safe_radius + + +-- Aquilo should have a smaller spawn area +AQUILO_SPAWN_CONFIG.radius_modifier = 0.5 + +AQUILO_SPAWN_CONFIG.solid_resources = {} + +AQUILO_SPAWN_CONFIG.fluid_resources = { + -- ["crude-oil"] = + -- { + -- num_patches = 2, + -- amount = 2000000, + -- spacing = 6, -- Spacing between each patch, only used for automatic placing. + + -- -- These are only used if not using automatic placing. + -- -- Starting position offset (relative to bottom/south of spawn area) + -- x_offset_start = -3, + -- y_offset_start = -10, + -- -- Additional position offsets for each new oil patch (relative to previous oil patch) + -- x_offset_next = 6, + -- y_offset_next = 0 + -- }, + -- ["lithium-brine"] = + -- { + -- num_patches = 2, + -- amount = 900000, + -- spacing = 6, -- Spacing between each patch, only used for automatic placing. + + -- -- These are only used if not using automatic placing. + -- -- Starting position offset (relative to bottom/south of spawn area) + -- x_offset_start = -3, + -- y_offset_start = -10, + -- -- Additional position offsets for each new oil patch (relative to previous oil patch) + -- x_offset_next = 6, + -- y_offset_next = 0 + -- }, + -- ["fluorine-vent"] = + -- { + -- num_patches = 2, + -- amount = 100000, + -- spacing = 6, -- Spacing between each patch, only used for automatic placing. + + -- -- These are only used if not using automatic placing. + -- -- Starting position offset (relative to bottom/south of spawn area) + -- x_offset_start = -3, + -- y_offset_start = -10, + -- -- Additional position offsets for each new oil patch (relative to previous oil patch) + -- x_offset_next = 6, + -- y_offset_next = 0 + -- } +} \ No newline at end of file diff --git a/lib/spawn_area_generation.lua b/lib/spawn_area_generation.lua index 88c876c..73da5e2 100644 --- a/lib/spawn_area_generation.lua +++ b/lib/spawn_area_generation.lua @@ -376,7 +376,8 @@ function PlaceRandomEntities(surface, position) if (open_pos ~= nil) then surface.create_entity({ name = entity_name, - position = open_pos + position = open_pos, + amount = entry.amount }) end end diff --git a/locale/en/locale-mod-settings.cfg b/locale/en/locale-mod-settings.cfg index 8147cf4..23414ce 100644 --- a/locale/en/locale-mod-settings.cfg +++ b/locale/en/locale-mod-settings.cfg @@ -64,7 +64,7 @@ oarc-mod-resource-placement-size-multiplier=Starting resource size multiplier oarc-mod-resource-placement-amount-multiplier=Starting resource amount multiplier [mod-setting-description] -oarc-mod-default-enable-secondary-spawns-on-other-surfaces=[color=red]SECONDARY SPAWNS ARE STILL EXPERIMENTAL AND NOT FULLY SUPPORTED!!!![/color] This controls the default behavior for whether other planets/surfaces allow secondary spawns. If enabled, by default all other surfaces will generate secondary spawns when players land on them. Secondary spawns mean that every player who starts their own base, gets their own landing site on the other planets/surfaces. [color=red]If you have other mods installed that add additional surfaces, I recommend leaving this disabled. Regardless of this setting, you can configure which surfaces allow spawning using the in game settings menu.[/color] +oarc-mod-default-enable-secondary-spawns-on-other-surfaces=[color=red]SECONDARY SPAWNS ARE STILL EXPERIMENTAL!!![/color] This controls the default behavior for whether other planets/surfaces allow secondary spawns. If enabled, by default all other surfaces will generate secondary spawns when players land on them. Secondary spawns mean that every player who starts their own base, gets their own landing site on the other planets/surfaces. [color=red]If you have other mods installed that add additional surfaces, I recommend leaving this disabled. Regardless of this setting, you can configure which surfaces allow spawning using the in game settings menu.[/color] oarc-mod-linked-chest-size=This is the size of the shared chest that players can use to share items with other players. This is only meaningful if the shared chest feature is enabled. oarc-mod-welcome-msg-title=This is the title of the welcome message that will be displayed to players when they join the game. diff --git a/locale/en/locale.cfg b/locale/en/locale.cfg index da3bb11..19c48d4 100644 --- a/locale/en/locale.cfg +++ b/locale/en/locale.cfg @@ -240,9 +240,9 @@ oarc-settings-tab-player-warning=You are not an admin. These settings are read-o oarc-settings-tab-description=This tab contains the same mod settings in the mod settings menu AND some additional settings that can only be changed in game. Check the Surface Settings tab for surface-specific settings. oarc-settings-tab-text-field-enter-tooltip=[color=red]You must press ENTER after typing in a text field to save the value![/color] oarc-settings-tab-title-surface=Enable or Disable Surface Features -oarc-settings-tab-surfaces-warning=Only Nauvis as primary and Fulgora as secondary are currently supported at this time! Don't change these settings if you have already landed on other planets. +oarc-settings-tab-surfaces-warning=Only Nauvis as primary is recommended! All planets support secondary spawns at this time, but it is still a work in progress. Please don't change these settings if you have already landed on other planets unless you are okay with losing your progress on those planets. oarc-settings-tab-surface-checkbox-tooltip=Enabling this will allow players to START with custom spawn areas (the main feature of this mod) on this surface. You need at least one of these enabled for the mod to work. -oarc-settings-tab-surface-secondary-checkbox-tooltip=Enabling this will give players custom secondary spawns when they first travel to this surface. This allows players to have separate landing sites. [color=red]This feature is currently a work in progress. If you enable this AFTER landing on a new planet, the next time you travel in a rocket you will be sent to a new spawn![/color] +oarc-settings-tab-surface-secondary-checkbox-tooltip=Enabling this will give players custom landing areas when they first travel to this surface. This allows players to have separate landing sites. [color=red]This feature is currently a work in progress. If you enable this AFTER landing on a new planet, the next time you travel in a rocket you will be sent to a new spawn![/color] oarc-settings-tab-surface-regrowth-checkbox-tooltip=Enabling this will allow the regrowth and world eater features to work on this surface, if those are enabled. oarc-settings-tab-surface-column-header=Surface oarc-settings-tab-surface-spawning-enabled=Home @@ -276,11 +276,13 @@ oarc-shared-chest-helper-txt=This connects to a shared storage chest for all pla oarc-mod-faq-what-is-this-mod=What is this mod? oarc-mod-faq-what-is-this-mod-answer=This mod overhauls multiplayer spawning. Players can create their own spawn points away from the center of the map. Players can also join other players' bases, or create buddy spawns. The mod does not change the core gameplay of Factorio, but it does change the way players start the game. The starting area is a preset area with resources, not a "natural" spawn point. oarc-mod-faq-other-surfaces=Can I start on a different surface/planet? -oarc-mod-faq-other-surfaces-answer=[color=red]This feature is currently a work in progress. As such, only spawning on "nauvis" or a default nauvis-like surface will work correctly.[/color] +oarc-mod-faq-other-surfaces-answer=[color=red]I only recommend starting on "nauvis" or a default nauvis-like surface.[/color] The short answer is yes, but the you probably don't want to. There is no simple way to ensure that you can start on other planets without breaking the normal progression and gameplay. There are other mods out there, like Any Planet Start, but I have not tested compatibility yet. oarc-mod-faq-secondary-spawns=What are secondary spawns? -oarc-mod-faq-secondary-spawns-answer=If enabled, when a player first travels to a new surface that has custom spawning enabled, they will automatically be given a new starting area based on their primary spawn choice (the first spawn they create). [color=red]This feature is currently a work in progress. Secondary spawning on other surfaces may cause issues.[/color] +oarc-mod-faq-secondary-spawns-answer=If enabled, when a player first travels to a new planet/surface, they will automatically be given a separate landing area based on their primary spawn choice (the first spawn they create). [color=red]This feature is currently a work in progress, but I have now added support for the Space Age planets (fulgora, gleba, vulcanus, and Aquilo).[/color] There are some known issues, such as cargo-pods landing at the center of the map if you don't have a landing pad setup yet (use the /oarc-wheres-my-cargo-pod command to retrieve them). Additionally, Vulcanus doesn't yet provide any API support to modify demolishers or territories, so I have a crude safety mechanism that removes demolishers close to your spawn area. All planets should still be playable, but it's not perfect. Please report issues to me on discord/github. +oarc-mod-faq-enemy-scaling=How are enemies handled? +oarc-mod-faq-enemy-scaling-answer=Good question! My mod attempts to provide a safe starting area to any player joining the game, or landing on a new planet. The primary way this is done is by removing most of the enemies around new bases. Additionally, areas near to player bases only spawn the easier enemy variants regardless of global evolution setting. On Nauvis, worms are scaled as well so that you won't be surrounded only by behemoth worms if you choose to spawn far from the map center. On Vulcanus, as a temporary workaround until we get a proper API to modify territories, I remove any demolishers that come close to your base. This is a crude solution, but it works for now. I also scale the damage done to spawners based on the evolution factor and distance to the closest spawn point. This helps compensate for the spawner health scaling at a high evolution factor. To tweak the distances, please check the surface settings tab. Each surface has its own settings for the safe, warn, and danger areas around spawn points. oarc-mod-faq-what-are-teams=What are the different team options? -oarc-mod-faq-what-are-teams-answer=I wrote this mod for co-op play only, not pvp. Depending on the mod settings, you can either join the main team, which shares research, or create your own team, which has its own research tree. All teams/forces are friendly to each other and can communicate in chat and (optionally) share map vision. The only reason to create your own team is if you want to have your own research progress. +oarc-mod-faq-what-are-teams-answer=I wrote this mod for co-op play only, not pvp, but you can disable cease fire and friendly teams in the settings. Depending on the mod settings, you can either join the main team, which shares research, or create your own team, which has its own research tree. All teams/forces are friendly to each other and can communicate in chat and (optionally) share map vision. The only reason to create your own team is if you want to have your own research progress. oarc-mod-faq-shared-spawn=What is a shared spawn? oarc-mod-faq-shared-spawn-answer=Players can choose to allow other players to join their base. This allows new players to spawn in the same starting area as the host player. The host player can control who can join their base. oarc-mod-faq-buddy-spawn=What is a buddy spawn? diff --git a/migrations/oarc-mod-v2.1.13.lua b/migrations/oarc-mod-v2.1.13.lua index 6c2958a..b2fc216 100644 --- a/migrations/oarc-mod-v2.1.13.lua +++ b/migrations/oarc-mod-v2.1.13.lua @@ -16,7 +16,7 @@ for _,surface in pairs(game.surfaces) do end end --- Make sure vulcanus config is set up if it is missing. +-- Make sure vulcanus config is set up if it is missing or outdated. if script.active_mods["space-age"] ~= nil then if (storage.ocfg.surfaces_config["vulcanus"] == nil) or (storage.ocfg.surfaces_config["vulcanus"].spawn_config.liquid_tile ~= "lava") then @@ -29,7 +29,7 @@ if script.active_mods["space-age"] ~= nil then end end --- Make sure gleba config is set up if it is missing. +-- Make sure gleba config is set up if it is missing or outdated. if script.active_mods["space-age"] ~= nil then if (storage.ocfg.surfaces_config["gleba"] == nil) or (storage.ocfg.surfaces_config["gleba"].spawn_config.gleba_resources == nil) or @@ -41,4 +41,17 @@ if script.active_mods["space-age"] ~= nil then } log("Updating gleba config with new spawn_config and starting_items.") end +end + +-- Make sure aquilo config is set up if it is missing or outdated. +if script.active_mods["space-age"] ~= nil then + if (storage.ocfg.surfaces_config["aquilo"] == nil) or + (storage.ocfg.surfaces_config["aquilo"].spawn_config.fill_tile ~= "ice-smooth") then + storage.ocfg.surfaces_config["aquilo"] = + { + spawn_config = AQUILO_SPAWN_CONFIG, + starting_items = AQUILO_STARTER_ITEMS + } + log("Updating aquilo config with new spawn_config and starting_items.") + end end \ No newline at end of file