Jump to content

sarbian

Members
  • Posts

    5,039
  • Joined

  • Last visited

Everything posted by sarbian

  1. You ll have to explain a bit more. Landing prediction, rover AP, landing gears and stagging for nearly empty tanks should now work in dev #760
  2. Ok, let me rewrite your answer then: C#, but C++, Lua, Python, Go, PHP, ... is possible as long as your write a wrapper for it in C#.
  3. MFI does nothing even remotely related to graphic. If you have some crash with SVT then have a look at SVT dependency that actually have error messages in your logs....
  4. Yes, but most of the time when you call a method that requires a Vector3 with a Vector3D you are not using the proper coordinate system.
  5. Damned, I was found out. It was indeed all a conspiracy so players can Git Gud. Instead of trying to make me intro a Bond villain you could maybe show us the settings you use ? Because I still use MJ default config to fly a Kerbal X to orbit as my basic test and it still does quite fine.
  6. I have left the solution and project file out since I did not really want to push a post build script that would not work for others. Not sure if I should include it...
  7. As said earlier in the thread you can use the normal System.IO class now. KSP.IO should be used only for the config serialization tricks
  8. Since you are deleting the PartStatsUpgradeModule first I doubt the @RESOURCE can find anything to patch. Try without the @
  9. I have been doing better but I am getting there I pushed a new dev with that added. Find the GameData\MechJeb2\Plugins\PluginData\MechJeb2\mechjeb_settings_global.cfg file and edit it. In the MechJebModuleFlightRecorder section add a historySize and set it to whatever you need (it will be created on MJ first save if not already there). You also have a precision (default 0.2). The default history is 3000 x 0.2 = 600s
  10. Messing with the velocity directly will always lead to strange behaviors since you will fight with the orbits and FlightIntegrator. SetWorldVelocity is one of those calls in KSP that should not be public, or even exist at all. The way it does things make me think it a a remmenant of the pre krakensbane era. If you want a constant velocity while maintaining control then write a cheat engine that provides the proper acceleration.
  11. Hum, have a look at MJ code there (in other line about drag in that file) and see if th result is more in line with expectation.
  12. You used the proper values & call. Why are you surprised that parts with surfaces parallel to the air flow reports small surfaces ?
  13. The new landing bug from 1.3.1 should be fixed in the dev build. I do not really have much time to look into any of my mods ATM (lot of work and I need something a bit less intellectual to relax) so you ll have to hope that some of the other contributors have more time.
  14. vessel.patchedConicSolver.maneuverNodes[0].nextPatch.ApA or ApR should do it.
  15. Parenting attach the object to it s parent and localPosition is the position relative to the parent. So if you want your object to be where the parent is then you need to set localPosition to Vector3.zero.
  16. So as I said earlier the problem is timming. Your code runs is most likely runs for an Update call so it runs each frame and since it s a mod code it runs a what Unity call priority 0. KSP code runs at various timing so some of KSP calls are always called before the mods and others are always called after. From memory one of the code that actually runs later is the movement of the ScaledSpace. So your mods move stuff related to the position of a planet in scaledSpace but scaledSpace move stuff after your mods, so you are lagging behind. For some code the answer is simple. Replace Update with LateUpdate. But here it won't help you because ScaledSpace already uses LateUpdate. So how do you make your code runs even later ? The "easy" solution is the TimmingManager that was added in 1.2. You can can ask it tu run your code at one of the pre set timing. If you look at the script order doc you will see that scaled space runs at timing 500 so you need something later. Luckily you can see Timing5 at the end of the list (Timing4 is at 19, too early for our needs). So how do you use that ? It requires a bit more code. A basic template would be public override void OnStart(PartModule.StartState state) // OnStart for a PartModule. "void Start()" for a MonoBehaviour { // Register our code with the timing manager and ask it to run at the last timing available (the order should be clear from the names) TimingManager.LateUpdateAdd(TimingManager.TimingStage.BetterLateThanNever, CodeWeWantToRunLate); } void OnDestroy() { // Removing the call when your object is gone is critial. TimingManager.LateUpdateRemove(TimingManager.TimingStage.BetterLateThanNever, CodeWeWantToRunLate); } // This replace our Update() or OnUpdate() void CodeWeWantToRunLate() { // We need to check if the object we run on is actually active because the timing manager does not check. if (!this.isActiveAndEnabled) return; (do stuff) }
  17. I know what is going on and how you can fix it but you ll have to wait for me to get back home so I have my code around. It s a matter of timing.
  18. It s a Vector3. It can be a constant like Vector3.right but it could be the position of the sun ( Planetarium.Sun.MapObject.trf.position ), the parent body (cb.parent.MapObject.trf.position), ...
  19. All of KSP modding is "potentially confusing". Even for an ex member of the team
×
×
  • Create New...