linuxgurugamer Posted October 11, 2019 Share Posted October 11, 2019 3 hours ago, garwel said: How can I read the persistentId of the vessel in the Editor? I tried using ShipConstruction.LoadShip().persistentId, but it causes terrible glitches (basically, the vessel on the screen is duplicated for every call of this method). Also, will this persistentId be the same for the ship when it is launched? Why do you need this? Quote Link to comment Share on other sites More sharing options...
garwel Posted October 11, 2019 Share Posted October 11, 2019 2 minutes ago, linuxgurugamer said: Why do you need this? I want to add a system that allows kerbals to "train" for a particular vessel before it is launched, so that they are more efficient during the mission. So I need a way to know that they have been trained for this vessel (or, as an option, for something very similar). Quote Link to comment Share on other sites More sharing options...
linuxgurugamer Posted October 11, 2019 Share Posted October 11, 2019 (edited) 6 minutes ago, garwel said: I want to add a system that allows kerbals to "train" for a particular vessel before it is launched, so that they are more efficient during the mission. So I need a way to know that they have been trained for this vessel (or, as an option, for something very similar). Use MM to add a field to command pods to store a unique id, then reference that ID in the training center. You could add a new module which would allow the I'd to se set and changed in the editor, but once launched it would be readonly Edited October 11, 2019 by linuxgurugamer Quote Link to comment Share on other sites More sharing options...
garwel Posted October 11, 2019 Share Posted October 11, 2019 Just now, linuxgurugamer said: Use MM to add a field to command pods to store a unique id, then reference that ID in the training center. I'm not sure if MM applies here, but I see what you mean. If I add a field to a PartModule to initialize all crewable parts with some IDs in the Editor, I can then check if the crew is trained for these specific parts in-flight. It may not be the simplest solution, but it is actually more flexible (should work with docking etc.). Quote Link to comment Share on other sites More sharing options...
linuxgurugamer Posted October 11, 2019 Share Posted October 11, 2019 Just now, garwel said: I'm not sure if MM applies here, but I see what you mean. If I add a field to a PartModule to initialize all crewable parts with some IDs in the Editor, I can then check if the crew is trained for these specific parts in-flight. It may not be the simplest solution, but it is actually more flexible (should work with docking etc.). You would use MM to add the part module to the parts Quote Link to comment Share on other sites More sharing options...
garwel Posted October 11, 2019 Share Posted October 11, 2019 Just now, linuxgurugamer said: You would use MM to add the part module to the parts Yeah, I'm already doing it. Besides, are VesselModules loaded in the Editor? Perhaps, I can attach an ID to it? Quote Link to comment Share on other sites More sharing options...
linuxgurugamer Posted October 11, 2019 Share Posted October 11, 2019 9 minutes ago, garwel said: Yeah, I'm already doing it. Besides, are VesselModules loaded in the Editor? Perhaps, I can attach an ID to it? No, VesselModules are not loaded in the editor Quote Link to comment Share on other sites More sharing options...
DoctorDavinci Posted October 11, 2019 Share Posted October 11, 2019 (edited) 1 hour ago, garwel said: Thanks, but it is bad news. I need to somehow associate the vessel in the Editor with its launched version. Couldn't you do this by using the vessel name? Attach a module to a kerbal ... put in the values you need to have into the part module, make them persistant and force activate the module OnStart You can check the data in the part module through protocrewmember and pull any values you need out of it which would be specific to that kerbal only As for MM, you dont need it really .... here's a slice of code to bypass any need for MM (just replace the 'ModuleOrX' with whatever you want to call the part module you are adding to a Kerbal) Spoiler [KSPAddon(KSPAddon.Startup.SpaceCentre, true)] class OrXAddModules : MonoBehaviour { public static OrXAddModules instance; public void Awake() { if (instance) Destroy(instance); instance = this; Debug.Log("[ORX] === ADDING OrX MODULE ==="); ConfigNode EVA = new ConfigNode("MODULE"); EVA.AddValue("name", "ModuleOrX"); try { PartLoader.getPartInfoByName("kerbalEVA").partPrefab.AddModule(EVA); Debug.Log("[ORX] === ADDED OrX MODULE to kerbalEVA ==="); } catch { //Debug.Log("[ORX] === ADDED OrX MODULE to kerbalEVA ==="); } try { PartLoader.getPartInfoByName("kerbalEVAfemale").partPrefab.AddModule(EVA); Debug.Log("[ORX] === ADDED OrX MODULE to kerbalEVAfemale ==="); } catch { // Debug.Log("[ORX] === ADDED OrX MODULE to kerbalEVAfemale ==="); } } } Edited October 11, 2019 by DoctorDavinci Quote Link to comment Share on other sites More sharing options...
linuxgurugamer Posted October 12, 2019 Share Posted October 12, 2019 2 hours ago, DoctorDavinci said: As for MM, you dont need it really .... here's a slice of code to bypass any need for MM Why have an extra 20-40 lines of code when it's a single line in MM? The fact that you can do something doesn't mean you should. Besides, there are advantages to having a module in the vessel when it's instantiated and not afterwards. 2 hours ago, DoctorDavinci said: Couldn't you do this by using the vessel name? Vessels can be renamed, defeating the purpose of the mod Quote Link to comment Share on other sites More sharing options...
garwel Posted October 12, 2019 Share Posted October 12, 2019 Guys, please don't fight, especially since there is no real conflict. Thank you both for your ideas; I now see how it can be done, perhaps even better than originally planned. Quote Link to comment Share on other sites More sharing options...
Vanamonde Posted October 12, 2019 Share Posted October 12, 2019 Some posts have been removed. Please discuss things without attacking each other in a personal way. Quote Link to comment Share on other sites More sharing options...
peteletroll Posted October 20, 2019 Share Posted October 20, 2019 (edited) Anybody else having problems with UI_FloatEdit PAW entries in KSP 1.8? I'm getting white misaligned rectangles... Edited October 20, 2019 by peteletroll Quote Link to comment Share on other sites More sharing options...
Lisias Posted October 21, 2019 Share Posted October 21, 2019 (edited) UI_ScaleEdit is defective on KSP 1.8. This affects every single Add'On that uses it. Yes, all the 4 of us. You can see the evidences on the TweakScale thread. @Shadowmage, Textures Unlimited and SSTUTools handle it but doesn't use it apparently. But I think you should be aware, as Add'On authors using Texture Unlimited and UI_ScaleEdit and knowing the source code can eventually ask you for help. @allista, Ground Construction uses this on the Widgets for "Bulkhead" and "Length" on the DeployableKitContainer class. I'm pretty sure this is affecting you. Cheers. (well, not exactly - I'm somewhat "liquided" with this. ) 11 hours ago, peteletroll said: Anybody else having problems with UI_FloatEdit PAW entries in KSP 1.8? I'm getting white misaligned rectangles... Ouch! I should had been here sooner! TweakScale has it, and I confirmed the behavirour testing with other Add'Ons on KSP 1.7 and trying them on KSP 1.8. Edited October 21, 2019 by Lisias tyop! Surprised? Quote Link to comment Share on other sites More sharing options...
peteletroll Posted October 21, 2019 Share Posted October 21, 2019 (edited) So @Lisias, maybe we can try filing a bug, or even summon @TriggerAu! A hotfix is probably coming soon, so there's hope I guess. Edited October 21, 2019 by peteletroll Quote Link to comment Share on other sites More sharing options...
Lisias Posted October 21, 2019 Share Posted October 21, 2019 (edited) UI_FloatRange is defective on KSP 1.8. Too This affects half the World. I can't even enumerate the victims here. Details on the TweakScale thread. I made that in a rush (work time), I can be wrong - but the images I got appears to corroborate my thesis. Guys, this is a way more serious and broad than I though. Edited October 21, 2019 by Lisias I typed that in a rush. :P Quote Link to comment Share on other sites More sharing options...
zer0Kerbal Posted October 21, 2019 Share Posted October 21, 2019 3 hours ago, Lisias said: Guys, this is a way more serious and broad than I though. both good news and bad. Good news, glass half full, silver pod lining - 1.8.1 might arrive all that much quicker! Quote Link to comment Share on other sites More sharing options...
Lisias Posted October 21, 2019 Share Posted October 21, 2019 (edited) 3 hours ago, zer0Kerbal said: both good news and bad. Good news, glass half full, silver pod lining - 1.8.1 might arrive all that much quicker! We survived 1.4.0. We will survive 1.8.0. But, boy, we will have some burning ears. I'm cooking dinner on mine! (The grumpyness factor is strong on this one!) Edited October 21, 2019 by Lisias EARS, YOU KRAKEN DAMNED AUTO-COMPLETE FROM HELL!! Quote Link to comment Share on other sites More sharing options...
Jacke Posted October 21, 2019 Share Posted October 21, 2019 40 minutes ago, Lisias said: We survived 1.4.0. We will survive 1.8.0. But, boy, we will have some burning years. KSP release history: 2018 Mar 6 1.4 2018 Mar 13 1.4.1 2018 Mar 28 1.4.2 2018 Apr 27 1.4.3 2018 Jun 21 1.4.4 2018 Jul 26 1.4.5 2018 Oct 15 1.5 Quote Link to comment Share on other sites More sharing options...
zer0Kerbal Posted October 22, 2019 Share Posted October 22, 2019 +2 since out of likes for today. Quote Link to comment Share on other sites More sharing options...
Lisias Posted October 22, 2019 Share Posted October 22, 2019 19 hours ago, peteletroll said: So @Lisias, maybe we can try filing a bug, or even summon @TriggerAu! A hotfix is probably coming soon, so there's hope I guess. Now I'm 90% confident to file a bug. But I would try some stunts on Windows first. It's not impossible that we are facing a glitch on cross-compiling. The stunts I already tried are on TweakScale's Thread, and I did them on MacOS. Quote Link to comment Share on other sites More sharing options...
peteletroll Posted October 22, 2019 Share Posted October 22, 2019 3 hours ago, Lisias said: But I would try some stunts on Windows first. If you're interested, I found the bug on Linux. Quote Link to comment Share on other sites More sharing options...
peteletroll Posted October 22, 2019 Share Posted October 22, 2019 @Lisias, do you plan to file a bug soon? Probably UI_FloatRange, UI_ScaleEdit and UI_FloatEdit have the same root bug. I can file it for you too, maybe someone from @SQUAD can suggest the best way to get this fixed soon. Quote Link to comment Share on other sites More sharing options...
Lisias Posted October 22, 2019 Share Posted October 22, 2019 2 hours ago, peteletroll said: @Lisias, do you plan to file a bug soon? Probably UI_FloatRange, UI_ScaleEdit and UI_FloatEdit have the same root bug. I can file it for you too, maybe someone from @SQUAD can suggest the best way to get this fixed soon. Please, do it. I neglected some Real Life duties, I will lack the time to do it properly - no keyboards on bathrooms. =D Quote Link to comment Share on other sites More sharing options...
peteletroll Posted October 22, 2019 Share Posted October 22, 2019 (edited) @Lisias, I added a bug here. Please add a note about UI_FloatRange and UI_ScaleEdit, I didn't check them out and I'm not 100% sure they appear the same (see attached image). And upvote the bug, of course! Edited October 22, 2019 by peteletroll spelling Quote Link to comment Share on other sites More sharing options...
AmpCat Posted October 23, 2019 Share Posted October 23, 2019 I'm trying to start learning to mod, and I've gotten kind of stuck on a simple 'Hello World'. The examples I've been following are old, so it may have something to do with that, but I've downloaded the latest unity, and am building with the .NET 4.7.2 framework. The KSP.log says it's loaded and reports no errors, but the mods do nothing. I added a second mod which adds a partmodule, and later on when it tries to load that into a part I modified, it tells me it can't find that module. So it's almost like KSP is loading the DLL, but then can't find anything in it. Here's the code: using System; using System.Diagnostics; using UnityEngine; namespace HelloWorld { //[KSPAddon(KSPAddon.Startup.MainMenu, false)] public class Hello : MonoBehaviour { public void Update() { Debug.Log("Hello world! " + Time.realtimeSinceStartup); } } } namespace HelloWorld2 { /// <summary> /// My first part! /// </summary> public class HelloKerbinMod : PartModule { /// <summary> /// Called when the part is started by Unity. /// </summary> public override void OnStart(StartState state) { // Add stuff to the log print("Hello, Kerbin!"); } } } It's real simple at this point, so I'm assuming there's something simple I'm doing wrong. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.