Jump to content

How to obtain the DeltaV


Recommended Posts

Sorry for my bad english : I don't speak it fluently.

OS : Windows 10 (x64) - KSP version : 1.3.0.1804

Hi !

I want to obtain the deltaV for display it on the screen of my dashboard that I am making. I've had different ideas :

  • To recover the deltaV from another add-on like Kerbal Engineer REDUX but I don't know ho to do that if it possible.
  • To calculate it. I've already start to program a class that calculate it, but for finish it, I need to know how to know if a part is a thruster or not, and if it is, how can I get :
    • Its type (LiquidFuel+Oxidizer or LiquidFuel+IntakeAir or Xenon)
    • Its Isp
    • Its thrust in vaccum or in athmosphere.

Thanks.

Link to comment
Share on other sites

4 minutes ago, TheRedColossus said:
  • To recover the deltaV from another add-on like Kerbal Engineer REDUX but I don't know ho to do that if it possible.

Basic DeltaV and SmartTank both take this approach.

  • Copy the VesselSimulator folder from KER into your own project
  • KER is licensed under GPLv3, so your mod will need to be as well since you'll be redistributing parts of it
  • In your Start, add a callback to SimManager.OnReady, and remove it in OnDisable
  • When you need the value, call SimManager.RequestSimulation() followed by SimManager.TryStartSimulation()
  • There are some input properties on SimManager as well, such as Gravity, Atmosphere, and Mach
  • Your OnReady callback will be called when the calculation is complete
  • The output of the simulator will be in the SimManager.Stages array

Ideally the simulator would be in its own separate DLL that would be shared among many mods, but currently the architecture for that isn't there.

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