Jump to content

SOLUTION: Lander Legs Defaulting to UP when loading older saves < .22


Recommended Posts

UPDATE 01/24/2014 - SOLVED! Solution is a few posts down.

----------------------

Kerbin KSC has dispatched a critical signal to all spacecraft in the solar system, warning of a virus taking control of lander leg modules and spontaneously raising them to cause pain and devastation. Be on the lookout.

Ok but seriously, I finally got around to loading my sandbox after playing career mode non-stop since .22. I have approximately 30 landers sitting on nearly every celestial body in the solar system, since version .18. So, feeling a little nostalgic, I decided to visit some of them....

Well it appears every single one of them loads with the landing gear UP. I have landers tipping over left and right, Kerbal sacrifice, dogs and cats living together, mass hysteria.

Thanks for that SQUAD. I have a boot and I'm about to place it somewhere.

Edited by iBeej
SOLVED
Link to comment
Share on other sites

The fix is to go into the persistance (Or quicksave) files and change the state of all the landing legs to deployed.

Any idea what the variable name is? Otherwise I'm going to use a DIFF tool to find it. I have a hundred flights in progress so it's a rather large persistent file.

Link to comment
Share on other sites

As far as I know this is problem with 0.22 ships only, ships you landed in 0.23 should be fine. Or aren't they?

No. I haven't had issues with them in career mode. Like I said, I have been playing career mode since 0.22 day 1, so i'm assuming this problem occurs for any craft already landed when patching to .22 or .23. I have a ton of stuff sitting on landing legs, everywhere. And they aren't small either. Each lander is approximately 120 parts. The persistent file is around 15Mb.

If anybody knows off the top of their head what the module name, variable and value type is... please feel free to post. Otherwise, I will DIFF the file against a backup, since I manually fixed one of my Ike and Laythe landers.

Link to comment
Share on other sites

For any of you experiencing this problem, I took the liberty of digging in to this to find out where and what went wrong. Anybody with a lander with landing legs prior to version .22 will suddenly discover their lander legs in the up position. This particular problem isn't exactly pretty.

So here is what is going on. In the 'persistent.sfs' file, you will first need to locate one of your landers by locating something like


