Jump to content

[1.3.1] VesselCategorizer v1.1.1: Choose vessel type in the editor, or automatically based on ship name.


Snark

Recommended Posts

What it does

  • Lets the user choose vessel type (i.e. probe, base, station, etc.) via UI in the vehicle editor.
  • Can automatically set vessel type from ship name, based on customizable configuration.

Download from SpaceDock
License: MIT
Source code

 

Player-selectable vessel type

All command pods and probe cores have a "Vessel Type" selector on their menu in the vehicle editor:

screenshot.png

...just choose whichever you like. Your choice will be saved with the ship. When you launch it, it will have whatever ship type you chose.

One of the available choices (the default one, in fact) is simply "Default". When that's chosen, then the ship type will be chosen as usual based on what parts it contains, unless there's a name-based setting (see below).

 

Automatic vessel type based on name

Unless you've manually chosen a specific vessel type in the editor (see above), the mod looks at your vessel name to see if it can automatically set the vessel type for you.

vesselName.png

By default, it looks for one of the following strings in the vessel name, and sets the vessel type to what you'd expect:

  • Lander
  • Station
  • Base

...However, the player can easily customize it to add their own strings, either by directly editing the config, or by patching it with ModuleManager. For example, suppose you routinely name your unmanned interplanetary probes with "Pioneer" or "Surveyor" in their names, and you want to designate such ships as the "probe" type. You could use ModuleManager config like this:

@VesselCategorizer:AFTER[VesselCategorizer] {
    @NamingRules {
        Probe = surveyor
        Probe = pioneer
    }
}

For tips on how to write your own config, see the comments in the default config file that comes with the mod.


 

How to install

Unzip the contents of "GameData" to your GameData folder, same as with most mods.  (Note, includes ModuleManager.)

 

Why I wrote it

It's one of those minor itches that bugs me every time I play KSP.  I don't enjoy having to manually tinker with ship type; I want it to just magically be what I want it to be.  Examples of things that bug me:

  • I use relay antennas instead of direct ones, wherever possible, because it lets my probes do double duty as relays.  But KSP then makes all of my probes into "relay" ship type, which is not what I want.
  • I launch stations.  There's no way for the stock game to automatically set "station" type.
  • I often make landers that don't have a "lander can" on them... so the stock game doesn't call them landers.
  • I play in career mode, which means that only 0.625m probe cores are available until very late game.  Which means I always have to tuck my probe cores inside service bays.  Which makes them a pain in the posterior to rename the ship.  (Have to open the bay, find the core, change the type, close the bay.  Every. Single. Blessed. Time.)  :mad:
  • I'm an OCD consistency freak, and have a fairly standard naming scheme for my ships.  So a name-based vessel categorizer is right up my alley.

 

 

Edited by Snark
Update to v1.1.1. Change license to more permissive MIT. No other changes.
Link to comment
Share on other sites

I see no reason why it wouldn't.  I'm guessing it probably would.  But am running 1.3 myself, so I have no actual first-hand knowledge there.  All I can say is, "try it and see".  :wink:

Link to comment
Share on other sites

Hi all,

I'm pleased to announce the release of VesselCategorizer v1.1.  The main new feature is UI in the vehicle editor to let you choose what vessel type you want:

screenshot.png

...just choose whichever you like. Your choice will be saved with the ship. When you launch it, it will have whatever ship type you chose.

One of the available choices (the default one, in fact) is simply "Default". When that's chosen, then the ship type will be chosen as usual based on what parts it contains, unless there's a name match.

(Note, this update adds ModuleManager 2.8.1 to the download, since MM is needed in order to enable the new feature.)

Enjoy!  :)

Link to comment
Share on other sites

Hey, nice update! I was kinda "meh" about the auto-categorize feature, since my naming schemes are all over the place and may or may not follow coherent rules for any given series of launches. But manually setting vehicle type in the editor sounds great.

Link to comment
Share on other sites

6 hours ago, White Owl said:

I was kinda "meh" about the auto-categorize feature, since my naming schemes are all over the place and may or may not follow coherent rules for any given series of launches. But manually setting vehicle type in the editor sounds great.

