Jump to content

ProtoVessel.Parts list empty while recovering


Recommended Posts

I am dealing with onVesselRecoveryProcessing(ProtoVessel pv, MissionRecoveryDialog dialog, float recoveryFraction) event method.

What I need is a List<> of Parts that the recovered vessel contains. Problem is the pv object which is of type ProtoVessel for some reason doesn't contain any Parts: all possible lists are empty. ProtoVessel.vesselRef didn't help either. In the method which is called before this one - OnVesselRecoveryRequested(Vessel v) - Vessel type object AND ProtoVessel type objects cointain Parts normally. However, when recovering from SpaceCenter or TrackingStation that method is not called.

What I managed to do was find the ConfigNode of the VESSEL from FLIGHTSTATE node which contains all the parts. Problem with that is that it contains very different values and converting manually (with a wrapper function) seems rather unreasonable.

So, my question is, is there are a way to sanely (not manually) convert a PART from FLIGHTSTATE to "normal" PART? I have added a comparison below.

OR alternatively is there a way to force the ProtoVessel object or it's related Vessel object to repopulate their Part Lists<> in the onVesselRecoveryProcessing() method?

Any help will be very appreciated!

[table=width: 100%]

[tr]

[td]PART saved by editor[/td]

[td]Same PART from FLIGHTSTATE after flight scene was loaded[/td]

[/tr]

[tr]

[td]

PART
{
part = mk1pod_4294814930
partName = Part
pos = 0,15,0
attPos = 0,0,0
attPos0 = 0,15,0
rot = 0,0,0,1
attRot = 0,0,0,1
attRot0 = 0,0,0,1
mir = 1,1,1
symMethod = Radial
istg = 0
dstg = 0
sidx = -1
sqor = -1
sepI = 0
attm = 0
modCost = 0
modMass = 0
modSize = (0.0, 0.0, 0.0)

[/td]

[td]

			PART
{
name = mk1pod
cid = 4294814930
uid = 3259493640
mid = 859288275
launchID = 50
parent = 0
position = 0,0,0
rotation = 0,0,0,1
mirror = 1,1,1
symMethod = Radial
istg = 0
dstg = 0
sqor = -1
sepI = 0
sidx = -1
attm = 0
srfN = None, -1
attN = None, -1
attN = None, -1
mass = 0.8
temp = 287.799555698255
expt = 0.5
state = 0
connected = True
attached = True
flag = Squad/Flags/default
rTrf = mk1pod
modCost = 0
crew = Jebediah Kerman

[/td]

[/tr]

[/table]

Edited by Tsynique
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...