Jump to content


  • Posts

  • Joined

  • Last visited


6 Neutral

1 Follower

Recent Profile Visitors

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

  1. In the hope that I don't misuse this thread as my rubber duck again I'll ask another question. As stated above im following @DMagic's Tutorial on UI creation. Because TMP (1.0.53 for Unity 2017.3) is integrated into KSP (1.12.3) and Unity (2019.4.18) I am trying to skip creating th UI in Unity Editor with normal text objects and convert them to TMP_Text fields when loading the AssetBundle. But unfortunatly I'm missing somthing since no TMP_Text fields are found in my AssetBundle's prefab when loaded into KSP. To give you a heads up behind the spoiler is my Unity Scene. I use the following code to load my prefab into KSP. An excerpt of the resulting KSP.log shows that no errors or exceptions are thrown but no TextMeshProUGUI component is found. When I try the same in my Unity assembly and editor game view all components are found using gameObject.GetComponentsInChildren<Type type>(). KSP.log: To get this far I have to include "TextMeshPro-2017.3-1.0.56-Runtime.dll" in my GameData folder in order to run the Unity assembly in KSP. Should that be necessary? I set up my references in VS like this: Is there an issue? As soon as the UI is supposed to be shown all TMP_Text elements throw a NullReferenceException which isn't that much of a mystery to me if they aren't loaded properly in the first place. I tried but I seem to not being able to figure it out by myself so any effort to help is much appreciated.
  2. I'm currently trying to develop my first mod for KSP as a part of a project at uni. I have no experience in Unity, C# or object oriented programming in general, which makes it quite a challenge. But I knew that when picking the project and it was even kind of the reason to do so. So far I'm learning a lot and enjoy every single success. Just to let you know that I know that I don't know much.... yet. I want to build an ingame code editor. I have it basicly running (quick and dirty, but good enough so far) in the Unity game window when assigning my .cs-scripts directly like most tutorials on YouTube do. According to D'Magic's tutorial on UI creation I have to hook up the UI by importing the .dll which causes some trouble in my case. As a MRE think of my UI as a panel with a TMPro input field and a button. Pressing the button saves the InputField.text in a .txt-file. Resulting in the following Unity assembly. using System.IO; using UnityEngine; using TMPro; namespace SimpleEditor.Unity { public class SimpleEditorController { public TMP_InputField InputField; public void SaveInput() { File.WriteAllText("output.txt", InputField.text); } } } When I try to add the .dll as script to my get a warning that a GameObject references runtime script in scene file and furthermore, the following error: (Names in error are different due to cope&paste from original error) I set up my Unity project according to the official PartTools-post. The references in VS are set like D'Magic did in BasicOrbit (I checked his project). Is this an issue of the TMPro versions? To my understanding that shouldn't be the case because the assembly compiles just fine since I added Assembly-CSharp as a reference in VS. I'm a little lost here and would be very grateful about a small push in the right direction. Edit: Noob-mistake: I mixed up the references and had to add the TectMeshPro 2017 dll from my unity project folder. It works now in Unity and i will continue the tutorial(s).
  3. Hello KSP-Community, I'm a fellow Kerbonaut for almost a year now and without this Forum, I'd probably still be sitting on the pad. So let me say a big thank you to everyone even though it took me a year! Well, apart from playing KSP, I'm studying Transport Systems with a strong focus on Aeronautics and Astronautics, which I hopefully will be graduating soon. I was talking to my Fundamentals of Space Technology-teacher recently about a senior thesis under his supervision and knowing about my passion for KSP he offered me to develop a concept/solution for using KSP in his course. One objective of my thesis is to build a "sub-mod" to kRPC. Students of the course will have to calculate data (e.g. dV needed for Hohmann transfer, inclination change, combined maneuvers or optimal ascent profiles using numerical integration) which are then fed into the autopilot sub-mod. Their calculation is executed by Python scripts which they'll have to write individually. Those scripts can be developed and run in an environment build by myself having its own UI in KSP. If they' run their code the vessel/rocket will do what they calculated, hopefully leading to spectacular explosions. This way we think their understanding of orbital mechanics and maneuvering will get much better. Building my own IDE / Editor + integrated Terminal will most likely be the tricky part. I've some experience writing mainly mathematical scripts and super basic sorting algorithms using Python, MATLAB and C but was never really taught how to develop a proper program. Nevertheless I really want to learn exactly that. At the moment I'm just getting started in C# and getting to know how to set up an console inside my own program/window to later integrate that into KSP and let the students run their scripts from there. So at a certain point I think this even might worth a dedicated thread but since I haven't much to show yet I figured I'll include that into my introduction. I'm sorry for the long post but I wanted to give you some background and not start with asking probably stupid questions, of which I already have one: If I run into an problem that I can't fix by myself, should I rather open a thread dedicated to my project or would you recommend posting it for example in there: The official unoffical "help a fellow plugin developer" thread ? Thanks a lot again!
  • Create New...