TheUndeadFish Posted May 23, 2013 Share Posted May 23, 2013 (edited) I didn't find a thread dedicated to the Subassembly Loader mod, so I had to create this one.Using the source code provided along with the mod, I just made a patched version that will work with 0.20. This moves the button to a usable location in the VAB as well as eliminates the lag caused by the plugin not loading properly.I only intend this as a quick-and-dirty fix until the mod's author can release a proper updated version of it. You still need the original files, then override the dll with the one from my path.Download:For the sake of those playing the game at much lower resolutions, I've made a second version of my patch. This one moves the button to the upper right corner, but under the other buttons instead of beside them. It's not as pretty as being on the top bar, but it should be functional.Download:Disclaimer: Use at your own risk, since I'm rather new to KSP modding.A few other people in this thread have made their own patches. So if one of my patches doesn't work for some reason, then you could try one of theirs: Edited June 23, 2013 by sal_vager Had to remove the links on copyright grounds. Link to comment Share on other sites More sharing options...
IvanTehFennec Posted May 23, 2013 Share Posted May 23, 2013 (edited) I didn't find a thread dedicated to the Subassembly Loader mod, so I had to create this one.Using the source code provided along with the mod, I just made a patched version that will work with 0.20. This moves the button to a usable location in the VAB as well as eliminates the lag caused by the plugin not loading properly.I only intend this as a quick-and-dirty fix until the mod's author can release a proper updated version of it.Download:Disclaimer: Use at your own risk, since I'm rather new to KSP modding.All I can say is THANK YOU. I wondered where DEADBEEF went after the forum catastrophe, though. Edited June 23, 2013 by sal_vager Link to comment Share on other sites More sharing options...
Mihara Posted May 23, 2013 Share Posted May 23, 2013 Could you maybe do the same for EdTools? It also comes with source and is also not working well in 0.20. Link to comment Share on other sites More sharing options...
eurybaric Posted May 23, 2013 Share Posted May 23, 2013 Could you maybe do the same for EdTools? It also comes with source and is also not working well in 0.20.Yes please I second that. Link to comment Share on other sites More sharing options...
bulletrhli Posted May 23, 2013 Share Posted May 23, 2013 Agreed with EdTools Link to comment Share on other sites More sharing options...
ahappydude Posted May 23, 2013 Share Posted May 23, 2013 The devs seems to incorperated an partreloader in the debug menu, dont know if it was the one that the use who made edtools made. Cheers for making it compatible for new version =) Link to comment Share on other sites More sharing options...
SVoyager Posted May 23, 2013 Share Posted May 23, 2013 Would it be possible to have a version/full repackage of the mod with the new directory structure? I am not quite sure what is involved in switching between from the old .19 to the new .20 directory structure so I don't know how to do this myself. I am hoping to be able to get a "clean" setup as I am starting a new ksp save and it would be nice to use the new .20 way, much less of a mess that way! Link to comment Share on other sites More sharing options...
Bluegobln Posted May 23, 2013 Share Posted May 23, 2013 He's not working on the mod, he just made a quick fix for the main DLL file so that it would work instead of completely not work.It works for me. The loading seems to be funky, and the icon is a tiny little question mark " ? " instead of the usual icon, but it works so I'm fine with this until its updated officially. Thanks mate. Link to comment Share on other sites More sharing options...
Katalliaan Posted May 23, 2013 Share Posted May 23, 2013 Would you mind releasing the source for your changes, so that those who are interested can look through the code? Link to comment Share on other sites More sharing options...
TheUndeadFish Posted May 23, 2013 Author Share Posted May 23, 2013 Would you mind releasing the source for your changes, so that those who are interested can look through the code?I actually only made two little changes to the code:The first was to comment out line 11://private static PluginConfiguration config = PluginConfiguration.CreateForType<subassemblyLoader>();A problem happens when the game runs that, as was evident by the errors in the output log. And it was consequently causing the plugin to fail to load, which causes the game to try to reload it over and over, which causes the lag. But since the mod doesn't seem to make use of that configuration file stuff, commenting out the line way a simple was the deal with the issue.The second was to adjust the first number on line 129, which is the x coordinate of where the button is drawn in the VAB:if (GUI.Button(new Rect(350, 1, 48, 36), new GUIContent(button, "Subassembly"), buttonStyle) && !EditorLogic.softLock) Link to comment Share on other sites More sharing options...
Fyrem Posted May 23, 2013 Share Posted May 23, 2013 thanks again! Link to comment Share on other sites More sharing options...
Hyomoto Posted May 23, 2013 Share Posted May 23, 2013 I like all my mods, but this is the only one I'd consider mandatory. Link to comment Share on other sites More sharing options...
Simplicity Posted May 23, 2013 Share Posted May 23, 2013 thank you for your quick fix, it works great, I don't have a question mark like the person above, I have the jigsaw picture on mine..To the person asking about new directory structure, do not use it, just use the old folders for this mod, it works in them at the moment. Link to comment Share on other sites More sharing options...
Luxmaster-CZ Posted May 23, 2013 Share Posted May 23, 2013 does I need to have previous version istalled? Seems so, because I dont have, and I cant see button at all Link to comment Share on other sites More sharing options...
Simplicity Posted May 23, 2013 Share Posted May 23, 2013 yes, install the proper version, and then overwrite the dll with the one from here, that will get it back for you Link to comment Share on other sites More sharing options...
Luxmaster-CZ Posted May 23, 2013 Share Posted May 23, 2013 Could you please upload it as whole? I cant find it on spaceport Link to comment Share on other sites More sharing options...
Richy teh space man Posted May 23, 2013 Share Posted May 23, 2013 Could you please upload it as whole? I cant find it on spaceportThe originalhttp://kerbalspaceprogram.com/subassembly-saver-loader/ Link to comment Share on other sites More sharing options...
Simplicity Posted May 23, 2013 Share Posted May 23, 2013 Could you please upload it as whole? I cant find it on spaceportNo need, go to the first post in this thread, the link to mediafire is there for the mod edit: or click the link above this post Link to comment Share on other sites More sharing options...
MDBenson Posted May 23, 2013 Share Posted May 23, 2013 Thank you. I was pining for this last night after the update! Link to comment Share on other sites More sharing options...
Commander Zoom Posted May 23, 2013 Share Posted May 23, 2013 Works like a charm. Thanks for the quick fix! Link to comment Share on other sites More sharing options...
Fel Posted May 23, 2013 Share Posted May 23, 2013 Thanks for the source tip (I prefer using the mod without the whole "Bad Subassembly" nonsense, so this makes it really simple to update what I have)AlsoThe new way to make Part-less plugins is to use the KSPAddon attribute, like this:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using UnityEngine;[KSPAddon(KSPAddon.Startup.EditorAny, false)]public class Class1 : MonoBehaviour{ private float lastUpdate = 0; void Awake() { Debug.Log("TAC [" + this.GetInstanceID().ToString("X") + "][" + Time.time + "] Awake"); } void Update() { float delta = Time.time - lastUpdate; if (delta > 15) { Debug.Log("TAC [" + this.GetInstanceID().ToString("X") + "][" + Time.time + "] Update"); lastUpdate = Time.time; } }}This class will be loaded every time the scene is changed to the Editor, and Awake will be called. And it will be unloaded when the scene is changed to something else, but until then Update() will be called.(Haven't tried yet; but just what has been said) Link to comment Share on other sites More sharing options...
smarky55 Posted May 23, 2013 Share Posted May 23, 2013 (edited) Hi all, love this mod so decided to delve a tad deeper into updating it for 0.20 :Extract the GameData folder inside the zip in your KSP folder, directory structure should be good.Basically all I did was use TheUndeadFish's edits along with changing the file references to a folder in GameData, seems to run OK and shouldn't have any problems with little question mark icons.@FelThis hooks in to Unity's OnGui function and already checks if the editor is open so the [KSPAddon] shouldn't be needed. Performance gain, if any would be tiny (I think:)). Edited June 23, 2013 by sal_vager Link to comment Share on other sites More sharing options...
Sma Posted May 23, 2013 Share Posted May 23, 2013 I changed the number for mine to something else: new Rect(526-45, 1, 48, 36) Maybe it has to do with screen sizes, but with 350 it put it almost in the middle of the blank space on the top bar. I guess the reason deadbeaf put screen.width - whatever number it was originally, was to make it so it positioned its self no matter the resolution settings, but thats just a guess. I did originally try leaving screen.width and changing the amount subtracted from it but I wasn't compiling it correctly then and it wasn't loading I guess. Got it working now though. I did try doing it my self before I read your post completely and did happen to find line 129, but didn't comment out line 11 so I bet that was part of my original problem. Thats when I thought I'd do it like you did but with my own numbers. No offence meant by not using the one you uploaded but I sometimes find coding fun and not having done c# before thought it'd be a fun little exercise.Anyway, enough of my rambling, just thought I'd mention the number thing. Glad you thought about editing the source code other wise a lot of us wouldn't be able to use sub assembly until an official update came out. I actually only made two little changes to the code:The first was to comment out line 11://private static PluginConfiguration config = PluginConfiguration.CreateForType<subassemblyLoader>();A problem happens when the game runs that, as was evident by the errors in the output log. And it was consequently causing the plugin to fail to load, which causes the game to try to reload it over and over, which causes the lag. But since the mod doesn't seem to make use of that configuration file stuff, commenting out the line way a simple was the deal with the issue.The second was to adjust the first number on line 129, which is the x coordinate of where the button is drawn in the VAB:if (GUI.Button(new Rect(350, 1, 48, 36), new GUIContent(button, "Subassembly"), buttonStyle) && !EditorLogic.softLock) Link to comment Share on other sites More sharing options...
Bluegobln Posted May 23, 2013 Share Posted May 23, 2013 (edited) ............ Edited May 23, 2013 by Bluegobln Grrrrrr Link to comment Share on other sites More sharing options...
Bluegobln Posted May 23, 2013 Share Posted May 23, 2013 The .CS file is in the main directory outside the GameData folder (not to mention the subassemblyLoader folder...)Enlighten me, please, as the the intended usage?Hi all, love this mod so decided to delve a tad deeper into updating it for 0.20 Link to comment Share on other sites More sharing options...
Recommended Posts