So, when I looked at your mod, and was attempting to add settings to it I hit a pitfall where I have no idea how to add settings to your mod the way I did bob's greenhouse (which my settings no longer work for since 0.17 because the devs changed something somewhere that broke my damn mod with no apparent cause). I'll share what I got so far, and perhaps you can add settings to your mod?
Settings.lua
Code: Select all
data:extend({
{
-- Technology List for Permanent Evolution
type = "string-setting",
name = "technology-list",
localised_name = "List of technologies and the level of evolution they max at.",
localised_description = "Simply list a technology, and then the evolution unlocking it will max at. I suggest going in evolution order so you don't get lost and confused. Warning, a blank setting will result in max evolution and disable the mod.",
setting_type = "startup",
allow_blank = true,
default_value = "turrets:0.01,military:0.1,steel-processing:0.2,military-2:0.3,military-3:0.7",
order = 1
},
-- Structure List for Evolution Addition
type = "string-setting",
name = "structure-list",
localised_name = "List of structures and evolution they add.",
localised_description = "This is a list of structures that once built, they will add evolution cap. Once destroyed, the evolution cap will decrease again.",
setting_type = "startup",
allow_blank = true,
default_value = "",
order = 2
},
{
-- Enemy Base evolution factor
type = "bool-setting",
name = "enemy-base-deleveler",
localised_name = "Reset enemy base structures as well?",
localised_description = "Set to true, if the enemy base should be reset when evolution level is lower than the base level. If set to false, bases will generate normally, and only enemy attack waves will be set to the current evolution factor making it potentially harde to take down enemy bases on resource deposits.",
setting_type = "startup",
default_value = true,
order = 3
}
})
The first setting, is a list of technologies and the evolution setting they unlock. But now that I've looked more closely at your mod because this confused me, it seems more like, the evolution listed on that technology is the technology that the game goes up to until you unlock that tech. Since it maxes at 1% till I unlock turrets, and then after turrets its 10%. Why do you have Steel Processing increase the max? A little odd since its not a defense technology.
The next list, is part of my suggestion previously. For each entity built, the cap of evolution increases. So say you add turret as one entity and set it to 0.001, the cap will go up by 0.1% each turret you have. If you have 30 turrets, the cap will be 3% higher than your permanent cap level. Say all you have is turrets researched, your cap is 10%, + 3%, 13%. Now half your turrets are destroyed in a raid, the cap will go down to 11.5%.
Adding onto that suggestion however, perhaps you can have the cap decrease slowly when it reduces, like a max rate of 0.1% per minute. That'll help smooth things out rather than instant de-leveling everything in the middle of a battle.
Here's the code part I was gonna attempt, but I'm not a coder so I have no idea if it would have worked. I just cut pieces from other projects of mine where a friend helped out with portions as well.
Code: Select all
local TECH_LIST= settings.global["technology-list"].value
local STRUCT_LIST= settings.global["structure-list"].value
local BASE_SETTING= settings.global["enemy-base-deleveler"].value
-- Lets create a splitter function so we can split our additional strings properly.
local function split(inputstr, sep)
if sep == nil then sep = "%s" end
t={} i=1
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
t[i] = str
i = i + 1
end return t
end
-- Now lets rebuild the list of technology unlocks and their evolution factors.
script.on_event(defines.events.on_player_created,function(param)
local p=game.players[param.player_index]
if TECH_LIST ~= "" then
local items = split(TECH_LIST,",")
for no, item_str in pairs(items) do
local info = split(item_str,":")
if game.forces[player].technologies[info[1]] then
addTechEvoThreshold(info[1],tonumber(info[2]))
end
end
end
end)
--[[ Reference Code:
addTechEvoThreshold("turrets", 0.01)
addTechEvoThreshold("steel-processing", 0.2)
addTechEvoThreshold("military", 0.1)
addTechEvoThreshold("military-2", 0.3)
addTechEvoThreshold("military-3", 0.7)]]--
I left the reference in there only when I was planning to test, but I gave up cause I couldn't figure out how to go about doing this. So I leave it up to you to fiddle with now. I really hope you can add these settings so we can alter this stuff ourselves.
With bob's mods and Rampart you can still lose rather quickly to AI, plus I play a slower game where I try not to pollute a lot. For some reason researching steel causes the evolution to go very high and I lose every time I do, when I need steel for early game stuff and I've still got crummy bad turrets.