lol, yeah, you're not the only one.  I kinda figured that out after watching a couple of days go by with like two downloads per day.  :)

To be frank, I was kinda "meh" about it myself.  "Pick the ship type in the VAB" is the feature I actually wanted, myself.  I just did the name thing first because it seemed easier, and had managed to (erroneously) convince myself that the VAB thing would be too hard, until I had a brainstorm.

Various maunderings on the subject in a spoiler section, for the curious.

Spoiler

See, "choose the vessel type in the VAB" seems like such an obvious, simple, and necessary feature that it bugged me for years that they don't have it in the stock game.  I would fantasize about what the UI would look like.  (Okay, okay, I have pretty dull fantasies these days.  I guess I'm just a boring person, or perhaps it's an occupational hazard of getting old.)  The "right" design seemed clear and obvious to me:

  • Have an additional tab up at the top of the editor screen, right next to the one that shows the ship's current flag.
  • It would show the icon of the ship's current vessel type.
  • Clicking the button on the tab would open a drop-down of all the icon buttons, and you just click on the one you want.

So I spent all that time picturing exactly that feature in my head, and I guess I did it so long that it kinda channelized my thinking and I got fixated on that exact image.  So every time I pictured writing a mod (which is my usual response to "I wish the game would do X") to address the matter, I pictured implementing that specific UI.  Which intimidated me, since implementing that UI would require doing a bunch of futzing around with Unity UI coding, which is a big area of ignorance for me.  I know nothing about it, having successfully managed to avoid needing to do anything with it up to this point.  I do like learning things, but I was pretty sure that implementing this would be a steep learning curve, taking a lot of my time and requiring a lot of tedious debugging.  So I just never got around to implementing it:  the lack of the feature is a relatively minor annoyance, and the pain of not having it never came close to reaching the perceived pain of trying to implement the UI I wanted.  (Plus I kept hoping that Squad would just add the feature and save me the hassle.)  :wink:

However, after releasing the simple name-based categorizer in this mod, and seeing that practically nobody wanted it (the download rate was probably the most pathetic of any mod I've released), that spurred me to take a fresh look at the problem ("hmmm, is there any other way I could make this work?"), and then I had the little brainstorm of "heeeeyyyyyy, what if I put a button on the command pod menu to do this?"  Having that idea changed everything:

  • First, it seems to me that it's actually not a bad UI model:  it's unintrusive (which I like), and (more importantly) it's actually pretty consistent with existing game behavior.  If you're in the flight scene (as opposed to the editor), and you want to change the ship icon, what do you do?  You click on a command pod and press a button.  So, just do the (nearly) same thing in the editor, and Bob's your uncle.
  • Second, and crucially, it's easy for me to code.  No Unity UI hackery required.  The KSP API has nice hooks for adding buttons and such to part menus, so I could add the feature to the right-click menu pretty easily with just a few lines of code.  It was one of the easiest mods I've ever written.

So anyway, yeah, I'm pretty happy with the new feature, myself.  Not only do I now have essentially the feature I've always wanted, but I think it's a lot more useful to other folks this way, too-- the download rate has shot up remarkably.

So, yay!  :)

Link to comment
Share on other sites

9 hours ago, garwel said:

Is it compatible with KCT?

No clue, since I don't happen to use that mod myself.  (Kerbal Construction Time, for anyone who didn't catch that reference.)

I see no reason why it wouldn't, but that's no guarantee, since I don't know how KCT is implemented-- specifically, I don't know exactly how KCT launches its ships. "Try it and see," is about the only advice I can offer.

9 hours ago, garwel said:

Have any plans to put it on CKAN?

Oh, the temptation to make a smart-aleck response... :wink:

Anyway, yes, it's already there-- has been since I first published it, like all my mods. SpaceDock makes it really easy to do, basically just check a little checkbox when publishing, then forget about it.

Link to comment
Share on other sites

On 24/08/2017 at 11:08 AM, Snark said:

I'm an OCD consistency freak

I'd never noticed :rolleyes: 

