Jump to content

[1.12.x] Champagne Bottle Redux


linuxgurugamer

Recommended Posts

  • 1 month later...

@linuxgurugamer - Either nobody but me uses this, or it's working fine for everyone else and my game is just strange. :D

I'm running into a bug in Champagne Bottle in 1.10.2 where it spits out a nullref when I select where I want English, Kerbal, or Both - clicking the button to start picking names causes the following error:

[ERR 23:40:56.996] [Toolbar] [ERROR] error while handling click event: ChampagneBottle_NS.champagneBottleButton
[EXC 23:40:56.997] NullReferenceException: Object reference not set to an instance of an object
	ChampagneBottle.ChampagneBottle.GenerateName () (at <155e214df2e4439f81e139276fafe74a>:0)
	ChampagneBottle.ChampagneBottle.OnAppLauncherTrue () (at <155e214df2e4439f81e139276fafe74a>:0)
	ToolbarControl_NS.ToolbarControl.SetButtonActive () (at <a925a118c9174edfb82f6b8781e2e04f>:0)
	ToolbarControl_NS.ToolbarControl.ToggleButtonActive () (at <a925a118c9174edfb82f6b8781e2e04f>:0)
	ToolbarControl_NS.ToolbarControl.button_Click (ToolbarControl_NS.ClickEvent e) (at <a925a118c9174edfb82f6b8781e2e04f>:0)
	ToolbarControl_NS.Button.clicked (System.Object realEvent) (at <a925a118c9174edfb82f6b8781e2e04f>:0)
	Toolbar.Command.click () (at <3b3a73f106c246ecb6e0b071fa9f6c5c>:0)
	UnityEngine.DebugLogHandler:LogException(Exception, Object)
	ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
	UnityEngine.Debug:LogException(Exception)
	Toolbar.Log:log(LogLevel, Exception, String, Object[])
	Toolbar.Log:error(Exception, String, Object[])
	Toolbar.Command:click()
	Toolbar.Button:click()
	Toolbar.Button:drawInToolbar(Rect, Boolean)
	Toolbar.Toolbar:drawButtons()
	Toolbar.Toolbar:draw()
	Toolbar.ToolbarManager:OnGUI()
[ERR 23:40:59.240] System.NullReferenceException: Object reference not set to an instance of an object
  at ChampagneBottle.ChampagneBottle.GenerateName () [0x00018] in <155e214df2e4439f81e139276fafe74a>:0 
  at ChampagneBottle.ChampagneBottle.WindowGui (System.Int32 windowId) [0x001d2] in <155e214df2e4439f81e139276fafe74a>:0 

Full log is here if you think the context will help: https://www.dropbox.com/s/lgofq36hcl1z1t8/KSPLog20210607.7z?dl=0

Reverting to the previous version of Champagne Bottle resolves the error.

A quick look at github shows you did change the code the error is complaining about, so I assume it's actually a legit bug this time. :D

 

Link to comment
Share on other sites

7 hours ago, etmoonshade said:

I'm running into a bug in Champagne Bottle in 1.10.2 where it spits out a nullref when I select where I want English, Kerbal, or Both - clicking the button to start picking names causes the following error:

Confirmed, working on a fix

Link to comment
Share on other sites

On 6/8/2021 at 7:33 AM, linuxgurugamer said:

New release, 0.3.11.1

  • Fixed Nullref which occurs when VesselNaming.FindPriorityNamePart(EditorLogic.fetch.ship) doesn't find a part (weird)
  • Removed old logging code
     

So, this next bug (which I casually mentioned on your stream yesterday) may be related to fixing the above:

When hitting the Champagne Bottle (CB) button in the VAB, my ship type reads as "debris" - a "D" suffix on the ship class. If I select my command pod and accept whatever vessel type is selected in "Configure vessel naming," CB will display the proper suffix.

Removing vessel naming will revert the ship type to to Debris. Selecting a different ship type will use whatever is auto-detecting.

Test scenarios in 1.10.2 (all on the same ship):

Incorrect: Place command pod, hit CB button, observe "D" vessel type (I suspect this is technically correct, since I'll bet KSP doesn't configure the naming when you place a command pod, but it's certainly unexpected behavior - I assume this is why you said it's "weird." Did you originally test the change you did in 1.11 but not 1.10? May be a difference between the versions...)

Correct: Configure vessel naming, accept, hit CB button, observe expected vessel type (ship, for a command pod.)

