Jump to content

Variant for Livery


Recommended Posts

Shifted my attention over to custom liveries again...  

Using Module Manager to patch in the VARIANT module seems to be the best approach, I have encountered one minor snag however and wondering if anyone (or perhaps @SQUAD) might provide some guidance here.  The issue involves adding a variant to a part that displays a mission flag.  The following code applies the new texture to the part, the problem is... it applies it to the flag as well.  I'd like to know how to specifically reference the part body and leave the flag as whatever is being displayed in the SPH/VAB.

The snippet of code that sets both the part and the flag to the same texture looks like this:

		VARIANT
		{
			.
			.
			.
			TEXTURE
			{
				mainTextureURL = Livery/Livery Name/Skins/Mk1Cockpit
			}
		}

After studying the structure of the Fairings part files, I know there are ways to specify that a texture be applied to an element of the object, such as the FairingIconShell noted below...

TEXTURE
{
	materialName=FairingIconShell
	mainTextureURL = Squad/Parts/Aero/fairings/fairings_diff
}
EXTRA_INFO
{
	FairingsTextureURL=Squad/Parts/Aero/fairings/fairings_diff
	FairingsNormalURL=Squad/Parts/Aero/fairings/fairings_normals
}

I just don't know how to specifically reference the part for Mk1Cockpit and exclude the flag or specifically set the flag to Alpha or the default SPH/VAB flag?

...any assistance here with the correct object model code references would be much appreciated!

Link to comment
Share on other sites

@SpannerMonkey(smce)  ...thanks, were you pointing me to this because he/she has the same exact issue as noted above in a mod for tinting colors?

Therefore suggesting there is an unresolved bug in KSP regarding this?   Or possibly we are ahead of @SQUAD in the development process and they just haven't instituted the changes required yet for part variants that involve parts with flags?   (and possibly good reason why we don't see any variants in these parts yet)

Edited by XLjedi
Link to comment
Share on other sites

@Bottle Rocketeer 500  Thanks, I see that in a typical part that has a flag...  they added a new module for FlagDecal as follows:

	MODULE
	{
		name = FlagDecal
		textureQuadName = FLAG
	}

My issue is with the code below is that it overwrites all textures on the part, including the textureQuadName = FLAG assignment...

TEXTURE
{
	mainTextureURL = Livery/Livery Name/Skins/Mk1Cockpit
}

This evening, I will try a few variations on the following to see if it works...

TEXTURE
{
	mainTextureURL = Livery/Livery Name/Skins/Mk1Cockpit
	textureQuadName = FLAG
}

I didn't see any references to "making the flag white" in the mk2CockpitStandard.cfg file that I reviewed.

Link to comment
Share on other sites

14 hours ago, XLjedi said:

@Bottle Rocketeer 500  Thanks, I see that in a typical part that has a flag...  they added a new module for FlagDecal as follows:


	MODULE
	{
		name = FlagDecal
		textureQuadName = FLAG
	}

My issue is with the code below is that it overwrites all textures on the part, including the textureQuadName = FLAG assignment...


TEXTURE
{
	mainTextureURL = Livery/Livery Name/Skins/Mk1Cockpit
}

This evening, I will try a few variations on the following to see if it works...


TEXTURE
{
	mainTextureURL = Livery/Livery Name/Skins/Mk1Cockpit
	textureQuadName = FLAG
}

I didn't see any references to "making the flag white" in the mk2CockpitStandard.cfg file that I reviewed.

what you're looking for is materialName = xxx, but even if you only replace a single mesh/material with the texture, the flags will still be white. So far as I have found, simply by having the ModulePartVariants module added, it automatically breaks flags.

Link to comment
Share on other sites

@Electrocutor  Thanks, I was kinda afraid that might be the case... 

Although, it would be nice to know what the "xxx" is for the various parts with flags.  I guess we may just have to wait until Squad puts out a variant for each of the flag parts to find out.  In the meantime, I s'pose I can live with toggling the flags on/off in the SPH at design time.  Still better than creating a whole batch of duplicate parts.  Assuming that once the flags are assigned they "stick" throughout the mission and save game files.

 

Link to comment
Share on other sites

49 minutes ago, XLjedi said:

@Electrocutor  Thanks, I was kinda afraid that might be the case... 

Although, it would be nice to know what the "xxx" is for the various parts with flags.  I guess we may just have to wait until Squad puts out a variant for each of the flag parts to find out.  In the meantime, I s'pose I can live with toggling the flags on/off in the SPH at design time.  Still better than creating a whole batch of duplicate parts.  Assuming that once the flags are assigned they "stick" throughout the mission and save game files.

 

You can use DebugStuff (the mod) to find out what it's called for different parts. You could hard-code a TEXTURE to update the flag material, but it would not be the dynamic one that was selected for the game. Since it is indeed a game bug, and fairly noticeable, I would hope they fix it.

Edited by Electrocutor
Link to comment
Share on other sites

6 minutes ago, Electrocutor said:

You can use DebugStuff (the mod) to find out what it's called for different parts. You could hard-code a TEXTURE to update the flag material, but it would not be the dynamic one that was selected for the game. Since it is indeed a game bug, and fairly noticeable, I would hope they fix it.

Thanks, I'll checkout that tool!  ...and yeah, my limited tinkering this evening had the flag reverting back to white as soon as the part hit the runway.  Guess I'll have to live with duplicate parts for those that have flags; at least for now.

 

 

Link to comment
Share on other sites

On ‎4‎/‎3‎/‎2018 at 11:41 PM, Electrocutor said:

Since it is indeed a game bug, and fairly noticeable, I would hope they fix it.

Have you by chance already posted this one to the Squad Bug Tracker?   ...if so, I will try to locate it to upvote, and maybe anyone else who stumbles upon this thread will do the same.  It would be nice to be able to use Variants on all parts without breaking the flags!   

If not, I'll post it.

Link to comment
Share on other sites

17 minutes ago, XLjedi said:

Have you by chance already posted this one to the Squad Bug Tracker?   ...if so, I will try to locate it to upvote, and maybe anyone else who stumbles upon this thread will do the same.  It would be nice to be able to use Variants on all parts without breaking the flags!   

If not, I'll post it.

https://bugs.kerbalspaceprogram.com/issues/18378

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