Jump to content

[1.2] TweakableEverything 1.16-beta - For all your part tweaking needs


toadicus

Recommended Posts

I'm getting this single error in my crash log:

While added ModuleTweakableEVA, encountered exception: System.NullReferenceException: Object reference not set to an instance of an object

at Part.AddModule (System.String moduleName) [0x00000] in <filename unknown>:0

at Part.AddModule (.ConfigNode node) [0x00000] in <filename unknown>:0

at TweakableEVA.TweakableEVAManager.Update () [0x00000] in <filename unknown>:0

I'm guessing this is your new addition.

The game crashes when I try to select a pod. Removing the mod "solved" the problem. So far no crashing.

Technically that's not an error, it just looks like one. Something in Squad's code throws an exception when adding things to parts in the space center via the method I'm using, but otherwise works. The same thing happens with TACLS. I've quieted down the log to make it look less like a problem, but that's an expected exception being handled by my code, not an unhandled exception causing havoc.

Thanks for reporting, though!

Link to comment
Share on other sites

Ok.

Your mod is still making the game crash though.

Can you please get me the whole log, then? I can't make the game crash in a quick-and-dirty run in 64-bit Windows or 64-bit Linux. Does it happen with no other mods installed, or only a few others? When you say "select a pod", do you mean add a pod as a root part in the editor?

Link to comment
Share on other sites

Does it happen with no other mods installed, or only a few others?

I don't know what to tell you. I just tried a few different mod combinations including just taking TweakableEVA.dll out, and now it all works even with everything back inside GameData. I'll just keep playing and see what happens. I'm still not seeing any other errors. Maybe there's something wrong with my computer.

When you say "select a pod", do you mean add a pod as a root part in the editor?

Yes. It happened twice in a row at the exact same moment.

Link to comment
Share on other sites

I don't know what to tell you. I just tried a few different mod combinations including just taking TweakableEVA.dll out, and now it all works even with everything back inside GameData. I'll just keep playing and see what happens. I'm still not seeing any other errors. Maybe there's something wrong with my computer.

Yes. It happened twice in a row at the exact same moment.

