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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...