Swedish city names mod: why won't this run?

isnorden

Amnesiac Modder
Joined
Jul 6, 2012
Messages
608
Location
Madison, Wisconsin, USA
Ever since I discovered a problem with name displays in the first version of this mod, I've been trying to make it run correctly. So far I know that special characters are not the root of the problem: the standard list included some names with non-English letters, and the original display bug affected all new names equally.

Now that the first bug has been dealt with (I think), I've run into a more serious one: this mod does nothing to the original list. In a recent playtest, the third city my player founded was Helsinki; this shouldn't have happened because (A) my mod deletes/replaces the Finnish names, and (B) Uppsala was number three on the new list.

Could someone please fix the error that's keeping this mod from running? I'd appreciate that VERY much!

Moderator Action: Moved to the main forum.
Because the mod components subforum is only for mod components, not for questions ;).
 
You redefine text keys that already exist, this will cause the entire file to get ignored.

(This should be reported in database.log if you enable logging.)
 
I don't know how you've managed it, but your .modinfo file is wrong

Code:
<Files>
  <File md5="88D0E99C07EFA982390781D528EBC05F" import="0">[COLOR="red"][B]Better Swedish City Names/[/B][/COLOR]XML/sweden-cities_fix.xml</File>
</Files>
	
<Actions>
  <OnModActivated>
    <UpdateDatabase>[B][COLOR="Red"]Better Swedish City Names/[/COLOR][/B]XML/sweden-cities_fix.xml</UpdateDatabase>
  </OnModActivated>
</Actions>

Delete the bits in red and your XML file will actually load, and then you'll get all the errors in database.log that you can work your way through, starting with

Code:
[35051.193] While executing - 'insert into Language_en_US('Tag', 'Text') values (?, ?);'
[35051.193] In XMLSerializer while inserting row into table insert into Language_en_US('Tag', 'Text') with  values (TXT_KEY_CITY_NAME_STOCKHOLM, Stockholm, ).
[35051.193] In XMLSerializer while updating table Language_en_US from file XML/sweden-cities_fix.xml.
[35051.209] columns Language, Tag are not unique

BTW Steam Workshop eats non US-ASCII / ISO-LATIN1 characters, so you'll need to encode all your accented letters, eg

Code:
Top 5 St&# 228 ;dte / Wunder
(without the spaces before and after 228)
 
I've managed to fix the already-defined-values error--partly by turniing <row> tags to <replace> as in the existing code for Spain; and partly by correcting the path in my info file (thank you for spotting that one, WHoward69). Just one more question before I deal with re-encoding those three extra vowels... How do I add brand-new entries to an existing list of data? Here's what I tried (only the first three entries appear here, for brevity's sake):

Spoiler :
Code:
?xml version="1.0" encoding="utf-8"?>
<!-- Adapted from Pouakai's Polynesian city-name code (ISN) -->
<!-- Original created by ModBuddy on 10/8/2010 10:23:59 PM -->
<GameData>

	<Language_en_US>

		<Update>
			<Set Text="Gävle"/>
			<Where Tag="TXT_KEY_CITY_NAME_GAVLE"/>
		</Update>
		<Update>
			<Set Text="Kalmar"/>
			<Where Tag="TXT_KEY_CITY_NAME_KALMAR"/>
		</Update>
		<Update>
			<Set Text="Kiruna"/>
			<Where Tag="TXT_KEY_CITY_NAME_KIRUNA"/>
		</Update>

	</Language_en_US>

</GameData>


If I should have used different commands to set the extra names, please tell me what they are; I appreciate all the help I've gotten to make this mod work. (I could have done this as a simple swap, but also wanted to avoid conflict with the Finland mod; that one moves the old names and variables to another civ.)
 
That should work for the last two, for the first one (which needs an encoded character) you may need to go the route of

Code:
<Update>
  <Where Tag="TXT_KEY_CITY_NAME_GAVLE"/>
  <Set>
    <Text>Gävle</Text>
  </Set>
</Update>
 
Thank you again; you deserve an honorable mention in the .modinfo file, at the very least. :thanx:
 
Thank you again; you deserve an honorable mention in the .modinfo file, at the very least. :thanx:

Nobody will ever look in the .modinfo. There's a nice little Special Thanks bar on the Mod properties where you can dole out your honorable mentions.
 
Nobody will ever look in the .modinfo. There's a nice little Special Thanks bar on the Mod properties where you can dole out your honorable mentions.

...And what goes in that section is defined in the .modinfo file. That's what I was driving at. :blush:
 
Back
Top Bottom