Space Engineers

Space Engineers

Helmet Auto-Toggle
Blue64 29 May, 2017 @ 8:09pm
Ideas
Why not throw an exception on the type of Damage taken? If it's Suffocation Damage then have it Toggle the Helmet, if helmet was also Auto-Toggled within the last 30 Seconds, have it run a HUD Warning "Auto-Visor Malfunction, Manual Examination Required." and Disable the Auto function for ~30 Seconds or until the Player manually Removes/Equips their Helmet.

By the way, you are going to want to cast a Grab Array to retrieve the Helmet Keybind (it's in the
%AppData%\SpaceEngineers\
folder I think, the Config File Format is XML, so you can simply do a Local Text File Grab and Parse it for the Information you want (remember, there's 2 Keys and a Mouse to Parse)
Last edited by Blue64; 4 Jul, 2017 @ 3:18pm
< >
Showing 1-9 of 9 comments
Blue64 29 May, 2017 @ 8:14pm 
Originally posted by Blue64:
if helmet was Auto-Toggled within the last 30 Seconds, have it run a HUD Warning "Auto-Visor Malfunction, Manual Examination Required." and Disable the Auto function for ~30 Seconds or until the Player manually Removes/Equips their Helmet.
This will prevent endless toggling when you run out of Air in your Air Tanks in a Zero Oxygen Environment, which can cause Lag Spikes that can prevent grabbing the nearest Oxygen Canister because you can't see what you are doing until the Lag goes away, which will happen when you stop Suffocating, which would happen when you get more Air :steamhappy: or Die :steamsad:
Blue64 4 Jul, 2017 @ 3:28pm 
Another Idea I forgot, include a chat command for the Timer, and stop using the % for your Timer math, a simple / will work fine, and (rand()%7) has a freshly discovered Error that always returns 6 recently, not sure if that's patched yet. The difference returned will be negligible as / uses roundDown() and % uses roundUp(), on top of that % is actually more math at ~3 equations, whereas / is only ~1 equation, this makes / less intensive on smaller CPUs (like my Dual-Core), and the % is just overkill.

when combined with the Auto-Toggle Auto-Disable idea, this can greatly improve performance and reduce Lagg. :steamhappy:

I am interested to hear your thoughts on these things @SGCam
Blue64 4 Jul, 2017 @ 3:58pm 
and perhaps allow the Environment Oxygen Check to be changed via Chat Command as well, with a HUD Warning when it gets set to a damaging value. (has anyone tested over-pressurized environmental damage limits?)
SGCam  [developer] 14 Jul, 2017 @ 3:09pm 
Blue - all good points. The endless toggling issue is on my list, but thanks for the tip on grabbing custom keybinds. I was thinking it was better to stick with integer variables when possible, but if % is calling 3 equations, I will definitely change that. AFAIK, you can't overpressurize a room, the max pressure is 1; I'm not sure I really get why you would want to change what percentage it gets toggled at though. You start taking damage at low oxygen, so i set the toggle point just above that.
Last edited by SGCam; 14 Jul, 2017 @ 3:10pm
SGCam  [developer] 15 Jul, 2017 @ 12:34pm 
Originally posted by Blue64:
...By the way, you are going to want to cast a Grab Array to retrieve the Helmet Keybind (it's in the
%AppData%\SpaceEngineers\
folder I think, the Config File Format is XML, so you can simply do a Local Text File Grab and Parse it for the Information you want (remember, there's 2 Keys and a Mouse to Parse)

Suggestions for getting around the prohibited libraries?
system.xml and system.readkey

I know there is a way to do it using the modAPI, but I have yet to find it.
Blue64 17 Jul, 2017 @ 6:33pm 
Overpressurizing: you never know with Mods these days lol, Black Hole Mod for example tarts crushing the player with it's Atmosphere, so if your ship loses Pressureand the Atmosphere is x500 you'll likely want your Helmet on, for what it's worth lol :steammocking:

I haven't actually looked into the whole API thing, as I haven't found any centralized location for all the info, it all seems spread out over ~5 different locations, makes learning it difficult and unenthusing, so I've actually got no idea how to access them, but it should be accessible as you are only looking to do a Read not a Write in the same directory that the Game writes to.
SGCam  [developer] 17 Jul, 2017 @ 8:11pm 
I think I found the solution while working on one of my other mods. We shall see.

And yea, the poor documentation is why i didnt start modding sooner. Thanks keen, lol.
Blue64 26 Dec, 2019 @ 6:17pm 
So, like, the Helmet is no longer Closing when I exit my Pressurized Hangar and enter the Vacuum of Space with my Helmet Open. I tried
/hat on
and all it did was make my computer freak out (had to Power Cycle my Laptop). So, you might want to update this one, find out what broke.
SGCam  [developer] 5 Jan, 2020 @ 5:04pm 
@Blue64 Thats actually impressive that it managed that, the mod code should fail safe. I'll take a look at it, but since I haven't been keeping up to date on SE no promises.
< >
Showing 1-9 of 9 comments
Per page: 1530 50