Jump to content

Need to add a textual resource


Recommended Posts

For a new mod I'm writing, I need to have a text resource for each command pod.  This mod will be an auto-namer mod, which will rename a ship upon launch (based on a template).  I also want to be able to have subassemblies have their own name, so that when they are detached from the mothership (such as rovers, landers, etc), they will have their own name.  My thought is to have a text-based resource which you can assign a name and then save the ship as a subassembly, and when it is detached/undocked from the mother ship, that text resource will be assigned as the ship name.

I've never done this before, this is the first time I'm working with parts.

So, I'm kind of looking for some sort of example.  I'm thinking that the resource will be set to the ship name before it is saved as a subassembly, either that or set it via a right-click in the editor.

But I have no idea how to set a resource in a part.  I've been looking, and have seen many examples, all different.

Thanks

 

Link to comment
Share on other sites

  • 2 weeks later...

Finally got the answer, thanks to Roverdude for answering in chat.

I need to create a new class derived form PartModule, add the new part module to the parts which will need to keep their names, etc

Watch for AutoCraftRenamer, to be written in the next few weeks

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...