TweakScale

TweakScale

1M Downloads

New bug related to IVA and Cameras when TweakScale is installed

Lisias opened this issue ยท 12 comments

commented

From KSP 1.4.x (tested on KSP 1.4.3) to KSP 1.12.3, if the user saves the game (or quicksave) while the camera is focused on a Breaking Ground Inventory part I[EDIT: nope! to any craft!!]*, once the user load it back all Crafts with IVA are screwed up until the user saves the game again and reload, but with the camera focusing something else (as a Kerbal or a Craft with normal parts).

Switching to the Tracking Station and reselecting a craft from there is also reported to fix the misbehaviour.

How to reproduce

1

Build a minimal craft like this (this craft is available on the savegame below). Shove on some inventory one of the parts of the Cargo Category depicted below:

screenshot35

2

Launch the thing:

screenshot36

3

Do a EVA, and grasp the part into the Kerbal's inventory:

screenshot37

4

Drop the part into the ground:

screenshot38

screenshot39

5

Go back to the craft and board it:

screenshot40

screenshot41

Note the portrait on the bottom right.

6

Do a quicksave, and then reload from it:

screenshot42

screenshot43

7 Evidence of Good Behaving

Note that the Kerbal is being shown on the Portrait, and by hitting "C" the IVA is being displayed correctly.

screenshot44

screenshot46

8 Triggering the problem

Hit [ to switch to the Portable RTG (or whatever part you selected), do a quicksave and reload from it:

screenshot47

screenshot48

screenshot49

9 Problem triggered

Hit ] again to switch back to the Command Pod.

Note the Portrait is now full black, and the by hitting "C" (IVA), there's no IVA at all!

screenshot50

screenshot51

screenshot52

10 Restoring the good behaviour

Do another quicksave and reload from it:

screenshot53

screenshot54

Problem solved.

Switching into Tracking Station scene and from there to a vessel is also known to "fix" the problem.

Evidences

commented

The problem was simpler that that. Once you load a Savegame, all the crafts but the one was focused got the IVA screwed. The problem was happening using a Breaking Ground part just because it has no IVA, but anything, virtually anything being loaded up without the Camera focus lose the IVA!

It was detected a bad move on TweakScale code itself.

Savegame with the evidence:
bug-iva.zip

commented

The problem was reproduced downto KSP 1.7.3. Obviously, KSP 1.6.1 and older are not prone to the problem, as they doesn't have Breaking Ground.

commented

The triggering parts are not patched with TweakScale. So TweakScale definitively doesn't have an active role on the mess. Why, so, things goes south when you load a savegame where the focused craft has no TweakScale on it?

Obvious answer: because TweakScale is being lied about.

The same way that on Editor some data is lately initialised, way after TweakScale needs is (and so I had to cook the AttachedOnEditor stunt), as well Procedural Parts that it's also lying about the initial node attachments (screwing up KSP-Recall - that is trying to prevent add'ons from being screwing by another similar problem on KSP itself), now on Flight, when the first focused part has no IVA, some data is not initialised and TweakScale ends up being screwed up by the mishap the same.

The IVA vanishes because probably it's being scaled to 0, and it's being scaled to zero because someone lied to TweakScale about the real size of the IVA.

It's a working theory, but it fits. Now I need a way to prove it.

commented

The bug probably affects KSP 1.3.1 too - but didn't bored to check.

commented

Fixed on commit c046214

(damn!!!)

commented

Fellow Kerbonaut Jezzick found reported a new misbehaviour related to this issue on forum:

Steps to reproduce :

with a new KSP install

Install TweakScale and dependencies listed above

Start a new flight with the acapello stock rocket

upon flight scene initilization, Kerbal Portraits and IVA and Interior overlay are all empty

(Switching away from active scene and back fixes the issue - as mentioned in the github issue#246)

Logs were omitted as I detected they are not relevant to this problem.

However, the report missed this important step: the craft must be launched directly into the launchpad or runway - launching it from Editor does not triggers the problem!

I'm reopening this so.

commented

Heya!

I have this issue as well (the IVA portrait on bottom right being black and switching to IVA "Moving" the camera inside the ship but no interior existing)

However for me I don't need to follow any steps or anything. It just happens on every craft from the moment the game launches. I have quite a big mod list but simply removing TweakScale makes it work (that's how I got here, I removed a lot of mods to test/find what was wrong)

I'm using the latest game version and mod version as provided by CKAN

Let me know what other info you may need!

EDIT:
Yes, my issue is precisely the same as the one reported above that made you reopen the issue...

commented

Thanks for the report, @DaniAngione . It's indeed a bug on TweakScale, in some situations it's utterly screwing up the IVA scaling (I think it's using 0 as scale by accident).

commented

@Lisias I have the same problem. IVA will not working if I launch from Launchpad or Runway.

commented

I found myself having the same issue. Is there any quick way of fixing it? Love the mod btw!

commented

I found myself having the same issue. Is there any quick way of fixing it? Love the mod btw!

Sorry for that.

I'm still fighting to dig some time in order to fix this one - it appears to be a pretty stupid mistake on the code, some value not being initialised on a specific situation - so I need to burn time debugging the damned thing until I find the issue - and time for this is exactly what I'm short of right now.

A work around is to switch to Tracking Station and then back to the vessel. It's also a hint for where I need to start looking, by the way.

commented

Hey, while refactoring the IVA code in order to purse this issue, I ended up fixing it by accident!

See commit 082a1b6