SSTU - Shadow Space Technologies Unlimited

SSTU - Shadow Space Technologies Unlimited

98.5k Downloads

SSTU-SC-TANK-MFT-L not attaching to parts.

lynwoodm opened this issue ยท 20 comments

commented

Replicate:

  1. Get any command pod or probe core.
    20170829143222_1
  2. Get the SSTU Lander tank and attach to part.
    20170829143300_1
  3. Lander Tank does not attach to part and puts the part off to the side with both attachment nodes missing.
    20170829143311_1

output_log.txt
Be warned, I do use a lot of mods and I may be the cause of this. But, I haven't had any issues until the last update of SSTU, because I use and test every part when an update is concerned. Including the Lander Tanks

commented

Ah, good to note that it appeared in the last update, because i'm still using the version before that and the tank works fine here. That might explain it.

commented

Thanks for including the log files, so much easier when I can see what is going on :)

A few SSTU exceptions from the log (there are others for other mods, but would seem unrelated to this problem):

Module SSTUVolumeContainer threw during OnStart: System.ArgumentException: An element with the same key already exists in the dictionary.
  at System.Collections.Generic.Dictionary`2[System.String,SSTUTools.SubContainerDefinition].Add (System.String key, SSTUTools.SubContainerDefinition value) [0x00000] in <filename unknown>:0 
  at SSTUTools.ContainerDefinition..ctor (SSTUTools.SSTUVolumeContainer module, .ConfigNode node, Single tankTotalVolume) [0x00000] in <filename unknown>:0 
  at SSTUTools.SSTUVolumeContainer.loadConfigData () [0x00000] in <filename unknown>:0 
  at SSTUTools.SSTUVolumeContainer.OnStart (StartState state) [0x00000] in <filename unknown>:0 
  at Part.ModulesOnStart () [0x00000] in <filename unknown>:0 
NullReferenceException: Object reference not set to an instance of an object
  at SSTUTools.SSTUVolumeContainer.updateContainerVolumes () [0x00000] in <filename unknown>:0 
  at SSTUTools.SSTUVolumeContainer.onVolumeUpdated (Single newVolume) [0x00000] in <filename unknown>:0 
  at SSTUTools.SSTUModInterop.onPartFuelVolumeUpdate (.Part part, Single liters) [0x00000] in <filename unknown>:0 
  at SSTUTools.SSTUModularFuelTank.updateContainerVolume () [0x00000] in <filename unknown>:0 
  at SSTUTools.SSTUModularFuelTank.Start () [0x00000] in <filename unknown>:0 
NullReferenceException: Object reference not set to an instance of an object
  at SSTUTools.SSTUVolumeContainer.updatePersistentData () [0x00000] in <filename unknown>:0 
  at SSTUTools.SSTUVolumeContainer.OnSave (.ConfigNode node) [0x00000] in <filename unknown>:0 
  at PartModule.Save (.ConfigNode node) [0x00000] in <filename unknown>:0 
  at ShipConstruct.SaveShip () [0x00000] in <filename unknown>:0 
  at ShipConstruction.CreateBackup (.ShipConstruct ship) [0x00000] in <filename unknown>:0 
  at EditorLogic.SetBackup () [0x00000] in <filename unknown>:0 
  at EditorLogic.<SetupFSM>m__8D () [0x00000] in <filename unknown>:0 
  at KerbalFSM.RunEvent (.KFSMEvent evt) [0x00000] in <filename unknown>:0 
  at KerbalFSM.updateFSM (KFSMUpdateMode mode) [0x00000] in <filename unknown>:0 
  at KerbalFSM.UpdateFSM () [0x00000] in <filename unknown>:0 
  at EditorLogic.Update () [0x00000] in <filename unknown>:0 

Those would point towards an incorrect/missing/duplicate resource definition or tank config file (probably some of each).

There were quite a few patches on some of the resource stuff in the latest release, so it is entirely possible that something either removed a resource incorrectly, or added a duplicate resource.

I'll see if I can get some time to test this personally tonight -- will ensure there are no other mod conflicts, and will let me add more debugging/logging if needed to see exactly what the error is.

commented

Check xenon, I had some problems with that when I assed NF fuels, but was resolved when I updated the PR to remove it.

Jedi, are you using TAC LS or other mods that would add resources with the new patches?

commented

Additionally -- there is something messed up with that install; there is somehow installed all of the resources from the repository, including the UnityEditor/etc .dll files. These can very likely cause problems. (I'm surprised the game even loaded with those in place)

AssemblyLoader: Loading assembly at C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\GameData\Plugin\SSTUTools\SSTUPartTools\bin\Release\UnityEngine.dll

It looks like you installed everything from the SSTU.zip download, whereas only the stuff inside the GameData folder in the download should be installed.

Looks like you need to delete your GameData/Plugin directory -- it looks like it contains all of the SSTU source and compilation files (some of which apparently I need to find a way to remove from the repository, while somehow also still keeping them available in the repository....).

Edit: Making a note that I need to update the build-script to work again; have been packing these last few releases manually, and apparently the included structure is... less than optimal... from an ease of installation perspective.

commented

No worries, was just pointing out some potential problematic bits I saw in the log.
On the bright side -- I have updated my build script to package things in a more reliable manner, and it now also includes install instructions (basic as they may be) :)

Investigating this problem in-game here momentarily, will let you know what I find out (mostly if it is present in a stock+sstu install).

commented

Hmm.. everything seems to be loading fine in a stock+SSTU only environment. No duplicate resources, no null-ref spam, part attaches just fine in the editor, and properly allows for fuel selection.

screenshot1

Investigating some of the patches now... will see what I can find out.

commented

Mod list extracted from the posted log file:

000_AT_Utils
000_FilterExtensions
000_FilterExtensions Configs
000_Toolbar
000_USITools
AirplanePlus
AnimatedDecouplers
AoATech
ASET
ATI Labs
B9PartSwitch
B9_Aerospace_ProceduralWings
BackgroundResources
BahaSP
Canadarm
Chatterer
CommunityCategoryKit
CommunityResourcePack
CommunityTechTree
ConfigurableContainers
ConnectedLivingSpace
ControlSurfaceToggle
CryoTanks
CTTP
CustomShaders
DECQs_SpaceShuttleSystem
DeployableEngines
DistantObject
DMagicOrbitalScience
DMagicScienceAnimate
DynamicBatteryStorage
ExtraplanetaryLaunchpads
FASA
Firespitter
FShangarExtender
Hangar
HeatControl
InterstellarFuelSwitch
Jimbodiah
JSI
KAS
KerbalAtomics
KerbalFoundries
KerbalJointReinforcement
KerbalReusabilityExpansion
KerbalScienceFoundation
Kerbaltek
KerbetrotterLtd
KeridianDynamics
Kermantech
KIS
KramaxAutoPilot
KSP-AVC
KSPWheel
LonesomeRobots
MagicSmokeIndustries
MainSailor
ManeuverNodeEvolved
MechJeb2
Mk2Expansion
ModularFuelTanks
NavyFish
NearFutureConstruction
NearFutureElectrical
NearFutureProps
NearFuturePropulsion
NearFutureSolar
NearFutureSpacecraft
OPT
PlanetaryBaseInc
Plugin
ProceduralFairings
ProceduralParts
QuantumStrutsContinued
QuizTechAeroContinued
RealChute
RealPlume
RealPlume-Stock
REPOSoftTech
RetractableLiftingSurface
RosterManager
SCANsat
ShipManifest
SmokeScreen
SPACE_SHUTTLE_SYSTEM
SPC
Stock folder: Squad

SSTU
StockPlugins
SurfaceExperimentPackage
TarsierSpaceTech
TDIndustriesRCSandHypergolicengines
TextureReplacer
ThunderAerospace
TokamakIndustries
TriggerTech
TRP-Hire
TweakScale
UmbraSpaceIndustries
UniversalStorage
VesselView
W3
Inventory.cfg
KSPModFileLocalizer.dll
ModuleManager.2.8.1.dll
ModuleManager.ConfigCache
ModuleManager.ConfigSHA
ModuleManager.Physics
ModuleManager.TechTree
toolbar-settings.dat

(this is just to help spot potential mod-conflicts, though I have a feeling the problem is being caused by one of the SSTU patches)

commented

Okay, to add, I have a habit of removing the RealFuels patch from the SSTU patch folder. Always done it, don't know if it's significant. I done it because it always conflicts with MFT. Also looking at this, I have way to many mods.... I did, however, delete the Plugin folder and I still got the same results.

commented

Thanks for investigating that bit. Re: removal of RF patch -- shouldn't make any difference for the problem we are investigating.

Is there any way you could upload your ModuleManager.ConfigCache file? This will let me know what the configs look like after MM has patched things, and will let me check for duplicate/invalid resources. With your install it will probably be fairly large, so you might need a 3rd party host such as DropBox, but GitHub might let you just drag+drop it into your post.

From the log file/exceptions posted further up in the conversation, it looks like a duplicate resource is being added, but (with my sloppy logging) it doesn't say which resource is duplicated. I've already fixed up the code to 1.) Log properly, and 2.) not crash for duplicate defs, but would still like to find out what patch is doubling-up the resource definitions. (So, problem should be solved with the next release, but would still like to clean up the patches)

commented

Okay, added the RealFuels patch back, now the tanks work. For the exception of the MUS tank. New log cometh.

output_log.txt

And this is with conjunction with the MM Cache.

commented

Thanks for uploading the cache.

Strangely.... the cache tells me that the SSTUVolumeContainer module isn't even present on that part (MFT-L). Instead, all that I'm finding in that part is the 'ModuleFuelTanks' from MFT/RF. (which makes sense if this cache was from when you ran with the RF patch in place)

However, when looking at a few other parts (that do use the SSTUVolumeContainer), I'm definitely seeing duplicate resources listed -- namely XenonGas. This is likely the cause of the problem -- am investigating now what patch(es) are adding that resource.

commented

@lynwoodm
I think I have found the problem, mostly certain anyhow. It looks like it is in the GameData/SSTU/ModIntegration/NFPropulsion/NFPropulsion.cfg -- near the bottom of the file there is a line 'resource = XenonGas' -- if you delete that line, there should be no more duplicate resources (I hope... unless other patches are also messed up, but can't tell from the cache file above as the module is not in most parts).

( https://github.com/shadowmage45/SSTULabs/blob/master/GameData/SSTU/ModIntegration/NFPropulsion/NFPropulsion.cfg#L43 )

You could also try using the SSTUTools.dll from the VCCleanup branch, as it has been updated with code that should no longer crash on duplicate (or missing) resources: ( https://github.com/shadowmage45/SSTULabs/raw/VCCleanup/GameData/SSTU/Plugins/SSTUTools.dll ) (replace the existing SSTUTools.dll in GameData/SSTU/Plugins)

commented

Dammit, you ninjad me...

I found it... your NF prop file in v138 is different than my last version that I think I PRed which has a xenon ref in the resource list added to the MUS. I added a volme definition but not an extra fuel definition. I can't see my old PR as I deleted the branches though...

Remove the line for resource = XenonGas in NFPropulsion.cfg

@part[SSTU-SC-TANK-MFT-A|SSTU-SC-TANK-MFT-S|SSTU-SC-TANK-MFT-R|SSTU-SC-TANK-MFT-L|SSTU-SC-TANK-MUS|SSTU-SC-TANK-MFT-D]:NEEDS[NearFuturePropulsion]
{
@module[SSTUVolumeContainer]
{
@container,0
{
resource = ArgonGas
resource = Lithium
resource = XenonGas <<< remove this line
}
}
}

commented

This is the file I have, not sure what went wrong or where...

SSTU_FUELTYPE:NEEDS[NearFuturePropulsion]
{
name = ArgonGas
RESOURCE
{
resource = ArgonGas
ratio = 10
}
}

SSTU_FUELTYPE:NEEDS[NearFuturePropulsion]
{
name = Lithium
RESOURCE
{
resource = Lithium
ratio = 2
}
}

SSTU_RESOURCEVOLUME:NEEDS[NearFuturePropulsion]
{
name = Lithium
volume = 0.89
}

SSTU_RESOURCEVOLUME:NEEDS[NearFuturePropulsion]
{
name = ArgonGas
volume = 0.003049
}

SSTU_RESOURCEVOLUME:NEEDS[NearFuturePropulsion]
{
name = XenonGas
volume = 0.16
}

@part[SSTU-SC-TANK-MFT-A|SSTU-SC-TANK-MFT-S|SSTU-SC-TANK-MFT-R|SSTU-SC-TANK-MFT-L|SSTU-SC-TANK-MUS|SSTU-SC-TANK-MFT-D]:NEEDS[NearFuturePropulsion]
{
@module[SSTUVolumeContainer]
{
@container,0
{
resource = ArgonGas
resource = Lithium
}
}
}

commented

I am happy to report that all is well and working properly! In retrospect, I do need to offer you an apology for making this a big deal (I really didn't want it to be a big deal). I know you are a busy person and solving problems for a game is quite low on the priority list. Also, a big thanks to Jim for narrowing this down in conjunction.

commented

Hmm... strange... the PR definitely has XenonGas in it ( https://github.com/shadowmage45/SSTULabs/pull/499/files ). Could be that the branch/pr was not updated with the changes? I'm not even sure which end that would need to be done on; still learning a lot about PR use.

But no worries; at the time the PR was submitted, I had not yet added XenonGas to the stock configs, so there wouldn't have been any conflicts.

Have it cleaned up, and also cleaned up the code to log rather than crash on similar errors in the future. Will also make patching things easier, as you won't need to worry about duplicates, you can just add whatever that mod/etc needs to add.


@lynwoodm Glad to hear it is working for you now :) I'll make sure this fix makes it into the next release. I actually needed a bit of a distraction today, and you were more than helpful with providing logs and feedback to help track it down.

commented

Could you check if the new version also has the adjusted volume definition? (0.16).

commented

Okay, here's the skinny on the installation. At first, I did just put everything from just the GameData folder from the update. Went to play the game and all the SSTU command pods (A, B, C) were colorless. So, I deduced that I needed to install -all- the things from the update. Including the Plugin and Custom Shader folders. I guess my fervor to figure stuff out on my own does go down a drain somewhere lol. I will delete the folder and try it again.

commented

Yes, the volume definition is setup properly.