Closed BruceTheLoon closed 5 years ago
Thanks a lot. Since my own most recent game is at 1.3.1 still, I don't get those changes. I will have a look at your data. Having support for old and new files as well sounds good, as that was always supported.
I could not reproduce with a new 1.7.3 save just launched some standard stuff to orbit. When does this third parameter occur? You only have it for "nfs-panel-deploying-concentrator-1x4-juno-1" parts, wtf is this? Is this DLC or a mod? Is this one of those welding many parts to one things?
The part is from the Near Future Solar mod, but it does appear on standard mods as well. It could be one of the mods I've got installed, no welding mods though. I've got both DLCs installed. Let me strip out my third party mods and see if it appears again.
This is implemented in https://github.com/my-th-os/KML/commit/6a6859f6379205195cfbdfe639705dca1ac88585 and released in v0.8.2
I would still appreciate some more information if this maybe needed in other cases as well.
E.g. does this apply to attN instead of srfN?
What actually is the third parameter, does the name need to match some other attribute found somewhere in the persistence file?
I don't think we'll get more info on this any time soon.
Since 1.7.3, I've noticed a third parameter appearing in the sfrn parameter list in some modules. I believe it is some sort of collision model function.
Example: srfAttach, 80,COLLIDERADAPT
This is causing KML to not read the surface attachment node properly and causes incorrect parent node adjustments on node insert and delete. Attached is a zip file containing a modified KmlPart.cs that resolves the problem for me and a sample persistent.sfs file with a problematic ship in orbit around Kerbin.
submission.zip
The changes implemented include the following.
a string variable AttachedToSurfaceCollider
changes to the srfn processor code in the Add function to check for a third element in items[] and then processing the index value and copying the collider value to the AttachedToSurfaceCollider variable
Changes to the srfn processor code in the ReIndexStructureForPartDeletion function to detect the third parameter and preserve it.
Changes to the srfn processor code in the ReIndexStructureForPartInsertion function to detect the third parameter and preserve it.
These changes appear to work properly for my issues with the third parameter and for .sfs files that don't have the third parameter.