Thanks a lot!
My problem has turned into a two-parter, it seems the Devs has made sectorturretgenerator.lua in such a way that each 15x15 quadrant can only have 5 different seeds for every type and rarity (so 20 variants per weapon type , 5 per type per rarity), so i need to mod that as well to get some more variety.
The second part is those Restore and Secure functions, i thought i understood them, but can't seem to get it working.
This is the setup:
function TurretFactory.restore(data)
local station = Entity()
local settings = GameSettings()
TheList = data
SeedMod = TheList[settings.seed .. "_" .. station.index.number]
end
function TurretFactory.secure()
local station = Entity()
local settings = GameSettings()
if SeedMod ~= 0 then
TheList[settings.seed .. "_" .. station.index.number] = SeedMod
end
local data = TheList
return data
end
My understanding is that Secure and Restore manipulates a single table associated with the namespace.
I store my modifying value at the [Gameseed_StationIndex]'th index of tha table, so i'm able to store a value for each factory.
Again, working on the assumption that there is a table for each namespace, and not for each instance of the script.
Another assumption is that global variables work the way i think they do.
My SeedMod and TheTable are just placed at the top of my mod file, outside any function.
Writing this, i'm also realizing that if the secure/restore table is for the namespace and not each instance, they would be overwriting eachother on secure, so that mustn't be the case.. hmm.
Sorry for the long post, but can you see what my probably blantant mistake is? :)