Space Engineers

Space Engineers

Not enough ratings
O2H2 Generator Control for H2 Engines V3
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
1.659 KB
18 Jun, 2019 @ 9:13am
29 Jun, 2019 @ 11:34pm
2 Change Notes ( view )

Subscribe to download
O2H2 Generator Control for H2 Engines V3

Description
In-Game Script for Programmable Block
UPDATE: Minor fix of my n00b code + the 2 group names are default blank now, which is autodetect mode to control all of them on the same grid as the script. Set the Group names and add to groups to just control/monitor specific blocks.

Quick Description.

Aimed at vehicles/ships using Hydrogen Engines as main power source on ships/vehicles with wheels or thrusters that require electricity, that do not have any Hydrogen Tanks (the tanks are toooooo big)...

This script takes control of any O2/H2 Generators and monitors any Hydrogen Engines on the same grid as the script is running, the default state is autodetect with the group names at the top of the script left blank, this will control/monitor them all. Or you can control/monitor specific blocks by placing them in groups and adding the names to the section at the top of the script. You can also customise the Hydrogen Engine's internal tank percentages at which your O2/H2 Generators switch on and off at.

This makes sure each Hydrogen Engine's internal tank is at least at the stated higher percentage before turning off the O2/H2 Generators, and then turns them back on when each Hydrogen Engine's internal tank is below the stated lower percentage. The script repeats every 100 game ticks, which is approx 1.4 seconds. This can be changed for greater accuracy, see below.

My first published script, and i couldnt have done it without a lot of help from Malware and Wicorel :)
its still messy in places, and will get cleaned up Soon™

Wall of text for curious people.

When using O2/H2 Generators with a Hydrogen Engine, there is a rather large inefficiency, it is from the fact that the O2/H2 Generator will always want to keep the engine's internal tank fully topped up, even a tiny 0.00000000001 less than 100% full will make the O2/H2 Generator power up to full usage, and the Hydrogen Engine will then be powering that, this results in the ice just being wasted, until there is no ice left in the generators.

Typical scenario is a rover, or Ion Thruster space craft using Hydrogen Engine with an O2/H2 Generator to convert the ice to hydrogen on the fly, i was turning the O2/H2 Generator off when my HUD fuel level monitor reached full, but this was often forgotten about while driving, so this script takes the burden away from you, and eliminates the waste of ice.

To increase accuracy of this script (make it run more often), at the end of line 22, change
UpdateFrequency.Update100;
to
UpdateFrequency.Update10;
3 Comments
Nikolas March  [author] 29 Jun, 2019 @ 11:16pm 
if you added more of the blocks that this monitors or controls you will need to recompile it, would help if i knew what the error was saying... though there is an optimization i need to do, all my scripts will have an update soon...
Patchouli 29 Jun, 2019 @ 7:25am 
it stopped working 10 mins after i build it....
Patchouli 29 Jun, 2019 @ 4:45am 
very nice thx for that! it helps a lot!