Jump to content

Need help making a ship pitch based on a formula.


Recommended Posts

Is it possible to make a ship change its pitch based on a formula? For example, say I wanted to make the ship's pitch to change by -1 degree for every 10 m/s of velocity it had, how would I go about doing that? I have no modding experience, or even coding that much for that matter, but where would be a good point to start in trying to do something like this?

Link to comment
Share on other sites

  • 4 weeks later...

First, it is possible to change pitch on a formula like this. However, it is also rather complex to do so.

The biggest hurdle is going to be how to move the vessel. You don't have a "pitch down by X degrees command", what you have is a "pitch down by X% of available control force".

Beyond that, I'm going to point you to MechJeb, specifically the module that allows to you "hold prograde" and see how it does it for ideas. (Don't have a link for you, sorry.)

D.

Link to comment
Share on other sites

I didn't look at the MechJeb code, but IIRC from a thread on the forum, it implements a PID controller (or some other structure).

Unless you know what they are and how to use one, I suggest you take mechjeb's code and start from there.

However, I've also seen other applications that send their commands to mechjeb and let it do the hard work for them: maybe it would be better to follow their example?

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