Jump to content

[1.3.0] Launch Numbering 0.4.0


Recommended Posts

On 13/08/2017 at 4:36 AM, Gora511 said:

I'm curious, how does the mod handle the names ending with a dash (-)? For example, if I want to use the same style as the STS-XXX mission numbering that NASA used in the space shuttle era.

At the moment, if you had a base name of "STS-" then it would still just append a space and sequential numbers.

 

For what you're wanting, would we be looking for a few more options to tick/untick, along the lines of "Do not use space separator between name and number" and "pad number with <X> leading zeroes"? I could probably look at adding those next weekend, if that's what you're after. If not, could you try to describe what you're after in more detail please?

Link to comment
Share on other sites

2 hours ago, Damien_The_Unbeliever said:

At the moment, if you had a base name of "STS-" then it would still just append a space and sequential numbers.

 

For what you're wanting, would we be looking for a few more options to tick/untick, along the lines of "Do not use space separator between name and number" and "pad number with <X> leading zeroes"? I could probably look at adding those next weekend, if that's what you're after. If not, could you try to describe what you're after in more detail please?

Why not use a very simple template, something like this:

anytexhere<<#>>anytexthere

Where you would replace the  <<#>> with the number.  The first would be how many leading zeros to put there.  So for example:

STS-<<0>>

Would generate names like:

STS-1

STS-2

etc.

and:

STS-<<1>>

would generate names like:

STS-01

STS-02

etc

 

You could get fancy and start having two numbers, the first number being the major number, and use the minor number for variants.  But that may be getting too far beyond what you want to do, cause then you have to start figuring out  how to determine variants.

Edited by linuxgurugamer
Link to comment
Share on other sites

3 hours ago, linuxgurugamer said:

You could get fancy and start having two numbers, the first number being the major number, and use the minor number for variants.  But that may be getting too far beyond what you want to do, cause then you have to start figuring out  how to determine variants.

Well, I already try to assign launch numbers and bloc numbers (variants - not guaranteed to detect changes but seems to work most of the time).

I want to try to keep the mod settings accessible for people who don't think like programmers. I could perhaps look at two modes for naming - one where I apply the current heuristics and the other to use some form of format string. I'll add it to this weekend's list :-). It's a long weekend here in the UK.

Edited by Damien_The_Unbeliever
Link to comment
Share on other sites

37 minutes ago, Damien_The_Unbeliever said:

Well, I already try to assign launch numbers and bloc numbers (variants - not guaranteed to detect changes but seems to work most of the time).

I want to try to keep the mod settings accessible for people who don't think like programmers. I could perhaps look at two modes for naming - one where I apply the current heuristics and the other to use some form of format string. I'll add it to this weekend's list :-). It's a long weekend here in the UK.

Oh, I didn't realize you had bloc numbers already.

I would suggest that you use something like:

<<launchNumber>>

and

<<blocNumber>>

or

[launchNumber]   &  [blocNumber]

Internally you should use the format string, but maybe have an easy mode where there are a few standard format strings to select from.

Link to comment
Share on other sites

 

 Since you are looking into that, a few more option for numbering scheme would be welcomed.

Lets take a design named "vessel" 2nd launch, 3rd variant some option may be:

Vessel 2(III)

Vessel III 2

Vessel 3.2

2nd Vessel III

Vessel Bloc3 Flight2

 

 

 

 

Link to comment
Share on other sites

On 8/23/2017 at 1:02 PM, Damien_The_Unbeliever said:

Well, I already try to assign launch numbers and bloc numbers (variants - not guaranteed to detect changes but seems to work most of the time).

I want to try to keep the mod settings accessible for people who don't think like programmers. I could perhaps look at two modes for naming - one where I apply the current heuristics and the other to use some form of format string. I'll add it to this weekend's list :-). It's a long weekend here in the UK.

Yeah, it's pretty good at detecting changes and discriminating between those and just relocating an item.  I've done something as simple as changing the type of parachute, and it's assigned a new Bloc number.  OTOH, just moving something from one location on the craft to another doesn't trigger a Bloc change (this is a GOOD thing).

