hemeac / kiwiTechTree

A "Probes/Planes Before Crew" overhaul of the Tech Tree that builds on the those concepts by adding part upgrades through the B9PS system and gameplay elements from certain mods for mods which are currently supported.
Other
8 stars 8 forks source link

Community Parts Titles Support #62

Open hemeac opened 3 years ago

hemeac commented 3 years ago

When CPT is installed, any changes to titles made by KTT are disabled. This includes changes to titles for mods that CPT does not natively support. This can create some cosmetic issues for B9 Switches for engines. I am not likely to create patches myself, but will accept user-submitted compatibility patches. Some likely mods that need support either for KTT and/or CPT include:

yalov commented 3 years ago

As I see it, #64 will solve this.

for all stock or mod renaming, done as

@PART[mk1pod_v2]:LAST[KiwiTechTree]
{
    @title = Mk1-0 "Anticipation" Command Pod
}

making it

Localization
{
    en-us
        {
        #autoLOC_500319 = Mk1-0 "Anticipation" Command Pod
        }
}

most likely will solve the Community Part Titles support

hemeac commented 3 years ago

@yalov , I have pushed an update that disables any title changes in KTT if Community Parts Titles is installed. This will create a few cosmetic errors with the engine upgrades as some engine names won't get caught in the regex, but this will not cause any functional issues. I won't provide any more support for the mod at this time as CPT has overlapping design goals, but will accept user submissions if anyone wants to go through and submit compatibility patches.

yalov commented 3 years ago

What kind of cosmetic errors you talking about?

hemeac commented 3 years ago

The B9 Part Switch for the engines has titles for the variants. To differentiate, I gave them "upgraded" names and numbers. As an example for Knes, I have the part: _Knes_Vesta_Engine_0625 which I have renamed MT-2 "Celtica" Liquid Fuel Engine (the original name is LRBA-V "Gauntness" Engine). For my script I tag several items within the part during the pass :AFTER[Knes]:

        engineNumber = 2
    engineNumberUpgrade = 2C
    engineName = Celtica
    engineNameUpgrade = Galatia

In the patch that applies the upgrade engine I change the title of the upgraded variant using a series of regular expressions to the title in the B9 switch.

title = #../../$title$
@title ^= #:$../../engineName$:$../../engineNameUpgrade$: // This then looks at the title and anywhere it finds Celtica it replaces with Galatia.

Thus if the title for Knes is not changed, the regular expression does not find Celtica and thus does not apply the upgraded variant has the same name.

I noticed you had changed the names for AirplanePlus engines so in that scenario this would also fail. But this issue is just cosmetic and the patching necessary will be a bit boring as someone will have to cross reference both configuration files to get things to play nicely, I feel it is not a super major issue, just something that could be nice in the future if someone wants to volunteer.