Jump to content

PartVariant Color Tinting


Electrocutor

Recommended Posts

Allow color tinting on all parts: stock or mod.

oPpUHlQ.jpg

 

Requires:
ModuleManager

 

Instructions:

  • Create a new text file under \GameData with extension .cfg (f.e. ColorTinting.cfg)
  • Copy and paste one of the following into the file and save it.

 

Natural Color System (NCS)

  Reveal hidden contents

 

Pigments (CMYK)

  Reveal hidden contents

 

KSP Colors (this is the one most people would want)

  Reveal hidden contents

 

Edited by Electrocutor
Link to comment
Share on other sites

Strange, I see that this interferes with the part's flag. Steps to reproduce:

 

1.  Take out part with flag on it.  Mk1 Lander Can is a great example to use.

2.  Set a mission flag, take your pick.

3. Change the part color via the variants provided by this MM config.

4. Observe the flag is interfered with.

5.  Re-choose mission flag.

6. Observe flag returns to proper display.

7.  Go to step 3 and repeat.

Link to comment
Share on other sites

  On 3/29/2018 at 5:30 PM, klesh said:

Strange, I see that this interferes with the part's flag. Steps to reproduce:

 

1.  Take out part with flag on it.  Mk1 Lander Can is a great example to use.

2.  Set a mission flag, take your pick.

3. Change the part color via the variants provided by this MM config.

4. Observe the flag is interfered with.

5.  Re-choose mission flag.

6. Observe flag returns to proper display.

7.  Go to step 3 and repeat.

Expand  

It's not this; it's a bug with KSP itself.

Link to comment
Share on other sites

I figured as much.  Its a very cool use of the Variant system!  Well done.

Might I suggest versions of the orange and "dark grey" that the MH parts come with (on the russian parts)?  Perhaps the gold and "white" and "dark" from the structural panels as well? 

Essentially a Making History companion .cfg.

Edited by klesh
Link to comment
Share on other sites

  On 3/29/2018 at 5:52 PM, klesh said:

I figured as much.  Its a very cool use of the Variant system!  Well done.

Might I suggest versions of the orange and "dark grey" that the MH parts come with (on the russian parts)?  Perhaps the gold and "white" and "dark" from the structural panels as well? 

Essentially a Making History companion .cfg.

Expand  

Okay... updated with KSP colors. That said, since the "white" parts have varying shades, they'll not all match perfectly.

Edited by Electrocutor
Link to comment
Share on other sites

oNJnVcm.jpg

Almost there... it seems I will have to do the ones with existing variants with a little different syntax because those parts have a whole bunch of extra meshes inside them that have to be explicitly hidden. I don't think I'll bother with it for now though unless there a number of people who want it fixed up.

Link to comment
Share on other sites

Really nice job man! looking like this will be a really cool feature. I see this is working on parts with variant switching?  I was under the impression from squad and what I have seen so far myself you could not load 2 modules at once? This appears to be working fine with multiple modules?  I tried to implement the stock colour switch with my Porkjet tanks and had to get rid of the stock resource switching code because I could only get one module at a time to load? I install my Porkjet parts as model replacements under the squad folder so that they will work Importing and exporting stock craft files. It appears the one module limit is a Squad game engine limitation and module manager can bypass it ? How do you see this working with other mods? I know that there is https://spacedock.info/mod/1748/Mauws' Custom Paint Jobs [Alpha Pack] That I have not tried yet. Even if stuff continues to play nice together How long do you think we can go before we blow up the UI "with to many choices" ?  Nice job that Stock Orange looks sweet on solar panels.                           VAUjebu.pngNow if I can get working Linux shaders again. Oh the pretty reflections.           

Edited by Delbrutis
Link to comment
Share on other sites

  On 3/29/2018 at 5:48 PM, Electrocutor said:

It's not this; it's a bug with KSP itself.

Expand  

Well if it's a Squad bug then that's why they don't have a texture switch on any part with a flag . With this installed any part with a flag gets "overridden" essentially looses the flag on load. Loading to the pad' loading a new craft' loading a save vessel out in the world. Even if you have not applied a new texture.or have switched back to the original it still overrides the flag. This may actually be part of a Squad feature. I don't know how many people  noticed but we now have persistent flags in the game. Your craft now will keep the flag chosen in the VAB when it was built and saved. Even if you have a different flag selected when you load the craft it will have the flag it was saved with. Now you can have multiple craft together with different flags on them in the game. Good news is it looks like your colour changes get saved and remembered exactly the same. But I think that's what is messing with the flag? You don't have to actually change the colour.Just having the module loaded on the part seems to interfere. It would be a shame to loose this ability on command parts and cockpits. But maybe there is a way to exclude the flag transform layer? The other parts look cool and worst case scenario is to just write in a exclusion for command part's. Or maybe ModuleManager could look for any part that has the flag transform listed in it's configuration. I'M not super good at writing MM file's but I might have a go at removing anything with a flag While I'M waiting for the new TRR to come out. The new Ven wheels just got fixed. And most mods  seem to be almost caught up .1.4.2 looks like it fixed some of the biggest Linux bugs "FINGERS CROSSED".  I know there are a lot of people that think the other switchers Firespitter' BAC9' Interstellar' "I think that's most of them ?" Work better or have nicer features. And I think their probably right. But I just think any time you can do something with a simple configuration file under stock It's just a way better option. So many mod's with different dependences to keep track of. Would be nice to cut down on some of those dll files we always have to keep updated.        

 