Link to comment
Share on other sites

  • 2 weeks later...

Ok, so a couple of comments, I was just testing this for my use:

  1. Initial vessel of a series does not have a number.  Maybe put in an option to the settings to always number vessels
  2. If the last digit of a vessel name is a digit, it doesn't assign any numbers.  This is, IMHO, not great.  At least provide an option in the settings about it
  3. Having a standard format for the numbering is fine, until someone wants something different.  I suggest creating a very simple template which would have three substitutable values:
  1. <<name>>
  2. <<launchNumber>>
  3. <<blocNumber>>

or

  1. [name]
  2. [launchNumber]
  3. [blocNumber]

Using these, and a single rule that text immediately in front of a field is only used if the field itself has data, a simple default template to do the same as what you currently have would be:

<<name>> <<launchNumber>>-<<blocNumber>>

[name] [launchNumber]-[blocNumber]

so, given a name:   My Big Launcher

the final result would be (for launch 2, bloc 3):

My Big Launcher 2-3

You can have the template in a config file, where people can change it if they want, but if they don't, then they won't see any change.  This would allow the people who don't want to be technical to use the mod, while those who want a bit more customizations to have it available

Link to comment
Share on other sites

@Damien_The_Unbeliever

I've made the following changes for myself:

1.  Added the following new options in the Settings screen:

  • Add number even if last char is a digit
  • Add number even for first vessel in series
  • Add option for number of leading zeros for launch number (not more than 2)
  • Add option for number of leading zeros for bloc number (not more than 2)

2. Created a simple templating system to make it fully configurable by reading a template from a file.  The template I have replicates what you have in code

 

If you'd like, I can send you a PR with the changes

On 8/29/2017 at 9:40 AM, SaintWacko said:

Would it be possible to add something to the config where it can be toggled based on launchpad? I love this for my rockets, but I'd rather not have it on my aircraft.

I'll add this to my local copy, will make it available on github when completed

On 7/5/2016 at 7:51 AM, TheCardinal said:

A nice mod! It does have a small downside. After reverting a craft (for a designchange f.e.), the mod does not revert the number. At the next launch the number is increased again.

 

Not sure what happened with you, when I tested this, it does revert.

Link to comment
Share on other sites

For anyone who is interested, I've been modifying this for my own use, and have a version available for KSP 1.3

It is available here:  https://github.com/linuxgurugamer/KSPLaunchNumbering/releases/tag/u1

If you have any problems with this, please contact me, not the original author

The changes include:

  1. Moved actual processing of new name into new method: ProcessTemplate
  2. Added template processing, default template matches original code
  3. Added new settings options:
    1.     addAlways
    2.     addToFirstVessel
    3.     Minimum # of digits for launch number
    4.     Minimum # of digits for bloc number
    5.     ActiveOnLaunchpad
    6.     ActiveOnRunway
    7.     ActiveOnExternalLaunchpad (used by EPL)
Link to comment
Share on other sites

On 14/09/2017 at 5:35 PM, linuxgurugamer said:

@Damien_The_Unbeliever

I've made the following changes for myself:

1.  Added the following new options in the Settings screen:

  • Add number even if last char is a digit
  • Add number even for first vessel in series
  • Add option for number of leading zeros for launch number (not more than 2)
  • Add option for number of leading zeros for bloc number (not more than 2)

2. Created a simple templating system to make it fully configurable by reading a template from a file.  The template I have replicates what you have in code

 

If you'd like, I can send you a PR with the changes

 

Sorry for not getting back sooner. A PR is of course welcome. I should be able to find time this weekend to look it over.

It was only recently that more suggestions came forward - at the same time that 1.3.1 is also being beta'd. I wanted to wait for 1.3.1 to go live before putting out the next release.

Link to comment
Share on other sites

3 hours ago, Damien_The_Unbeliever said:

Sorry for not getting back sooner. A PR is of course welcome. I should be able to find time this weekend to look it over.

It was only recently that more suggestions came forward - at the same time that 1.3.1 is also being beta'd. I wanted to wait for 1.3.1 to go live before putting out the next release.

I'll get a PR to you over the weekend

