Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPS seems to be ignoring AbilityTreeTitles config #44

Closed
pledbrook opened this issue Jun 10, 2021 · 13 comments · Fixed by #50
Closed

CPS seems to be ignoring AbilityTreeTitles config #44

pledbrook opened this issue Jun 10, 2021 · 13 comments · Fixed by #50

Comments

@pledbrook
Copy link

I have this config for SPARKs:

+AbilityTreeTitles[0]="Future Combat"
+AbilityTreeTitles[1]=""
+AbilityTreeTitles[2]="War Machine"
+AbilityTreeTitles[3]="XCOM"

and yet the blank row seems to be ignored:

image

@Iridar
Copy link

Iridar commented Jun 10, 2021

The current GetLocalizedAbilityTreeTitle() function is a bit noodly, but I don't see why it would result in that behavior. I'm a bit confused you would call AbilityTreeTitles a "config"; it's a localized array, so to be crystal clear, you are in fact using localization files to set that array?

@pledbrook
Copy link
Author

Yes, that's from the localisation.

@Iridar
Copy link

Iridar commented Jun 10, 2021

Hm, weird. I'd suggest adding some logging to GetLocalizedAbilityTreeTitle() in CPS to see where this goes wrong.

@pledbrook
Copy link
Author

X2CharacterTemplate.AbilityTreeTitles itself seems to be mangled. I'll need to compare with normal LWOTC.

@pledbrook
Copy link
Author

LWOTC with integrated promotion screen:

image

I'll try to look further into it at some point.

@pledbrook
Copy link
Author

This is because CPS provides its own localisation for SPARKs and mod config load order comes into play as to which mod wins.

@Iridar
Copy link

Iridar commented Jun 12, 2021

I see. You can use the event I added for the purpose of overriding these localized row names.

@pledbrook
Copy link
Author

I can't say I like CPS placing the burden onto other mods to work around this. Would it be possible for CPS to set these values if they're all empty? Perhaps in OPTC?

@Iridar
Copy link

Iridar commented Jun 12, 2021

I can't say I like CPS placing the burden onto other mods to work around this. Would it be possible for CPS to set these values if they're all empty? Perhaps in OPTC?

The only reason CPS provides localization for SPARK per rows (NPSBD did that too btw) is because the base game doesn't, so SPARKs would be left without localization on the new promotion screen.

SPARKs don't even get training center perks in base WOTC, so it's not a problem there. This is basically just to ensure consistency.

Conditionally changing localization for perk rows of a specific unit is very much the intended use for the event.

To answer your question directly, yes we can set up CPS to OPTC patch localization for SPARK perk rows if another mod has not done so, if you don't like the event for some reason, though setting that up is probably gonna take slightly longer than just setting up the event listener.

@pledbrook
Copy link
Author

The only reason CPS provides localization for SPARK per rows (NPSBD did that too btw) is because the base game doesn't, so SPARKs would be left without localization on the new promotion screen.

I understand that, but CPS potentially overrides any other mod that provides entries for SPARKs in their l10n files. "Community" mods should work a little harder compared to other mods to not get in the way. Ideally NPSBD wouldn't have done this.

I suggested OPTC because I was initially worried about CPS again overriding other mods, but the event listener approach is better if CPS has a high priority for its one. Then a normal default-priority listener from another mod will take precedence without the mod author having to worry about it.

@Iridar
Copy link

Iridar commented Jun 12, 2021

Okay, let's do it that way.

@pledbrook
Copy link
Author

Is this what it should look like?

image

@Iridar
Copy link

Iridar commented Jun 12, 2021

Yep

pledbrook added a commit that referenced this issue Jun 12, 2021
Placing the default SPARK ability tree titles into the localisation
files makes it difficult to override them in other mods. Now, CPS sets
those tree titles in an 'OverrideLocalizedAbilityTreeTitle' listener and
*only* sets values if none are already configured.

Fixes #44.
Iridar added a commit that referenced this issue Jun 12, 2021
Use listener to set SPARK ability tree titles (#44)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants