From 75a8323fd07ed6c87c0232731d9407b4b5ba8ea4 Mon Sep 17 00:00:00 2001 From: Jayefuu <87483003+JamesFWilliamson@users.noreply.github.com> Date: Mon, 27 Sep 2021 22:09:15 +0100 Subject: [PATCH 1/7] Updated the starting pollution multiplier The new meta sucks. No one builds any walls or defences. Players can go 3 or 4 hours with no attacks so long as they craft nothing. Now that the pollution from outposts is generated at position = {0,0}.... let's try a very small amount of pollution for every outpost captured to force at least a small amount of defences to be built. This will be MUCH less pollution than if all of the items they get free were made in base, but it will still force at least a few defenses or clearing of nearby bases. Starting with a value of 10 to see how it goes. --- map_gen/maps/crash_site/outpost_builder.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/map_gen/maps/crash_site/outpost_builder.lua b/map_gen/maps/crash_site/outpost_builder.lua index caae142b0..c499ea74b 100644 --- a/map_gen/maps/crash_site/outpost_builder.lua +++ b/map_gen/maps/crash_site/outpost_builder.lua @@ -60,7 +60,8 @@ local magic_fluid_crafters = {index = 1} local outposts = {} local artillery_outposts = {index = 1} local outpost_count = 0 -local pollution_multiplier = {value = 0} +local base_pollution_multiplier = 10 +local pollution_multiplier = {value = 10} Global.register( { @@ -1227,6 +1228,11 @@ local function set_pollution_multiplier(args, player) return end + if multiplier < base_pollution_multiplier then + pollution_multiplier.value = base_pollution_multiplier + player.print("Cannot set the multiplier lower than the base multiplier of " .. base_pollution_multiplier) + end + local old_multiplier = pollution_multiplier.value pollution_multiplier.value = multiplier local message = player.name..' changed magic crafter pollution multiplier from '..old_multiplier..' to '..pollution_multiplier.value From c4286ddf142258f3b6304e645cfac58bee5fa171 Mon Sep 17 00:00:00 2001 From: Jayefuu <87483003+JamesFWilliamson@users.noreply.github.com> Date: Mon, 27 Sep 2021 22:11:06 +0100 Subject: [PATCH 2/7] Fixed failed lua check --- map_gen/maps/crash_site/outpost_builder.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/map_gen/maps/crash_site/outpost_builder.lua b/map_gen/maps/crash_site/outpost_builder.lua index c499ea74b..0341367d8 100644 --- a/map_gen/maps/crash_site/outpost_builder.lua +++ b/map_gen/maps/crash_site/outpost_builder.lua @@ -1231,7 +1231,7 @@ local function set_pollution_multiplier(args, player) if multiplier < base_pollution_multiplier then pollution_multiplier.value = base_pollution_multiplier player.print("Cannot set the multiplier lower than the base multiplier of " .. base_pollution_multiplier) - end + end local old_multiplier = pollution_multiplier.value pollution_multiplier.value = multiplier From eef52b0e7125678740f87eb9d28fda47f49919da Mon Sep 17 00:00:00 2001 From: Jayefuu <87483003+JamesFWilliamson@users.noreply.github.com> Date: Mon, 27 Sep 2021 23:17:30 +0100 Subject: [PATCH 3/7] Missing return --- map_gen/maps/crash_site/outpost_builder.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/map_gen/maps/crash_site/outpost_builder.lua b/map_gen/maps/crash_site/outpost_builder.lua index 0341367d8..6a757e13a 100644 --- a/map_gen/maps/crash_site/outpost_builder.lua +++ b/map_gen/maps/crash_site/outpost_builder.lua @@ -1231,6 +1231,7 @@ local function set_pollution_multiplier(args, player) if multiplier < base_pollution_multiplier then pollution_multiplier.value = base_pollution_multiplier player.print("Cannot set the multiplier lower than the base multiplier of " .. base_pollution_multiplier) + return end local old_multiplier = pollution_multiplier.value From 894b605fe0a3d003bf3e73c6667d8b6fbf86e40c Mon Sep 17 00:00:00 2001 From: Jayefuu Date: Wed, 29 Sep 2021 08:31:40 +0100 Subject: [PATCH 4/7] Updated pollution multiplier minimum limits Following Discord messages with @grilledham, updated the messages to be clearer. Also updated some broken logic and reduced spam to admins if someone tries to set it below the minimum and it's already at the minimum. Changes untestested. I'll test tonight or tomorrow if it passes review, not got Factorio on this laptop. --- map_gen/maps/crash_site/outpost_builder.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/map_gen/maps/crash_site/outpost_builder.lua b/map_gen/maps/crash_site/outpost_builder.lua index 6a757e13a..7ba19f584 100644 --- a/map_gen/maps/crash_site/outpost_builder.lua +++ b/map_gen/maps/crash_site/outpost_builder.lua @@ -1228,10 +1228,14 @@ local function set_pollution_multiplier(args, player) return end - if multiplier < base_pollution_multiplier then - pollution_multiplier.value = base_pollution_multiplier - player.print("Cannot set the multiplier lower than the base multiplier of " .. base_pollution_multiplier) - return + if multiplier < base_pollution_multiplier then + if base_pollution_multiplier == pollution_multiplier.value then -- no change, so not necessary to message all admins and update the value + player.print("Magic crafter pollution is already at minimum value of " .. base_pollution_multiplier) + return + else -- update the value to the minimum and continue to message all admins + player.print("Setting magic crafter pollution multiplier to the minimum value of " .. base_pollution_multiplier) + multiplier = base_pollution_multiplier + end end local old_multiplier = pollution_multiplier.value From 766666026804d49812301bc5a2ab356565d79182 Mon Sep 17 00:00:00 2001 From: Jayefuu Date: Wed, 29 Sep 2021 08:34:56 +0100 Subject: [PATCH 5/7] Fixed failed lua checks --- map_gen/maps/crash_site/outpost_builder.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/map_gen/maps/crash_site/outpost_builder.lua b/map_gen/maps/crash_site/outpost_builder.lua index 7ba19f584..b1c227f75 100644 --- a/map_gen/maps/crash_site/outpost_builder.lua +++ b/map_gen/maps/crash_site/outpost_builder.lua @@ -1228,7 +1228,7 @@ local function set_pollution_multiplier(args, player) return end - if multiplier < base_pollution_multiplier then + if multiplier < base_pollution_multiplier then if base_pollution_multiplier == pollution_multiplier.value then -- no change, so not necessary to message all admins and update the value player.print("Magic crafter pollution is already at minimum value of " .. base_pollution_multiplier) return From ba696c50c3706cfbb292fdf232e8b15cc74eef84 Mon Sep 17 00:00:00 2001 From: Jayefuu Date: Thu, 30 Sep 2021 11:21:34 +0100 Subject: [PATCH 6/7] Update map_gen/maps/crash_site/outpost_builder.lua Co-authored-by: grilledham --- map_gen/maps/crash_site/outpost_builder.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/map_gen/maps/crash_site/outpost_builder.lua b/map_gen/maps/crash_site/outpost_builder.lua index b1c227f75..d3f8b1784 100644 --- a/map_gen/maps/crash_site/outpost_builder.lua +++ b/map_gen/maps/crash_site/outpost_builder.lua @@ -1232,10 +1232,10 @@ local function set_pollution_multiplier(args, player) if base_pollution_multiplier == pollution_multiplier.value then -- no change, so not necessary to message all admins and update the value player.print("Magic crafter pollution is already at minimum value of " .. base_pollution_multiplier) return - else -- update the value to the minimum and continue to message all admins - player.print("Setting magic crafter pollution multiplier to the minimum value of " .. base_pollution_multiplier) - multiplier = base_pollution_multiplier end + -- update the value to the minimum and continue to message all admins + player.print("Setting magic crafter pollution multiplier to the minimum value of " .. base_pollution_multiplier) + multiplier = base_pollution_multiplier end local old_multiplier = pollution_multiplier.value From 2276706743326b21b21881a01f592ce296d42efd Mon Sep 17 00:00:00 2001 From: Jayefuu Date: Thu, 30 Sep 2021 11:24:50 +0100 Subject: [PATCH 7/7] Fixed LUA check --- map_gen/maps/crash_site/outpost_builder.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/map_gen/maps/crash_site/outpost_builder.lua b/map_gen/maps/crash_site/outpost_builder.lua index d3f8b1784..288010c95 100644 --- a/map_gen/maps/crash_site/outpost_builder.lua +++ b/map_gen/maps/crash_site/outpost_builder.lua @@ -1235,7 +1235,7 @@ local function set_pollution_multiplier(args, player) end -- update the value to the minimum and continue to message all admins player.print("Setting magic crafter pollution multiplier to the minimum value of " .. base_pollution_multiplier) - multiplier = base_pollution_multiplier + multiplier = base_pollution_multiplier end local old_multiplier = pollution_multiplier.value