linuxgurugamer Posted October 27, 2015 Share Posted October 27, 2015 (edited) Hi,I know how to load a craft in the editor using:EditorLogic.LoadCraftFromFilebut I can't find how to load an assembly so that it can be added on.Also, how do I tell what parts are currently loaded in the system (for a different problem)?Hints? Pointers? Thanks Edited October 27, 2015 by linuxgurugamer Link to comment Share on other sites More sharing options...
Diazo Posted October 27, 2015 Share Posted October 27, 2015 I'm confused by your use of assembly in this context.This is the plugin subforum, an assembly is a name for the overarching container that code resides in within a .dll file. It sounds however like you are using it as meaning a ground of parts assembled in the editor?As for parts loaded, you need to look at the ProtoParts database, I can remember exactly where it lives though, AvailableParts I think?D. Link to comment Share on other sites More sharing options...
linuxgurugamer Posted October 27, 2015 Author Share Posted October 27, 2015 I'm confused by your use of assembly in this context.This is the plugin subforum, an assembly is a name for the overarching container that code resides in within a .dll file. It sounds however like you are using it as meaning a ground of parts assembled in the editor?As for parts loaded, you need to look at the ProtoParts database, I can remember exactly where it lives though, AvailableParts I think?D.I'm referring to Subassemblies as seen in the Editor scene.So what I'm trying to do is to load a specific assembly and have it in the Editor, similarly to the way you would load a subassembly in the editor Link to comment Share on other sites More sharing options...
Diazo Posted October 28, 2015 Share Posted October 28, 2015 Looking at the object browser, it most likely is one of:EditorLogic.LoadShipFromFileEditorLogic.SpawnConstructEditorLogic.SpawnTemplateI can't help with actually using any of those though, not something I've tried.D. Link to comment Share on other sites More sharing options...
linuxgurugamer Posted October 28, 2015 Author Share Posted October 28, 2015 (edited) Looking at the object browser, it most likely is one of:EditorLogic.LoadShipFromFileEditorLogic.SpawnConstructEditorLogic.SpawnTemplateI can't help with actually using any of those though, not something I've tried.D.Unfortunately, the first doesn't work because:LoadShipFromFile - Loads it as a new ship, deleting the oldI'll have to test the spawn ones, they involve extra steps.What's really strange is, in Xamarin, I can see both the LoadShipFromFile and SpawnConstruct in the browser, but the SpawnConstruct isn't static, so I need to use it from an object. Thanks- - - Updated - - -As for parts loaded, you need to look at the ProtoParts database, I can remember exactly where it lives though, AvailableParts I think?D.I found: PartLoader.getPartInfoByNamewhich does what I need (ie: verify that a part exists).LGG Edited October 28, 2015 by linuxgurugamer Link to comment Share on other sites More sharing options...
linuxgurugamer Posted October 28, 2015 Author Share Posted October 28, 2015 Unfortunately, the first doesn't work because:LoadShipFromFile - Loads it as a new ship, deleting the oldI'll have to test the spawn ones, they involve extra steps.What's really strange is, in Xamarin, I can see both the LoadShipFromFile and SpawnConstruct in the browser, but the SpawnConstruct isn't static, so I need to use it from an object. SpaceTiger was able to show me how to use the SpawnConstruct.So this is all solved. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now