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

Input is null for field 'agent' in config node 'CONTRACT' #672

Closed No3371 closed 5 years ago

No3371 commented 5 years ago

I know similiar issues had been issued, but in my case it's causing massive stutter when a saving occured. (Or maybe other mods, but this is the only error log when saving.)

[ERR 04:17:29.642] Input is null for field 'agent' in config node 'CONTRACT'
   at System.Environment.get_StackTrace()
   at ConfigNode.AddValue(System.String name, System.String value)
   at Contracts.Contract.Save(.ConfigNode node)
   at ContractConfigurator.ContractPreLoader.OnSave(.ConfigNode node)
   at ScenarioModule.Save(.ConfigNode node)
   at ProtoScenarioModule..ctor(.ScenarioModule module)
   at ScenarioRunner.UpdateModules()
   at ScenarioRunner.GetUpdatedProtoModules()
   at Game.Updated(GameScenes startSceneOverride)
   at GamePersistence.SaveGame(System.String saveFileName, System.String saveFolder, SaveMode saveMode, GameScenes startScene)
   at GamePersistence.SaveGame(System.String saveFileName, System.String saveFolder, SaveMode saveMode)
   at FlightAutoSave+<PersistentSave>c__Iterator0.MoveNext()
   at UnityEngine.SetupCoroutine.InvokeMoveNext(IEnumerator enumerator, IntPtr returnValueAddress)
No3371 commented 5 years ago

I checked save files and confirm that some missions' agent field will become empty even if I modified the value to a same string as the agent name below.

jrossignol commented 5 years ago

Took a look, not enough information to investigate. The agent field is saved by stock code and the only place I set it is on initial contract generation. So if it gets set to null after you've manually set it in the save file, then it shouldn't be Contract Configurator doing it. To say anything more I'd need to see the ksp.log file.

No3371 commented 5 years ago

OK. I reinstalled FieldResearch, Tourism Plus And Kerbal Academy pack and load the game. Here is the log. (p.s. FYI, I uninstalled these packs then there's no more 'CONTRACT' log, only 'CONTRACT_FINISHED') KSP.log

No3371 commented 5 years ago

I tried to help :D, but a serach with regex "Contract.*$" did not give me any note worthy error log.

denyasis commented 5 years ago

I can confirm this error. A check of my save file also shows that some agent fields are blank. I checked the contracts themselves and verified they do have agent names. The only contract type that is affected in my save is the "ConfiguredContract" type, although I should note that not all contracts of that type are missing the agent string, but of the ones missing that string, they all share the same type. KSP.log

I also checked the contract configurator logs folder and found no errors. Interestingly, I also checked the log out put for a contract that is missing the agent string in my save and found that the contract configurator log does have a valid string for the agent field. I'm not sure where / when the program is loosing the string.

Thank you for your time

denyasis commented 5 years ago

Did a little more digging with a new save and the console on. The errors throws for me at a specific time - When leaving the Mission Control scene.

Hope that helps and Thank you for your time.

jrossignol commented 5 years ago

I haven't been able to reproduce this one - can someone provide a save file? That may help me narrow down a bit more still.

denyasis commented 5 years ago

Gladly. It will be a few days. I don't have access to my computer during my work week, my apologies.

D

On December 31, 2018 12:31:41 PM EST, nightingale notifications@github.com wrote:

I haven't been able to reproduce this one - can someone provide a save file? That may help me narrow down a bit more still.

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/jrossignol/ContractConfigurator/issues/672#issuecomment-450672248

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

denyasis commented 5 years ago

My apologies for the delay. I've attached a save file. I did a quick search and the contracts in the save with the blank agent line are from contract packs: ScanSat, Field Research, and Historical Progression. I verified in these packs, there is indeed an agent field for these missions and it is not blank.

I played a bit just now and it doesn't seem to affect the missions or the gameplay, just spams the log.

persistent.sfs.txt

jrossignol commented 5 years ago

Okay, figured it out. It's because the agencies don't have a title defined, which is a field that was added in 1.2 for localization (the name is always fixed, but the title gets translated). The stock code handles the "legacy" agencies just fine, with the exception of the input is null message.

So I don't think that it's causing the slowdown, and the ideal fix is to fix all the contract packs with missing agent titles (unlikely to happen). I'll see if I can code in an easy workaround into Contract Configurator.

jrossignol commented 5 years ago

Got it sorted for next release.

bpwatts commented 5 years ago

So I'm still getting this error message even after downloading the current master and copying the ContractConfigurator directory over my existing one. What am I goofing on? Recently uninstalled FAR and ScienceAlert trying to resolve as well (had seem prior error messages associated with it)

This happens on a brand new sandbox game as wel.

@No3371 did reinstalling Field Research, Tourism Plus and Kerbal Academy help? KSP.log

bpwatts commented 5 years ago

@jrossignol any ideas on what may be causing this error still? i saw you pushed this fix out already

phoenix2004uk commented 5 years ago

Hi, i've been getting this same exception spam in my 1.7.2 career save, and as stated by nightingale it is caused by AGENT definitions that are missing the title attribute. I fixed the problem in my own save following this procedure that I posted in the forums in response to this exception spam: https://forum.kerbalspaceprogram.com/index.php?/topic/179261-ksp-151-contracts-issue-stock-issue/#comment-3620017