Technically correct: Configure vessel naming, remove naming, hit CB button, observe "D" vessel type (I assume that removing naming sets the vessel type to 0 or whatever debris is.)

Incorrect: Configure vessel naming, assign a type other than Ship (e.g. base or rover,) observe ship vessel type. Vessel type should be whatever was chosen in the naming config.

 

No useful logs this time - Champagne Bottle is only mentioned in loading. No nullrefs - no log messages about it at all, in fact. :D

Link to comment
Share on other sites

5 hours ago, etmoonshade said:

So, this next bug (which I casually mentioned on your stream yesterday) may be related to fixing the above:

When hitting the Champagne Bottle (CB) button in the VAB, my ship type reads as "debris" - a "D" suffix on the ship class. If I select my command pod and accept whatever vessel type is selected in "Configure vessel naming," CB will display the proper suffix.

Removing vessel naming will revert the ship type to to Debris. Selecting a different ship type will use whatever is auto-detecting.

Test scenarios in 1.10.2 (all on the same ship):

Incorrect: Place command pod, hit CB button, observe "D" vessel type (I suspect this is technically correct, since I'll bet KSP doesn't configure the naming when you place a command pod, but it's certainly unexpected behavior - I assume this is why you said it's "weird." Did you originally test the change you did in 1.11 but not 1.10? May be a difference between the versions...)

Correct: Configure vessel naming, accept, hit CB button, observe expected vessel type (ship, for a command pod.)

Technically correct: Configure vessel naming, remove naming, hit CB button, observe "D" vessel type (I assume that removing naming sets the vessel type to 0 or whatever debris is.)

Incorrect: Configure vessel naming, assign a type other than Ship (e.g. base or rover,) observe ship vessel type. Vessel type should be whatever was chosen in the naming config.

 

No useful logs this time - Champagne Bottle is only mentioned in loading. No nullrefs - no log messages about it at all, in fact. :D

Interesting.  I'll look into it, but it's quite possible that this is actually the cause of the previous bug, and may be a lot harder to fix than I expected.

But you provided a clue, so I'll look into it

 

Link to comment
Share on other sites

On 6/9/2021 at 10:39 AM, etmoonshade said:

So, this next bug (which I casually mentioned on your stream yesterday) may be related to fixing the above:

When hitting the Champagne Bottle (CB) button in the VAB, my ship type reads as "debris" - a "D" suffix on the ship class. If I select my command pod and accept whatever vessel type is selected in "Configure vessel naming," CB will display the proper suffix.

Removing vessel naming will revert the ship type to to Debris. Selecting a different ship type will use whatever is auto-detecting.

Test scenarios in 1.10.2 (all on the same ship):

Incorrect: Place command pod, hit CB button, observe "D" vessel type (I suspect this is technically correct, since I'll bet KSP doesn't configure the naming when you place a command pod, but it's certainly unexpected behavior - I assume this is why you said it's "weird." Did you originally test the change you did in 1.11 but not 1.10? May be a difference between the versions...)

Correct: Configure vessel naming, accept, hit CB button, observe expected vessel type (ship, for a command pod.)

Technically correct: Configure vessel naming, remove naming, hit CB button, observe "D" vessel type (I assume that removing naming sets the vessel type to 0 or whatever debris is.)

Incorrect: Configure vessel naming, assign a type other than Ship (e.g. base or rover,) observe ship vessel type. Vessel type should be whatever was chosen in the naming config.

 

No useful logs this time - Champagne Bottle is only mentioned in loading. No nullrefs - no log messages about it at all, in fact. :D

Please try this beta:

https://www.dropbox.com/s/53iatk3c468educ/Champagne-0.3.11.2-beta.zip?dl=0

Changes

  • Creates a VesselNaming class if none exist.
    • Sets vessel type to probe if first part found with a commandmodule can't have crew
    • Sets vessel type to shp if crew is possible
    • Does not work on vessels without a commandmodule
    • Removing vessel naming will revert ship time to Debris, this is KSP, not this mod

This isn't finished, but would like to have you check it out.  I'm not sure how to deal with the first commandmodule found being a probe and a following one having crew

Link to comment
Share on other sites

6 hours ago, linuxgurugamer said:

Please try this beta:

https://www.dropbox.com/s/53iatk3c468educ/Champagne-0.3.11.2-beta.zip?dl=0

Changes

  • Creates a VesselNaming class if none exist.
    • Sets vessel type to probe if first part found with a commandmodule can't have crew
    • Sets vessel type to shp if crew is possible
    • Does not work on vessels without a commandmodule
    • Removing vessel naming will revert ship time to Debris, this is KSP, not this mod