So, I still feel strongly that this is a) a mod interaction problem, with which to deal I need the parts of your log that show the other mods you have installed and the stack trace at the end of the crash report, or B) a memory issue (64-bit KSP on Linux hasn't been free from memory limits, 64-bit on Windows might not be either?). TweakableEVA shouldn't be running any code in the editor whatsoever.

That said, I've added some checks to make completely sure that once TweakableEVA does its work in the space center, it does nothing at all until it needs to do tweakable assignments for the EVA part in flight. I've also fixed some problems with my ModuleDB. If you're having trouble with crashes and think TweakableEverything might be to blame, please follow these steps:

  1. Get me a full debug log (Windows: \path\to\KSP_win\KSP_Data\output_log.txt; Linux: ~/.config/unity3d/Squad/Kerbal\ Space\ Program/Player.log; Mac: ~/Library/Logs/Unity/Player.log)
  2. Download this development version: http://ksp.hawkbats.com/dev/TweakableEverything-dev.zip
  3. If the problem persists, get me a full debug log (Windows: \path\to\KSP_win\KSP_Data\output_log.txt; Linux: ~/.config/unity3d/Squad/Kerbal\ Space\ Program/Player.log; Mac: ~/Library/Logs/Unity/Player.log) again.

Thanks!

Link to comment
Share on other sites

I noticed that stock air intakes can only be "toggled" via action groups, not specifically opened and closed. So for instance, in a non-RAPIER space plane...

Group 1: Jet engines on, rocket engines off, toggle intakes

Group 2: Jet engines off, rockets on, toggle intakes

By default, you close your intakes if you use the 1 key instead of staging to start your engines. If anything goes wonky in the flight and you end up using an action group in an improper order, you'll toggle the intakes improperly.

Easily "fixed" by simply leaving the intakes open forever, but...yanno...

Link to comment
Share on other sites

There is a fix for Decoupler for KSP x64 on Windows:

Fixed Decoupler for KSP x64 on Windows - v1 - (July 20)

http://forum.kerbalspaceprogram.com/threads/87127-Fixed-Decoupler-for-KSP-x64-on-Windows-v1-%28July-20%29

But it doesn't work with TweakableEverything! ;.;

I think this is problem in TweakableDecouplers.dll and how it changes ejection force.

Take a look how the fix alters the decouplers: https://github.com/sarbian/DecoupleForX64/blob/master/ModuleDecoupleX64.cs

Edited by Kolago
Link to comment
Share on other sites

Fixed Decoupler for KSP x64 on Windows - v2 is out, this shut solve the problem. But the decouplers are not tweak able anymore!

Edited by Kolago
Link to comment
Share on other sites

So, I still feel strongly that this is a) a mod interaction problem, with which to deal I need the parts of your log that show the other mods you have installed and the stack trace at the end of the crash report, or B) a memory issue (64-bit KSP on Linux hasn't been free from memory limits, 64-bit on Windows might not be either?). TweakableEVA shouldn't be running any code in the editor whatsoever.

That said, I've added some checks to make completely sure that once TweakableEVA does its work in the space center, it does nothing at all until it needs to do tweakable assignments for the EVA part in flight. I've also fixed some problems with my ModuleDB. If you're having trouble with crashes and think TweakableEverything might be to blame, please follow these steps:

  1. Get me a full debug log (Windows: \path\to\KSP_win\KSP_Data\output_log.txt; Linux: ~/.config/unity3d/Squad/Kerbal\ Space\ Program/Player.log; Mac: ~/Library/Logs/Unity/Player.log)
  2. Download this development version: http://ksp.hawkbats.com/dev/TweakableEverything-dev.zip
  3. If the problem persists, get me a full debug log (Windows: \path\to\KSP_win\KSP_Data\output_log.txt; Linux: ~/.config/unity3d/Squad/Kerbal\ Space\ Program/Player.log; Mac: ~/Library/Logs/Unity/Player.log) again.

Thanks!

Agreed. I ran into the same problem, it works fine the first time i create a new career, but when I try to load a saved game, crash.


[LOG 14:37:13.478] AddonLoader: Instantiating addon 'TweakableEVAManager' from assembly 'TweakableEVA'
[EXC 14:37:13.878] NullReferenceException: Object reference not set to an instance of an object
[LOG 14:37:13.883] FF: adding toolbar buttons
[LOG 14:37:13.885] While added ModuleTweakableEVA, encountered exception: System.NullReferenceException: Object reference not set to an instance of an object
at Part.AddModule (System.String moduleName) [0x00000] in <filename unknown>:0
at Part.AddModule (.ConfigNode node) [0x00000] in <filename unknown>:0
at TweakableEVA.TweakableEVAManager.Update () [0x00000] in <filename unknown>:0

Full log is here.

https://www.dropbox.com/s/8sir0uei2d3wdu1/2014-07-20_143508.zip

I will test out the dev version that you posted.

EDIT - I'm not convinced that the error is really related to the crash. Even after removing tweakable everything, I still get sporadic crashes.

Edited by westamastaflash
Link to comment
Share on other sites

I noticed that stock air intakes can only be "toggled" via action groups, not specifically opened and closed. So for instance, in a non-RAPIER space plane...

Group 1: Jet engines on, rocket engines off, toggle intakes

Group 2: Jet engines off, rockets on, toggle intakes

By default, you close your intakes if you use the 1 key instead of staging to start your engines. If anything goes wonky in the flight and you end up using an action group in an improper order, you'll toggle the intakes improperly.

Easily "fixed" by simply leaving the intakes open forever, but...yanno...

That's a good idea. I have the same thought every time I build a spaceplane; no idea why I didn't think to fix it. I'll look in to it!

UPDATE 2: I've coded this up; I'll post it once I get a chance to test it.

There is a fix for Decoupler for KSP x64 on Windows:

Fixed Decoupler for KSP x64 on Windows - v1 - (July 20)

http://forum.kerbalspaceprogram.com/threads/87127-Fixed-Decoupler-for-KSP-x64-on-Windows-v1-%28July-20%29

But it doesn't work with TweakableEverything! ;.;

I think this is problem in TweakableDecouplers.dll and how it changes ejection force.

Take a look how the fix alters the decouplers: https://github.com/sarbian/DecoupleForX64/blob/master/ModuleDecoupleX64.cs

Fixed Decoupler for KSP x64 on Windows - v2 is out, this shut solve the problem. But the decouplers are not tweak able anymore!

I'll have a look. I should be able to incorporate this.

UPDATE: Looks like the problem was just a couple of issues in the DFX64 ModuleManager patch. I've posted a fix over there.

Agreed. I ran into the same problem, it works fine the first time i create a new career, but when I try to load a saved game, crash.


[LOG 14:37:13.478] AddonLoader: Instantiating addon 'TweakableEVAManager' from assembly 'TweakableEVA'
[EXC 14:37:13.878] NullReferenceException: Object reference not set to an instance of an object
[LOG 14:37:13.883] FF: adding toolbar buttons
[LOG 14:37:13.885] While added ModuleTweakableEVA, encountered exception: System.NullReferenceException: Object reference not set to an instance of an object
at Part.AddModule (System.String moduleName) [0x00000] in <filename unknown>:0
at Part.AddModule (.ConfigNode node) [0x00000] in <filename unknown>:0
at TweakableEVA.TweakableEVAManager.Update () [0x00000] in <filename unknown>:0

Full log is here.

https://www.dropbox.com/s/8sir0uei2d3wdu1/2014-07-20_143508.zip

I will test out the dev version that you posted.

EDIT - I'm not convinced that the error is really related to the crash. Even after removing tweakable everything, I still get sporadic crashes.

I agree with your edit that TweakableEverything likely has little if anything to do with the crash.

Looking at the debug log, the exception fired there is actually in Squad code (might be related to this bug), and the messy-looking exception log from TE is actually just messy logging; the exception was handled in my code and does not cause a problem later on. The crash trace suggests a crash somewhere in the Contracts system; I suspect this is to do with memory issues: it is very unlikely IMO that switching to 64-bit is a silver bullet to let you add all the mods you want. I'd recommend to anyone getting 64-bit crashes that you go get Active Texture Management, even temporarily, to see if that ameliorates your crash issues. Whether it helps or not, that knowledge is useful data to modders and Squad.

Edited by toadicus
Update 2: TweakableIntakes module added. Update 1: Info regarding DecoupleForX64
Link to comment
Share on other sites

I was getting a lot of nullrefs like this until I removed tweakablestaging:


[LOG 15:58:27.311] [TweakScale] Rescaling heatProduction. Current value: 400. Base value: 400. Factor: 1
[LOG 15:58:27.314] [TweakScale] Rescaling breakingForce. Current value: 22. Base value: 22. Factor: 1
[LOG 15:58:27.314] [TweakScale] Rescaling breakingTorque. Current value: 22. Base value: 22. Factor: 1
[LOG 15:58:27.315] [TweakScale] Rescaling buoyancy. Current value: 1. Base value: 1. Factor: 1
[LOG 15:58:27.315] [TweakScale] Rescaling crashTolerance. Current value: 8. Base value: 8. Factor: 1
[LOG 15:58:27.316] [TweakScale] Rescaling explosionPotential. Current value: 0.5. Base value: 0.5. Factor: 1
[LOG 15:58:27.316] [TweakScale] Rescaling maxTemp. Current value: 3200. Base value: 3200. Factor: 1
[LOG 15:58:27.317] [TweakScale] Rescaling mass. Current value: 0.025000000372529. Base value: 0.025000000372529. Factor: 1
[EXC 15:58:27.318] NullReferenceException: Object reference not set to an instance of an object
[LOG 15:58:27.321] [TweakScale] Rescaling breakingForce. Current value: 50. Base value: 50. Factor: 1
[LOG 15:58:27.322] [TweakScale] Rescaling breakingTorque. Current value: 50. Base value: 50. Factor: 1
[LOG 15:58:27.322] [TweakScale] Rescaling buoyancy. Current value: 1. Base value: 1. Factor: 1
[LOG 15:58:27.323] [TweakScale] Rescaling crashTolerance. Current value: 6. Base value: 6. Factor: 1
[LOG 15:58:27.323] [TweakScale] Rescaling explosionPotential. Current value: 0.5. Base value: 0.5. Factor: 1

I was getting decoupler smoke puff animations in the vab which made me think it was not tweakscale.

I think the solars may have been at fault. Tweaksolars was still in and was getting nullrefs again until I removed everything tweakableeverything and rebuilt the ship from scratch. TweakScale (using version 1.22) is still preferable for me for how it works with other mods. tweakableeverything I liked for VAB sizing.

Edited by BigD145
Link to comment
Share on other sites

I was getting a lot of nullrefs like this until I removed tweakablestaging:


[LOG 15:58:27.311] [TweakScale] Rescaling heatProduction. Current value: 400. Base value: 400. Factor: 1
[LOG 15:58:27.314] [TweakScale] Rescaling breakingForce. Current value: 22. Base value: 22. Factor: 1
[LOG 15:58:27.314] [TweakScale] Rescaling breakingTorque. Current value: 22. Base value: 22. Factor: 1
[LOG 15:58:27.315] [TweakScale] Rescaling buoyancy. Current value: 1. Base value: 1. Factor: 1
[LOG 15:58:27.315] [TweakScale] Rescaling crashTolerance. Current value: 8. Base value: 8. Factor: 1
[LOG 15:58:27.316] [TweakScale] Rescaling explosionPotential. Current value: 0.5. Base value: 0.5. Factor: 1
[LOG 15:58:27.316] [TweakScale] Rescaling maxTemp. Current value: 3200. Base value: 3200. Factor: 1
[LOG 15:58:27.317] [TweakScale] Rescaling mass. Current value: 0.025000000372529. Base value: 0.025000000372529. Factor: 1
[EXC 15:58:27.318] NullReferenceException: Object reference not set to an instance of an object
[LOG 15:58:27.321] [TweakScale] Rescaling breakingForce. Current value: 50. Base value: 50. Factor: 1
[LOG 15:58:27.322] [TweakScale] Rescaling breakingTorque. Current value: 50. Base value: 50. Factor: 1
[LOG 15:58:27.322] [TweakScale] Rescaling buoyancy. Current value: 1. Base value: 1. Factor: 1
[LOG 15:58:27.323] [TweakScale] Rescaling crashTolerance. Current value: 6. Base value: 6. Factor: 1
[LOG 15:58:27.323] [TweakScale] Rescaling explosionPotential. Current value: 0.5. Base value: 0.5. Factor: 1

I was getting decoupler smoke puff animations in the vab which made me think it was not tweakscale.

I think the solars may have been at fault. Tweaksolars was still in and was getting nullrefs again until I removed everything tweakableeverything and rebuilt the ship from scratch. TweakScale (using version 1.22) is still preferable for me for how it works with other mods. tweakableeverything I liked for VAB sizing.

So, I don't know exactly what the issue is, but this is pretty much certainly a mod interaction issue. Do you have sarbian's DecoupleForX64 v1 or v2? In either case, TweakableDecouplers will not play nicely with DecoupleForX64 unless you have the fixed MM patch I posted here: http://forum.kerbalspaceprogram.com/threads/87127/page5#post1288061. TweakScale isn't my mod at all, and those don't look like exceptions. If you're referring to the exception in the middle of everything at 15:58:27.318, I can't tell you anything about it without a proper debug log (not just KSP.log; Windows: \path\to\KSP_win\KSP_Data\output_log.txt; Linux: ~/.config/unity3d/Squad/Kerbal\ Space\ Program/Player.log; Mac: ~/Library/Logs/Unity/Player.log).

I'm happy to take a look and help if I can. :)

Link to comment
Share on other sites

I do not use decoupleforx64. Never even heard of it. The problem may or may not be IR's version of tweakscale. I'll get back to you on this if it persists.

Please do. :) Like I said, I'm happy to help out if I can, I just can't know if I can help based on what you've given me. If you can get me a debug log, I'll at least be able to offer information. :)