VESSEL
{
pid = 560473b08166426382fe29f6b625dfad
name = KOSMOS Lander 1 @ Ike
type = Lander
sit = LANDED

Then you will need to go to EACH Landing Leg Part which looks like


PART
{
name = landingLeg1-2
uid = 2341964657
mid = 3764243702

But here is where things get ugly. SQUAD added an entire new section which was never there before. The section is added when you load the lander for the first time, and it immediately creates this entire MODULE section under PART:


MODULE
{
name = ModuleLandingLeg
isEnabled = True
StartDeployed = False
savedAnimationTime = 1
savedAnimationSpeed = 0.3260869
[U][B]savedLegState = 0[/B][/U]
savedLocalPosition = (2.176186E-05, -1.754067E-05, 0.5388514)
suspensionLocked = False
StartDeployed_UIFlight
{
controlEnabled = True
}
EVENTS
{
LowerLeg
{
[B][U]active = True[/U][/B]
guiActive = True
guiIcon = Lower Legs
guiName = Lower Legs
category = Lower Legs
guiActiveUnfocused = True
unfocusedRange = 4
externalToEVAOnly = True
}
RaiseLeg
{
[B][U]active = False[/U][/B]
guiActive = True
guiIcon = Raise Legs
guiName = Raise Legs
category = Raise Legs
guiActiveUnfocused = True
unfocusedRange = 4
externalToEVAOnly = True
}
RepairLeg
{
active = False
guiActive = False
guiIcon = Repair Leg
guiName = Repair Leg
category = Repair Leg
guiActiveUnfocused = True
unfocusedRange = 4
externalToEVAOnly = True
}
LockSuspension
{
active = True
guiActive = True
guiActiveEditor = True
guiIcon = Lock Suspension
guiName = Lock Suspension
category = Lock Suspension
guiActiveUnfocused = True
unfocusedRange = 4
externalToEVAOnly = True
}
UnLockSuspension
{
active = False
guiActive = True
guiActiveEditor = True
guiIcon = UnLock Suspension
guiName = UnLock Suspension
category = UnLock Suspension
guiActiveUnfocused = True
unfocusedRange = 4
externalToEVAOnly = True
}
}
ACTIONS
{
OnAction
{
actionGroup = Gear
}
ToggleSuspensionLockAction
{
actionGroup = None
}
RaiseAction
{
actionGroup = None
}
LowerAction
{
actionGroup = None
}
}
}

The line that I bolded and underlined "savedLegState" is the problem. Because once SQUAD creates this new MODULE entry, they default savedLegState to 0. (Which is Lander Legs in the up position) If you wanted the Lander Legs to be in the down position you would change it to:


savedLegState = 3

The other issue you may have noticed, was where I also bolded and underlined under the "LowerLeg" and "RaiseLeg" section under EVENTS. Depending on the current position of the lander legs these two variables flip back and forth between True and False. So there are a whole mess of things going on. And this is going on for EVERY single Lander Leg Part.

And remember, the MODULE section doesn't exist on the older persistent save file. So there isn't a simple flip of the switch or variable change that fixes this problem. The only thing I can think of doing is attempting to manually add the MODULE section to all the Landing Leg parts with just the savedLegState variable and see what happens. Not only would that be a LOT of manual work, i'm not even sure if it will work or corrupt the save file.

Maybe I should just suck it up and deal with it. I haven't decided yet. :huh:

Link to comment
Share on other sites

QUICK UPDATE - SOLUTION!

Okay so I found a solution. It will take some work, but it's doable. I have tested it on one of my landers and it loaded up with the legs down and all was well!

DO NOT DO ANY OF THIS UNTIL YOU MAKE A BACKUP OF YOUR PERSISTENT.SFS FILE!

See my previous post about finding the PART section. Under the PART section, add this above the ACTIONS section:


MODULE
{
name = ModuleLandingLeg
isEnabled = True
savedLegState = 3
}

Repeat this process for EVERY LandingLeg part in the persistent.sfs file. Here is a snippet of how it should look and I marked the entry in BOLD and Underlined it:


VESSEL
{
pid = 560473b08166426382fe29f6b625dfad
name = KOSMOS Lander 1 @ Ike
type = Lander
sit = LANDED
landed = True
landedAt =
splashed = False
met = 16751797.019391
lct = 365263743.929064
root = 0
lat = -38.2483616954948
lon = 234.447055886582
alt = 5033.39937250005
hgt = 1.834257
nrm = 0.00472896,-0.9999849,0.00278542
rot = -0.1560384,0.657515,0.4448432,-0.5877419
CoM = -0.003074482,-3.733253,0.0003579338
stg = 3
prst = False
ref = 1807943788
cPch =
cHdg =
cMod = 0
ORBIT
{
SMA = 0
ECC = 1
INC = NaN
LPE = 107.153246713876
LAN = 3.64366355764491
MNA = -8.40714670366796
EPH = 382176818.70738
REF = 7
OBJ = 1
}
PART
{
name = landingLeg1-2
uid = 2341964657
mid = 3764243702
parent = 34
position = -1.99799919128418,-0.644870758056641,1.31492114067078
rotation = -0.4999988,-1.060647E-06,0.8660263,-5.479314E-07
mirror = 1,1,1
istg = 2
dstg = 2
sqor = -1
sidx = -1
attm = 1
sym = 38
sym = 41
sym = 44
srfN = srfAttach, 34
mass = 0.1
temp = -83.87865
expt = 0.5
state = 0
connected = True
attached = True
flag = Squad/Flags/default
rTrf = landingLeg1-2
lgSt = 2, INT
nTime = 0, FLOAT
aSpeed = 0, FLOAT
EVENTS
{
ToggleAction
{
actionGroup = None
}
RaiseAction
{
actionGroup = None
}
LowerAction
{
actionGroup = None
}
}
[B][U]MODULE[/U]
[U]{[/U]
[U]name = ModuleLandingLeg[/U]
[U]isEnabled = True[/U]
[U]savedLegState = 3[/U]
[U]}[/U][/B]
ACTIONS
{
ToggleAction
{
actionGroup = None
}
RaiseAction
{
actionGroup = None
}
LowerAction
{
actionGroup = None
}
}
}

When I did this for all 4 LandingLeg parts for my Lander on Ike, it loaded up properly with all the legs in the down position! Now I just need to spend some time doing this for 30 landers with 4 legs each. So that's only 120 manual entries I have to make. :confused:

Edited by iBeej
Link to comment
Share on other sites

SNIP

When I did this for all 4 LandingLeg parts for my Lander on Ike, it loaded up properly with all the legs in the down position! Now I just need to spend some time doing this for 30 landers with 4 legs each. So that's only 120 manual entries I have to make. :confused:

The good news is you can use the search funcion (ctrl+f) to find only that part.

Link to comment
Share on other sites

Use notepad++ And you can find and replace every savedlegstate line with a click.

I think you missed the part where I said, "savedLegstate" doesn't exist yet. It's not written to the file until you load the craft. And by that time, the damage is done.

Any craft CREATED since .22 has it all coded from the beginning. But since all my landers were prior to .22 the new MODULE code simply does not exist. It has to be manually inserted like I described above, and there is no way I can think of to make a "search & replace" work at all without writing a proper parser script.

Edited by iBeej
quoting
Link to comment
Share on other sites

The good news is you can use the search funcion (ctrl+f) to find only that part.

Precisely. The ONE thing going for me is, I can search for every instance of "landingLeg1-2" and begin inserting that small MODULE block with the savedLegState variable.

I'm just about done with it. I will be glad when all of this is over. lol

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