Maxx

How to make solar panels repairable?

Recommended Posts

How would I write a mm patch to make engineers repair solar panels in the same fashion as wheels?

Share this post


Link to post
Share on other sites
Posted (edited)

I suspect that's not possible (without coding a new module) - the wheels have a ModuleWheelDamage and one of the attributes is "isRepairable". The ModuleDeployableSolarPanel doesn't have anything similar.

Edited by wasml

Share this post


Link to post
Share on other sites
Posted (edited)
On 7/3/2019 at 1:07 PM, Maxx said:

How would I write a mm patch to make engineers repair solar panels in the same fashion as wheels?

It's not possible without code. MM runs during game load, before you have a chance to load your save. MM can't address the state of any parts in your current save or make changes while you play.

The state of solar panels is saved in the persistent.sfs file in the part module ModuleDeployableSolarPanel with deployState, which can have values RETRACTED, EXTENDED, or BROKEN. You need a mod to change this during flight.

 

Edited by Tonka Crash

Share this post


Link to post
Share on other sites

Ok thanks a bunch! I've only written a single mm patch, and tweaked configs for new parts using existing models. Making a whole mod... I dont even know where to start... is this something easy to do?

Share this post


Link to post
Share on other sites
On 7/4/2019 at 8:57 PM, Maxx said:

.. is this something easy to do?

@Maxx The difficulty will depend on a number of things
    1) How familiar you are with programming
    2) How familiar you are with the Unity API
    3) How familiar you are with the KSP API

#1 and #2 have lots of online as well as offline documentation/tutorials, #3 has bare bones API documentation (mostly a list of classes and methods) with a few comments at https://kerbalspaceprogram.com/api/index.html and lots of examples in the form of source code from most of the mods out there. I've found it to be very satisfying as well as intensely frustrating - I seem to keep coming back to it so either the satisfying out weighs the frustrating or I'm a masochist. If your interested I can dig up some links that I've found useful.

Share this post


Link to post
Share on other sites

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.