magico13

[1.4.1] ScrapYard - The Common Part Inventory - 1.1.0.107 (2018-03-18)

Recommended Posts

What does this mean?

Quote

    Line 46012: [ScrapYard] Found part on vessel with same ID as inventory part, but not matching. Resetting. fuelTank.long:6fe1e75b-a7b5-44b1-b6db-afc7eda2b976

The reason I ask, is because on my main save, ScrapYard is not pulling through fuel tanks from the inventory. I can provide full log if needed, but I'm suspecting mod conflict (cannot reproduce on my nearly stock install) - so want to try and narrow it down a little bit before I make a full report.

The only thing that makes these tanks special is that they were recovered by StageRecovery - but as I said, can't reproduce on a stock install, even with StageRecovery.

Edit: ok so after looking at the code, it seems that ScrapYard has decided that the fuel tanks are not "strict" matches to the part (which is weird, as it's exactly the same part) - so the inventory match is not valid. So, what causes a strict match to fail? - I can't find the code for that bit.

Edited by severedsolo

Share this post


Link to post
Share on other sites
3 hours ago, severedsolo said:

The reason I ask, is because on my main save, ScrapYard is not pulling through fuel tanks from the inventory. I can provide full log if needed, but I'm suspecting mod conflict (cannot reproduce on my nearly stock install) - so want to try and narrow it down a little bit before I make a full report.

Like you found out, it happens whenever a strict comparison fails, to safe guard against something claiming to be from the inventory when they aren't actually. Can you send me the save file from right before rollout, the Auto Saved Ship file generated when you go to launch, and the log file. Don't have KCT installed preferably. 

Strict comparisons will fail if anything that defines an inventory part fails. Are you changing a module before the parts are being removed (for instance, doing something at Start to the craft before OnVesselRollout happens, without KCT)? I mention without KCT since with KCT at rollout ScrapYard doesn't do anything, it instead acts when KCT registers the build, which should allow for things to happen before OnVesselRollout since ScrapYard has already processed the vessel.

OnVesselRollout is an extremely convenient event for me to listen to since it only happens once and for brand new launches, but the fact that it's so delayed might be an issue. I might have to act at OnLoad or Start. Or find matches solely by ID instead of looking for a strict match. I don't like that idea because of the bugs it can introduce. For instance, you launch a craft using inventory parts with N TimesRecovered and then recover it (N+1), then you click the launchpad and launch that vessel again. It's still got the IDs saved, so it removes those parts from the inventory, but the vessel has N TimesRecovered in its modules while the true parts are N+1, causing that last flight to basically no longer exist. In that case it could probably just reapply the inventory I guess.

Share this post


Link to post
Share on other sites
1 hour ago, magico13 said:

Are you changing a module before the parts are being removed (for instance, doing something at Start to the craft before OnVesselRollout happens, without KCT)?

Sorry, should have been clearer.

This is happening when the "Apply Inventory" button is pressed in the VAB - no rollouts have happened yet. It's also happening with KCT installed (but it's inconsistent - the same vessel worked fine on the same modset in a different save).

In terms of code being called at Start() - nothing is done in the VAB at all, the Start method just returns. (I do initialise failures in Start() in the flight scene, but if SY fires its tracker updated event, it runs the code again to take that into account).

Will get you saves logs etc later.

Edited by severedsolo

Share this post


Link to post
Share on other sites
55 minutes ago, severedsolo said:

This is happening when the "Apply Inventory" button is pressed in the VAB -

Hmm. Right after clicking the button? So it's applying the inventory (meaning the modules must match), copying over the tracker info, and then failing to match the modules+tracker... Yeah, that's definitely goofed up if that's the case. I'll want to see that. If you figure out what mod(s) are leading to that situation, please let me know. The only modules that should matter in the comparisons are the ones being tracked, so you could also start disabling some of those, but that wouldn't update the parts that are already in the inventory. You also mentioned StageRecovery, so it could be related to the API.

Share this post


