Jump to content

Recommended Posts

Hello,

I am woking on a "multiplayer" mod now, and I have run into the following problem:
I need to spawn a craft (on the launchpad or runway, maybe in the atmosphere/orbit).

I can think of 2 ways to achive this:
1. Spawn it from a .craft file (file shareing not a problem)
2. Some way to serialize a a craft with its settings and all, and transport that data, then reconstruct

I know that I can load a craft with a ProtoVessel, bat can it be serialized? Also I would like to know how to do the 1. option (for later reference)

Help is well received!

Link to comment
Share on other sites

2 hours ago, Erv00 said:

Hello,

I am woking on a "multiplayer" mod now, and I have run into the following problem:
I need to spawn a craft (on the launchpad or runway, maybe in the atmosphere/orbit).

I can think of 2 ways to achive this:
1. Spawn it from a .craft file (file shareing not a problem)
2. Some way to serialize a a craft with its settings and all, and transport that data, then reconstruct

I know that I can load a craft with a ProtoVessel, bat can it be serialized? Also I would like to know how to do the 1. option (for later reference)

Help is well received!

You can serialize the protovessel to a config node, then the config node to a string. You can check the code on LMP. 

 

https://github.com/LunaMultiplayer/LunaMultiplayer/blob/f2192f0cbbfa74df6a698dffa3ec29c73d76e681/Client/VesselUtilities/VesselSerializer.cs

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