Link to comment
Share on other sites

I'm happy to take a look and help if I can. :)

So I got pretty drunk last night and updated and downloaded a fair few things, including that decoupler fix mod (and your cfg for it) and I remember loading a vessel in orbit that had the decoupler smoke puffing constantly and the camera panned away and the ship started spinning pretty heavily and I thought 'ehh, I fix tomorrow' and went to bed.

So it's now tomorrow and I want to fix it. Clean install of KSP, with TweakableEverything, DecoupleForx64 and TweakScale (because that may or may not be related) installed. Entered the VAB and selected the lander can for root. Select a decoupler and there's the smoke puffing away. I can't attach it to the craft even though it turns green. I load up the Kerbal X to see if I can get a decoupler into space and all the decouplers in the VAB are puffing away. If I select a part from it, it can't be re-attached. Go to launch and it says it won't be controllable because no control source :confused:

Anyway, this is the output log from it, full of Exceptions for you :P - http://pastebin.com/6PFW4W9c (VAB shenanigans start at line 6891, standard log before that, no errors)

Edited by ObsessedWithKSP
Link to comment
Share on other sites

(VAB shenanigans start at line 6891, standard log before that, no errors)

Ah, but in that you are mistaken my friend! In fact, the fun starts at line 178, though we don't get the real clue until line 220:

