Project

General

Profile

Bug #3872

Empty craft saved via name field causes argument rage exceptions when loaded.

Added by voltara over 9 years ago. Updated almost 8 years ago.

Status:
Closed
Severity:
Low
Assignee:
-
Category:
Gameplay
Target version:
-
Start date:
12/18/2014
% Done:

100%

Version:
Platform:
Linux
Expansion:
Language:
English (US)
Mod Related:
No
Votes:
Arrow u r green
Arrow d r red

Description

Updated for 1.0.5

The reproduce steps don't involve the save button. (The save button is not the only way to save a ship.) You can still save an empty ship in 1.0.5 by pressing "Enter" in the ship name input box in the VAB.

Although it doesn't break the Load button like before (as I reported originally), it still throws errors and exceptions to the logfile.
Try these revised instructions for 1.0.5:

Create a new sandbox game.
Enter the VAB.
Make sure this is a new "Untitled Space Craft" with no parts.
Click on the name of the ship (top center of screen)
Rename to "emptytest1"
Press the "Enter" key. This will save the empty ship, despite the "Save" button being greyed out.
Click "Load" and load the Dynawing (stock) model.
Click "Load" again, and load the "emptytest1" model by double-clicking "emptytest1" in the list. This will fail, and the GUI event (double click) will bubble up to the VAB editor, and grab part of the Dynawing ship for part placement.

What happens: It is possible to save an empty (no parts) craft in the VAB, even when the "Save" button is disabled. This prevents the VAB "Load" button from functioning until the bad file is deleted.

How to reproduce:
  • Enter the VAB.
  • Click the "New" button. Do not add any parts to the craft.
  • Click on the name of the craft ("Untitled Space Craft")
  • Press the "Enter" key. This saves the (empty) craft, even though the "Save" button is disabled.
  • Click the "Load" button. The load dialog will not appear, and an exception is logged to KSP.log.

Error log:

[ERR 17:26:05.606] [ShipTemplate]: Could not locate root part in Untitled Space Craft as 0 entries remain after eliminating all parts
                                   listed as children. This is probably wrong.

[EXC 17:26:05.606] NullReferenceException: Object reference not set to an instance of an object
        ShipTemplate.SetIfControllable ()
        ShipTemplate.LoadShip (.ConfigNode root)
        CraftBrowser+^O^K..ctor (System.IO.FileInfo ^A)
        CraftBrowser.buildCraftList ()
        CraftBrowser..ctor (Rect rect, EditorFacility facility, System.String profile, System.String title, .SelectedCallback onFileSelected,
                            .CancelledCallback onCancel, UnityEngine.GUISkin guiSkin, UnityEngine.Texture2D fileIcon, Boolean showFlagButton)
        EditorLogic.loadShip ()

History

#1 Updated by aureus over 9 years ago

Reproduced on OS X as well.

#2 Updated by sal_vager over 8 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

This is no longer reproducible as the save button was disabled in an empty editor scene in 1.0.0

#3 Updated by voltara over 8 years ago

The reproduce steps don't involve the save button. (The save button is not the only way to save a ship.) You can still save an empty ship in 1.0.5 by pressing "Enter" in the ship name input box in the VAB.

Although it doesn't break the Load button like before (as I reported originally), it still throws errors and exceptions to the logfile.

Try these revised instructions for 1.0.5:
  • Create a new sandbox game.
  • Enter the VAB.
  • Make sure this is a new "Untitled Space Craft" with no parts.
  • Click on the name of the ship (top center of screen)
  • Rename to "emptytest1"
  • Press the "Enter" key. This will save the empty ship, despite the "Save" button being greyed out.
  • Click "Load" and load the Dynawing (stock) model.
  • Click "Load" again, and load the "emptytest1" model by double-clicking "emptytest1" in the list. This will fail, and the GUI event (double click) will bubble up to the VAB editor, and grab part of the Dynawing ship for part placement.
[ERR 09:07:38.691] [ShipTemplate]: Could not locate root part in emptytest1 as 0 entries remain after eliminating all parts listed as children. This is probably wrong.

[ERR 09:07:38.691] emptytest1 has no root part defined, aborting

[ERR 09:07:38.691] [ShipTemplate]: Could not locate root part in emptytest2 as 0 entries remain after eliminating all parts listed as children. This is probably wrong.

[ERR 09:07:38.691] emptytest2 has no root part defined, aborting

[ERR 09:07:38.691] [ShipTemplate]: Could not locate root part in emptytest3 as 0 entries remain after eliminating all parts listed as children. This is probably wrong.

[ERR 09:07:38.691] emptytest3 has no root part defined, aborting

[LOG 09:07:41.866] emptytest1 loaded!
[EXC 09:07:41.866] ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
    System.Collections.Generic.List`1[Part].get_Item (Int32 index)
    EditorLogic.StartEditor (Boolean isRestart)
    EditorLogic.shipToLoadSelected (System.String path, System.String flagURL, LoadType loadType)
    CraftBrowser.drawList (Int32 id)
    UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style)

#4 Updated by sal_vager over 8 years ago

  • Subject changed from Saving empty craft in the VAB breaks the "Load" button until the craft file is deleted manually to Empty craft saved via name field causes argument rage exceptions when loaded.
  • Status changed from Resolved to New
  • Severity changed from Normal to Low
  • % Done changed from 100 to 0
  • Version changed from 0.90 to 1.0.5

Reopening this issue as I am able to reproduce this in 1.0.5 (build 1028)

Renaming to better reflect current behavior.

#5 Updated by sal_vager over 8 years ago

  • Description updated (diff)
  • Status changed from New to Confirmed
  • % Done changed from 0 to 10

Confirmed behavior on build 1028.

This issue can be worked around by loading another vessel.

#6 Updated by TriggerAu almost 8 years ago

  • Status changed from Confirmed to Needs Clarification
  • % Done changed from 10 to 0

#7 Updated by voltara almost 8 years ago

I can no longer reproduce this. I tried on version 1.1.3.1289, and:
  • Pressing the "enter" key in the vessel name field of the VAB no longer saves the vessel.
  • The name field is disabled when the vessel has no parts.

So it no longer seems possible to save an empty vessel.

Consider this issue resolved - thanks.

#8 Updated by TriggerAu almost 8 years ago

  • Status changed from Needs Clarification to Closed
  • % Done changed from 0 to 100

Thanks voltara

Also available in: Atom PDF