Link to post
Share on other sites
53 minutes ago, magico13 said:

You also mentioned StageRecovery, so it could be related to the API.

That may have been a red herring. I've since seen it happen using the stock recovery button too. I'll keep poking at it, and let you know if I make any progress.

Edit: How do I see what modules SY is tracking? I can't see any modules at all for the parts that are bugging out in the PartInventory in my save.

			ScrapYard.InventoryPart
			{
				_name = fuelTank
				_dryCost = 316.399994
				_id = dce0e4b0-3b45-4a3a-8c5b-a4ccc40bc780
				_timesRecovered = 2
				_inventoried = True
			}

 

Edited by severedsolo

Share this post


Link to post
Share on other sites
2 hours ago, severedsolo said:

How do I see what modules SY is tracking? I can't see any modules at all for the parts that are bugging out in the PartInventory in my save.

Well, that indicates that it isn't tracking anything for those parts. Compare the craft file to the ModuleTemplates and see if there are any modules that should be tracked that aren't being tracked. For instance if you've got procedural modules on the part in the craft but not in the save. I'm just confused on how it clearly matched in the editor at some point when applying inventory but stopped matching while still in the editor if no modules were changed. I'd still like to see the log, craft file, and save file at some point. And any module templates that were added.

Edited by magico13

Share this post


Link to post
Share on other sites
1 hour ago, severedsolo said:

Here you go: https://www.dropbox.com/s/qha5mihhvtpw34g/ScrapYardData.zip?dl=0

I did it without KCT for quickness. In this case the bugged part is a 625bonny. You can see it in the inventory in the save, and you can see in the log it has the same error as above.

It looks like you're just loading a saved vessel and not applying the inventory at all. If you are applying the inventory, it isn't succeeding since nothing is getting applied (you'd see messages in the log like "Found a part in inventory for ..."). If you recovered those parts and then added other mods then it might not recognize them as being the same. Specifically in this case it seems like maybe you created a ship, saved it, then launched it and recovered it. Now the saved version of the ship has the same IDs on it as parts in the inventory, but they all say they're brand new. ScrapYard loops through the parts on the ship and sees the IDs match something in the inventory, but the parts on the ship say they're new and the parts in the inventory say they aren't. ScrapYard assumes it's just an old ship you loaded, so it resets everything to fresh. If you want to use the recovered parts, you just have to reapply the inventory.

Things seem to me like they're working how they're intended, but I'm just basing that off what the log says happened.

Share this post


Link to post
Share on other sites

<whole bunch of irrelevant stuff deleted because I figured it out>

ScrapYard and TAC Life support are not playing nicely together.

Reproduction Steps:

1) Install ScrapYard and Dependencies, SXT (not actually necessary, but one of the cockpits fails every time), and TAC (and CRP).

2) Start a new Career game, place a "bonny" cockpit on the pad and recover it.

3) Try to apply ScrapYards inventory.

I really hope this can be fixed in SY, as otherwise I may have to choose between SY and TACLS and I don't know which I'd choose :sealed:

Edited by severedsolo

Share this post


Link to post
Share on other sites

Awesome that you figured out consistent reproduction steps. I'll try that out and hopefully get a fix out today.

Share this post


Link to post
Share on other sites

Getting a lot of errors with this in the VAB on my excessively modded install.
 

Spoiler

 

Specifically I'm getting a huge amount of logspam of:


[ERR 14:25:29.614] Input is null for field 'initialName' in config node 'MODULE'
   at System.Environment.get_StackTrace()
   at ConfigNode.AddValue(System.String name, System.String value)
   at BaseFieldList.Save(.ConfigNode node)
   at PartModule.Save(.ConfigNode node)
   at ShipConstruct.SaveShip()
   at ShipConstruction.CreateBackup(.ShipConstruct ship)
   at EditorLogic.SetBackup()
   at EditorLogic.<SetupFSM>m__8C()
   at KerbalFSM.RunEvent(.KFSMEvent evt)
   at KerbalFSM.updateFSM(KFSMUpdateMode mode)
   at KerbalFSM.UpdateFSM()
   at EditorLogic.Update()

