Jump to content

Edit action groups in persistent file?


Recommended Posts

It seems the 1.6 update to Kopernicus somehow removed solar arrays from my action groups.  It was quite thorough about it, too:  if I focused on an existing ship with deployable solar arrays in an action group, it closed them and deleted the arrays from the action group; if I opened a ship file in the VAB, it stripped out any solar arrays from action groups.  The only thing I was using Kopernicus for was to give Jool a set of rings, so the obvious first step was to delete Kopernicus.  Which seems to have prevented the problem from getting WORSE, at least--ship files that I did NOT open (and re-save) in the VAB still have their action groups intact, and ships that I did NOT focus on with Kopernicus installed still have their solar arrays in their action groups.  So, yay for that.

But--the existing ships in flight which got corrupted appear to have had their solar arrays permanently removed from their action groups (okay, that's not surprising--the persistent file got rewritten with the ships in their new state, after all).  And I'd like to fix that.  My playstyle involves building a permanent infrastructure with reusable landers, space stations, ground bases, deep-space tugs, etc.  So some of the corrupted vessels are assets I'd intended to keep around "forever"--and I really don't want to have to manually retract/deploy each and every array one at a time when I'm docking/aerobraking/etc.

So, I expect I'll have to go in and manually re-jigger the action groups for the affected ships in the persistent file.  But I have no idea what to look for or how to fix it.

Anybody have any advice/pointers?

======

Edited to add:  I may have spoken too soon and been overoptimistic in my summary above.  It appears that the corruption occurred specifically for all instances of the shielded 1x6 arrays (but not the unshielded arrays, or the 2x3 arrays or Gigantors), and affected all such ships in flight whether I had focused on them or not.  I also "fixed" and saved several ship designs in the VAB when I first noticed the problem, before I sorted out the Kopernicus connection--and now with Kopernicus uninstalled the "fixed" ships have corrupted solar arrays.  (Apparently Kopernicus replaces some existing solar array code modules with its own, and this update did not do so as elegantly as one might have wished?)

None of which changes the core of my question--but I don't want my mischaracterization of the issue to mislead others who may have this or similar problems.

Edited by Srpadget
Link to comment
Share on other sites

29 minutes ago, Geonovast said:

This will let you edit action groups in flight, as well as expand you to 250 NAMED groups.  I can't live without this mod.

Hmm...  I wonder if there's ANY chance I could install that, ONLY edit the existing action groups and leave them numbered-not-named, if I could then uninstall after doing so?  Despite this problem being caused by a rather frivolous use of a mod, I do try to keep my "necessary" mods to a bare minimum (KAC and KAS are really the entirety of my "can't live without 'em" mods); the rest of my mods are aesthetic-only.  Rationale being that if there's a glitch in a 'cosmetic' mod, I just delete it and continue on my merry way; if there's a glitch in a part/functionality mod, I'm hosed at least until it gets fixed.

(This issue, of course, is a rather flagrant exception to that rationale...!)

Edited by Srpadget
Derned editor decided to post before I was ready....
Link to comment
Share on other sites

1 minute ago, Srpadget said:

Hmm...  I wonder if there's ANY chance I could install that, ONLY edit the existing action groups and leave them numbered-not-named, if I could then uninstall after doing so?  Despite this problem being caused by a rather frivolous use of a mod, I do try to keep my "necessary" mods to a bare minimum (KAC and KAS are really the entirety of my "can't live without 'em" mods); the rest of my mods are aesthetic

That... I'm not sure.  You could just copy your persistent.sfs file, save it as a backup, then give it a try. 

Otherwise, AFAIK, you can sort through the sfs file and manually add each action group.  I believe it's just a parameter in each part, but it sounds like you would have a ton of sifting through to do.

Link to comment
Share on other sites

3 hours ago, Srpadget said:

I wonder if there's ANY chance I could install that, ONLY edit the existing action groups and leave them numbered-not-named, if I could then uninstall after doing so? 

pinging @linuxgurugamer for clarification, but I would make a backup as mentioned first, then try.  AGX should leave all the stock groups alone, aside from the editing.  If you added a custom one outside of the stock 11 groups, I believe there is no way to access it without AGX. 

Link to comment
Share on other sites

15 hours ago, Srpadget said:

So, I expect I'll have to go in and manually re-jigger the action groups for the affected ships in the persistent file.  But I have no idea what to look for or how to fix it.

Anybody have any advice/pointers?

I don't know where you're coming from, what background your having and so on and so forth... so the best advice I can give is: whip out the text editor of your choice and have a good look at the file.

You have to figure out the format, at least to some degree, in oder to make your changes (which are relatively easy to do). If you are in any way familiar with manually editing config files, or reading XML without a browser or the likes, it will be a piece of cake. If you're not, this may be a chance to learn. (make a backup!)

If it gives you a headache, well, there have been plenty of alternive suggestions in this thread.

Link to comment
Share on other sites

Following up:  I went with the AGM option as the smallest/simplest one that would meet my needs.  So I reinstalled Kopernicus (because why not?), installed AGM and its dependencies.  Then I did a quick test case with the sandbox save I use to test stuff out on, fixed one craft in orbit, saved, quit, removed AGM & dependencies, restarted, and the AG that I modified worked just fine even after AGM was removed.

HUZZAH! I don't have to bother with persistent.sfs forensic followed by one-part-at-a-time manual editing of dozens of solar arrays!  My space program is SAVED!  (Okay, perhaps that last is a wee bit of exaggeration...)

Dunno yet if I'll be keeping AGM around after everything is cleaned up.  But I'll certainly make note of the fact that it's a spiffy utility if/when this happens again!

Link to comment
Share on other sites

I know you like to keep it stock, but I think you'll be happy if you keep AGX around.  You can even click on the AGX button in the editor, and it'll go back to the stock GUI with only 10 action groups.  So it doesn't really add something new... just expands on a stock aspect.

Being able to name them and edit them in flight really should be part of stock.  At the very least naming them.  You shouldn't have to keep a notebook full of what button does what for each vessel.  Having a named display in flight where I can click on the action groups has become insanely necessary for me to play the game.  I'll even frequently use them to control all staging of a vessel, completely ignoring the spacebar.

Link to comment
Share on other sites

17 hours ago, Gargamel said:

pinging @linuxgurugamer for clarification, but I would make a backup as mentioned first, then try.  AGX should leave all the stock groups alone, aside from the editing.  If you added a custom one outside of the stock 11 groups, I believe there is no way to access it without AGX. 

For this, use the Action Groups Manager

 

Link to comment
Share on other sites

  • 1 month later...

I know this is an older post, but I found it, and found some useful information in it, so I wanted to add what I was able to do to fix the issue - though it is fixed with a bit of a club, not a scalpel.

-- Summary:
-- Regex find.
(trackingBodyName = The Sun([^\r\n]*\R+){17})(^.+?actionGroup = )(None.*\r\n)
--- regex replace.
\1\3Custom10\r\n

In essence, yes, Kopernicus is the problem. One element of the MOD is upgraded solar Panels. Any Panel that can track the sun - and that's all extendable panels - are updated. But my those rings of Jool are nice arn't they? Well worth this pain, right?
Anyway, during the update it strips out the action group items. From day 1 I had configured all extendable solar panels, along with Antenna and anything else that was essential for Craft startup, or could burn off during re-entry, to use the Zero key, or as KSP knows it "Custom10".

Kopernicus edits the persistent.sfs, and adds the XML tag "trackingBodyName = The Sun" to each every extendable panel in the file. 17 lines down from this tag are the action group elements.  Changing the ExtendPanelsAction element,  actionGroup tag, from "None"  to "Custom10" will allow said solar array to toggle with the Zero key. It does not affect any other already-assigned items, such as Antenna.

I had 642 trackingBodyName tags, and some were already configured to Custom10, as I launched ships before I realized what I was dealing with, and how extensive the problem was. So I only had 631 solar panels, across all my active ships, stations, probes & rovers, that needed to be updated. Obviously I wasn't doing THAT by hand. So, I developed the following regex expressions to do the find and replace fore me.

Steps to resolve.

1) Save the game and exit out.
2) Create a backup copy of your persistant.sfs file.
3) Open the persistent.sfs file in Notepad++ (It is free to download off the web if you don't already have it.)
4) Do a find. (CTRL-H) and hit the radio button for "Regular Expression" at the bottom of the find window.
5) Drop in this FIND regex string...
     (trackingBodyName = The Sun([^\r\n]*\R+){17})(^.+?actionGroup = )(None.*\r\n)
