[MOD 1.1] Oxygen

Topics and discussion about specific mods
User avatar
Cheata
Long Handed Inserter
Long Handed Inserter
Posts: 78
Joined: Sun Aug 17, 2014 6:46 am
Contact:

Re: [0.11.X] Oxygen

Post by Cheata »

Neomore wrote:For anyone better at coding than me, i was able to actually get the mod to load on .12 after having to add over 50 lines of code, and lots of underscores. However, currently only placing the oxygen dispenser down works. Picking it up breaks the mod. Haven't figured out how to fix that, yet.

Also, the smoke effect and the dispenser's shadow effects are also broken, as well as oxygen being added to the main menu (i believe). It at least doesn't in test mode.

But, hey. At least Factorio is able to turn on when the mod is installed. That's at least a bit of progress.

Here's the file. I will keep trying to work on it, but would appreciate someone more qualified to do this. Hopefully the mod author him/her self, but anyone will do.

you had to add code? interesting, i might have a look at it myself.

Did you happen to mark the code you added with comments?

**EDIT**
oh nvm i c, extra data in the type definitions to allow for the updates to the circuit network

ill see if i can get my flatmate to do some beta testing on it (as i don't have factorio installed atm) if so i might look at those bugs for u ;)
**EDIT
User avatar
ZombieMooose
Filter Inserter
Filter Inserter
Posts: 289
Joined: Mon Feb 09, 2015 7:23 am
Contact:

Re: [0.11.X] Oxygen

Post by ZombieMooose »

Love the idea of this, and hope you can update it to 0.12.
"men will literally learn everything about ancient Rome instead of going to therapy"
goku90504
Inserter
Inserter
Posts: 24
Joined: Mon Nov 16, 2015 9:16 am
Contact:

Re: [0.11.X] Oxygen

Post by goku90504 »

is there going to be an update for the newer game versions?
QAstral
Manual Inserter
Manual Inserter
Posts: 1
Joined: Thu Dec 31, 2015 1:34 pm
Contact:

Re: [0.11.X] Oxygen

Post by QAstral »

I tried to fix it for game version 0.12.20. But I have found several bugs which probably were in previous mod versions too, so I tried to fix them too... While I was fixing them I decided to add several changes for this mod which are not minor. I hope author will not by angry on me if I send it as unofficial update 1.3.8

Changes are those:
New features
- added config file which is used for some ingame parameters as radius from dispenser, replenishing speed, damages, etc.
- completely reworked dispenser. Now it does not give static amount of oxygen when player is close to it, but it depends on how far he is from it. When player creates several dispenser near to each other he will get even more oxygen per tick (there is still some maximum which he can reach per one tick). It means if you put 2 dispensers near each other you will get almost twice oxygen, but if you add third one you will not almost get any boost (you still get some minor)
- completely reworked tick check (how often is something happening). Now it checks twice per second (if it will creates lags, there is a config to change)
- reworked damages which are taken by player, enemies and spawners (because of tick changes)
- completely reworked how player checks if he is out of oxygen and out of bottles. The amount now is not integer but decimal (100.00 instead of 100). It was made because of dynamic dispensers. The player is always running out of oxygen, but this speed can be lessen if he stands near dispenser or even he can get some oxygen.
- by default bottles are not refilled when player stands near dispensers (in config it is possible to turn it back)
- added notification when bottle is used
- other minor changes which I do not remember :)

Fixes
- fixed bottle replenishing when per one tick were replenished bottle in main inventory and in belt too. Now first replenished are those in main inventory and then in belt. (I think similar were with emptying them too, but now it should be fixed too)

Known Bugs
- When there is an empty bottle in a belt and it is filled and there is no space to add to belt, this bottle will disappear (I think this bug were in previous versions too)
- Enemies still get static damage even if they are far away from dispensers. Maybe I'll change it in the future too, so it will work similar to oxygen replenishing.
- Unbalanced damages, speed of loosing or replenishing oxygen, too small or too big distance from dispensers etc. That is why there is a config file. Changes should by applied after game reload.