[ERR 15:33:00.173] Input is null for field 'initialName' in config node 'MODULE'
   at System.Environment.get_StackTrace()
   at ConfigNode.AddValue(System.String name, System.String value)
   at BaseFieldList.Save(.ConfigNode node)
   at PartModule.Save(.ConfigNode node)
   at ScrapYard.InventoryPart..ctor(.Part originPart)
   at ScrapYard.Utilities.EditorHandling.FilterOutUsedParts(IEnumerable`1 sourceList)
   at ScrapYard.UI.InstanceSelectorVM.UpdatePartList(ScrapYard.PartInventory inventory, ScrapYard.InventoryPart partBase, Boolean selling)
   at ScrapYard.UI.InstanceSelectorVM.UpdatePartList()
   at ScrapYard.Utilities.EditorHandling.VerifyEditorShip()
   at ScrapYard.ScrapYard.VerifyEditor()

[ERR 15:33:41.727] Input is null for field '_id' in config node 'ScrapYard.InventoryPart'
   at System.Environment.get_StackTrace()
   at ConfigNode.AddValue(System.String name, System.Object value)
   at ScrapYard.InventoryPart.get_State()
   at ScrapYard.PartTracker.get_State()
   at ScrapYard.ScrapYard.OnSave(.ConfigNode node)
   at ScenarioModule.Save(.ConfigNode node)
   at ProtoScenarioModule..ctor(.ScenarioModule module)
   at ScenarioRunner.UpdateModules()
   at ScenarioRunner.GetUpdatedProtoModules()
   at Game.Updated()
   at GamePersistence.SaveGame(System.String saveFileName, System.String saveFolder, SaveMode saveMode)
   at FlightDriver.StartWithNewLaunch(System.String fullFilePath, System.String missionFlagURL, System.String launchSiteName, .VesselCrewManifest manifest)
   at EditorLogic.<goForLaunch>m__A7()
   at CallbackUtil+<DelayedCallback>c__IteratorEC.MoveNext()
   at UnityEngine.SetupCoroutine.InvokeMoveNext(IEnumerator enumerator, IntPtr returnValueAddress)

[ERR 15:33:16.619] Input is null for field 'initialName' in config node 'MODULE'
   at System.Environment.get_StackTrace()
   at ConfigNode.AddValue(System.String name, System.String value)
   at BaseFieldList.Save(.ConfigNode node)
   at PartModule.Save(.ConfigNode node)
   at ShipConstruct.SaveShip()
   at ShipConstruction.CreateBackup(.ShipConstruct ship)
   at EditorLogic.onSaveConfirm()
   at EditorLogic.saveShip(.Callback afterSave)
   at EditorLogic.saveShip()
   at UnityEngine.Events.InvokableCall.Invoke(System.Object[] args)
   at UnityEngine.Events.InvokableCallList.Invoke(System.Object[] parameters)
   at UnityEngine.Events.UnityEventBase.Invoke(System.Object[] parameters)
   at UnityEngine.Events.UnityEvent.Invoke()
   at UnityEngine.UI.Button.Press()
   at UnityEngine.UI.Button.OnPointerClick(UnityEngine.EventSystems.PointerEventData eventData)
   at UnityEngine.EventSystems.ExecuteEvents.Execute(IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData)
   at UnityEngine.EventSystems.ExecuteEvents.Execute(UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor)
   at UnityEngine.EventSystems.StandaloneInputModule.ProcessMousePress(UnityEngine.EventSystems.MouseButtonEventData data)
   at UnityEngine.EventSystems.StandaloneInputModule.ProcessMouseEvent(Int32 id)
   at UnityEngine.EventSystems.StandaloneInputModule.ProcessMouseEvent()
   at UnityEngine.EventSystems.StandaloneInputModule.Process()
   at UnityEngine.EventSystems.EventSystem.Update()

[ERR 15:33:02.281] Input is null for field 'initialName' in config node 'MODULE'
   at System.Environment.get_StackTrace()
   at ConfigNode.AddValue(System.String name, System.String value)
   at BaseFieldList.Save(.ConfigNode node)
   at PartModule.Save(.ConfigNode node)
   at ShipConstruct.SaveShip()
   at KerbalConstructionTime.KCT_BuildListVessel..ctor(.ShipConstruct s, System.String ls, Double bP, System.String flagURL)
   at KerbalConstructionTime.KCT_Utilities.RecalculateEditorBuildTime(.ShipConstruct ship)
   at KerbalConstructionTime.KerbalConstructionTime.EditorRecalculation()

[ERR 15:33:02.076] Input is null for field 'initialName' in config node 'MODULE'
   at System.Environment.get_StackTrace()
   at ConfigNode.AddValue(System.String name, System.String value)
   at BaseFieldList.Save(.ConfigNode node)
   at PartModule.Save(.ConfigNode node)
   at ScrapYard.InventoryPart..ctor(.Part originPart)
   at ScrapYard.PartTracker.GetUsesForPart(.Part part, TrackType type)
   at ScrapYard.APIManager.GetUseCount_Part(.Part part, System.String type)
   at System.Reflection.MonoMethod.InternalInvoke(System.Object , System.Object[] , System.Exception ByRef )
   at System.Reflection.MonoMethod.Invoke(System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(System.Object obj, System.Object[] parameters)
   at KerbalConstructionTime.ScrapYardWrapper.invokeMethod(System.String methodName, System.Object[] parameters)
   at KerbalConstructionTime.ScrapYardWrapper.GetUseCount(.Part part, TrackType trackType)
   at KerbalConstructionTime.KCT_Utilities.GetBuildTime(System.Collections.Generic.List`1 parts, Boolean useInventory)
   at KerbalConstructionTime.KCT_Utilities.RecalculateEditorBuildTime(.ShipConstruct ship)
   at KerbalConstructionTime.KerbalConstructionTime.EditorRecalculation()