OK I just checked this out and it's worse than I thought . It turns out in my first post when I was surprised this worked with two modules loaded I was right " I wish I wasn’t"  the flag transform was just another module. Unity cant seem to keep more than one. When I tried to get it working with the same configuration file the game simply loaded the first and ignored any other modules. ModuleManager Technically lets you bypass this and load more than one. They appear to be working at first But when the game tries to access or use a module's info again like reloading a craft or a scene change it cant. moduleManager can handle loading more than one and maybe they would work fine together ? But the native game loader obviously cant.  Example take a structural tube and make it it's full length attach something to the bottom node. colour it and watch the node disappear with the attached part inside of it . You can start over just like applying a new flag and it works in the VAB Temporarily until you change the texture again or leave to launch the craft load a new scene or whatever . It wont work outside of the VAB . Sorry but it looks like having this stuff universally applied is a "BAD IDEA"  OH well guess it's back to one of the Dll files.               

Edited by Delbrutis
Add Update Info
Link to comment
Share on other sites

If enough people want this, I will fix the issue with existing variants not properly using the tinting. It just requires a bit of MM finesse so that each iteration of the existing variant also has a tinted version of that variant.

That said... using an actual recolor texture like what Textures Unlimited has allowed @Manwith Noname to do is a much better approach because it allows actual recoloring instead of just a universal tint. It is, however, also a great deal of work to make those recolor mask textures.

Edited by Electrocutor
Link to comment
Share on other sites

I've updated the KSP Colors script to compensate for existing model-changing variants. The current implementation uses the first variant as a base and then applies tint to it. I had originally made a copy of every variant for tinting, but that became rather unruly very quickly.

Edited by Electrocutor
Link to comment
Share on other sites

  On 4/2/2018 at 2:33 AM, [INDO]dimas_1502 said:

so this is basically kerbpaint but stock?

Expand  

No, Kerbpaint requires a new shader and new textures with masks to allow specific repainting; like what Textures Unlimited allows. This is not even a mod, it's just a config that uses the stuff already in KSP to tint what is already there. It is very generic.

Link to comment
Share on other sites

  On 4/2/2018 at 3:13 AM, Electrocutor said:

No, Kerbpaint requires a new shader and new textures with masks to allow specific repainting; like what Textures Unlimited allows. This is not even a mod, it's just a config that uses the stuff already in KSP to tint what is already there. It is very generic.

Expand  

no i mean the tinting ability
also ">stock"

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

Hello, sorry for being dense, i feel like i can use the information in the op to get at what i want, but i cannot wrap my head around it.

I am writing a patch that clones the existing fuel cells to create monoprop fuel cells. I am simply writing a module manager patch that uses +PART to clone the fuel cell and then modifying the INPUT_RESOURCE nodes to use monoprop instead of lfo.

Can I use the _COLOR variable to tint the existing texture so that my cloned part has a slightly different coloration?

I feel like I can, but I am not sure if the syntax would be as simple as that. Would it work if i just added the following?

TEXTURE
{
    _COLOR = #FFD700
}

Nope! Just tried it, didn't work.

Edit2: Hm I have made a tiny bit of progress, but it does not seem to work still. I am thinking, judging by the screenshots on this thead, that the tinting works by tinting the white parts of the existing texture. The texture for the fuel cells have very little or no white in it, so the variant coloring just does not show up. Nope, that's not it. Looking closely, it does have some white parts and pieces, but they are not getting any tinting.

Edited by canisin
Link to comment
Share on other sites

This might be of interest to some of you 

Also @canisin, you can change the texture in the part config in the MODEL section 

MODEL
{
model = BDArmory/Parts/agm-86Cruise/model
texture = texture, OrX/Parts/TMTSNBN/texture2
scale = 1.0, 1.0, 1.0
}
 
if you have questions feel free to pm me 
Link to comment
Share on other sites

  On 7/8/2018 at 5:05 PM, DoctorDavinci said:

This might be of interest to some of you 

Also @canisin, you can change the texture in the part config in the MODEL section 

MODEL
{
model = BDArmory/Parts/agm-86Cruise/model
texture = texture, OrX/Parts/TMTSNBN/texture2
scale = 1.0, 1.0, 1.0
}
 
if you have questions feel free to pm me 
Expand  

Yea, i could change the texture, but that would mean that i need a new texture, right? I was hoping that i would be able to get away with merely tinting the existing texture.

Link to comment
Share on other sites

  On 7/8/2018 at 8:37 PM, canisin said:

Yea, i could change the texture, but that would mean that i need a new texture, right? I was hoping that i would be able to get away with merely tinting the existing texture.

Expand  

Yes, you would need to add a texture but that is super simple to do and deosn't really add much in the means of space taken in memory

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