Mod
OxygenUnofficial_1.3.8.zip
(36.42 KiB) Downloaded 334 times
Just to add... I'm not a lua programmer and I do not want to keep on unofficial changes(not in a long term). I just wanted to fix this mod in a way I want to play it right now and just wanted to share those changes :).
Ah, yeah, and sorry for my English :)
Yeah, and a last thing... Author can use any of those changes in his official update without asking me, if he would like them.
User avatar
ZombieMooose
Filter Inserter
Filter Inserter
Posts: 289
Joined: Mon Feb 09, 2015 7:23 am
Contact:

Re: [0.11.X] Oxygen

Post by ZombieMooose »

QAstral wrote:I tried to fix it for game version 0.12.20. But I have found several bugs which probably were in previous mod versions too, so I tried to fix them too... While I was fixing them I decided to add several changes for this mod which are not minor. I hope author will not by angry on me if I send it as unofficial update 1.3.8

Changes are those:
New features
- added config file which is used for some ingame parameters as radius from dispenser, replenishing speed, damages, etc.
- completely reworked dispenser. Now it does not give static amount of oxygen when player is close to it, but it depends on how far he is from it. When player creates several dispenser near to each other he will get even more oxygen per tick (there is still some maximum which he can reach per one tick). It means if you put 2 dispensers near each other you will get almost twice oxygen, but if you add third one you will not almost get any boost (you still get some minor)
- completely reworked tick check (how often is something happening). Now it checks twice per second (if it will creates lags, there is a config to change)
- reworked damages which are taken by player, enemies and spawners (because of tick changes)
- completely reworked how player checks if he is out of oxygen and out of bottles. The amount now is not integer but decimal (100.00 instead of 100). It was made because of dynamic dispensers. The player is always running out of oxygen, but this speed can be lessen if he stands near dispenser or even he can get some oxygen.
- by default bottles are not refilled when player stands near dispensers (in config it is possible to turn it back)
- added notification when bottle is used
- other minor changes which I do not remember :)

Fixes
- fixed bottle replenishing when per one tick were replenished bottle in main inventory and in belt too. Now first replenished are those in main inventory and then in belt. (I think similar were with emptying them too, but now it should be fixed too)

Known Bugs
- When there is an empty bottle in a belt and it is filled and there is no space to add to belt, this bottle will disappear (I think this bug were in previous versions too)
- Enemies still get static damage even if they are far away from dispensers. Maybe I'll change it in the future too, so it will work similar to oxygen replenishing.
- Unbalanced damages, speed of loosing or replenishing oxygen, too small or too big distance from dispensers etc. That is why there is a config file. Changes should by applied after game reload.

Mod
OxygenUnofficial_1.3.8.zip
Just to add... I'm not a lua programmer and I do not want to keep on unofficial changes(not in a long term). I just wanted to fix this mod in a way I want to play it right now and just wanted to share those changes :).
Ah, yeah, and sorry for my English :)
Yeah, and a last thing... Author can use any of those changes in his official update without asking me, if he would like them.
awesome work, but maybe making a new post in unofficial updates?
"men will literally learn everything about ancient Rome instead of going to therapy"
Natha
Fast Inserter
Fast Inserter
Posts: 226
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

Re: [0.11.X] Oxygen

Post by Natha »

Thangs to QAstral for make an unofficial post! I took the changes into the official version and will update it.
Crawl
Manual Inserter
Manual Inserter
Posts: 1
Joined: Thu Feb 25, 2016 7:30 pm
Contact:

Re: [MOD 0.12.+] Oxygen

Post by Crawl »

could it be that the mod doesnt work in multiplayer right now? using 12.20 stable.

our oxygen is getting up to -200 and we get no damage :/

could also that its conflicting with another mod, but i dont really see how it does because no other mod fiddles with my health.