Link to comment
Share on other sites

On 9/15/2017 at 1:02 PM, Damien_The_Unbeliever said:

Sorry for not getting back sooner. A PR is of course welcome. I should be able to find time this weekend to look it over.

It was only recently that more suggestions came forward - at the same time that 1.3.1 is also being beta'd. I wanted to wait for 1.3.1 to go live before putting out the next release.

Ok, PR is done.

I had to redo the repo since I had changes in there which I didn't want you to have to deal with (Visual Studio changes only)

The .gitignore has been modified to ignore all VS files, you may want to remove those lines (at the end)

Looking forward to an official release of this (if you like it)

Edited by linuxgurugamer
Link to comment
Share on other sites

  • 1 month later...
On 21/10/2017 at 7:48 AM, linuxgurugamer said:

@Damien_The_Unbeliever

any idea when you will have a chance to look at the PR I submitted last month?

Apologies. I don't think I've managed to open KSP for several weeks due to outside events. I hope I'll be able to look into this on Thursday (UK time). Apologies for the frustration.

Link to comment
Share on other sites

  • 1 month later...
56 minutes ago, JoshuaRaven said:

@linuxgurugamer did you remove your custom release in anticipation of your changes being merged upstream? Just asking, since I'd like to use your changes, but see (assume?) that @Damien_The_Unbeliever hasn't found the time yet to merge and release your changes (which is totally fine, I want to add).

Looks like I did.

I can rebuild it, but it would be for 1.3.1, would that be ok for you?

Link to comment
Share on other sites

here you go:

For all who don't know what this is, this is my UNOFFICIAL rebuild with some changes:

  • Updates to add templates, see the new file Changelog.txt for complete details
  • Moved actual processing of new name into new method: ProcessTemplate
  • Added template processing, default template matches original code
  • Added new settings options:
    • addAlways
    • addToFirstVessel
    • Minimum # of digits for launch number
    • Minimum # of digits for bloc number
    • ActiveOnLaunchpad
    • ActiveOnRunway
    • ActiveOnExternalLaunchpad (used by EPL)
       

https://github.com/linuxgurugamer/KSPLaunchNumbering/releases/tag/u2

 

And I'm going to PM the author about this again

Link to comment
Share on other sites

  • 4 months later...
  • 3 weeks later...
On 12/12/2017 at 7:40 AM, linuxgurugamer said:

here you go:

For all who don't know what this is, this is my UNOFFICIAL rebuild with some changes:

  • Updates to add templates, see the new file Changelog.txt for complete details
  • Moved actual processing of new name into new method: ProcessTemplate
  • Added template processing, default template matches original code
  • Added new settings options:
    • addAlways
    • addToFirstVessel
    • Minimum # of digits for launch number
    • Minimum # of digits for bloc number
    • ActiveOnLaunchpad
    • ActiveOnRunway
    • ActiveOnExternalLaunchpad (used by EPL)
       

https://github.com/linuxgurugamer/KSPLaunchNumbering/releases/tag/u2

 

And I'm going to PM the author about this again

LGG, I've been using this fork in 1.3.1.

Just now I brought up what would have been the 10th flight of a vessel, and it number it -0A.

R621eHA.png

Which I thought was odd, I didn't recall setting the number system to Hex.

This is the first listing of Myros-0A in the logs:

[LOG 22:17:40.728] 5/1/2018 10:17:40 PM,AmpYear,OnVesselRollout
[LOG 22:17:40.730] RenameVessel, vessel.landedAt: LaunchPad
[LOG 22:17:40.734] template: {[name]}{-[launchNumber]}{ (Bloc [blocNumber])}
[LOG 22:17:40.736] vesselName: Myros-0A
[LOG 22:17:40.912] Flight State Captured

 

I reverted to the KSC scene, and when I went to open the settings menu for Launch Numbering, the game crashed to Desktop.   Now I'm doing another 15 minute load of the game to see what the issue is.

Also a request for you or @Damien_The_Unbeliever, instead of doing bloc numbers, if I do a very minor edit to the vessel, I'd like it to just continue with the numbering scheme in the name.  Optional perhaps?

 

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...