Jump to content

Add new data field to craft file


Recommended Posts

I'm aware of, and am using, the PartModule to add a new data item to a part.  I'd like to do the same for the entire craft, but so far, I can't find any way to do this.

From what I can tell by looking at the various craft files, there are 5 fields at the beginning of every craft file:

ship = *test1*
version = 1.1.2
description = Craft Description
type = VAB
size = 1.337897,8.338528,1.337897
PART
{
.
.
.

Is this possible at all without adding another part?

If I would need to add a part, how can I have a hidden part added?

Thanks in advance

LGG

Edited by linuxgurugamer
Link to comment
Share on other sites

No, not without hooking in the GameSave/Load events and parsing the entire save file.

However, as of KSP 1.1, the VesselModule class does save data and it is created on a 1 per vessel basis, that might work?

D.

Link to comment
Share on other sites

1 hour ago, Diazo said:

No, not without hooking in the GameSave/Load events and parsing the entire save file.

However, as of KSP 1.1, the VesselModule class does save data and it is created on a 1 per vessel basis, that might work?

D.

Sounds like it might do it, how can i access it in the Editor?  Can you link to an example?

But I need to save data in the .craft file as well, will VesselModule do that?

Edited by linuxgurugamer
Link to comment
Share on other sites

No, VesselModule is automatically instantiated on the vessel object in flight, I do not believe it exists in the editor.

You could check the ShipContruct to see if something comes over, but the last time I worked with VesselModule was before KSP 1.1 and at the time they couldn't save data.

It's in the KSP 1.1 patch notes specifically that VesselModules can now save data so that functionality has been added, but the specifics would require testing.

D.

Link to comment
Share on other sites

13 hours ago, Diazo said:

It's in the KSP 1.1 patch notes specifically that VesselModules can now save data so that functionality has been added, but the specifics would require testing.

This is crazy.  I just spent 30 minutes looking for those patch notes.  I'm sure I'm missing something really stupid, can you post a link to that?

Thanks

Link to comment
Share on other sites

Weird, it looks like the post with the 1.1 patch notes got nuked (or maybe just hidden) when they removed the KSP 1.1 specific subforums after the experimentals was over.

Here is my original post where I noticed it, the pasted line I'm quoting was a copy-paste from those patch notes.

But as I said, I haven't actually used this functionality so I don't know any further details.

D.

Link to comment
Share on other sites

5 hours ago, Diazo said:

Weird, it looks like the post with the 1.1 patch notes got nuked (or maybe just hidden) when they removed the KSP 1.1 specific subforums after the experimentals was over.

I feel better, was beginning to think I was going crazy (or senile)

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