How to run SQL after XML re text

CivilizationAce

Warlord
Joined
Jan 17, 2017
Messages
236
Here's my conundrum:

I want to change the text for a Policy, but I also want to stick with the localisation. i.e. I'd like to create a string as XML, e.g. LOC_MYNEWSTRING. Then update the existing string:

update LocalizedText
set Text = Text || ' ' || (
select L.Text
from LocalizedText as L
where L.Language = LocalizedText.Language
and L.Tag = 'LOC_MYNEWSTRING'
)
where Tag = 'LOC_EXISTINGSTRING'
and exists (
select *
from LocalizedText as L
where L.Language = LocalizedText.Language
and L.Tag = 'LOC_MYNEWSTRING'
);

However, without producing any database errors, this doesn't do anything, so I suspect that it's running before the XML. Anyone know how/if I can set the SQL to run after the XML?
 
Thanks. That'll do it :)

I figure if people are going to translate my mods (which has happened once already :)) then I should make it easy for them.

I like to concatenate, but I'm unsure what to do re languages which read in the opposite order. I don't even know which languages those are TBH.
 
This complex sql you wrote above is updating only 1 specific string by adding another string at the end. I don't think that it is wise to it automatically for all languages, with all their grammar complexity.

As an example - I've created a mod that adds building upgrades. In English it was easy - each name was OriginalName + Upgrade. When a guy translated the names to French, it was nothing like this. The 'upgrade' word appeared in various places, and had sometimes additional characters added, etc. No automation possible.
 
I don't think that it is wise to it automatically for all languages, with all their grammar complexity.
But my scenario is simpler. I'm adding another sentence like I did for my Borg mod: "Also applies to Drones and Adjuncts." Worst case scenario is that someone translates it into one of the two Chinese languages and the sentences are the wrong way around. Not ideal, but if they're sensible the translation would replace the period with a colon (or whatever the Chinese equivalent of a colon is) so that it still makes sense. Talking of the Borg I'll get around to taking the same approach that the text additions in that.

If I want to change text where complexity is involved I'll replace the whole thing and sacrifice other mod compatibility, though I know it's wishful thinking that other mods will alter rather than overwrite text. (Though I do have a decent chance of my code running second)
 
Last edited:
Gedemon, I would to seek your guidance on how to make a change to mod. I am using your Gaint map and playing with (1) Moar unit, (2) Moar unit Aztec, (3) Moar unit Poland, (4) Moar unit Australia and (5) GDG's Super OP Civ for FUN Only. Mods s/n 1-4 need to be activated to play mod s/n 5. I wish to play only with s/n 1 & 5. Is there a way or how can I make changes to mod to make it possible. I am reading on xml and sql basic program to understand to learn some basics. Your guidance will very much appreciate. Thank you.
 
Dependancies are set in the .modinfo, but they are usually set for a reason, removing them without knowing why will surely lead to errors on start or unexpected behaviors in game.
 
Yes. Agreed. I tried removing the 'Dependancies' and started a new game with s/n 1 & 5 activated but the game failed to start. How to find out the reason?
 
Top Bottom