Jump to content

how to load assembly in editor


Recommended Posts

Hi,

I know how to load a craft in the editor using:

EditorLogic.LoadCraftFromFile

but 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 by linuxgurugamer
Link to comment
Share on other sites

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

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

Looking at the object browser, it most likely is one of:

EditorLogic.LoadShipFromFile

EditorLogic.SpawnConstruct

EditorLogic.SpawnTemplate

I can't help with actually using any of those though, not something I've tried.

D.

Link to comment
Share on other sites

Looking at the object browser, it most likely is one of:

EditorLogic.LoadShipFromFile

EditorLogic.SpawnConstruct

EditorLogic.SpawnTemplate

I 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 old

I'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.getPartInfoByName

which does what I need (ie: verify that a part exists).

LGG

Edited by linuxgurugamer
Link to comment
Share on other sites

Unfortunately, the first doesn't work because:

LoadShipFromFile - Loads it as a new ship, deleting the old

I'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

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...