Jump to content

Creating custom resources window, and changing gauge indications


Recommended Posts

Hi !

Few days ago I started to work on my first mod. Generally I want to delete electric charge and replace it with 6 different power lines. (3.3V, 5V, 12V, 36V, AC, and High Voltage ) Actually it`s done (for few parts now, just to see if it`s working) but without gauges showing actual production and consumption it`s like "flying blind". The idea of this mod is to add built-in (and later external) powers supplies and fuel cells with specified power ( in wats) so it has to be managed all the time to be sure every device is getting enough power etc. without relying on batteries only, and make them just an emergency feature.( to make game a little harder and more realistic ;)

The problem is I don`t understand a word from C#...

Ok, I saw many tutorials and managed to create a window with a simple text, but how add variable values ? Stock resources tab does not work for me. I need 2 values per line in the window , for ex. :

5V : 120 / 300 Wats

12V: 45 / 200 Wats

First line represents the name of the power line, second real-time consumption , and the third line real-time production. In this case, pod is using 120W and generator is giving 300W, so I know I have 180W free, while stock tab shows 0 because there is no change in batteries.

Power is just a normal resource like original electric charge, and voltage converters are made using moduleGenerator in cfg file.

And how integrate it with a toolbar ? Does it need any special code, or does it work automatically ?

I wanted it to be like mechjeb, always visible in the hangar and during flight, and use module name for ex. PowerMod in cfg to enable it.

Now the second part...

I wanted to add a CFDC (Central Flight Data Computer :D ) to simulate computers on-board. I wanted it to consume electricity while working, but to save energy for ex. while docked to space station I thought about adding an "on/off" switch. I would like to override the data coming to GUI to set altimeter and speed meter to 0, and set navball straight up.

Another nice option I thought about is Fly-by-wire system, when it`s turned off, the ModuleCommand has to be somehow jammed (or sth) just not to react on control buttons.

But doing this is complete hardcore and I even don`t know how to start :(

Please help ! :cool:

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...