Selene: Lunar Exploitation


Explore and exploit Nauvis's closest neighbour, its moon Selene. Mine new metals, transform your use of solar energy and unlock powerful new technologies.

Content
9 days ago
2.0 - 2.1
316
Planets Combat Armor Environment Mining Fluids Logistic network Manufacturing Power Storage

g field 'oxygen-barrel' (a nil value)

a month ago

selene/data-updates.lua:63: attempt to index field 'oxygen-barrel' (a nil value)
stack traceback:
selene/data-updates.lua:63: in main chunk

a month ago

selene/data-final-fixes.lua:11: attempt to index local 'prototype' (a nil value)
stack traceback:
selene/data-final-fixes.lua:11: in function 'add_tooltip'
selene/data-final-fixes.lua:20: in main chunk

a month ago

sorry ,it maybe caused by shchierbin or maraxsis

a month ago

I've looked into it; I think its Shchierbin that's causing the issue because it's version of oxygen doesn't allow barrelling (which Selene requires) and there can only be one "oxygen" fluid.

As a quick fix, you can just replace line 7 of Selene's info.json file with:
"dependencies": ["base >= 2.1", "space-age", "? DiscoScience", "(?) more-quality-scaling", "(?) shchierbin"],
That'll resolve the crash and things should work while I look into proper compatibility.

a month ago

thank you!

a month ago
(updated 9 days ago)

I reached out to the author for Shchierbin but didn't hear back - I've made the smallest change that fixes this (which is the dependency change) and now Selene's oxygen barrelling recipe is back, with no more crashes. Thanks again for your help!

a month ago

Errors still occur. I installed many mods, and the most effective method is to add existence checks.
just like

data-final-fixes.lua:

local function add_tooltip(prototype, name, value_of)
if prototype then
local field = {name = {name}, value = value_of(0), quality_values = {}}
for quality_name, quality in pairs(data.raw.quality) do
if quality.level > 0 then field.quality_values[quality_name] = value_of(quality.level) end
end
prototype.custom_tooltip_fields = prototype.custom_tooltip_fields or {}
table.insert(prototype.custom_tooltip_fields, field)
end
end

data-updates.lua:
if data.raw["item"]["oxygen-barrel"] then
data.raw["item"]["oxygen-barrel"].place_as_equipment_result = "oxygen-barrel"
end

and...

Please use PlanetsLib (PlanetsLib:extend) to define Selene's orbit instead of hardcoding origin in data.lua and
data-final-fixes.lua, as the current implementation breaks compatibility with starmap overhaul mods and causes
Selene's position to glitch out into deep space.

a month ago

Almost all planet mods use PlanetsLib.
https://mods.factorio.com/mod/PlanetsLib

a month ago

Hi, thanks again for reporting this.

I'll take a look at using PlanetLib - I was aware of it but hesitant to add a dependency on an external mod. Would you mind letting me know which spacemap mod you were using that caused the glitch out so I can do some testing?

With regard to the existence checks, the problem with doing things like this is that while the mod runs, players wouldn't find out about fundamental incompatibilities. Crashes like this can be indications of two mods not playing nice, not necessarily just an error to be suppressed. I'll take a look into it but it would be very much appreciated if you could let me know the mod list & crash log?

a month ago

Regarding PlanetsLib, when a mod uses the official definitions instead of PlanetsLib's extend function, subsequently using PlanetsLib's update function to update planet positions will cause misalignment. Currently no other star map mods modify your planet positions; only my modpack has added your mod, and I'm still in the development stage. The old version cannot reproduce the above issue. However, I don't recommend that you test it, because there are more than 240 mods. The most convenient method is to add existence checks. You can add logging, so that when a problem occurs it will be written to the log, and you can see it as well, while players won't get errors either—two birds with one stone.

a month ago

Installing my modpack is also a bit troublesome—it requires downloading specific versions of mods and running an exe file to modify some of them. I suggest you just add existence checks.

a month ago

As for the specific error information, the problem is that when calling add_tooltip, a non-existent prototype is passed in, and data.raw["item"]["oxygen-barrel"] does not exist.

a month ago

As for the specific error information, the problem is that when calling add_tooltip, a non-existent prototype is passed in, and data.raw["item"]["oxygen-barrel"] does not exist.

This is consistent with the two error messages I reported to you at the very beginning.

14 days ago

I'll take a look at using PlanetLib - I was aware of it but hesitant to add a dependency on an external mod.

It's up to you of course, but I would just like to point out that most players that are interested in your mod likely have several other planet mods installed already, and so also likely have planetslib already.

13 days ago

It makes sense and I'm working on a patch currently that will adopt the use of PlanetLib and fix the barrelling issue now that I understand beomyo's use case a little better.

9 days ago

Latest release should fix the outstanding issues:
- PlanetLib now a requirement, so should have compatibility with other mods & space map mods.
- If another mod has removed oxygen barrels when Selene loads, the mod now indicates the issue on load with a more helpful error (oxygen barrels do need to exist for Selene to be playable). A new setting - "Provide missing oxygen barrels" can be enabled to fix this, which adds new oxygen barrels to prevent future nil value errors.

9 days ago

Thanks a lot

8 days ago

selene/data-updates.lua:77: Selene needs oxygen barrels for breathing on Selene, but they are missing. Another mod has probably redefined oxygen with barrelling turned off, or removed the barrels. To have Selene add them, turn on the startup setting "Provide missing oxygen barrels" (selene-provide-missing-oxygen-barrels).

emmm...
I can only modify the mod settings after entering the game.

8 days ago

If you're just looking to get your own saves & game booting, you can just disable all your mods except Selene and its dependencies to get to the main menu (don't load any saves). Then in Settings > Mod Settings > Startup settings > Selene, you can turn on the "Provide missing oxygen barrels" setting, and then re-enable all your other mods, which should now load.

If you are building a mod-pack you want to share with other people, you'll need a tiny mod that forces the setting on permanently. You'll need two files:

info.json

{
"name": "force-selene-oxygen-barrels",
"version": "0.0.1",
"title": "Force Selene to provide oxygen barrels",
"author": "beomyo",
"factorio_version": "2.1",
"dependencies": ["selene >= 1.0.5"]
}

settings-updates.lua

local setting = data.raw["bool-setting"]["selene-provide-missing-oxygen-barrels"]
if setting then
setting.forced_value = true
setting.hidden = true
end

7 days ago

ok

New response