and


[ERR 15:33:40.704] Input is null for field 'initialName' in config node 'MODULE'
   at System.Environment.get_StackTrace()
   at ConfigNode.AddValue(System.String name, System.String value)
   at BaseFieldList.Save(.ConfigNode node)
   at PartModule.Save(.ConfigNode node)
   at ShipConstruct.SaveShip()
   at ShipConstruction.CreateBackup(.ShipConstruct ship)
   at EditorLogic.launchVessel()
   at KRASH.LaunchGUI.LaunchSim()
   at KRASH.LaunchGUI.drawRightSelectorWindow(SelectionType type)
   at KRASH.LaunchGUI.drawSelectorWindow(Int32 id)
   at UnityEngine.GUI.CallWindowDelegate(UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style)

I think those are the main ones. Each one repeating itself tens (if not hundreds) of times per second, often followed shortly by one of the others repeating at similar rapidity.

I think they only happen when picking up a part, attaching a part, or hovering a part in place ready to attach.

 

It was causing me enough lag that I tried uninstalling ScrapYard, but then I was getting similar errors just from KCT which I was stupid/lazy enough not to record. Tried upgrading ScrapYard to the latest version, and the problem persisted, and the new Part Inventory window seemed broken as well. Opened by default in the VAB, can't be closed, and all the part names are missing. Picking a part off the menu still seems to work though and I think recovered parts are correctly being added to the inventory, although I should probably test this properly.

Unless you have better ideas as to what sort of mod conflicts could be causing errors like this, I guess I'll start by trying it with KRASH and KCT disabled since they're the only two other mods explicitly mentioned in those error messages. Should also double-check if it's happening on all my different saves.

Obviously I don't expect real support for an install as cluttered as mine, so am mainly posting for reference in case the info's useful to anyone else, but I can get you a log as well if you want a closer look at it.