This isn't finished, but would like to have you check it out.  I'm not sure how to deal with the first commandmodule found being a probe and a following one having crew

I'll fire this up sometime today and kick the tires. Fighting another bug right now :/

If I understand the issue right based on your description, 1.10.1 isn't providing info on the ship's type in the VAB, so you're having to make a best guess based on the stats of the "top" command module (e.g. has crew = ship, no crew = probe) and you can't even extract/force the information otherwise?

In general, I think crew > not crew as far as naming goes - if I have crew on a ship, that's usually what I care about.

(also, thanks for giving this a look quickly - when I was complaining about bugs, I didn't mean this one though - dealing with KSPI-E being weird right now :D)

Link to comment
Share on other sites

50 minutes ago, etmoonshade said:

If I understand the issue right based on your description, 1.10.1 isn't providing info on the ship's type in the VAB, so you're having to make a best guess based on the stats of the "top" command module (e.g. has crew = ship, no crew = probe) and you can't even extract/force the information otherwise?

Not sure about 1.10.1, but that's essentially what's going on.

Link to comment
Share on other sites

Okay, kicked the tires on this a bit. And they exploded. I'm now missing a leg, thanks for that. :V

The automatic detection of crewed vs. non-crewed seems to be working correctly, but when applying the name from the CB interface (i.e. clicking the button with a name on it,) it doesn't appear to apply the name to the command module itself.

https://www.dropbox.com/s/52bq2vv4skhpobl/Annotation 2021-06-11 163819.png?dl=0

For what it's worth, I also had a bug at one point where the actual ship name (the text field at the top you can fill out) wouldn't actually save, but I can't reproduce it at this point. I'll let you know if I can.

Link to comment
Share on other sites

1 minute ago, etmoonshade said:

Okay, kicked the tires on this a bit. And they exploded. I'm now missing a leg, thanks for that. :V

The automatic detection of crewed vs. non-crewed seems to be working correctly, but when applying the name from the CB interface (i.e. clicking the button with a name on it,) it doesn't appear to apply the name to the command module itself.

https://www.dropbox.com/s/52bq2vv4skhpobl/Annotation 2021-06-11 163819.png?dl=0

For what it's worth, I also had a bug at one point where the actual ship name (the text field at the top you can fill out) wouldn't actually save, but I can't reproduce it at this point. I'll let you know if I can.

yuck.  It was a quick fix, seems that I'll have to do some more digging

I was actually just booting it up to do a test for something else, will look, but don't expect anything until Sunday at the earliest (although stranger things have happened).

 

And what's the old expression?  Break a leg?  :D

Also, craft file, please

 

Edited by linuxgurugamer
Link to comment
Share on other sites

To note, the same thing is occurring for me on 1.11.2 so it's not a KSP version thing.

Haven't gotten around to the beta yet, I'll do that and try to mock up a craft file with minimal mods when I'm free, but that won't be until Tuesday.  I'm using ReStock, so that may be part of it, as I believe I have at least one of the inline probe cores it adds in every ship I make.

Link to comment
Share on other sites

9 minutes ago, etmoonshade said:

Here you go, one that's stock: A Mk 1 command pod on top of a FL-T400:
https://www.dropbox.com/s/k8l09n5lr0nvud4/KSV SeriousCat's Claw.7z?dl=0

And it was actually pretty simple, I had to add the name to the VesselNaming class as well as the editor.

Expect a new beta soon

16 minutes ago, etmoonshade said:

Here you go, one that's stock: A Mk 1 command pod on top of a FL-T400:
https://www.dropbox.com/s/k8l09n5lr0nvud4/KSV SeriousCat's Claw.7z?dl=0

Beta 2:

https://www.dropbox.com/s/b2u085nj0fpwxvx/ChampagneBottle-0.3.11.2-beta2.zip?dl=0

Link to comment
Share on other sites

3 hours ago, BlooSkies said:

To note, the same thing is occurring for me on 1.11.2 so it's not a KSP version thing.

Haven't gotten around to the beta yet, I'll do that and try to mock up a craft file with minimal mods when I'm free, but that won't be until Tuesday.  I'm using ReStock, so that may be part of it, as I believe I have at least one of the inline probe cores it adds in every ship I make.

It actually is, I'm not sure which version this changed, but it was when they introduced the ability to name individual command pods/probe cores/etc.

Link to comment
Share on other sites

3 hours ago, linuxgurugamer said:

It actually is, I'm not sure which version this changed, but it was when they introduced the ability to name individual command pods/probe cores/etc.

I just meant in terms of, between 1.10 and 1.11. I had -- perhaps wrongly -- assumed you had been testing in 1.11 and not encountered the bug yourself or such.

The VesselNaming per command module thing goes all the way back to version 1.4, so I'm surprised this is only coming up now.

Link to comment
Share on other sites

11 hours ago, BlooSkies said:

I just meant in terms of, between 1.10 and 1.11. I had -- perhaps wrongly -- assumed you had been testing in 1.11 and not encountered the bug yourself or such.

The VesselNaming per command module thing goes all the way back to version 1.4, so I'm surprised this is only coming up now.

May it shows how little used the mod is ??

and no, I don’t have time to test in all versions.  

Link to comment
Share on other sites

On 6/11/2021 at 5:11 PM, linuxgurugamer said:

And it was actually pretty simple, I had to add the name to the VesselNaming class as well as the editor.

Expect a new beta soon

Beta 2:

https://www.dropbox.com/s/b2u085nj0fpwxvx/ChampagneBottle-0.3.11.2-beta2.zip?dl=0

Yup, it now assigns a vessel name properly without having to go in and configure naming, based on my testing. Or at least, I wasn't able to break it. :D

I think the only remaining complaint would be getting it to re-read the vessel type (assuming it still exists?) each time the CB window is opened so it can actually use the list of ship prefixes (which is a pretty minor complaint, all things considered. But hopefully another one of those "easy fixes".)

Link to comment
Share on other sites

56 minutes ago, etmoonshade said:

I think the only remaining complaint would be getting it to re-read the vessel type (assuming it still exists?) each time the CB window is opened so it can actually use the list of ship prefixes (which is a pretty minor complaint, all things considered. But hopefully another one of those "easy fixes".)

If a ship type is there, it doesn't try to do it again, it should use what's already there

If not, then a problem, can you do a short video demonstrating, please

Link to comment
Share on other sites

Finally made a video! Sorry, it's basically the setup I had from streaming. You might see some similarities...

https://www.dropbox.com/s/wo1x5ts43pu9fd4/2021-06-15 19-35-33.flv?dl=0

Instructions:

Build a simple ship. Let's say a command pod and a tank, like I sent before.

Change the command pod's type to a Station because, I dunno, I'm going to have a station with a command pod. Don't question me! :D

Hit the Champagne Bottle button - the mod still uses the "SV" type rather than the "SS" type.

 

Link to comment
Share on other sites

  • 1 month later...
  • 8 months later...
On 5/3/2016 at 12:44 PM, linuxgurugamer said:

The prefix is the shp class, based on  random first letter being one of the following:

M = Mankind's
S = System
K = Kerbal
HM = His/Her Majesty's
A = Alliance
I = International

followed by the shiptype:

D = Debris (should never appear)
SV = Space Vehicle
SP = Probe
RV = RoVer
LV = Lander Vehicle
SC = SpaceCraft
SS = Space Station
Col = Colony
AN = AstroNaught
F = Flag

 

I always have trouble giving my ships proper and descriptive names, so I quite like this mod. But I don't like how you get random prefixes with the names.

 

 

I would suggest the following, @linuxgurugamer:

Add two buttoms to the UI:

1) select planet (Kerbin, Mun, etc.) or system (Mankind, Alliance, International - like above)

2) select ship type (as above)

And only then generate the names.

 

That way you don't get all those prefixes which are totally irrelevant to this vessel. And I also always forget what the current prefixes stand for, if I can't select them myself / see them written out.

Edited by FasterThanFlourite
Link to comment
Share on other sites

On 3/31/2022 at 6:20 PM, FasterThanFlourite said:

I always have trouble giving my ships proper and descriptive names, so I quite like this mod. But I don't like how you get random prefixes with the names.

 

 

I would suggest the following, @linuxgurugamer:

Add two buttoms to the UI:

1) select planet (Kerbin, Mun, etc.) or system (Mankind, Alliance, International - like above)

2) select ship type (as above)

And only then generate the names.

 

That way you don't get all those prefixes which are totally irrelevant to this vessel. And I also always forget what the current prefixes stand for, if I can't select them myself / see them written out.

The mod already selects the names based on what's on the ship.

You can look at  this: 

 

 

which is a more advanced mod, it might do what you want

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...