Planetorio


Warptorio2 but the planets thing is a standalone library that can be used by anyone to make and work with planets, surface templates, and simple automation and management of surface-specific events (e.g. only raised if an entity is built on that planets surface) and chunk generation.

Internal
1 year, 7 months ago
0.17 - 1.1
36.6K
Environment

g Can someone explain me how to create or edit planets

2 years ago

Hi,
I would like to adjust the stored planets so that resources from other mods are also generated there. (more precisely from the bz mods.)

Can someone explain me how to approach this matter.
So: Where are the mods stored and what do you have to specify to insert another Reccoursen in a map, which should be optional, so that you can play with or without this mod. (and if necessary also how to create optional maps, for example to create an aluminum planet.)

2 years ago
(updated 2 years ago)

This looks to be the result of the modifier "nauvis" (and "mauvis") disabling parts of the default world-gen settings via g.default_enable_all_autoplace_controls=false. No real idea on how that best can be fixed

2 years ago
(updated 2 years ago)

First of all, thanks for this tip.
I just want to mention that I have never worked on a mod at Factorio or anywhere else. So I'm just learning all the basics. I am a complete novice when it comes to mods. (But I have programming experience with VBA and Google app script.) So if you give me tips then please explain me rather too much than too little. :-)

My suspicion of how the Planetorio mods work is:
The default setting for generating a planet is disabled and instead a dataset is retrieved from the new detected planet at each warp. In this dataset is defined which land types are there, how the scaling of the enemies is and which resources should be generated there. (Because there are planets on which resources are missing).

My solutions are now I find the file in which the planet properties are defined and add there the resources from the bz mods, but what would mean that I have to overwrite the original file and I thus create a modified mod only for me.

or I find a way how I can still deposit an additional entry in the list with the planet parameters. In this case I could create and upload a mod that can be used by others.

edit: The Name of the file with planet parameters is "control_planets_templates.lua"
edit2: currently I do not understand the following code correctly (the example is from Copper Planet)
the first code seems to switch on all resources with a multiplier of 0.3 and
the second code then seems to assign a new value to copper again.
The question that now pops into my head is, where are the default values from the first line loaded from?

            {"resource",{op="set",all=true,value=0.3}},
            {"resource_named",{op="set",res={["copper-ore"]=PCR(4,2,1)}}}

edit3: the default values are stored in another file:
control_planets_modifiers.lua

All resources are also stored here individually.
nauvis.resource={"iron-ore","copper-ore","stone","coal","uranium-ore","crude-oil"} -- game.autoplace_control_prototypes (resources edition)

So now I have to find a way to overwrite this default list with a modified list generated by checking the installed bz-mods.

2 years ago

I managed to hack it by modifying the list mentioned above as well as two more places in the same file (searched for "copper"), to include the added bz resources. I think a real fix would be for the nauvis.resource list to not be hardcoded and instead be populated by reading which resources exist from the global data variable however that seems to require more invasive changes since data is not available when nauvis.resource is set. (First time I looked at factorio mods so I might be very wrong about all this but the hack did get the resources generated again).

local function contains(table, elem)
    for i, v in ipairs(table) do
        if v == elem then
            return true
        end
    end
    return false
end

local function add_missing_elements(output, input)
    for i, v in ipairs(input) do
        if not contains(output, v) then
            table.insert(output, v)
        end
    end
end

nauvis.resource = { "crude-oil", "coal", "copper-ore", "iron-ore", "stone", "uranium-ore", "tin-ore", "aluminum-ore", "lead-ore", "gas", "tungsten-ore", "zircon", "titanium-ore", "graphite" }

nauvis.tile = { -- game.tile_prototypes (with autoplace)
    "concrete", "stone-path", "tutorial-grid", "refined-concrete", "refined-hazard-concrete-left", "refined-hazard-concrete-right", "hazard-concrete-left", "hazard-concrete-right",
    "grass-1", "grass-2", "grass-3", "grass-4", "dirt-1", "dirt-2", "dirt-3", "dirt-4", "dirt-5", "dirt-6", "dirt-7", "dry-dirt", "sand-1", "sand-2", "sand-3",
    "red-desert-0", "red-desert-1", "red-desert-2", "red-desert-3", "lab-dark-1", "lab-dark-2", "lab-white", "landfill", "out-of-map", "water", "deepwater",
}

nauvis.noise = { -- game.noise_layer_prototypes (isn't used nor needed for planets)
    "aux", "brown-fluff", "coal", "copper-ore", "crude-oil", "dirt-1", "dirt-2", "dirt-3", "dirt-4", "dirt-5", "dirt-6", "dirt-7", "dry-dirt",
    "elevation", "elevation-persistence", "enemy-base", "fluff", "garballo",
    "grass-1", "grass-2", "grass-3", "grass-4", "grass1", "grass2", "green-fluff", "iron-ore", "moisture", "pita", "pita-mini",
    "red-desert-0", "red-desert-1", "red-desert-2", "red-desert-3", "red-desert-decal", "rocks",
    "sand-1", "sand-2", "sand-3", "sand-decal", "sand-dune-decal", "starting-area", "stone", "temperature",
    "trees", "trees-1", "trees-10", "trees-11", "trees-12", "trees-13", "trees-14", "trees-15", "trees-2", "trees-3", "trees-4", "trees-5", "trees-6", "trees-7", "trees-8", "trees-9",
    "uranium-ore", }
add_missing_elements(nauvis.noise, nauvis.resource)

nauvis.decor = { -- game.decorative_prototypes (with autoplace)
    "brown-hairy-grass", "green-hairy-grass", "brown-carpet-grass",
    "green-carpet-grass", "green-small-grass", "green-asterisk",
    "brown-asterisk-mini", "green-asterisk-mini", "brown-asterisk",
    "red-asterisk", "dark-mud-decal", "light-mud-decal", "puberty-decal",
    "red-desert-decal", "sand-decal", "sand-dune-decal", "green-pita",
    "red-pita", "green-croton", "red-croton", "green-pita-mini", "brown-fluff",
    "brown-fluff-dry", "green-desert-bush", "red-desert-bush", "white-desert-bush",
    "garballo-mini-dry", "garballo", "green-bush-mini", "lichen", "rock-medium",
    "rock-small", "rock-tiny", "big-ship-wreck-grass", "sand-rock-medium", "sand-rock-small", "small-ship-wreck-grass"

}

nauvis.entities = { -- game.entity_prototypes (with autoplace)
    "fish", "tree-01", "tree-02", "tree-03", "tree-04", "tree-05", "tree-09", "tree-02-red", "tree-07", "tree-06", "tree-06-brown",
    "tree-09-brown", "tree-09-red", "tree-08", "tree-08-brown", "tree-08-red", "dead-dry-hairy-tree", "dead-grey-trunk",
    "dead-tree-desert", "dry-hairy-tree", "dry-tree", "rock-huge", "rock-big", "sand-rock-big", "small-worm-turret",
    "medium-worm-turret", "big-worm-turret", "behemoth-worm-turret", "biter-spawner", "spitter-spawner",
    "crude-oil", "coal", "copper-ore", "iron-ore", "stone", "uranium-ore",
}
add_missing_elements(nauvis.entities, nauvis.resource)
2 years ago

I think it might actually be a load-order issue. the on_init() attempts to add resources it doesn't know about, but it apparently isn't seeing the BZ resources

1 year, 10 months ago

Modded ore related issues have been fixed in 0.1.4.
If this is still an issue afterwards please open a new thread.

This thread has been locked.