Jump to content

Adding Part details/info ?


Mr_Auto

Recommended Posts

Hi there

i'm wondering, how to add info to specific parts (tanks and engines), like in the empty space (marked red)

 elRMZwc.png

I wanted to add mass to fuel and mass to thrust ratios

is it possible, or maybe there is a mod with this already?

 

 

Link to comment
Share on other sites

ok, i done it but there is a problem

F7tFftZ.png

 

That module title, don't know from where come that "Ratio Module Class"

code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using System.Threading.Tasks;

namespace KSP_modul
{
    public class RatioModuleClass : PartModule
    {
        public string GetModuleTitle()
        {
            return "Ratio";
        }

        public override string GetInfo()
        {
            return "Info";
        }

        /*public Callback<Rect> GetDrawModulePanelCallback()
        {
            return null;
        }*/
    }
}

and in part cfg file:

	MODULE
	{
		name = RatioModuleClass
	}

 

Link to comment
Share on other sites

Sorry I am rusty :)

 

public override string GetModuleDisplayName()
{
	return "Stuff;
}

And When you ll want to get the engine stats

ModuleEngines engine;

public override void OnAwake()
{
	engine = part.modules.GetModule<ModuleEngines>;
}

 

Link to comment
Share on other sites

Well you have the part mass ( part.mass ), the engine stats (engine.maxFuelFlow, ...) and the gravity at sea level (Planetarium.fetch.Home.GeeASL) so do math.

float isp =  engine.atmosphereCurve.Evaluate(1);

float  flowModifier = stuff

float  trust = engine.maxFuelFlow * engine.flowModifier * Isp * engine.g;

...

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...