6) OPTIONAL do a count so you have an idea of how many solar panels you are about to update.
7) Click the "Replace tab"
8) Drop in the following REPLACE regex string....
      \1\3Custom10\r\n
9) Replace all.
10) Save the file,. Launch your game, and load your save. (NOTE: If you have had this issue for a while, and go back to an old quick save, or other save, you will loose all the changes. You can do the same edit to all of the save files.)

This resolved my issue - at least, for the way I use the solar array action groups. (On one class of ship, one that has 8 child probes, and where I had each prob set to use an action group to prep it for flight; I.e. probes numbered 1 - 8 were on action groups 1-8. Now, all of the probes solar panels are tied to action group 0. This is the "Club" part of the fix I mentioned above.)

 

Hope this helps. and good luck.

InCrypt_

Edited by InCrypt_
Link to comment
Share on other sites

I recently ran into the same issue when syncing saves between computers. Switching between KopernicusSolarPanel and ModuleDeployableSolarPanel causes deployed panels to revert to their retracted state.

If you don't need to draw power from multiple stars, you can disable the Kopernicus module with this MM patch:

Spoiler

@PART:HAS[@MODULE[ModuleDeployableSolarPanel]]:BEFORE[Kopernicus]
{
	@MODULE[ModuleDeployableSolarPanel]
	{
		%useKopernicusSolarPanels = false
	}
}

 

 

To fix a save I just replaced all "KopernicusSolarPanel" with "ModuleDeployableSolarPanel" and changed "deployState = RETRACTED"  to "EXTENDED" where necessary,

 

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