Jump to content


  • Posts

  • Joined

  • Last visited


27 Excellent

1 Follower

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Newly downloaded [email protected], with two expansions, but with no mods. Quite simple to reproduce this bug: 1, load any save 2, press "ESC" 3, press "F2" (hide GUI) 4, press "ESC", again 5, load any save, again 6, BOOM! Now, KSP will load forever. But if you press "ESC", the GUI will show up, but the vessel disappears. The only way to recover is quit and launch KSP, again. Exceptions in KSP.log: [EXC 13:27:38.029] NullReferenceException FlightCamera.SetTarget (UnityEngine.Transform tgt, System.Boolean keepWorldPos, FlightCamera+TargetMode targetMode) (at <a5c262f7fe724eb9918d4487db8b635e>:0) FlightCamera.SetTarget (UnityEngine.Transform tgt, FlightCamera+TargetMode targetMode) (at <a5c262f7fe724eb9918d4487db8b635e>:0) FlightCamera.SetTargetVessel (Vessel vessel) (at <a5c262f7fe724eb9918d4487db8b635e>:0) FlightCamera+<Startup>d__67.MoveNext () (at <a5c262f7fe724eb9918d4487db8b635e>:0) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <12e76cd50cc64cf19e759e981cb725af>:0) [EXC 13:27:38.033] NullReferenceException UnityEngine.Transform.get_position () (at <12e76cd50cc64cf19e759e981cb725af>:0) FlightCamera.UpdateCameraTransform () (at <a5c262f7fe724eb9918d4487db8b635e>:0) FlightCamera.LateUpdate () (at <a5c262f7fe724eb9918d4487db8b635e>:0)
  2. "What country do you live in?" No China?
  3. It WORKS! Thank you! @si2504 With some minor changes though, appending following config node in "RealismOverhaul\Engine_Configs\EngineVariants_Config.cfg": @PART[*]:FOR[RealismOverhaulEnginesPost] { @MODULE[ModuleEngineConfigs] { @CONFIG,* { @minThrust = 0 } } }
  4. Hi, how can I change "Min Throttle" to all engines to "0%"? I have already set "simulateUllage" and "limitedIgnitions" in RealSettings.cfg to false, this is the last "stocklike" thing I need in RSS.
  5. Having the same issue, should I take this as a KSP bug? I'm going to swap them to each other in my code.
  6. Please help! KSP gets stucked whiling loading "proceduralSRBRealFuels". With [email protected] installed, I tested against multi versions of procedural parts, it seems this happens when ProceduralParts version 2.1.1 or 2.1.2 is installed. There may be something in version 2.1.1.
  7. hi, @Stone Blue, thanks. Sorry, I'm testing this function along with many other WIP features in my project, so it's not quite convenient to provide a DLL. But the codes above are basicly all the codes needed for this feature, for now. You can 1, create a new project in Visual Studio, 2, create a C# file with those codes. 3, add references of Assembly-CSharp.dll and UnityEngine.dll to project. 4, then you can compile it to generate a DLL, Besides, you have to add a button somewhere(e.g. some part's right click menu) to set "bottonClicked" to true, or activate the addon in other ways.
  8. OK, my mistake, some lines of code weren't commented out correctly. The code above works fine, now.
  9. I'm trying to play KSP on more than one monitor, with different content in each monitor. I successfully achieved this on two monitors, but I encountered an issue, and I need some help: the vessel disappears in the first monitor. This is how I enable the second monitor: 1, Connect another monitor to the PC running KSP (via HDMI port). 2, Compile following codes and start KSP, this addon will take effect in Flight scene. [KSPAddon(KSPAddon.Startup.Flight, false)] public class DisplayAddon : MonoBehaviour { private static bool bottonClicked; private static global::Vessel vessel; private static Camera galaxyCamera; private static Camera scaledSpaceCamera; private static Camera camera00; private static int SecondDisplay = 1; public void Start() { vessel = FlightGlobals.ActiveVessel; Display.displays[SecondDisplay].Activate(); // Activate the second display // Copy in-game cameras galaxyCamera = new GameObject().AddComponent<Camera>(); galaxyCamera.CopyFrom(Camera.allCameras.FirstOrDefault(cam => cam.name == "GalaxyCamera")); galaxyCamera.name = "GalaxyCameraCopy"; scaledSpaceCamera = new GameObject().AddComponent<Camera>(); scaledSpaceCamera.CopyFrom(Camera.allCameras.FirstOrDefault(cam => cam.name == "Camera ScaledSpace")); scaledSpaceCamera.name = "scaledSpaceCameraCopy"; camera00 = new GameObject().AddComponent<Camera>(); camera00.CopyFrom(Camera.allCameras.FirstOrDefault(cam => cam.name == "Camera 00")); camera00.name = "camera00Copy"; // New cameras render to the second display galaxyCamera.targetDisplay = SecondDisplay; scaledSpaceCamera.targetDisplay = SecondDisplay; camera00.targetDisplay = SecondDisplay; } public void FixedUpdate() { if (bottonClicked) { camera00.transform.position = new Vector3(-5.5f, 0.7f, -2.0f); // Place the camera at somewhere near the vessel camera00.transform.LookAt(vessel.CoM); galaxyCamera.transform.rotation = camera00.transform.rotation; scaledSpaceCamera.transform.rotation = camera00.transform.rotation; } } } 3, Load a save, load a vessel, then enable addon. Please take a look at these 4 images: https://imgur.com/a/uiOz9pn The first 2 images are contents in two monitors when the addon IS NOT activated. The last 2 images are contents in two monitors when the addon IS activated. As you can see, in the third image, the vessel is not shown. Does anyone know how to fix this? Thanks a lot!
  10. OK, it's "FlightCamera.fetch.Distance" and "FlightCamera.fetch.SetDistanceImmediate( )"
  11. When I scroll the mouse wheel in Flight scene, the camera will zoom in or zoom out. Which field in Camera(or FlightCamera) object is changing? How can I zoom in/out with code as if I'm scrolling the wheel? It doesn't seem to be the "fov"(field of view) field, on the basis of my test results.
  12. After some learning and testing, following codes can do the trick: FlightCamera.fetch.SetFoV(50); Camera.main.nearClipPlane = 0.1f; FlightCamera.fetch.SetTarget(null); GameObject parent = new GameObject("parent"); FlightCamera.fetch.transform.parent = parent.transform; Part p = ... // any part in the vessel parent.transform.position = p.transform.position + p.transform.rotation * new Vector3(offsetX, offsetY, offsetZ); parent.transform.rotation = Quaternion.AngleAxis(offsetDegree, engine.transform.right) * Quaternion.LookRotation(-p.transform.up, -p.transform.forward); // this is the correct rotation for engine parts It simply changes position and rotation of player's camera. But the camera seems to rotate around an point at about 75 units far, still don't know how to change that point and make it closer
  13. I'm trying to create a mod to use any part in a vessel as a camera. With this mod, I can view from any part in a more realistic way, without any new camera parts. For example, I can view from the bottom of engines, or view from pods in forward direction, or view from the top edge of fuel tanks(so I can see booster seperation). But I'm not familiar with either manipulating cameras or Unity engine, so I'm not quite sure about how to achieve this. My thoughts about this mod are: 1, Add a button in the right-click menu of each part. 2, If the button is clicked, the mod will create a new Camera object for this part. 3, Init the Camera object with the part's orientation(position + rotation), and some offsets. 4, Activate the new Camera, and view from it. I have to figure out how to implement each step, but the first question is, am I right about those steps? If I'm wrong, what is the right way to do that? Thanks!
  14. Thanks, problem solved. But I should look for remaining ignitions from "ModuleEnginesRF", not "ModuleEngines".
  15. Hi, how to get the amount of remaining ignitions? I tried this, but the the number doesn't change if the engine is turned on and off: ModuleEngineConfigs engineConfigs = p.GetModule<ModuleEngineConfigs>(); if (engineConfigs!=null) { Debug.LogWarning("engine ignition:"+ engineConfigs.config.GetValue("ignitions")); }
  • Create New...