System.IO.FileNotFoundException: Could not load file or assembly 'ToadicusTools, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

Looks like somehow or another you don't have ToadicusTools installed, which is a hard dependency for most of the modules. So, any part with a module tweaked by TweakableEverything except engine fairings, gimbals, and RCS won't start up right or work right at all ever. HTH!

Link to comment
Share on other sites

My errors seemed to come from KAS and some version incompatibilities between tweakscale and infernalrobotics branded tweakscale. I have not seen the staging smoke puffs in the vab yet.

Link to comment
Share on other sites

I have puffs coming from other parts than decouplers, but only on ships I load. If I delete the puffing part and add it again, I get no puffs. Also I got a KW Rocketry motor seeming to be burning in two (TWO!) directions magically out of the nozzle. Problem goes away when uninstalling TE mod. Love the mod though! I use it for disabling RCS thrusters inside upper stages.

Link to comment
Share on other sites

I have puffs coming from other parts than decouplers, but only on ships I load. If I delete the puffing part and add it again, I get no puffs. Also I got a KW Rocketry motor seeming to be burning in two (TWO!) directions magically out of the nozzle. Problem goes away when uninstalling TE mod. Love the mod though! I use it for disabling RCS thrusters inside upper stages.

I need a Debug log to help find the conflict or problem. :)

