Space Engineers

Space Engineers

Does NOT WORK! Suit Energy Manager [Prox]
42 megjegyzés
Jace ∅ Ethaniel 2019. jan. 7., 0:17 
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  [készítő] 2016. jan. 26., 12:55 
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 2016. jan. 24., 18:16 
this script no longer can compile after recent changes to the scripting system
Wolfebane 2015. aug. 27., 14:32 
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  [készítő] 2015. máj. 14., 11:34 
I will add audio warnings as soon as i install this game again.
J0K3R6397 2015. máj. 9., 21:44 
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  [készítő] 2015. ápr. 26., 17:25 
Thank you ;)
Ah Whole Lotta Lumps 2015. ápr. 19., 10:41 
PROXIMO YOU ARE A GUARDIAN ANGEL :)
merath 2015. ápr. 19., 7:52 
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 2015. jan. 29., 16:58 
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  [készítő] 2015. jan. 9., 13:03 
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 2015. jan. 9., 0:54 
is this script still working?
Vip3rGER 2014. okt. 21., 19:23 
Nice, it*s work.
Proximo  [készítő] 2014. okt. 20., 14:26 
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 2014. okt. 20., 2:36 
How about a wait state while controlled entity != Player ?
Proximo  [készítő] 2014. okt. 19., 14:44 
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 2014. okt. 19., 10:44 
aianstant crash, yep.
Dark 2014. okt. 19., 3:27 
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  [készítő] 2014. okt. 18., 4:17 
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 2014. okt. 17., 19:27 
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 2014. okt. 17., 19:20 
Having said that, I do wish they would deprecate changes instead of breaking things constantly.
Geneticus 2014. okt. 17., 19:10 
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  [készítő] 2014. okt. 17., 12:20 
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  [készítő] 2014. okt. 17., 8:57 
Thanks you for reporting, i will fix it as soon as possible (probably today or tomorrow)
Geneticus 2014. okt. 16., 17:28 
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  [készítő] 2014. okt. 11., 20:17 
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  [készítő] 2014. szept. 30., 6:31 
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 2014. szept. 30., 0:16 
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  [készítő] 2014. szept. 28., 7:43 
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  [készítő] 2014. szept. 25., 3:50 
Well, it's done now, enjoy
Proximo  [készítő] 2014. szept. 25., 0:16 
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 2014. szept. 24., 20:14 
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 2014. szept. 24., 20:13 
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  [készítő] 2014. szept. 24., 2:08 
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 2014. szept. 23., 17:54 
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  [készítő] 2014. szept. 20., 9:35 
It does in my case, but there is probably something special for multiplayer. I will see into that, thank you.
Nikki 2014. szept. 20., 8:54 
the warning didnt show up and the power cut off
Proximo  [készítő] 2014. szept. 20., 6:49 
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 2014. szept. 20., 6:04 
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  [készítő] 2014. szept. 20., 3:50 
I am glad this script helps. If you have any more ideas what i could make better, just ask.
Todo: sounds
Goldobsidian 2014. szept. 19., 21:44 
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 2014. szept. 19., 17:28 
small thing but useful