So, burning while warping. KSP2 devs made a point on this being the norm now.
With this in mind, I built a 100k dv Xenon probe. Barely got it to LKO after a few tries.
Then found out that even with K2D2 and ManeuverNodeController, trying to get out of LKO is a chore.
And I'm planning to get into 750km (very low) polar Jool orbit later (completionist reflex after reading the OrbitalSurvey changelog), so the current approach is not feasible.
Ofc, building a more reasonable spacecraft is not an option.
So instead I've decided to make a mod that auto-rotates the craft during warp to the currently selected SAS mode (like prograde/retrograde),
In other words, I want to warp-burn my Xenon continuously, without stopping warp to correct the course.
But after messing around for a bit I found out I don't know what I'm doing.
Here is the latest attempt. Mostly pieces of code stolen from various parts of K2D2... But rewritten the way I like.
https://pastebin.com/U6PENXGf
And here is a demonstration of how it currently works.
https://youtu.be/-vf6K0Bf0AY
At the end I also opened the console to view debug output, tho I don't see anything useful in it rn...
Now, the problems:
vessel.transform.UpdateRotationonly works during warp. I mean, that itself is fine, but makes me thinkvessel.transformisn't supposed to be used this way;Vector3d Vector.vectorproperty (likevessel.transform.forward.vector) is in local coordinates, so outputting it isn't very useful. While a regularVectordoesn't override.ToString();- For some reason I need vessel
upinstead offorward(as a base vector for rotation). Why? Counterintuitive to me; - This way of rotating the vessel is inaccurate, it eases rotation to prograde slowly instead of teleporting it. And then it glitches out after ~90 degrees of orbit.
At this point it's past midnight, so explanation might be a bit scuffed, please ask if something doesn't make sense.
Any tips from some more experienced people?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.