edit: also not working with 12.24 (steam version)
Bl00drav3n
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Jun 07, 2014 9:35 pm
Contact:

Re: [MOD 0.12.+] Oxygen

Post by Bl00drav3n »

Yes the current version is broken, because Lua.

To fix it, in control.lua, line 90 change

Code: Select all

return remove_bottle
to

Code: Select all

return removed_bottle
What was happening is remove_bottle() returned itself instead of the local variable, and the expression that checks if a bottle was removed never evaluates to false.
I like type safety.

Edit:

Also there is a critical bug when using this mod in multiplayer. The current version does not check if a player in the global player-list is connected and will continue to drain oxygen, up until the point where the offline player starts choking. Following line will then crash the server:

Code: Select all

v[1].character.damage(Config.ChokingDamage, v[1].force, "oxygen")
To fix the problem, simply check the player.connected property before entering the relevant codepaths (inside handle_players and handle_dispensers).

Here's the patched script:
control.lua
Patched v.1.3.8
(10.73 KiB) Downloaded 159 times
FoolishBalloon
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Mar 04, 2016 11:57 pm
Contact:

Re: [MOD 0.12.+] Oxygen

Post by FoolishBalloon »

Hey! I'm using your mod alongside Bob's Mods and N.Tech Chemistry, and they do make the research chain a bit longer, so it was practically impossible for me to get to Oxygen Refill with the 5 bottles that I spawned with. I used Console to give me new bottles until I researched it, and with it being the 100% priority I had to use exactly 20 bottles before I was able to refill my first one. Better players could probably do it faster, either way, it'd be nice to receive more bottles if the mods detects Bob's mods and N.Tech Chemistry :)
Natha
Fast Inserter
Fast Inserter
Posts: 226
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

Re: [MOD 0.12.+] Oxygen

Post by Natha »

FoolishBalloon wrote:Hey! I'm using your mod alongside Bob's Mods and N.Tech Chemistry, and they do make the research chain a bit longer, so it was practically impossible for me to get to Oxygen Refill with the 5 bottles that I spawned with. I used Console to give me new bottles until I researched it, and with it being the 100% priority I had to use exactly 20 bottles before I was able to refill my first one. Better players could probably do it faster, either way, it'd be nice to receive more bottles if the mods detects Bob's mods and N.Tech Chemistry :)
I'll look for that :)
thomas2003
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Feb 22, 2015 3:51 pm
Contact:

Re: [MOD 0.12.+] Oxygen

Post by thomas2003 »

Any help would be appreciated.My problem is that if you put this mod in then load an older save you will have no oxygen meter or anything, I can still research the oxygen things, but there is no oxygen meter.

Thanks in advance.


(If you start a new game you do see the oxygen meter.)
Austin5003
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Mar 18, 2016 10:16 pm
Contact:

Re: [MOD 0.12.+] Oxygen

Post by Austin5003 »

A planet full of trees still needs oxygen production? :shock:
Factorio2016
Fast Inserter
Fast Inserter
Posts: 136
Joined: Wed Dec 23, 2015 1:17 pm
Contact:

Re: [MOD 0.12.+] Oxygen

Post by Factorio2016 »

1) imagine that a lot of oxygen and your lungs burn.
2) a Different composition of the air you can't breathe normally.
3) you are not forced to use mod. :)
English is not my native language. Translator.
seronis
Fast Inserter
Fast Inserter
Posts: 225
Joined: Fri Mar 04, 2016 8:04 pm
Contact:

Re: [MOD 0.12.+] Oxygen

Post by seronis »

Austin5003 wrote:A planet full of trees still needs oxygen production? :shock:
They're not earth trees. Why do you assume their trees release oxygen ?
Austin5003
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Mar 18, 2016 10:16 pm
Contact:

Re: [MOD 0.12.+] Oxygen

Post by Austin5003 »

