Jump to content

[1.7.*] Kerbal Occupation Colors version 1.0


Starwaster

Recommended Posts

Kerbal Occupation Colors

(Requires Breaking Ground DLC) 

This mod will automatically assign colors to the Breaking Ground Future Suit based on Kerbal occupation. Red for pilots, gold for engineers and blue for scientists. (totally not related to any Star Trek colors :blush:) This mod will not affect your ability to edit your Kerbal's suit colors in the field and those will still be persistent.

You can edit the default colors in the KerbalOccupation.cfg file. See the README.MD file for details. Or just have at the cfg file. It's not hard to figure out. It should even work for non-stock occupations if added by any mods. That's not tested as I don't have any such mod installed on my system. 

Directions

When installed, all newly hired Kerbals wearing the Future Suit will have color coded suits according to their occupations. Kerbals already existing in older saved games will retain the colors they had before the mod was installed. Also, by default, KOC does not force Kerbals to wear the Future Suit. These can be changed in the mod's menu settings. (accessed through the stock difficulty menu). In this menu, Kerbals can be required to equip the Future Suit and current hires can have the color coded dress code enforced on them. You can even try to enforce this on Kerbals on assignment but this doesn't always work, especially if you try to do it in the flight scene with those Kerbals loaded, so do it from the Space Center scene instead.

Also note that enabling dress code compliance is a toggle which disables itself after it has cycled through your Kerbals. This is so that you can still assign custom colors in the field. (think of the setting as you having sent out a memo to all your employees)

