Ezriilc Posted June 18, 2013 Share Posted June 18, 2013 Ezrillc, I can join with you if you like. I'm pretty familiar with programming and have made my own custom mod to the part filter plugin that got rid of the annoying mod pack filter window. I have some ideas I would like to add to hyperedit. One of which is an info window that gives a legend that explains what the parameters are.It sounds to me like you are far more qualified than I, and I'd love to help you in any way I can. All I can offer you is my formidable brain and a web server or two.So, you're up to speed on C#? How might you recommend a PHP junkie speed-learn it? I'm quick, but this may take me weeks to understand fully. Link to comment Share on other sites More sharing options...
sirkut Posted June 18, 2013 Share Posted June 18, 2013 I've been developing in c# for a few years at my current job (web services, web apps and a few winforms) before I moved to being a DBA. Now it's just for fun rather than work. Php junkie to learn? Do you know any java, I'm going to flinch saying this bit it's similar in syntax. You can get either the visual studio express IDE or sharpdevelop to get started. I haven't tried sharpdevelop so I may install it so I can tell you how to set it up. Link to comment Share on other sites More sharing options...
Ezriilc Posted June 18, 2013 Share Posted June 18, 2013 Excellent! YOU are just what HyperEdit needs!PHP and some other web stuff mostly, but I've so far managed to avoid learning Java with excuses like "it's insecure, so I don't want to encourage it" or similar marklar. I did dip my toes in during the height of my Minecraft addiction (still run a private server), but it didn't go far because the mods I wanted were already available.I have heard of the syntax parallels, but I'm hoping I can get the hang of that stuff quickly. I've actually read most of this tutorial on C# and I understand most of what I read ("Hello Whirled!"), but I need much practice to become fluent. Link to comment Share on other sites More sharing options...
Ezriilc Posted June 18, 2013 Share Posted June 18, 2013 Oh, and I do have Visual C# Express+SP1 and SharpDevelop (not tried it yet) on this box, as well as MonoDevelop (also not tried), which handily came integrated with the Unity Editor. I have worked with VS/VCS a bit, and the others look pretty much the same; and I've got them all setup right, I think.I've even followed the tutorial in the KSP Wiki to make a useless PartModule that writes a line to the log, but I think I may be mixing old info with new, so I'm not sure where I stand there. My next step is to figure out what makes a plugin independent of any part - like HyperEdit is - and then I remember reading someone - a Dev? - say that C# "Attributes" were the new/best way to do that. That's when my eyes glazed over and I woke up with a console window saying... "Hello Whirled" ...again. Doh! I guess, now that I step back and look at it, I've got everything I need and I've learned the basics. I just need to see and do some simple, but real-world tasks. Any chance you have samples of some useful and common tasks that demonstrate stuff I should know? Anything to speed up the process would be appreciated. Link to comment Share on other sites More sharing options...
sirkut Posted June 19, 2013 Share Posted June 19, 2013 Samples? Oh man I have no idea. I suppose you could try downloading some other people's plugins that include the source code, try to get those to compile and place them in your KSP game. Then next step is modify them and see what it does. The files on github won't compile right away without some changes. I'll need to contact the author. Link to comment Share on other sites More sharing options...
Ezriilc Posted June 19, 2013 Share Posted June 19, 2013 Samples? Oh man I have no idea. I suppose you could try downloading some other people's plugins that include the source code, try to get those to compile and place them in your KSP game. Then next step is modify them and see what it does. The files on github won't compile right away without some changes. I'll need to contact the author.Well, that is where I was headed, so onward I press. Link to comment Share on other sites More sharing options...
Mr Shifty Posted June 19, 2013 Share Posted June 19, 2013 I wouldn't mind picking up some dev duties on this as well. I've written one very minor mod, which merely means I half-way know my way around the KSP assembly and the Unity scripting interface. I've worked with C# on and off since .NET 1.1, so I'm pretty familiar with its capabilities, coding practices, syntax, etc. I'm a hardware/embedded guy, but whenever I need to write a software app that interfaces with my designs, I inevitably turn to C#. I can't promise hours and hours of time, but if you want to throw minor stuff/fixes my way, I'd be glad to help out. Link to comment Share on other sites More sharing options...
Ezriilc Posted June 19, 2013 Share Posted June 19, 2013 (edited) Updated the git.Note that I am no longer working on HyperEdit, as well as not being in the KSP community much at all anymore. If you'd like to take over development, or know someone who will, please tell me. I haven't found anyone willing to take it up.Ok, so it looks like we have an incomplete update on GitHub. The file ShipEditor.cs is the same in the new version as the previous, but the new plugin doesn't have the buttons described in the file, so I'm sure it's not the correct file for the new version.kypheria, any chance we can find that updated ShipEditor.cs file and maybe your IDE project files? These guys seem to be plenty good at this, but it might speed up the process. It appears that ShipEditor.cs and UniverseTools.cs should don't belong in the new project. I've removed them and the project builds with no errors. I'm loading KSP with it in place now to see if that's the only build problem. [it wasn't]EDIT: I've no idea what I'm doing... apparently. It did build, but the plugin doesn't work in-game. Considering how many things I may have wrong here, there's no surprise really.EDIT:EDIT: I'm pretty sure they don't belong. The functions defined in them are taken care of elsewhere, like MiscEditor.cs and Lander.cs. Edited June 19, 2013 by Ezriilc Link to comment Share on other sites More sharing options...
SolarLiner Posted June 19, 2013 Share Posted June 19, 2013 Is this what you're looking for?Right click in your Project in the Solution Explorer Click "Add Reference". Click the "Browse" tab. Navigate to your KSP install folder, and inside \KSP_Data\Managed\, you'll find 2 .dll's to reference.Assembly-CSharp.dll UnityEngine.dll Worked ! Thanks.So, wanna work together ? We can create a new repo or take the current (I prefer create another, since github app doesn't work for me (dl problem)), and split up work, like real team Link to comment Share on other sites More sharing options...
Ezriilc Posted June 19, 2013 Share Posted June 19, 2013 Worked ! Thanks.So, wanna work together ? We can create a new repo or take the current (I prefer create another, since github app doesn't work for me (dl problem)), and split up work, like real team Yes! I gladly accept help from anyone and everyone that wishes to offer it.I think all we need to do is figure out what's wrong with the latest GitHub repo, since HyperEdit currently works very well and needs very little, if anything.I've confirmed that ShipEditor.cs and UniverseEditor.cs should NOT be in the project. The code in them has been moved to other files. But even though the build goes fine, the plugin doesn't load - I get the following in the KSP.log:[LOG 10:22:21.926] Load(Assembly): Plugins/HyperEdit[LOG 10:22:21.927] AssemblyLoader: Loading assembly at C:\MyDocs\Games\Kerbal Space Program\KSP_Game\Plugins\HyperEdit.dll[LOG 10:22:22.070] AssemblyLoader: Loading assembly 'C:\MyDocs\Games\Kerbal Space Program\KSP_Game\Plugins\HyperEdit.dll'[ERR 10:22:22.076] Exception when loading C:\MyDocs\Games\Kerbal Space Program\KSP_Game\Plugins\HyperEdit.dll: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded. at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool) at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0 at AssemblyLoader.LoadAssembly (System.Reflection.Assembly assembly, System.String filePath, System.String url) [0x00000] in <filename unknown>:0 Additional information about this exception: System.TypeLoadException: Could not load type 'HyperEdit.Window' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type 'HyperEdit.HyperEditWindow' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type 'HyperEdit.Extentions' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type 'HyperEdit.WindowDrawer' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type 'HyperEdit.Button' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type 'HyperEdit.CustomDisplay' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type 'HyperEdit.LanderAttachment' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type 'HyperEdit.Window' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type 'HyperEdit.Window' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type 'HyperEdit.Window' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type 'HyperEdit.Window' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type 'VelChangeDir' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type 'EditMode' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type 'HyperEdit.Window' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type 'HyperEdit.Window' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type 'HyperEdit.Window' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type '<>c__DisplayClass1`1' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type '<>c__DisplayClassa`2' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type '<>c__DisplayClassd`2' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type '<>c__DisplayClass1' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type '<>c__DisplayClass4' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type '<>c__DisplayClass8' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type '<>c__DisplayClass11' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type '<>c__DisplayClass4' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type '<>c__DisplayClass6' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type '<>c__DisplayClass3' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type '<>c__DisplayClassd' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type '<>c__DisplayClass4' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type '<>c__DisplayClass9' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type '<>c__DisplayClass4' from assembly 'HyperEdit, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null'.At this point, I'm pretty sure it's just something wrong with the project settings regarding how references are linked, but I don't know enough about compiling to see it. So, it's kinda on you experts to find it, unless I get lucky, and I will keep trying. Link to comment Share on other sites More sharing options...
Ezriilc Posted June 19, 2013 Share Posted June 19, 2013 Can anyone point out another plugin that is NOT linked to a part? I'd like to look at functioning code to see what is required regarding the project settings, references, etc..Anyone? Link to comment Share on other sites More sharing options...
Ezriilc Posted June 19, 2013 Share Posted June 19, 2013 Another question for anyone concerned with the project.:Has a test executable for debugging plugins ever been made? I mean a small .exe file that can be used as a "Startup object" in the IDE, for debugging our .dll files. A quick Google search turns up nothing that jumps out at me, so I think I'll see about creating one.It seems to me that being able to run any sort of debug tool in the IDE might speed up the development process, and so I think that creating a test .exe should perhaps be a priority for us as a team.What do y'all think? Link to comment Share on other sites More sharing options...
Mr Shifty Posted June 19, 2013 Share Posted June 19, 2013 Can anyone point out another plugin that is NOT linked to a part? I'd like to look at functioning code to see what is required regarding the project settings, references, etc..Anyone?Check out my plugin (link in my signature). It has no part; source is in the download zip file. Regarding project settings, cybutek's tutorial series is fantastic. Check it out here: Link to comment Share on other sites More sharing options...
Ezriilc Posted June 19, 2013 Share Posted June 19, 2013 Check out my plugin (link in my signature). It has no part; source is in the download zip file. Regarding project settings, cybutek's tutorial series is fantastic. Check it out here: Ah, your plugin is a great example, thanks.The vids look all well and good, but I find it hard to sit through video tutorials and much prefer written. I'll give them a try eventually. Link to comment Share on other sites More sharing options...
ahd1601 Posted June 19, 2013 Share Posted June 19, 2013 Can anyone point out another plugin that is NOT linked to a part? I'd like to look at functioning code to see what is required regarding the project settings, references, etc..Anyone?check out crew manifest Link to comment Share on other sites More sharing options...
sirkut Posted June 19, 2013 Share Posted June 19, 2013 I may have a trick for you. When I get home I will try something that I have used then let you know. Link to comment Share on other sites More sharing options...
Mr Shifty Posted June 19, 2013 Share Posted June 19, 2013 Ah, your plugin is a great example, thanks.The vids look all well and good, but I find it hard to sit through video tutorials and much prefer written. I'll give them a try eventually.Just the first couple are all you'd need; they're fairly short. Generally, you just need to make sure:- You're targeting .NET 3.5- You're not compiling a debug version of the assembly- You have Assembly-CSharp.dll and UnityEngine.dll as referencesFor non-part plugins you just need the KSPAddOn attribute on your MonoBehavior derived class. Some info here:http://forum.kerbalspaceprogram.com/showthread.php/34013-0-20-PartTools-GameDatabase-and-new-featuresI also found this old post pretty informative:http://forum.kerbalspaceprogram.com/showthread.php/7529-Plugin-Posting-Rules-And-Official-Documentation?p=156430&viewfull=1#post156430 Link to comment Share on other sites More sharing options...
Ezriilc Posted June 19, 2013 Share Posted June 19, 2013 Just the first couple are all you'd need; they're fairly short. Generally, you just need to make sure:- You're targeting .NET 3.5- You're not compiling a debug version of the assembly- You have Assembly-CSharp.dll and UnityEngine.dll as referencesFor non-part plugins you just need the KSPAddOn attribute on your MonoBehavior derived class. Some info here:http://forum.kerbalspaceprogram.com/showthread.php/34013-0-20-PartTools-GameDatabase-and-new-featuresI also found this old post pretty informative:http://forum.kerbalspaceprogram.com/showthread.php/7529-Plugin-Posting-Rules-And-Official-Documentation?p=156430&viewfull=1#post156430Ah-HA! .NET 3.5... I was on 4.0. No debug, references are in place. Link to comment Share on other sites More sharing options...
Ezriilc Posted June 19, 2013 Share Posted June 19, 2013 (edited) For non-part plugins you just need the KSPAddOn attribute on your MonoBehavior derived class. Some info here:http://forum.kerbalspaceprogram.com/showthread.php/34013-0-20-PartTools-GameDatabase-and-new-features Yea, THAT's the bit about the non-part attributes. Now that makes a bit more sense.I also found this old post pretty informative:http://forum.kerbalspaceprogram.com/showthread.php/7529-Plugin-Posting-Rules-And-Official-Documentation?p=156430&viewfull=1#post156430That I've seen.What would be really great, is if the professionals who own/control/profit from this game would make a concerted effort to publish, organize and maintain ALL the information needed to use EVERY function of the game, including modding. I know this is unheard of in today's game world - especially indies - but damn; that's how I'd do it. This hunting and begging for specifications and info really sucks. EDIT: Ah, who am I kidding; I love this stuff!Nothing but love to Squad et al. Edited June 19, 2013 by Ezriilc Link to comment Share on other sites More sharing options...
Ezriilc Posted June 19, 2013 Share Posted June 19, 2013 YES! It works! Changing my build setup to .NET 3.5 from 4.0 did the trick! Thanks, Mr. Shifty!We now have what we need to move forward.In that regard, I think we should...:Create a test executable to debug in the IDE (for ALL plugins maybe?).Change from using "KSP.Testing.UnitTest" to using the KSPAddOn attribute. Link to comment Share on other sites More sharing options...
sirkut Posted June 19, 2013 Share Posted June 19, 2013 YES! It works! Changing my build setup to .NET 3.5 from 4.0 did the trick! Thanks, Mr. Shifty!We now have what we need to move forward.In that regard, I think we should...:Create a test executable to debug in the IDE (for ALL plugins maybe?).Change from using "KSP.Testing.UnitTest" to using the KSPAddOn attribute.Currently the only real way that I know how to test a dll within KSP is to use a lot of Debug.Log messages to print values or strings just to give a status of the flow. Link to comment Share on other sites More sharing options...
Ezriilc Posted June 19, 2013 Share Posted June 19, 2013 I've taken the liberty of creating a new ZIP archive of HyperEdit 1.2.1 (latest), with the new GameData folder structure, and includes the source files as well as my project properties for Visual C#.In the hopes that khyperia doesn't mind, I've uploaded it to my site so you all can have it. I've not changed his code, just repackaged the ZIP with the corrected source - minus the stray files. This copy has been tested by me.http://www.sonsofdurin.com/KSP/HyperEdit_1.2.1.zip Link to comment Share on other sites More sharing options...
Ezriilc Posted June 19, 2013 Share Posted June 19, 2013 Currently the only real way that I know how to test a dll within KSP is to use a lot of Debug.Log messages to print values or strings just to give a status of the flow.Yea, that's what I've discovered, which is why I'd like to create an .exe file that applies as much of the KSP API as possible to the plugin .dll, in order to trigger all the code and allow debugging to work as intended. I've already begun the process, and so far I'm not able to trigger the assembly code, but I don't see any reason why we can't make it work. We just need to make the .exe touch all the API calls. Link to comment Share on other sites More sharing options...
Ezriilc Posted June 19, 2013 Share Posted June 19, 2013 Now that I feel more up to speed on this, I don't mind taking the lead on this project if you all are OK with that. I think I have the resources and time needed to maintain it, but with all the help being provided, I feel there won't be any problems there.So, if you all wish it, and khyperia approves, I volunteer to take over the HyperEdit project. Link to comment Share on other sites More sharing options...
Ezriilc Posted June 19, 2013 Share Posted June 19, 2013 Sweet, now I have a new feature - MechJeb completely goes crazy if / when I hyperedit something into orbit. All my windows disappear for that vessel and reverts to default. Hmm.Correcting any errors and supporting the existing HyperEdit product is my top priority, so I plan to address this ASAP. Let me work on recreating this scenario, and I'll get back to you. Link to comment Share on other sites More sharing options...
Recommended Posts