Edited by baldamundo

Share this post


Link to post
Share on other sites
9 minutes ago, baldamundo said:

Tried upgrading ScrapYard to the latest version, and the problem persisted, and the new Part Inventory window seemed broken as well. Opened by default in the VAB, can't be closed, and all the part names are missing.

That menu isn't even close to being fully implemented and shouldn't be used at all. I'd recommend rolling back to the last beta since there weren't any changes that would affect this between then and now.

Can you upload the full log? Based on what I'm seeing this looks like a bigger problem that removing SY, KCT, and KRASH isn't going to help. The lag might go away, but the ship can't be saved without throwing an exception which implies a much bigger problem. Can you even launch a vessel? With the errors presented I don't think you'll be able to. Remove those three mods and let me know if you still can't launch. It's definitely possible that SY is making the problem worse, but I'm expecting there will still be a problem. It could also be vessel specific, if you were using a specific craft or part to test with,

Share this post


Link to post
Share on other sites
55 minutes ago, magico13 said:

That menu isn't even close to being fully implemented and shouldn't be used at all. I'd recommend rolling back to the last beta since there weren't any changes that would affect this between then and now.

Can you upload the full log? Based on what I'm seeing this looks like a bigger problem that removing SY, KCT, and KRASH isn't going to help. The lag might go away, but the ship can't be saved without throwing an exception which implies a much bigger problem. Can you even launch a vessel? With the errors presented I don't think you'll be able to. Remove those three mods and let me know if you still can't launch. It's definitely possible that SY is making the problem worse, but I'm expecting there will still be a problem. It could also be vessel specific, if you were using a specific craft or part to test with,

Strangely enough, as far as I can tell, everything else is working basically fine besides the lag - certainly KCT seems to be working perfectly, and launches and simulations are mostly fine. Like, I've always had the occasional crash on this install, but nothing excessive for KSP. Lag and loading times have really been the only serious and persistent issues - at least off the top of my head.

And it happens even if I create a new vessel from scratch, so it doesn't look vessel or part specific.

Log here - just contains brief mucking about in the VAB and the SPH in two saves, one launch (via KCT) and immediate recovery, and one KRASH simulation.

Will have a go removing the three aforementioned mods shortly.

Edited by baldamundo

Share this post


Link to post
Share on other sites

Okay, looks like your hunch was right about there being something deeper the matter, with ScrapYard just making it more noticeable. Getting similar but less severe errors with those mods removed. Guess I should move this to a separate thread in Modded Support. Sorry to have bothered you about this, and thanks very much for the help!

Edited by baldamundo

Share this post


Link to post
Share on other sites
31 minutes ago, baldamundo said:

Okay, looks like your hunch was right about there being something deeper the matter, with ScrapYard just making it more noticeable. Getting similar but less severe errors with those mods removed. Guess I should move this to a separate thread in Modded Support. Sorry to have bothered you about this, and thanks very much for the help!

I hope you can figure out what's causing it! Feel free to let me know if you do, as I can maybe make my mods more fault tolerant toward whatever was happening.

Share this post


Link to post
Share on other sites
9 hours ago, severedsolo said:

ScrapYard and TAC Life support are not playing nicely together.

Reproduction Steps:

Well, I can definitely reproduce it. Even using the new WIP UI that fully copies the modules over is saying they're not matches. I've seen something weird before that might be related and that's the dry cost coming up differently than expected, so maybe that's the issue here. I'll let you know if I figure anything out.

E: I see the dry cost is 799.730896. I swear if this is just an issue with the last digit being different... Stock parts tend to have whole numbers for their dry cost so the comparisons aren't generally and issue. I used cost as a comparison since it's much faster than comparing all the modules and two identical parts should have the same cost, but modules like tweakscale and procedural parts would result in different costs for different sizes so I could eliminate those deep checks by checking the cost first. I might just have to check if it's within one or two funds.

E2: 799.7309 vs 799.730:confused:

