Re: [MOD 0.10.2] Resource Spawner Overhaul - v1.0.2
Posted: Wed Jan 21, 2015 2:49 am
Can we have support for Uranium Power mod?
www.factorio.com
https://forums.factorio.com/
Since you have a github up for this mod ( it be nice if all mods did this ) would you mind if I push some support for MoMods?AnodeCathode wrote:Done. Excellent changes. I've put together an updated archive on the releases page:fishlips13 wrote: AnodeCathode, if you wish to use the changes I've made and update your GitHub, by all means do. The files I've changed (config.lua and control.lua) are in a separate zip file attached to this post.
https://github.com/AnodeCathode/Resourc ... s/releases
You can also see any changes made from 1.0.5 to 1.0.6 here:
https://github.com/AnodeCathode/Resourc ... 7a30f9535d
I wouldn't mind at all. That was the idea of throwing it up on Github, so we can track the changes and easily fold in PRs for new features.gnz wrote: Since you have a github up for this mod ( it be nice if all mods did this ) would you mind if I push some support for MoMods?
Code: Select all
if remote.interfaces["peacemod"] then
config["alien-ore"] = {
type="resource-ore",
allotment=30,
spawns_per_region={min=0, max=1},
richness={min=300, max=1000},
size={min=5, max=10},
multi_resource_chance=0.2,
multi_resource={
['copper-ore'] = 1,
}
}
end
Code: Select all
33536.417519 Info Logger.cpp:149: 2015-01-30 23:40:55; Factorio 0.11.13 (Build 13133, linux64)
33536.417601 Info Logger.cpp:153: Operating system: Linux
33536.417626 Info Paths.cpp:202: Read data path: /home/mnorman/factorio/data
33536.417647 Info Paths.cpp:203: Write data path: /home/mnorman/factorio
33536.417665 Info Paths.cpp:204: Binaries path: /home/mnorman/factorio/bin
33536.737921 Info ModManager.cpp:204: Loading mod core 0.0.0 (data.lua)
33536.759761 Info ModManager.cpp:204: Loading mod base 0.11.13 (data.lua)
33537.032673 Info ModManager.cpp:204: Loading mod peacemod 0.1.0 (data.lua)
33537.277859 Info ModManager.cpp:204: Loading mod rso-mod 1.0.6 (data.lua)
33537.298135 Error Util.cpp:43: __rso-mod__/data.lua:3: __rso-mod__/prototypes/prototype_utils.lua:8: attempt to index field 'autoplace' (a nil value)
Try removing lines 24 to 43 from peacemods data.lua and useMNorman wrote: This crash is not seen if override_normal_spawn=false, but setting disable_RSO_biter_spawning = true does not prevent the crash.
I think that this means that the crash is due to RSO trying to override the biter spawner placement code after peacemod has prevented biters from spawning by setting the autoplace for this equal to null.
What would be the best approach to preventing RSO from overriding the biter spawner code when peacemod is installed without altering the spawning of other items?
Are you sure your evolution is high enough for spitters to spawn? I know they need a certain evolution (0.3 according to the release notes) to spawn, and guess below that they will spawn biters?Animar wrote:Hi guys, I having the weird issue that spiter spawner nests created by RSO spawn normal biters ?
- I first used the 1.0.2 self modified for spiter spawner. Spiter nests where created but after a while i noticed that there are only normal biter mobs running at me.
- Then I used the 1.0.5 from this thread, still same problem.
- Lastly I tried the 1.0.6 version but again both nest types but only normal biters
so what the hell went wrong ????
This is probably a bit late since it's been a couple of days, but here is the reason:MNorman wrote: However, I get a crash on loading the game, with the following log:This crash is not seen if override_normal_spawn=false, but setting disable_RSO_biter_spawning = true does not prevent the crash.Code: Select all
33536.417519 Info Logger.cpp:149: 2015-01-30 23:40:55; Factorio 0.11.13 (Build 13133, linux64) 33536.417601 Info Logger.cpp:153: Operating system: Linux 33536.417626 Info Paths.cpp:202: Read data path: /home/mnorman/factorio/data 33536.417647 Info Paths.cpp:203: Write data path: /home/mnorman/factorio 33536.417665 Info Paths.cpp:204: Binaries path: /home/mnorman/factorio/bin 33536.737921 Info ModManager.cpp:204: Loading mod core 0.0.0 (data.lua) 33536.759761 Info ModManager.cpp:204: Loading mod base 0.11.13 (data.lua) 33537.032673 Info ModManager.cpp:204: Loading mod peacemod 0.1.0 (data.lua) 33537.277859 Info ModManager.cpp:204: Loading mod rso-mod 1.0.6 (data.lua) 33537.298135 Error Util.cpp:43: __rso-mod__/data.lua:3: __rso-mod__/prototypes/prototype_utils.lua:8: attempt to index field 'autoplace' (a nil value)
I think that this means that the crash is due to RSO trying to override the biter spawner placement code after peacemod has prevented biters from spawning by setting the autoplace for this equal to null.
What would be the best approach to preventing RSO from overriding the biter spawner code when peacemod is installed without altering the spawning of other items?
Code: Select all
function add_peak(ent, peak)
if (ent.autoplace ~= null) then
ent.autoplace.peaks[#ent.autoplace.peaks+1] = peak
end
end
My modified version is set to not do complete replacement by default. This means you do need to set the vanilla worldgen settings to 'none'. I changed it so I can allow some vanilla worldgen if desired. You can also go into the config.lua and change:JackGruff wrote:0.11.15
No other mods.
I downloaded https://github.com/AnodeCathode/Resourc ... cial.1.0.6
Did not touch any world gen settings.
Pretty sure it's not suppose to look like this.
Code: Select all
override_normal_spawn = false
Code: Select all
override_normal_spawn = true
Code: Select all
require 'defines'
debug_enabled = false
region_size=8 -- alternative mean to control how further away resources would be, default - 256 tiles or 8 chunks
-- each region is region_size*region_size chunks
-- each chunk is 32*32 tiles
override_normal_spawn = true -- if false then the standard spawner can also spawn full grown resources/entities,
-- set resources you want to control through this config to "None" in worldgen "Size" settings when starting a new game
-- changing of this setting requires game restart, i.e. close game and start it again, not actally a new game
override_type = 'full' -- 'full' - no spawns by game are allowed, 'partially' - very small patches are spawned by world gen
-- changing of this setting requires game restart
starting_area_size=1 -- starting area in regions, safe from random nonsense
absolute_resource_chance=0.30 -- chance to spawn an resource in a region
global_richness_mult = 1.2 -- multiply richness all resources
multi_resource_richness_factor=0.60 -- any additional resource is multiplied by this value times resources-1
multi_resource_size_factor=0.60
multi_resource_chance_diminish=0.8 -- diminishing effect factor on multi_resource_chance
min_amount=350 -- default value for minimum amount of resource in single pile
richness_distance_factor=1.050 -- 3.0 relative % per region distance ~ 2.1x mult @ 25 regions distance
deterministic = true -- set to false to use system for all decisions math.random
endless_resource_mode = false -- if true, the size of each resource is modified by the following modifier. Use with the endless resources mod.
endless_resource_mode_sizeModifier = 0.30
disable_RSO_biter_spawning = false -- if true, no biters will be spawned by RSO. Do not use with override_normal_spawn = true, because then no biters will be spawned at all.
biter_ratio_segment=1 --the ratio components determining how many biters to spitters will be spawned
spitter_ratio_segment=1 --eg. 1 and 1 -> equal number of biters and spitters, 10 and 1 -> 10 times as many biters to spitters
config={
["iron-ore"] = {
type="resource-ore",
-- general spawn params
allotment=120, -- how common resource is
spawns_per_region={min=1, max=2}, --number of chunks
richness=9000,
size={min=10, max=60}, -- rough radius of area, too high value can produce square shaped areas
-- resource provided at starting location
-- probability: 1 = 100% chance to be in starting area
-- 0 = resource is not in starting area
starting={richness=3000, size=20, probability=1},
multi_resource_chance=0.13, -- absolute value
multi_resource={
["iron-ore"] = 2, -- ["resource_name"] = allotment
['copper-ore'] = 4,
["coal"] = 8,
["stone"] = 8,
["crude-oil"] = 1,
}
},
["copper-ore"] = {
type="resource-ore",
allotment=120,
spawns_per_region={min=1, max=2},
richness=11000,
size={min=10, max=50},
starting={richness=2500, size=15, probability=1},
multi_resource_chance=0.13,
multi_resource={
["iron-ore"] = 4,
['copper-ore'] = 2,
["coal"] = 8,
["stone"] = 8,
["crude-oil"] = 1,
}
},
["coal"] = {
type="resource-ore",
allotment=100,
spawns_per_region={min=1, max=3},
size={min=5, max=40},
richness=14000,
starting={richness=2750, size=15, probability=1},
multi_resource_chance=0.13,
multi_resource={
["iron-ore"] = 2,
['copper-ore'] = 2,
["coal"] = 8,
["stone"] = 8,
["crude-oil"] = 1,
}
},
["stone"] = {
type="resource-ore",
allotment=80,
spawns_per_region={min=1, max=2},
richness=9000,
size={min=15, max=25},
starting={richness=2000, size=8, probability=1},
multi_resource_chance=0.13,
multi_resource={
["iron-ore"] = 2,
['copper-ore'] = 2,
["coal"] = 8,
["stone"] = 8,
["crude-oil"] = 3,
}
},
["crude-oil"] = {
type="resource-liquid",
minimum_amount=750,
allotment=45,
spawns_per_region={min=1, max=2},
richness={min=20000, max=100000}, -- total richness of site
size={min=2, max=10}, -- richness devided by this number
starting={richness=4000, size=1, probability=0.5}
},
["biter-spawner"] = {
type="entity",
force="enemy",
clear_range = {3, 3},
spawns_per_region={min=1,max=3},
size={min=2,max=6},
size_per_region_factor=1.05,
richness=1,
absolute_probability=0.15, -- chance to spawn in region
probability_distance_factor=1, -- relative incress per region
max_probability_distance_factor=2.0, -- absolute value
along_resource_probability=0.30, -- chance to spawn in resource chunk anyway, absolute value. Can happen once per resource.
sub_spawn_probability=0.4, -- chance for this entity to spawn anything from sub_spawns table, absolute value
sub_spawn_size={min=1, max=2}, -- in same chunk
sub_spawn_distance_factor=1.02,
sub_spawn_max_distance_factor=2,
sub_spawns={
["small-worm-turret"]={
min_distance=2,
allotment=2000,
allotment_distance_factor=0.9,
clear_range = {1, 1},
},
["medium-worm-turret"]={
min_distance=5,
allotment=1000,
allotment_distance_factor=1.05,
clear_range = {1, 1},
},
["big-worm-turret"]={
min_distance=7,
allotment=500,
allotment_distance_factor=1.15,
clear_range = {1, 1},
}
}
}
}
--[[ MODS SUPPORT ]]--
-- Endless resources mod
-- reduce the starting area size of resources (Note: only done for vanilla resources)
-- The size will additionally be modified with endless_resource_mode_sizeModifier
if endless_resource_mode then
config["iron-ore"].starting = {richness=2000, size=22, probability=1}
config["copper-ore"].starting = {richness=1800, size=20, probability=1}
config["coal"].starting = {richness=2500, size=15, probability=1}
config["stone"].starting = {richness=1000, size=10, probability=1}
end
-- Roadworks mod
if remote and game then
if game.entityprototypes["RW-limestone"] then
config["RW-limestone"] = {
type="resource-ore",
allotment=85,
spawns_per_region={min=1, max=2},
richness=11000,
size={min=10, max=17},
starting={richness=1000, size=4, probability=0.9},
multi_resource_chance=0.15,
multi_resource={
["coal"] = 2,
["stone"] = 8,
["crude-oil"] = 1,
}
}
config["stone"].multi_resource["RW-limestone"] = 12
config["iron-ore"].multi_resource["RW-limestone"] = 3
config["copper-ore"].multi_resource["RW-limestone"] = 3
config["coal"].multi_resource["RW-limestone"] = 3
end
-- DyTech
if remote.interfaces["DyTech-Core"] then
config["stone"].allotment = 100
config["stone"].richness = 25000
config["stone"].starting.richness = 10000
end
if remote.interfaces["DyTech-Metallurgy"] then
-- exotic ores
config["gold-ore"] = {
type="resource-ore",
allotment=25,
spawns_per_region={min=2, max=5},
richness=175,
size={min=2, max=5},
min_amount = 15,
starting={richness=50, size=3, probability=0},
multi_resource_chance=0.60,
multi_resource={
["lead-ore"] = 3,
["silver-ore"] = 3,
["tin-ore"] = 3,
["tungsten-ore"] = 3,
["zinc-ore"] = 3,
}
}
config["silver-ore"] = {
type="resource-ore",
allotment=25,
spawns_per_region={min=2, max=5},
richness=220,
size={min=2, max=5},
min_amount = 15,
starting={richness=50, size=3, probability=0},
multi_resource_chance=0.60,
multi_resource={
["lead-ore"] = 3,
["gold-ore"] = 3,
["tin-ore"] = 3,
["tungsten-ore"] = 3,
["zinc-ore"] = 3,
}
}
config["lead-ore"] = {
type="resource-ore",
allotment=25,
spawns_per_region={min=2, max=5},
richness=220,
size={min=2, max=5},
min_amount = 15,
starting={richness=50, size=3, probability=0.2},
multi_resource_chance=0.60,
multi_resource={
["silver-ore"] = 3,
["gold-ore"] = 3,
["tin-ore"] = 3,
["tungsten-ore"] = 3,
["zinc-ore"] = 3,
}
}
config["tin-ore"] = {
type="resource-ore",
allotment=25,
spawns_per_region={min=2, max=5},
richness=220,
size={min=2, max=5},
min_amount = 15,
starting={richness=50, size=3, probability=0},
multi_resource_chance=0.60,
multi_resource={
["lead-ore"] = 3,
["silver-ore"] = 3,
["gold-ore"] = 3,
["tungsten-ore"] = 3,
["zinc-ore"] = 3,
["copper-ore"] = 2,
}
}
config["tungsten-ore"] = {
type="resource-ore",
allotment=25,
spawns_per_region={min=2, max=5},
richness=220,
size={min=2, max=5},
min_amount = 15,
starting={richness=50, size=3, probability=0},
multi_resource_chance=0.60,
multi_resource={
["lead-ore"] = 3,
["silver-ore"] = 3,
["gold-ore"] = 3,
["tin-ore"] = 3,
["zinc-ore"] = 3,
}
}
config["zinc-ore"] = {
type="resource-ore",
allotment=25,
spawns_per_region={min=2, max=5},
richness=220,
size={min=2, max=5},
min_amount = 15,
starting={richness=50, size=3, probability=0},
multi_resource_chance=0.60,
multi_resource={
["lead-ore"] = 3,
["silver-ore"] = 3,
["gold-ore"] = 3,
["tin-ore"] = 3,
["tungsten-ore"] = 3,
}
}
-- moltensomethin
config["lava-2800"] = {
type="resource-liquid",
minimum_amount=1000,
allotment=17,
spawns_per_region={min=1, max=3},
richness={min=40000, max=120000},
size={min=2, max=7},
absolute_probability=0.01,
multi_resource_chance=0.25,
multi_resource={
["lava-2800"] = 1,
["lava-1400"] = 2,
["lava-600"] = 4
}
}
config["lava-1400"] = {
type="resource-liquid",
minimum_amount=1000,
allotment=22,
spawns_per_region={min=1, max=3},
richness={min=40000, max=120000},
size={min=2, max=7},
absolute_probability=0.01,
multi_resource_chance=0.25,
multi_resource={
["lava-2800"] = 1,
["lava-1400"] = 2,
["lava-600"] = 4
}
}
config["lava-600"] = {
type="resource-liquid",
minimum_amount=1000,
allotment=25,
spawns_per_region={min=1, max=3},
richness={min=40000, max=120000}, -- total richness of site
size={min=2, max=7}, -- richness devided by this number
absolute_probability=0.01,
starting={richness=10500, size=3, probability=0.4},
multi_resource_chance=0.25,
multi_resource={
["lava-2800"] = 1,
["lava-1400"] = 2,
["lava-600"] = 4
}
}
end
if remote.interfaces["DyTech-Warfare"] then
config["gems"] = {
type="resource-ore",
allotment=50,
spawns_per_region={min=2, max=5},
richness=125,
size={min=2, max=5},
min_amount = 15,
starting={richness=40, size=3, probability=0},
multi_resource_chance=0.20,
multi_resource={
["stone"] = 1
}
}
if config["zinc"] then
config["gems"].multi_resource["lead-ore"] = 3
config["gems"].multi_resource["silver-ore"] = 3
config["gems"].multi_resource["gold-ore"] = 3
config["gems"].multi_resource["tin-ore"] = 3
config["gems"].multi_resource["tungsten-ore"] = 3
config["gems"].multi_resource["zinc-ore"] = 3
config["gems"].multi_resource_chance = 0.50
config["lead-ore"].multi_resource["gems"] = 2
config["silver-ore"].multi_resource["gems"] = 2
config["gold-ore"].multi_resource["gems"] = 2
config["tin-ore"].multi_resource["gems"] = 2
config["tungsten-ore"].multi_resource["gems"] = 2
config["zinc-ore"].multi_resource["gems"] = 2
end
end
-- BobOres
-- up the stone at start
if remote.interfaces["bobores"] then
config["stone"].allotment = 100
config["stone"].starting.richness = 10000
end
-- bobores
if remote.interfaces["bobores"] then
config["gold-ore"] = {
type="resource-ore",
allotment=80,
spawns_per_region={min=2, max=5},
richness=6000,
size={min=10, max=19},
min_amount = 15,
starting={richness=500, size=3, probability=0.1},
multi_resource_chance=0.60,
multi_resource={
["lead-ore"] = 3,
["silver-ore"] = 3,
["tin-ore"] = 3,
["tungsten-ore"] = 3,
["zinc-ore"] = 3,
}
}
config["silver-ore"] = {
type="resource-ore",
allotment=60,
spawns_per_region={min=2, max=5},
richness=4000,
size={min=8, max=10},
min_amount = 15,
starting={richness=500, size=3, probability=0.5},
multi_resource_chance=0.60,
multi_resource={
["lead-ore"] = 3,
["gold-ore"] = 3,
["tin-ore"] = 3,
["tungsten-ore"] = 3,
["zinc-ore"] = 3,
}
}
config["lead-ore"] = {
type="resource-ore",
allotment=80,
spawns_per_region={min=2, max=5},
richness=5000,
size={min=6, max=15},
min_amount = 15,
starting={richness=500, size=6, probability=1},
multi_resource_chance=0.60,
multi_resource={
["silver-ore"] = 3,
["gold-ore"] = 3,
["tin-ore"] = 3,
["tungsten-ore"] = 3,
["zinc-ore"] = 3,
}
}
config["tin-ore"] = {
type="resource-ore",
allotment=90,
spawns_per_region={min=2, max=5},
richness=5000,
size={min=18, max=27},
min_amount = 15,
starting={richness=1000, size=6, probability=1},
multi_resource_chance=0.60,
multi_resource={
["lead-ore"] = 3,
["silver-ore"] = 3,
["gold-ore"] = 3,
["tungsten-ore"] = 3,
["zinc-ore"] = 3,
["copper-ore"] = 2,
}
}
config["tungsten-ore"] = {
type="resource-ore",
allotment=40,
spawns_per_region={min=2, max=5},
richness=2000,
size={min=6, max=9},
min_amount = 15,
starting={richness=50, size=3, probability=0},
multi_resource_chance=0.60,
multi_resource={
["lead-ore"] = 3,
["silver-ore"] = 3,
["gold-ore"] = 3,
["tin-ore"] = 3,
["zinc-ore"] = 3
}
}
config["bauxite-ore"] = {
type="resource-ore",
allotment=90,
spawns_per_region={min=2, max=5},
richness=4000,
size={min=9, max=15},
min_amount = 15,
starting={richness=50, size=3, probability=0},
multi_resource_chance=0.0,
multi_resource={
["lead-ore"] = 3,
["silver-ore"] = 3,
["gold-ore"] = 3,
["tin-ore"] = 3,
["zinc-ore"] = 3,
}
}
config["rutile-ore"] = {
type="resource-ore",
allotment=40,
spawns_per_region={min=2, max=5},
richness=2000,
size={min=6, max=9},
min_amount = 15,
starting={richness=50, size=3, probability=0},
multi_resource_chance=0.0,
multi_resource={
["lead-ore"] = 3,
["silver-ore"] = 3,
["gold-ore"] = 3,
["tin-ore"] = 3,
["zinc-ore"] = 3,
}
}
config["quartz"] = {
type="resource-ore",
allotment=90,
spawns_per_region={min=2, max=5},
richness=5000,
size={min=5, max=12},
min_amount = 15,
starting={richness=500, size=4, probability=0.0},
multi_resource_chance=0.0,
multi_resource={
["lead-ore"] = 3,
["silver-ore"] = 3,
["gold-ore"] = 3,
["tin-ore"] = 3,
["zinc-ore"] = 3,
}
}
config["zinc-ore"] = {
type="resource-ore",
allotment=60,
spawns_per_region={min=2, max=5},
richness=3000,
size={min=6, max=15},
min_amount = 15,
starting={richness=50, size=3, probability=0},
multi_resource_chance=0.60,
multi_resource={
["lead-ore"] = 3,
["silver-ore"] = 3,
["gold-ore"] = 3,
["tin-ore"] = 3,
["tungsten-ore"] = 3,
}
}
end
--[[ commented due to absence in current version of F-Mod
if remote.interfaces["F-Mod"] then
-- geyser left as is for now
config["geyser"] = {
type="resource-liquid",
minimum_amount=750000000,
allotment=0,
spawns_per_region={min=1, max=2},
richness={min=7500000000, max=7500000000}, -- total richness of site
size={min=1, max=2}, -- richness devided by this number
}
if config["lava-600"] then
config["lava-600"].multi_resource["geyser"] = 8
config["lava-1400"].multi_resource["geyser"] = 8
config["lava-2000"].multi_resource["geyser"] = 8
end
end
]]--
end
Well I'll be the first to admit I don't totally understand the generator functions. From going through it I do see that it divides the min_amount by 3 for some reason when doing a full 4 chunk resource generation. Also, if the ore has a min_amount defined, that overrides the global min_amount.katyal wrote:I have "min_amount = 350" in config.lua If I understood correctly this should mean that the smallest pile of ore should have 350 ore in it. Except that I most piles have only 50 ore in the game I am playing. Is there anything I'm missing? Just in case here is the whole file (I've made other changes to it to try and suit my play style):
OK, thanks.AnodeCathode wrote: This means you do need to set the vanilla worldgen settings to 'none'.
Looks like RSO is doing it's thing, yes.JackGruff wrote: OK, thanks.
Does this look normal to you, then?
Code: Select all
richness={min=300, max=1000},
Code: Select all
richness=300,