Windows: \path\to\KSP_win\KSP_Data\output_log.txt; Linux: ~/.config/unity3d/Squad/Kerbal\ Space\ Program/Player.log; Mac: ~/Library/Logs/Unity/Player.log

Link to comment
Share on other sites

I'll get you one soon.

Edit: Nevermind, it was actually the radial decouplers that were puffing. Also, I think the weird double-jet from the KW part I saw earlier was because of incompatible versions between a new version of your mod and an older version of KW. It's gone now. :)

Edited by LostOblivion
Link to comment
Share on other sites

Latest TweakableEverything, latest KW Rocketry, DecoupleForx64 and this time I have ToadicusTools installed. In case it's not clear from the image, decoupelrs are firing.

ChvyaDr.png

Your move :P

Full output log here (it's a big one as I'd done some messing around before this, sorry).

EDIT: Interestingly, this only happens when loading the subassembly - if I build the same thing from scratch, there's no issue. Don't know if that's helpful, but there you go.

Edited by ObsessedWithKSP
Link to comment
Share on other sites

I do not use decoupleforx64. Never even heard of it. The problem may or may not be IR's version of tweakscale. I'll get back to you on this if it persists.

That's the decoupler fix for 64-bit Windows versions of KSP which have a bug where in the stock game, decouplers will fire and have zero effective force. It's by Sarbian & Toadicus.

Link to comment
Share on other sites

I'll get you one soon.

Edit: Nevermind, it was actually the radial decouplers that were puffing. Also, I think the weird double-jet from the KW part I saw earlier was because of incompatible versions between a new version of your mod and an older version of KW. It's gone now. :)

Your move :P

EDIT: Interestingly, this only happens when loading the subassembly - if I build the same thing from scratch, there's no issue. Don't know if that's helpful, but there you go.

So I'm pretty sure you were both having the same issue, and I'm pretty sure Squad's new "fix mis-ordered PartModules" code is to blame, as NathanKell hints here.

My understanding / conjecture is thus:

  • User has a .craft file from an older version, or without mods installed.
  • Mods use ModuleManager to replace a module on parts used in the .craft file.
  • When loading the craft file, KSP detects that the modules referenced in the .craft file (e.g. ModuleDecouple) are not present in the part's prefab (e.g. having been replaced by DecoupleForX64 with ModuleDecoupleX64).
  • KSP "fixes" the inconsistency

At that point TweakableDecouplers has out of date information and fails to start up. I need to make it fail a bit more gracefully, but that notwithstanding it isn't going to work. DecoupleForX64 isn't going to work either; if you uninstalled TE, loaded that assembly and launched it, none of your decouplers would work.

So, the moral of this story is: if you are using mods that change part functionality, especially if those mods use ModuleManager, you cannot use old or un-modded .craft files because KSP will break them. I'ma go put that on the first post.

That's the decoupler fix for 64-bit Windows versions of KSP which have a bug where in the stock game, decouplers will fire and have zero effective force. It's by Sarbian & Toadicus.

Credit where it's due: Sarbian wrote it, not me. All I did was contribute a couple fixes for the MM patch. ;)

Link to comment
Share on other sites

So I'm pretty sure you were both having the same issue, and I'm pretty sure Squad's new "fix mis-ordered PartModules" code is to blame, as NathanKell hints here.

My understanding / conjecture is thus:

  • User has a .craft file from an older version, or without mods installed.
  • Mods use ModuleManager to replace a module on parts used in the .craft file.
  • When loading the craft file, KSP detects that the modules referenced in the .craft file (e.g. ModuleDecouple) are not present in the part's prefab (e.g. having been replaced by DecoupleForX64 with ModuleDecoupleX64).
  • KSP "fixes" the inconsistency

Modules added via ModuleManager should be in the prefab because they were added to the part's configuration node before the part was compiled.

It's (probably) only when we do part.AddModule("ModuleMySuperUltraCoolModule") that they're not in the prefab.

That's always been the source of those 'cannot load module #x, the part only has y modules' warnings. Or was, I haven't seen any since 0.24

At any rate, I've been thinking we should be adding to the prefabs instead, if we can.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...