jrossignol / ContractConfigurator

A config file based solution for creating new contracts for Kerbal Space Program.
https://forum.kerbalspaceprogram.com/index.php?/topic/91625-1
Other
64 stars 67 forks source link

Debug (alt-f10) screen won't load if you exit your game and load a new one #563

Open 5thHorseman opened 8 years ago

5thHorseman commented 8 years ago

Steps to reproduce: Load KSP. Load a save or create a new one. Alt-F10 works as normal Exit that save back to the main menu. Load a save or create a new one. You can even load the same save. Alt-F10 does nothing. The only way I've found to get alt-F10 back is to close KSP fully and restart.

jrossignol commented 8 years ago

Can you send a KSP.log?

On Aug 28, 2016 3:27 PM, "5thHorseman" notifications@github.com wrote:

Steps to reproduce: Load KSP. Load a save or create a new one. Alt-F10 works as normal Exit that save back to the main menu. Load a save or create a new one. You can even load the same save. Alt-F10 does nothing. The only way I've found to get alt-F10 back is to close KSP fully and restart.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jrossignol/ContractConfigurator/issues/563, or mute the thread https://github.com/notifications/unsubscribe-auth/AIUFdSLQL5x8FKwGZWDYePbkoJoqzy2pks5qkf1JgaJpZM4JvBdy .

5thHorseman commented 8 years ago

Here it is. It's not as easy to recreate as I'd originally thought. I literally never experienced a situation where it didn't happen so I thought it was universal. I'm not sure what I was so consistently doing to cause it to happen before, but among the things I did in this log were to leave the alt-f10 window open when I exited the game (which I'm sure I never did before) and have contracts with errors in them (which was consistent before. I only ever had this happen while working on a contract with bugs in it)

output.zip

jrossignol commented 8 years ago

Odd, nothing about the debug window in there. One thing that pops out is this one:

ContractConfigurator.ContractGroup: CONTRACT_GROUP 'AnomalySurveyor': Error parsing agent

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)

ArgumentException: 'Anomaly Surveyor Group' is not a valid agent.
  at ContractConfigurator.ConfigNodeUtil.ParseAgentValue (System.String name) [0x00000] in <filename unknown>:0 

  at ContractConfigurator.ConfigNodeUtil.ParseSingleValue[Agent] (System.String key, System.String stringValue, Boolean allowExpression) [0x00000] in <filename unknown>:0 

  at ContractConfigurator.ConfigNodeUtil.ParseValue[Agent] (.ConfigNode configNode, System.String key, Boolean allowExpression) [0x00000] in <filename unknown>:0 

  at ContractConfigurator.ConfigNodeUtil.ParseValue[Agent] (.ConfigNode configNode, System.String key, System.Action`1 setter, IContractConfiguratorFactory obj, Contracts.Agents.Agent defaultValue, System.Func`2 validation) [0x00000] in <filename unknown>:0 
UnityEngine.Debug:Internal_LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
ContractConfigurator.LoggingUtil:LogException(Exception)
ContractConfigurator.ConfigNodeUtil:ParseValue(ConfigNode, String, Action`1, IContractConfiguratorFactory, Agent, Func`2)
ContractConfigurator.ConfigNodeUtil:ParseValue(ConfigNode, String, Action`1, IContractConfiguratorFactory, Agent)
ContractConfigurator.ContractGroup:Load(ConfigNode)
ContractConfigurator.<LoadContractConfig>d__26:MoveNext()
ContractConfigurator.<ContractConfiguratorReload>d__21:MoveNext()

Which is happening because the Anomaly Surveyor agency got removed by Module Manager:

[ModuleManager] Changes :
Deleted : ContractPacks/AnomalySurveyor/Agencies/Agents.cfg

That plausibly could break the DebugWindow (which would be a bug if it does), but there's nothing in the log that directly points to that happening. Also, there's not enough info in the ModuleManager output to tell me why it would do that - but maybe you know what patch is affecting it? Actually, looking at the Module Manager code I think this might happen when the file is actually deleted and the log message is basically a config cache miss. So it could be that you accidentally deleted/moved the file while using it as an example?

If you're able to figure out that issue (or maybe just re-install/remove Anomaly Surveyor) and let me know if that fixes the debug window issue? At the very least it'll clean up the log file in case I'm missing the actual issue in there.

jrossignol commented 8 years ago

Lastly - I do see that it looks like you did a contract config reload in the debug menu - that might be where the issue is (I'll look at that next if the Anomaly Surveyor thing doesn't fix it).

5thHorseman commented 8 years ago

Bah. Don't post tired. I actually deleted the agents.cfg file manually, so there were errors in a contract pack. When there are no errors in a contract pack I was never able to get this bug (the alt-f10 window not showing up anymore) to occur. I thought maybe the one caused the other.

Then I totally forgot to mention that I did that :/

So the errors about missing agencs.cfg is fine and expected, I just think it's possibly related to why the alt-f10 window didn't come up.

5thHorseman commented 8 years ago

Lastly - I do see that it looks like you did a contract config reload in the debug menu - that might be where the issue is (I'll look at that next if the Anomaly Surveyor thing doesn't fix it).

Upon further testing that's what does it. Here's a log from a session where I loaded a fresh game, regenerated contracts via alt-f10, exited that game, loaded it back up, and Alt-F10 did not show up.

output_log_alt_f10.zip