Frozen World


Stuck on an ice world with seas of methane and and an ammonia atmosphere. The only organic material on the planet appears to be a vicious native animal! Can you survive long enough to escape?

Mod packs
3 years ago
0.16 - 1.1
408

b Crash on Death by O2 loss with no tanks in inventory

6 years ago
(updated 6 years ago)

HAS BEEN RESOLVED

Crash on Death by O2 loss with no tanks in inventory

Was running some tests on the mod for a playthrough that myself and another were planning to do an ran into an immediate issue on testing deaths.

Started a new Game and I removed all O2 tanks from inventory to start dying. Upon death I get this error which then reverts user to main menu.

Error while running event Oxygen::on_tick (ID 0)
Oxygen/control.lua:91: attempt to get length of local 'inv' (a nil value)

This section of the Oxygen mod is doing a check for the O2 tanks in players inventory but since there are none the game crashes as there is no Else statement or exception in the code for if the player has no O2 tanks in inventory.

This is not solely caused by the Mod pack but the Oxygen mod itself so I will also test by itself and get back to this.

6 years ago

Same effect on just using Oxygen mod by itself (had to edit to include icon_size = 32, in the Lua to get it to work by itself) so we need to make an else statement to get oxygen to not cause the issue on not having o2 tanks in inventory.

6 years ago

Yeah, I bumped into this one myself testing today. I'll have it (and a number of other issues) fixed by tomorrow. Thanks for the report.

6 years ago
(updated 6 years ago)

No problem I am messing around with learning how the code for that section works and it seems that the code is not able to handle an empty Quickbar as the issue as that is what Line 91 is referencing.

The above is incorrect just tested.

6 years ago

Im really dumb sorry about that i should have thought in the first place about inv size. The actual issue is the system is doing a reference to player inventory size but upon death inventory size is set to 0.

6 years ago

I just dropped a fixed version here: https://mods.factorio.com/mod/Oxygen_Patched

You were right, it just needed a nil reference check before doing it's thing. I'm guessing character inventory returns nil when you're dead.

6 years ago
(updated 6 years ago)

be sure to update the Graphics listed on your fixed version to Oxygen_Patched/graphics as it will give an error if there is not a mod in the mod folder called Oxygen

6 years ago

Yeah, first version I uploaded I forgot that :P New one should work.

6 years ago

Yup works great now doing some initial testing of the mod now will do more in-depth thoughts on Thursday when my friend and I play co-op. As to not cause any stress to the mod on here I will create a new discussion for that as this issue is Resolved.

New response