E3: @severedsolo give the latest dev build a try and let me know if that works better. It allows the part costs to differ by 1:funds: which should hopefully eliminate the problems you were seeing while still allowing that to act as a sanity check before checking the modules. I also hid the UI that I'm working on since it's not at all ready to be used.

Edited by magico13

Share this post


Link to post
Share on other sites
59 minutes ago, magico13 said:

 give the latest dev build a try and let me know if that works better. It allows the part costs to differ by 1:funds: which should hopefully eliminate the problems you were seeing while still allowing that to act as a sanity check before checking the modules. I also hid the UI that I'm working on since it's not at all ready to be used.

You are my hero. Actually that would explain the fuel tanks too (Modular Fuel Tanks would interfere with it).

Early days, but the cockpit has loaded into the inventory, so thats a win

Share this post


Link to post
Share on other sites

@magico13, Is there a way to automatically apply the Scrap Yard parts instead of having to press the button?

Share this post


Link to post
Share on other sites
3 hours ago, magico13 said:

I hope you can figure out what's causing it! Feel free to let me know if you do, as I can maybe make my mods more fault tolerant toward whatever was happening.

Huh. Strangely enough it seems to have been Ship Sections that was at the root of the problem...Or at least, disabling Ship Sections stops me from getting any errors that are obviously similar or related, either with or without KCT/Scrapyard.

Share this post


Link to post
Share on other sites
1 hour ago, Probus said:

@magico13, Is there a way to automatically apply the Scrap Yard parts instead of having to press the button?

Not yet. I can probably add that in as an option pretty easily. Maybe tomorrow.

Edited by magico13

Share this post


Link to post
Share on other sites
23 minutes ago, magico13 said:

Not yet. I can probably add that in as an option pretty easily. Maybe tomorrow.

Sweet!  Thanks magico

Share this post


Link to post
Share on other sites

Whats your preference for bundling SY and magicore with dependent mods?

At the moment I'm telling people to get it separately with UPFM but I've had an installation issue with someone installing an old version of Magicore already.

I'm debating bundling SY and Magicore with it, so at least I know people should have a working version

Share this post


Link to post
Share on other sites
15 minutes ago, severedsolo said:

Whats your preference for bundling SY and magicore with dependent mods?

ScrapYard probably shouldn't be bundled, at least not once it's on CKAN. For now I'll allow it since things might not work properly with newer ScrapYard versions if things change while in Beta.

MagiCore is bundled with ScrapYard so they should just be using that version. It shouldn't be downloaded separately (except when using CKAN). There was a change a while back where MagiCore was put in GameData directly, but that changed to go into GameData/MagiCore. That's already been an issue a few times.

Share this post


Link to post
Share on other sites
2 hours ago, magico13 said:

ScrapYard probably shouldn't be bundled, at least not once it's on CKAN. For now I'll allow it since things might not work properly with newer ScrapYard versions if things change while in Beta.

CKAN can handle bundled mods if your directory structure is right, but I think I'll risk it and not bundle. It's just more stuff to put together when doing a release.

Share this post


Link to post
Share on other sites
9 hours ago, severedsolo said:

CKAN can handle bundled mods if your directory structure is right, but I think I'll risk it and not bundle. It's just more stuff to put together when doing a release.

Yeah, KCT already distributes MagiCore in the .zip but separately through CKAN (so do the modlets). But with CKAN having a non-bundled dependency is also easier to do since it'll pull it in automatically. ScrapYard is big enough that I don't feel it's appropriate to bundle, but that feeling might change.

Btw, if you want some space on the build server I can set something up for you. ScrapYard's build process already pulls in the latest Module Manager and it automatically packages up all the GameData stuff, so I could set up something similar for you.

 

E: @Probus the latest dev build should have an option to automatically apply the inventory as you build. It should be off by default. It's just a toggle on the little UI with the Apply Inventory button. You should also be able to move that UI to wherever you want and it should save it's position, but I haven't extensively tested that.

Edited by magico13

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.