On 24/08/2017 at 11:08 AM, Snark said:
  • I play in career mode, which means that only 0.625m probe cores are available until very late game.  Which means I always have to tuck my probe cores inside service bays.  Which makes them a pain in the posterior to rename the ship.  (Have to open the bay, find the core, change the type, close the bay.  Every. Single. Blessed. Time.)  :mad:

I don't mind the rest so much, but oh this

Link to comment
Share on other sites

11 hours ago, Snark said:

Anyway, yes, it's already there-- has been since I first published it, like all my mods. SpaceDock makes it really easy to do, basically just check a little checkbox when publishing, then forget about it.

Is it just me then who doesn't see the mod on CKAN, not even in the ALL list? Possibly, there is something wrong with its dependencies (the only one, I understand, is MM).

Link to comment
Share on other sites

11 minutes ago, garwel said:

Is it just me then who doesn't see the mod on CKAN, not even in the ALL list? 

No idea.  Have never used CKAN myself and never will; don't know what it looks like when it's installed, don't even know what an "ALL list" is (nor do I need to know, since I'm not a CKAN user).

I just check the little "CKAN" checkbox on SpaceDock when I'm publishing my mod, and leave it at that, and trust that it all just magically works.  I'm pretty sure that my other mods are working properly with CKAN (for example, when I release a new BetterBurnTime version, there's generally a surge of well over a thousand downloads within a few hours-- I assume those are CKAN people, I doubt that there are thousands of people monitoring my forum thread here!)  :wink: 

So my guess would be "it's just you".  Another possibility would be if SpaceDock had just recently broken its CKAN integration somehow, but if that were the case, I expect there would be lots of people yelling about it (perhaps you could check over at the SpaceDock thread).  (Or maybe CKAN is really slow these days, and it takes a week or more to propagate?  I only published this mod a few days ago.)

What I'm pretty sure it's not, is anything about my mod specifically.  I just check the checkbox, same as with all my mods.  (And even if there were something up with my mod... it's not as though I could do anything about it.  It's SpaceDock that handles all that CKAN stuff.)

11 minutes ago, garwel said:

Possibly, there is something wrong with its dependencies (the only one, I understand, is MM).

This seems unlikely to me (though admittedly I know nothing of the actual nuts-and-bolts of how CKAN works).  Yes, my mod requires MM to run... but I would guess that CKAN doesn't actually know that it needs MM, because, 1. I bundle MM inside my mod (so I don't need any dependency management there), and 2. I certainly haven't provided any special metadata files to CKAN telling them "I use MM", so I doubt it even knows.  (Plus there's the fact that I have other MM-bundling mods, such as IndicatorLights, which seem to work just fine on CKAN and always have.)

 

Link to comment
Share on other sites

On 9/6/2017 at 4:30 AM, Snark said:

 

Anyway, yes, it's already there-- has been since I first published it, like all my mods. SpaceDock makes it really easy to do, basically just check a little checkbox when publishing, then forget about it.

I wish it was that simple.  Unfortunately, the file generated by spacedock rarely works, so I had to create a new one and put it into ckan.

 

Link to comment
Share on other sites

On 9/7/2017 at 8:24 PM, linuxgurugamer said:

I wish it was that simple.  Unfortunately, the file generated by spacedock rarely works, so I had to create a new one and put it into ckan.

 

Major thanks for that, it's a tremendous service you just did.  :)

(Next time I'm ready to publish a mod, I guess I'll come pester you for technical details about how to tell if CKAN is set up correctly and how to fix it if it isn't.)

Link to comment
Share on other sites

10 hours ago, Snark said:

Major thanks for that, it's a tremendous service you just did.  :)

(Next time I'm ready to publish a mod, I guess I'll come pester you for technical details about how to tell if CKAN is set up correctly and how to fix it if it isn't.)

Just ping me

Link to comment
Share on other sites

  • 5 months later...
19 hours ago, PocketBrotector said:

Am I right in thinking that this mod has been obviated by the new vessel-naming features in 1.4?

Pretty much, yeah.  :)

This mod does two things:

  • let you set the vessel type explicitly in the editor
  • auto-set the vessel type based on its name

Of the two:  the former is completely obviated by the new 1.4 feature, and would probably arm-wrestle unpleasantly with it if you tried to use it.  The latter function is still there... but it uses the implementation of the first, so I'm not sure how well it would work now that 1.4 has its feature.

I'd say that it's sufficient to consider this mod basically dead, now.  At some point, I may get around to re-working it so that the "auto-categorize based on ship name" works with the new stock 1.4 implementation... but it's not super high on my priority list and I wouldn't hold your breath.   :wink:

 

Link to comment
Share on other sites

  • 3 weeks later...
On ‎11‎/‎03‎/‎2018 at 5:10 AM, Snark said:

Pretty much, yeah.  :)