seronis wrote:
Austin5003 wrote:A planet full of trees still needs oxygen production? :shock:
They're not earth trees. Why do you assume their trees release oxygen ?
There are a few reasons for me thinking the trees produce oxygen;
-If the planet had no oxygen, you wouldn't be able to burn fuels
-The trees reduce the amount of carbon dioxide in the air
-N.Tech chemistry lets chemical plants pull oxygen and nitrogen out of the atmosphere
-They're trees
tetryon
Fast Inserter
Fast Inserter
Posts: 190
Joined: Wed Nov 04, 2015 2:49 am
Contact:

Re: [MOD 0.12.+] Oxygen

Post by tetryon »

One of our MP server users reported...
devilwarriors wrote:The oxygen mod crashed my game and the server when I equipped a power armor 1 for the first time...

Image

I fixed by adding 'armor' before 'grid' in 140.

for _,equip in pairs(grid.equipment) do
->
for _,equip in pairs(armor.grid.equipment) do


Additionally, Steve modified this (around line 187-189)
if v[1].controller_type == defines.controllers.character then
->
if v[1].controller_type == defines.controllers.character and v[1].connected then

He also made the initial config easier.
I've uploaded the zip we're now using.
Attachments
Oxygen_1.3.10.zip
(64.29 KiB) Downloaded 174 times
User avatar
Ben Vagan
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sat Apr 02, 2016 4:26 pm
Contact:

Re: [0.11.X] Oxygen

Post by Ben Vagan »

This mod sure looks promissing for the ones that want to add another resource to manage in game and making their survival a little bit harder.
darkshadow1809 wrote:How about making the aliens get damage from the oxygen you dispense? Since they have a whole other way of consuming another sort of oxygen. If they stay in the oxygen area to long they die :o And if a nests gets consumed in oxygen it will die of slowly. Dmg per tick? Could be really nice to just have your main base rid of those bugs! Overtime that is! Not to be too overpowered but since alot of people use Dytech or some other form that makes monsters ALOT harder this would definetly help!
Abou darkshadow suggestion, I wounder if instead of making oxygen do some dps on bitters you could add up something even more fancy, like another type of gas that could kill both of you, something harder to manage without a any care. It would also make a bit more sense since just because bitters don't breath the same type of "oxygen" it wouldn't harm them since oxygen doesn't have toxins (or at least, that's how I think about it, I'm no chem-pro).
Xalizar
Manual Inserter
Manual Inserter
Posts: 3
Joined: Mon Apr 11, 2016 3:23 am
Contact:

Re: [MOD 0.12.+] Oxygen

Post by Xalizar »

@Natha: Thank you for making this mod, it is a nice addition to the game.

I started a new game with this mod, Hardcrafting, and N.Tech Chemistry and needed 36 bottles of Oxygen to get far enough to produce Oxygen. I'm definitely not the best at this game so I'm sure it can but done faster but it was still a fun experience trying to figure out how to become self sustaining before my Oxygen ran out. :)

@tetryon: I ran into the same problem when crafting the Basic modular armor. Thank you for posting the 1.3.10 zip file with the fix.

-Xalizar
Gromp
Burner Inserter
Burner Inserter
Posts: 5
Joined: Wed Apr 27, 2016 11:38 am
Contact:

Re: [MOD 0.12.+] Oxygen

Post by Gromp »

there are trees there
and any living being needs oxygen to survive
even aliens
there has to be oxygen over there
seronis
Fast Inserter
Fast Inserter
Posts: 225
Joined: Fri Mar 04, 2016 8:04 pm
Contact:

Re: [MOD 0.12.+] Oxygen

Post by seronis »

Gromp wrote:there are trees there
and any living being needs oxygen to survive
there has to be oxygen over there
*facepalm*

OUR known life requires oxygen. That doesnt mean in the least that all life needs oxygen. There are microbial varieties of life on earth that dont require oxygen in their life cycle. If those had randomly been the early cells that evolved into later life then all life on earth might not have cared about oxygen. Assumptions about the unknown are bad in science
Post Reply

Return to “Mods”