Known issues:

  • The first four Kerbals (Jeb, Bill, Bob and Valentina) have the default orange lighting. This is a feature, not a bug. (if it's a big deal I'll look into fixing it but this works by hooking into the event created when new applicants appear and the Fab Four probably get added in some way that doesn't trigger an event)
  • Only new Kerbals will be affected by the mod. If you have a save game with existing Kerbals they will not be modified. This is because the mod works by intercepting the onKerbalAdded event and also so that any player modified Kerbals will retain their colors. (you did know you could edit a Kerbal's color by right clicking on them in the Future Suit, right?)

This mod requires the Breaking Ground DLC to work. (if you install it anyway, nothing bad will happen, it just wont do anything since there's no Future Suit)

Download here! Or I will type something in Comic Sans! (you are warned)

https://github.com/Starwaster/Kerbal-Occupation-Colors/releases/latest

License: This mod is released into the Public Domain.

XU7EKTy.png

Edited by Starwaster
Added instructions
Link to comment
Share on other sites

Oh! Cool! Breaking Ground gets even better with this.

Regarding the ‘this will not be applied to Kerbals in a save before the mod was installed’, does that mean you have to make a new save for the mod to take effect, or does it just mean Kerbals wearing the BG future suit in an existing save won’t get the default colours?

Edited by RealKerbal3x
Link to comment
Share on other sites

25 minutes ago, RealKerbal3x said:

Oh! Cool! Breaking Ground gets even better with this.

Regarding the ‘this will not be applied to Kerbals in a save before the mod was installed’, does that mean you have to make a new save for the mod to take effect, or does it just mean Kerbals wearing the BG future suit in an existing save won’t get the default colours?

It just means that any Kerbals already in existence won't have their occupation colors assigned to them.

That's because this mod is event driven; whenever you get a new Applicant an event is fired by the game (onKerbalAdded) with the new applicant being passed in as a parameter.

I intercept that and change the Kerbal's suit colors. Those are actually specified on the Kerbal itself. Whenever you right click on the Kerbal the new colors are written over. That way the colors are persistent. That's another reason why this only affects new Kerbals. I could easily step through the entire roster and make all Kerbals comply with the new colors. But then players couldn't modify their colors.

Link to comment
Share on other sites

6 minutes ago, Tabris said:

does it only work for the "Stock Occupations" only or is it extensible to other mods that introduce new occupations?

If someone cares to extend it then that can easily be done via Module Manager. Occupations are not hard coded in the mod, I just look at the Kerbal's trait field which is a simple string and I pass that to a function that checks if there is an entry matching that string in the KerbalOccupationColors.cfg

Let's say there's a mod that expands the list of occupations to include a NerfHerder. The patch would look like this: (in the code, the occupation string is converted to all lower case so that's what you want to do to the config)

BTW, this mod is in the public domain. I so declare that.

@KERBAL_OCCUPATION_COLORS
{
	nerfherder
	{
		red = 0.5
		green = 0.5
		blue = 0.5
	}
}

 

Edited by Starwaster
Link to comment
Share on other sites

13 minutes ago, Jesusthebird said:

Those glowy colors are sleeeeek!! Way to go!

So this mod doesn't need texture replacer to work?? *inserts southpark "niiice" gif*

Nope. It's all stock. It does require the new DLC though or you don't get the spiffy new Future Suit for this to work on.

Link to comment
Share on other sites

Well this is a pleasnat surprise that I will download but I wanted to make a comment here

 

As yo know most people I think like the USI Kolonization mod suits and in fact there  probably could be a way to take the stock code of those suits and thrun them into add ones for this mod..

 

if you want to see what I am talking about here is the Link right here

 

Anyway just a thought

 

Space _Coyote

 

Additional note

 

for the USI thogh I think the Pilot colors should be Orange and the Medic colors should be red..(After all that's what the colors should be shouldn't they?

Link to comment
Share on other sites

17 minutes ago, Space_Coyote said:

Well this is a pleasnat surprise that I will download but I wanted to make a comment here

 

As yo know most people I think like the USI Kolonization mod suits and in fact there  probably could be a way to take the stock code of those suits and thrun them into add ones for this mod..

I've said as much ;)

Just needs the names of the extra classes added along with the appropriate color codes.

Link to comment
Share on other sites

Update time already. Don't expect a lot of updates on this mod; it's fairly simple and I want to keep it that way.

https://github.com/Starwaster/Kerbal-Occupation-Colors/releases/tag/v1.1.0

  • Support added for stock KSP Settings menu. Option added to force Future Suit for all new hires. (from inside save game: Escape -> Settings -> Kerbal Occupation Colors)
  • Tentative support for USI MKS classes. Need feedback on these colors! I do not use that mod and can't readily test out the colors. Feel free to suggest alternate color schemes (with before/after screenshot if possible)
  • Format change in KerbalOccupationColors.cfg: Occupations must use proper case. (previously allowed all lower case but that might confuse people) When adding support for new occupations, entries must use the same case as the occupation being supported

@Space_Coyote There you go. Should work but I have no idea what some of those colors will actually come out as in game. So try it and let me know.

Edited by Starwaster
Link to comment
Share on other sites

15 hours ago, Starwaster said:

Tentative support for USI MKS classes. Need feedback on these colors! I do not use that mod and can't readily test out the colors. Feel free to suggest alternate color schemes (with before/after screenshot if possible)

How about the colors from the Community Trait stuff? This would automagically cover MKS, etc.

 

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...
7 hours ago, linuxgurugamer said:

@Starwaster

Any chance to add this to CKAN?

If you like, I could do it for you, but I need your permission

 

Also, related, but separate, could you add a .version file ?  Makes it easier to know when there are updates, etc.

LGG

You can do that if you want. I'll see about making a .version file. 

As I said earlier, there are probably NOT going to be a lot of updates to this. It's not going to be a constant 'in development thing' though it will be maintained if some KSP update breaks it.

It's got config files now to handle  USI MKS and can be easily extended to handle new classes for any mods that add them.

The only other thing I'm wanting to do is add a button in its menu to force all currently employed KSP Kerbonauts to conform to the 'new dress code' as it were, in case they were already employed when the player installed the mod. Other than that it's finished product.

Link to comment
Share on other sites

On 7/3/2019 at 5:11 PM, Beetlecat said:

How about the colors from the Community Trait stuff? This would automagically cover MKS, etc.

 

Appears at this time the colours of Community Trait Icons (used by many other mods) and this mod are aligned.  Which is very good indeed.

Link to comment
Share on other sites

37 minutes ago, Bombaatu said:

Is there a way to have the Kerbal's lights (and therefore the suit piping lights) turned on by default when they EVA?

Crew Light turns on their headlight - but not the piping lights.

 

Link to comment
Share on other sites

1 hour ago, DStaal said:

Crew Light turns on their headlight - but not the piping lights.

 

But the piping lights are bound to the same action group as the suit lights, so there’s no reason why Crew Light shouldn’t turn them on as well.

Link to comment
Share on other sites

16 hours ago, RealKerbal3x said:

But the piping lights are bound to the same action group as the suit lights, so there’s no reason why Crew Light shouldn’t turn them on as well.

Unless it's not using an action group to turn the suit light on.

Link to comment
Share on other sites

3 minutes ago, Starwaster said:

Unless it's not using an action group to turn the suit light on.

Well, whenever you turn the suit lights on (via the keyboard shortcut or the UI button) it's always the same way that lights on the vessel are turned on, so it's probably the same action group, even though you can't edit it.

Link to comment
Share on other sites

Just now, RealKerbal3x said:

Well, whenever you turn the suit lights on (via the keyboard shortcut or the UI button) it's always the same way that lights on the vessel are turned on, so it's probably the same action group, even though you can't edit it.

It's really not. Go look at the code for Crew Light.

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