Space Engineers

Space Engineers

Does NOT WORK! Suit Energy Manager [Prox]
42 Comments
Jace ∅ Ethaniel 7 Jan, 2019 @ 12:17am 
I wonder why modders haven't made Backup Batteries for suits yet. Perhaps the API doesn't give access to the needed bits of code?...
Proximo  [author] 26 Jan, 2016 @ 12:55pm 
Sorry to hear that, in this case i add this new information to the name of this mod. You are free to use/use parts/change this mod if you find it more useful that way. But i have currently no time to fix this mod.
Visentinel 24 Jan, 2016 @ 6:16pm 
this script no longer can compile after recent changes to the scripting system
Wolfebane 27 Aug, 2015 @ 2:32pm 
Now some one just needs to make a freaking umbilical mod or at the very least use the coding for the O2 bottles and make something for suit energy.
Proximo  [author] 14 May, 2015 @ 11:34am 
I will add audio warnings as soon as i install this game again.
J0K3R6397 9 May, 2015 @ 9:44pm 
I cant seem to add spaces to my warning messages. any help on this? Also, can you implement a sound play feature when warnings are displayed?

Thanks
Proximo  [author] 26 Apr, 2015 @ 5:25pm 
Thank you ;)
Ah Whole Lotta Lumps 19 Apr, 2015 @ 10:41am 
PROXIMO YOU ARE A GUARDIAN ANGEL :)
merath 19 Apr, 2015 @ 7:52am 
it work wonderfuly i love it altho iagee somesort of soudnwouldhel cus i dontalwes see the reten warning cin mi mostly vlind i ushly notes by aout 10 % so ithas saved me
thanks forthe nice script
McyD 29 Jan, 2015 @ 4:58pm 
Seems to be working fine, Though it would be nice to get sounds with the added warning messages, even if it was just a vanilla one, or even a few beeps.
Proximo  [author] 9 Jan, 2015 @ 1:03pm 
It's a very old script and i have not changed it in a very long time. If it's not working any longer, please tell me. I will than install space engineers again and fix it.
Palindine 9 Jan, 2015 @ 12:54am 
is this script still working?
Vip3rGER 21 Oct, 2014 @ 7:23pm 
Nice, it*s work.
Proximo  [author] 20 Oct, 2014 @ 2:26pm 
It's working again

@Geneticus
It's a good idea, but it's not the problem at all.

To get the User-Object i have to call "GetObjectBuilder" on the entity, and the entity is just an interface-object. The only way to check if that works is simply to try it. And if its impossible, the application it will rise an exception.
So my quickfix is to just try/catch the error that happens. And yes, thats uggly, but it works...
Geneticus 20 Oct, 2014 @ 2:36am 
How about a wait state while controlled entity != Player ?
Proximo  [author] 19 Oct, 2014 @ 2:44pm 
I understand now. The ControlledEntity is the ship, after you enter a cockpit. That means that i try to get the property "Energy" of the ship, but there is no property with that name available, because it is a ship. But the main problem is that i can not longer access the "player"-character, only the "thing" he currently controlles. I am sure there is another way but for the moment my script is broken, i am sorry about that, i will try to find another way soon.
Nathan 19 Oct, 2014 @ 10:44am 
aianstant crash, yep.
Dark 19 Oct, 2014 @ 3:27am 
Instant crash as soon as I enter small ship cockpit.
Conditions: hosting multiplayer game, bunch of other mods.

Exception occured: System.NullReferenceException: Object reference not set to an instance of an object.
at 5BCAC68007431E61367F5B2CF24E2D6F.F6DF01EE4159339113BB9650DEEE1913.GetObjectBuilder(Boolean A5DC70F106B952A1255F4B70E35F9DCD)
at ProxSpaceEngineers.ProxEnergyWarner.UpdateAfterSimulation100()
at ProxSpaceEngineers.ProxEnergyWarner.UpdateAfterSimulation()
at AAC05F537A6F0F6775339593FBDFC564.D580AE7552E79DAB03A3D64B1F7B67F9.F672BBF9E192151CE8FD7E91E62B997D()
at AAC05F537A6F0F6775339593FBDFC564.D580AE7552E79DAB03A3D64B1F7B67F9.EC90B1C44E3C361983D093F355FF0CC8(MyTimeSpan 9916A9BA14FB0BB1A36908E2E8C15A74)
Proximo  [author] 18 Oct, 2014 @ 4:17am 
I can not reproduce this error, but it could be because of the change i made (Controller could be nothing, that means ControlledEntity and Entity to...)
I tested it in a offline-sandbox. What are the testing conditions you have?
Geneticus 17 Oct, 2014 @ 7:27pm 
Application crash now :(
Exception occured: System.NullReferenceException: Object reference not set to an instance of an object.
at 5BCAC68007431E61367F5B2CF24E2D6F.F6DF01EE4159339113BB9650DEEE1913.GetObjectBuilder(Boolean A5DC70F106B952A1255F4B70E35F9DCD)
at ProxSpaceEngineers.ProxEnergyWarner.UpdateAfterSimulation100()
at ProxSpaceEngineers.ProxEnergyWarner.UpdateAfterSimulation()
at AAC05F537A6F0F6775339593FBDFC564.D580AE7552E79DAB03A3D64B1F7B67F9.F672BBF9E192151CE8FD7E91E62B997D()
Geneticus 17 Oct, 2014 @ 7:20pm 
Having said that, I do wish they would deprecate changes instead of breaking things constantly.
Geneticus 17 Oct, 2014 @ 7:10pm 
I can't make heads or tails of the API so far (mostly a time issue). I am an ASP/C#/SQL enterprise application programmer atm. I deal with Grids, form fields, and web services all day.
Proximo  [author] 17 Oct, 2014 @ 12:20pm 
There was a change in the API because of this patch. The property "PlayerCharacter" is not longer available.
I reprogramed the part using this: "MyAPIGateway.Session.Player.Controller.ControlledEntity.Entity"
If you know how to program you see how stupid this is. If not, it's working again ;)
Proximo  [author] 17 Oct, 2014 @ 8:57am 
Thanks you for reporting, i will fix it as soon as possible (probably today or tomorrow)
Geneticus 16 Oct, 2014 @ 5:28pm 
New Patch Bugs. Yay.

MOD_ERROR: 316092014.sbm_energyWarnerScript, in file: 316092014.sbm_energyWarnerScript
c:\Users\Username\AppData\Local\Temp\EnergyWarner.cs(193,70) : error CS1061: 'Sandbox.ModAPI.IMyPlayer' does not contain a definition for 'PlayerCharacter' and no extension method 'PlayerCharacter' accepting a first argument of type 'Sandbox.ModAPI.IMyPlayer' could be found (are you missing a using directive or an assembly reference?)
MOD_ERROR: 316092014.sbm_energyWarnerScript, in file: 316092014.sbm_energyWarnerScript
Compilation of 316092014.sbm_energyWarnerScript failed:
Proximo  [author] 11 Oct, 2014 @ 8:17pm 
The bug Generticus was talking about should be fixed in the current version of space engineers. If you have any other problem with the script, just write a comment ;)
Proximo  [author] 30 Sep, 2014 @ 6:31am 
Thats one of the errors i was talking about Geneticus. That error means:
"I tryed to write to the file where the finish version of the 'energy warner script' (Suit Energy Manager) is, but i couln't BECAUSE there is someone using this file"
Now here comes the Joke: The one using the file IS Space Engineers, so it is basicly trying to access a file that is currently in used by IT SELF!

