MechJeb2

MechJeb2

4M Downloads

New Window Persistence Issues

johnwittle opened this issue ยท 2 comments

commented

so when I check the "maneuver planner" checkbox on the mechjeb settings window, so that the "maneuver planner" window shows up, I expect that window to remain open in Flight mode until I close it. Instead, it remains open only until the next time I exit Flight mode, and then must be reopened the next time I enter Flight mode, no matter what craft or vessel is the active vessel

it seems almost as though mechjeb2 simply refuses to ever write to the files in /path/to/Kerbal Space Program/GameData/MechJeb2/Plugins/PluginData/MechJeb2, as if they are regenerated from some cache each time they get loaded so that changes never persist

here is a (embedded) video of the behavior i'm referring to: https://www.dropbox.com/s/49mreubh6dn277s/KSP_x64_Pm5oTAfL5C.mp4?dl=0

I would expect the following behavior: I launch an Orbiter II. When launching Orbiter II, mechjeb2 loads the configuration file /path/to/KerbalSpaceProgram/GameData/MechJeb2/Plugins/PluginData/MechJeb2/mechjeb_settings_type_Orbiter\ II.cfg, and loads the MechJeb2 windows described in the config file, in the locations specified. First, I close the default Mechjeb2 "Vessel Info" window. Then I open some new Mechjeb2 windows, including the "maneuver planner", the "maneuver node editor", and the "smart ass" windows. Then I click the "Recover Vessel" button at the top, ending the Flight mode session and returning to Editor mode; at this point Mechjeb2 overwrites the old mechjeb_settings_type_Orbiter\ II.cfg file with the new data, including that the new windows should be open, they should be in xyz position, and the "Vessel info" window should be closed. Then I launch Orbiter II again, and see that my previous UI changes have persisted.

Instead, when I "Recover Vessel", the mechjeb_settings_type_Orbiter\ II.cfg file is unchanged, I see no mention of mechjeb trying to update it in the logfiles, and when I launch the vessel again, it still has the old UI configuration from before i changed it.

At first I thought that maybe the permissions for the folder were wrong, so that ksp.exe couldn't write to it. But that's not the case, because at some point (before making my own custom Info window) I opened the "Vessel info" window and it correctly made it persistent. Also, I set up that custom "Info" window at some point, and it clearly has the settings for that stored in the global_settings file. So at some point it must have been willing to change these files.

I looked through my Player.log file and can't really find anything that looks relevant, I read every line between loading the editor mode in the VAB, launching the Orbiter II, recovering it, and quitting the game, and the only mechjeb2-relevant lines are stuff about loading shader models

here is my modlist:

BetterBurnTime (BetterBurnTime 1.10)
ClickThrough Blocker (ClickThroughBlocker 1:0.1.10.17)
Community Resource Pack (CommunityResourcePack v112.0.1)
Community Tech Tree (CommunityTechTree 1:3.4.4)
Filter Extensions - Plugin (FilterExtensions 3.2.7)
Hide Empty Tech Tree Nodes (HideEmptyTechNodes 1.3.2)
Interstellar Redistributable  (InterstellarRedistributable 1.4)
Kerbal Joint Reinforcement Continued (KerbalJointReinforcementContinued v3.6.1)
KSP Recall (KSP-Recall v0.3.0.1)
KW Rocketry Rebalanced (KWRocketryRebalanced 3.2.7.2)
MechJeb 2 (MechJeb2 2.14.1.0)
Module Manager (ModuleManager 4.2.2)
Part Commander Continued (PartCommanderCont 1.1.6.3)
Patch Manager (PatchManager 0.0.17.4)
Photon Sailor (PhotonSailor 1.7.3)
Procedural Fairings (ProceduralFairings 1:v6.2)
Procedural Parts (ProceduralParts v2.3.0)
RemoteTech (RemoteTech v1.9.12)
Science - Full Reward! (Continued) (Science-Full-Reward v5.2)
ScienceAlert ReAlerted (ScienceAlert 1.9.10)
Simple Adjustable Fairings - KW Rocketry Pack (SimpleAdjustableFairings-KWRocketry v1.4.0)
Simple Adjustable Fairings - Plugin (SimpleAdjustableFairings v1.12.0)
SpaceTux Library (SpaceTuxLibrary 0.0.8.4)
The Janitor's Closet (JanitorsCloset 0.3.7.8)
Toolbar Controller (ToolbarController 1:0.1.9.6)
TweakScale - Rescale Everything! (TweakScale v2.4.6.15b)
TweakScale Redistributable (TweakScale-Redist v2.4.6.15b)
Universal Storage II Finalized (UniversalStorage2 4.0.0.7)
Zero MiniAVC (ZeroMiniAVC 1:1.1.2.4)

I haven't confirmed that this happens if mechjeb2 is the only installed mod but i'm willing to try if it seems relevant

Copied from my discord messages:

Hey, anyone in here know about how mechjeb's settings files work?

In particular, I am trying to figure out how to make the 'maneuver planner' window show up in flight mode, without having to manually open it every time i put a new rocket on the launch pad
i've noticed that there's a mechjeb_settings_global.cfg in the plugin folder that seems to tell mechjeb which windows should be open by default, and their positions on the screen
but as soon as i actually make a new vessel, it creates a mechjeb_settings_type_VesselName.cfg file which dictates the UI for that specific vessel, and this new settings file doesn't seem to be copied from the global settings file (or maybe it does and I'm confused?)
i can't quite figure out exactly how these files work, when they get updated and what template they get copied from, etc

like, for instance

if i make a vessel, press the 'launch' button, then while i'm on the launch pad I open the maneuver planner, smart ass, the orbit info window, and the maneuver editor window
and then i click the little green button to collect this vessel
i would expect it to save that window configuration in the mechjeb_settings config file for that vessel
but it doesn't update it. the next time i fly that vessel, the windows will start out closed and i'll have to open them again
and yet it must update it at some point, because at some point the 'vessel info' window opened and now it's open by default for all of my craft, i'm just not sure how i accomplished it
i also notice that all of my custom info windows seem to be defined in the mechjeb_settings file... does that mean if i delete these files, i will lose my custom windows? they don't get stored anywhere else?

Okay so. I made a quick video showing the question I am having about mechjeb. (I can't get windows to stay persistent between launches)

https://www.dropbox.com/s/49mreubh6dn277s/KSP_x64_Pm5oTAfL5C.mp4?dl=0

First I set up the windows the way I want them, then I 'recover vessel', then when I launch the vessel again my windows have been reset to a default state and I have to make all the changes all over again, every single time I launch a new craft

this has something to do with mechjeb_settings_global.cfg and the other vessel-specific files, I can't figure out when they get rewritten or how to force it to happen, it seems like i've gotten trapped into having bad settings and they just won't ever update and I don't know why

please, please, somebody tell me how this system works

no responses even though channel was active :(

commented

I found it was the AntennaHelper and Kronometer mods that were causing the MechJeb menu to lock to the upper left AND the causing the settings and rover autopilot windows to be disabled. They also caused problems with window persistence

commented

I don't think I have either of those mods installed, nor have I ever

Nor do I understand why pointing out some possible conflicts cause this issue to be closed? We still have no idea why it happens