![](https://forum.kerbalspaceprogram.com/uploads/set_resources_17/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
![](https://forum.kerbalspaceprogram.com/uploads/set_resources_17/84c1e40ea0e759e3f1505eb1788ddf3c_default_photo.png)
xEvilReeperx
Members-
Posts
894 -
Joined
-
Last visited
Content Type
Profiles
Forums
Developer Articles
KSP2 Release Notes
Everything posted by xEvilReeperx
-
Rotation and Rotation Rate of Celestial Bodies?
xEvilReeperx replied to Arrowstar's topic in KSP1 Mods Discussions
Looks like CelestialBody has everything you'd need: initialRotation, rotationPeriod, tidallyLocked, and rotates are all accessible -
I only had you delete error.wav because that was the last thing that was happening in your log before the game crashed. The chances of it being the cause were pretty remote but it was easy to rule out Something just caught my eye though and sort of related to the MM error I was mentioning earlier: [LOG 00:05:58.590] Config(EXPERIMENT_DEFINITION) Squad/Resources/ScienceDefs/EXPERIMENT_DEFINITION [LOG 00:05:58.590] Config(EXPERIMENT_DEFINITION) Squad/Resources/old_ScienceDefs/EXPERIMENT_DEFINITION It looks like you created a copy of the experiment definitions but left the copy inside GameData. Assuming KSP/GameData/Squad/Resources/old_ScienceDefs/ScienceDefs.cfg is unneeded, could you move it out of GameData or delete it? I'm 85% certain this is the cause of the issue, and if so it's fixed (at least, the plugin won't silently fail) in the next version
-
My advice would be to ignore it and use a textured plane or GUIText if you want good results. With that said, I don't see where you set the GO's layer anywhere so the MapView camera doesn't render it testText = new GameObject("testText", typeof(MeshRenderer)); var text = testText.AddComponent<TextMesh>(); Font ArialFont = (Font)Resources.GetBuiltinResource(typeof(Font), "Arial.ttf"); testText.renderer.sharedMaterial = ArialFont.material; text.font = ArialFont; text.fontSize = 12; text.text = "Hello, world!"; text.color = XKCDColors.Amber; testText.layer = 10; ScaledSpace.AddScaledSpaceTransform(testText.transform);
-
Ah, I didn't see the interface overrides. There's no need to hide them though. The actual type is hidden behind the interface so overriding the methods you're interested in will just work unlike Deploy(). In that case, Ship Manifest should work for your experiments aside from the BioDrill which did not override its interface. ShipManifest itself also has a bug that prevents it from seeing BioDrill or any other experiment that isn't derived from ModuleScienceExperiment or ModuleScienceContainer. He really should be looking for experiment data containers (IScienceDataContainer) rather than MSE/MSC
-
1:6000 (ScaledSpace.Instance.scaleFactor, or ScaledSpace.InverseScaledFactor for the inve-well, you get it). So a line 10,000 units long in local space would be 1.67 units long in scaled space. Kerbin's radius is about 1,000 units for comparison. It might be better to have two different scales else you might have to zoom in pretty close to your mapview vessel to even see the lines
-
Uh, in this case it's actually because you didn't override IScienceDataContainer.GetScienceCount. Instead, you hid the inherited member and created a brand new version. ScienceAlert only works because it uses IScienceDataContainer.GetData and not IScienceDataContainer.GetScienceCount, otherwise it'd be calling the wrong one too. You'll note that you DO override GetData: ScienceData[] IScienceDataContainer.GetData() { return anomalyData.ToArray(); }
-
Grats on the release! If I may make a suggestion though: why not cache the modules you're interested in? Currently, you loop through every module of every part on the active vessel twice per Update(). Instead, you could keep lists of the types of modules you're interested in and just rebuild them whenever the vessel changed. It'd simplify your main logic and save some extra cpu time too List<ModuleParachute> parachutes; // etc // GameEvents.OnVesselWasModified public void OnVesselModified(Vessel vessel) { if (vessel == FlightGlobals.ActiveVessel) { parachutes = vessel.FindPartModulesImplementing<ModuleParachute>(); // etc } } public void Update() { // do parachute stuff foreach (var parachuteModule in parachutes) ... // your logic }
-
Thanks for getting back to me. This actually looks like a ModuleManager bug. I tested it with both MM 1.5.6 and 2.0.3. Apparently, the !EXPERIMENT_DEFINITION line isn't removing the previous definition which causes an exception inside ksp on a critical function ScienceAlert uses. I'm glad you found a workaround In other news, 1.5 is now released
-
Forcing the activation of a PartModule
xEvilReeperx replied to Nertea's topic in KSP1 C# Plugin Development Help and Support
Ah, that's a wrinkle. Well, if anybody frowns on your use of reflection to get private stuff, there's the alternative of creating a child GameObject of your own for the sole reason of having it kick FixedUpdate calls back at you -
Forcing the activation of a PartModule
xEvilReeperx replied to Nertea's topic in KSP1 C# Plugin Development Help and Support
No, it works as you'd expect it to What's wrong with FixedUpdate? That's what Part is almost certainly calling OnFixedUpdate from anyway... public void FixedUpdate() { if (HighLogic.LoadedSceneIsFlight) { // logic } }