What i can do about it is:
- Nothing
- Wait for a patch

What you can do about it:
- Restart Space Engineers every time before you join a new game
- Wait for a patch

I hope this helps ;)
Geneticus 30 Sep, 2014 @ 12:16am 
MOD_ERROR: 316092014.sbm_energyWarnerScript, in file: 316092014.sbm_energyWarnerScript
Compilation of 316092014.sbm_energyWarnerScript failed:
MOD_ERROR: 316092014.sbm_energyWarnerScript, in file: 316092014.sbm_energyWarnerScript
error CS0016: Could not write to output file 'e:\Steam\steamapps\common\SpaceEngineers\Bin64\316092014.sbm_energyWarnerScript' -- 'The process cannot access the file because it is being used by another process. '
Proximo  [author] 28 Sep, 2014 @ 7:43am 
Thats odd, yes, but there are very serious problems with the script-api currently. So i have to wait for the next patch to work on this mod, sorry ;)
Proximo  [author] 25 Sep, 2014 @ 3:50am 
Well, it's done now, enjoy
Proximo  [author] 25 Sep, 2014 @ 12:16am 
I see, i am currently working on a ingame and file-config. Its hard because xml is not available, so i had to program something from scratch. It will be available in about 5 hours.
Darkaiser 24 Sep, 2014 @ 8:14pm 
My reasoning is that studies have shown that any sort of contact, even the artificial kind, can help fend off lonliness in survival situations. Kind of like Wilson from the Tom Hanks film Castaway.
Darkaiser 24 Sep, 2014 @ 8:13pm 
Wonderful and thank you! I was thinking of somewhere between Jarvis from the Iron Man movies (almost TOO pilot if a bit ironic) to the annoying operator on the other end of the radio.
Proximo  [author] 24 Sep, 2014 @ 2:08am 
I was thinking the most people don't appreciate my jokes, so i tryed to be direct and simple. But yes, its very, very simple to add warnings with every text you can imagine. I try to make a config next so that you can add some youself.
Darkaiser 23 Sep, 2014 @ 5:54pm 
How difficult would it be for you to mod a version of this that is a bit more...flavorful? By that I mean annoying. For instance at 20% you get the ususal 'Suit power at 20%' warning. At 15% you get 'Ok now...you're down to 15%. Time to head back' and so on. The 5% should be something serious like 'Ok dumba$$...get back and rechanrge NOW!'

Or am I asking too much?
Proximo  [author] 20 Sep, 2014 @ 9:35am 
It does in my case, but there is probably something special for multiplayer. I will see into that, thank you.
Nikki 20 Sep, 2014 @ 8:54am 
the warning didnt show up and the power cut off
Proximo  [author] 20 Sep, 2014 @ 6:49am 
I am sorry, i do not understand what you are trying to say. this script only displayes messages in the current state and has nothing to do with ship power or your friends.
Nikki 20 Sep, 2014 @ 6:04am 
Thank ou for making this svript energy destroyed my friends ship when power went out he flew towords a cargo ship and gotshredded to bits
Proximo  [author] 20 Sep, 2014 @ 3:50am 
I am glad this script helps. If you have any more ideas what i could make better, just ask.
Todo: sounds
Goldobsidian 19 Sep, 2014 @ 9:44pm 
Thank you, I hate how they knocked the warning down, it use to be at like 15% or something and they dropped it to 5%
Joseph Sneed 19 Sep, 2014 @ 5:28pm 
small thing but useful