This mod does two things:

  • let you set the vessel type explicitly in the editor
  • auto-set the vessel type based on its name

Of the two:  the former is completely obviated by the new 1.4 feature, and would probably arm-wrestle unpleasantly with it if you tried to use it.  The latter function is still there... but it uses the implementation of the first, so I'm not sure how well it would work now that 1.4 has its feature.

I'd say that it's sufficient to consider this mod basically dead, now.  At some point, I may get around to re-working it so that the "auto-categorize based on ship name" works with the new stock 1.4 implementation... but it's not super high on my priority list and I wouldn't hold your breath.   :wink:

 

soooo... congrats? (I think)

Link to comment
Share on other sites

On 3/10/2018 at 1:10 PM, Snark said:

I'd say that it's sufficient to consider this mod basically dead, now.  At some point, I may get around to re-working it so that the "auto-categorize based on ship name" works with the new stock 1.4 implementation... but it's not super high on my priority list and I wouldn't hold your breath.   :wink:

I’d say “retired” instead of “dead,” it’s a more pleasant word and you can bring it back later if, for some odd reason, you prefer writing code for us ungrateful dogs over playing KSP. Without becoming a Necromancer, I mean.

I assume the dream of most mod developers: now that Squad does it, I don’t have to do it.

Link to comment
Share on other sites

2 minutes ago, Kerbart said:

I’d say “retired” instead of “dead,” it’s a more pleasant word and you can bring it back later if, for some odd reason, you prefer writing code for us ungrateful dogs over playing KSP.

Yeah, but I said "dead" because "retired" feels like it may be giving false hope regarding the likelihood that I'll dust it off again.  Frankly, now that we've got the new naming mechanic in KSP 1.4, my motivation to spend time on this just to bring back the "auto-categorize based on vessel name" feature is pretty small.  So I think "dead" does a better job of capturing how likely it is to be brought back, i.e. not very.

(cue the "Bring out your dead!" scene from Monty Python and the Holy Grail.  "'Ere, now, 'e says 'es not dead!")

4 minutes ago, Kerbart said:

I assume the dream of most mod developers: now that Squad does it, I don’t have to do it.

Certainly it is, for me:)

And I've had pretty good luck thus far.  This is the third mod of mine that's been rendered obsolete by the stock game adding stuff.  (After RadiatorToggle and EveBiomesPlus.)

Link to comment
Share on other sites

2 minutes ago, Kerbart said:

Expect requests for a VAB dV calculator to be flooding your inbox... :wink:

It already exists.  It's called KER.  And I won't be doing it, ever, for the same reason I didn't do it in BetterBurnTime:  Because, 1. I don't need it myself, and 2. it's really complicated and time-consuming to code, and 3. it's already been done, in a very popular mod that everyone and his brother tends to run.  :wink:

Link to comment
Share on other sites

1 hour ago, Snark said:

Yeah, but I said "dead" because "retired" feels like it may be giving false hope regarding the likelihood that I'll dust it off again.  Frankly, now that we've got the new naming mechanic in KSP 1.4, my motivation to spend time on this just to bring back the "auto-categorize based on vessel name" feature is pretty small.  So I think "dead" does a better job of capturing how likely it is to be brought back, i.e. not very.

(cue the "Bring out your dead!" scene from Monty Python and the Holy Grail.  "'Ere, now, 'e says 'es not dead!")

Certainly it is, for me:)

And I've had pretty good luck thus far.  This is the third mod of mine that's been rendered obsolete by the stock game adding stuff.  (After RadiatorToggle and EveBiomesPlus.)

I see it as a complement of your vision, @Snark!

Link to comment
Share on other sites

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