Nationnames instead of leadernames

Ermelinho

Child with the Mirror
Joined
May 8, 2007
Messages
88
Location
Among the Daughters of the Desert
Hi!

In some scenarios, nationnames instead of leadernames are shown at the right bottom of the screen. I´d like to implement this in one of my mods and wonder how it´s done.

anyone?!

Thanks!
 
Add the "CvMainInterface.py" file to your mod, go to line 2786, and change:
Code:
gc.getPlayer(ePlayer).getName()
to:
Code:
gc.getPlayer(ePlayer).getCivilizationDescription(0)

Bh
 
Definitely move this on to the request for the patch, something that Should be changed in the main game. I'd far rather declare war on the Aztes than on Montezuma. Who leads them is Fine For the diplomatc screen, otherwise... let it be Russia that Discovers Liberalism, not Peter
 
I actually changed it to "X of the Y empire" (ie, "Lincoln of the American empire"). Makes it a lot easier to deal with requests when playing Unrestricted Leaders.

Bh
 
Definitely move this on to the request for the patch, something that Should be changed in the main game. I'd far rather declare war on the Aztes than on Montezuma. Who leads them is Fine For the diplomatc screen, otherwise... let it be Russia that Discovers Liberalism, not Peter

That would be a problem if you had two opponents playing different leaders of the same nation, which you can if you customize the game or have vassals.
 
^ That looks like it might be fixed, and if you customize the game you can have two civs playing with the same Leader, so that realy doesn't affect it.

(in any case if the civ name is shared... make it Civ name(Leader name) like they do with cities that share names)
 
I actually changed it to "X of the Y empire" (ie, "Lincoln of the American empire"). Makes it a lot easier to deal with requests when playing Unrestricted Leaders.

Bh

How'd you do that? :)
 
^ The problem with colonies looks like it might be fixed in the next patch, and since you can customize the game to have multiple different civs playing with the same Leader, That really doesn't affect it.

Essentially, if you mod it so there are multiples of the same civ, you need to mod it so that it states the Leader.. which you would need to do now anyways, as some things are stated with Leader Names, others with Civ Names.
or make it Civ name(Leader name) like they do with cities that share names [of course it is possible for a game to have multiple "Churchill of England" as well... but once they correct the multiple Englands bug, if you mod it back in...its your business to make it clear]
 
I ought to try a game against 10 Fredericks. I bet I could win that one.
 
I would really like to have the scores shown by nation name rather than by leader name. I play with unrestricted leaders, and since the colours on the map are associated with the particular nations rather than the leaders, I would find it easier at a glance to make out who is who if the nation name were given.

Even better are the suggestions of Bhruic or Krikkitone, to include both the the nation name and the leader name in the leaderboard.
 
How'd you do that? :)

Same file and line as I mentioned above. Replace the current line with:
Code:
szTempBuffer = u"%d: <color=%d,%d,%d,%d>%s</color> of the <color=%d,%d,%d,%d>%s</color>" %(gc.getGame().getPlayerScore(ePlayer), gc.getPlayer(ePlayer).getPlayerTextColorR(), gc.getPlayer(ePlayer).getPlayerTextColorG(), gc.getPlayer(ePlayer).getPlayerTextColorB(), gc.getPlayer(ePlayer).getPlayerTextColorA(), gc.getPlayer(ePlayer).getName(), gc.getPlayer(ePlayer).getPlayerTextColorR(), gc.getPlayer(ePlayer).getPlayerTextColorG(), gc.getPlayer(ePlayer).getPlayerTextColorB(), gc.getPlayer(ePlayer).getPlayerTextColorA(), gc.getPlayer(ePlayer).getCivilizationDescription(0))

Bh
 
Awesome! Next time i'm on my Civ PC, i'll change it around. Thanks man! :D
 
Thanks a lot, Bhruic! :goodjob:

I just changed
Code:
.getCivilizationDescription(0))
to
Code:
.getCivilizationShortDescription(0))

now it´s "Tokugawa of Japan" so that the list wont cover half the screen.

could you tell me, how to make python get that "of (the)" from an external .xml file to have it vary depending on the language you play?


EDIT: I made it! by try and error! thanks anyway
 
I've got a nice widescreen, so I don't mind it taking up more room, but if you don't, yeah, using Short would be preferable. Glad to see you got the other languages working.

Bh
 
Bhruic, I've got Khmer and Japan and England on my screen, but how do I get Tokugawa of Japan, or Churchill of England?
 
Bhruic, I've got Khmer and Japan and England on my screen, but how do I get Tokugawa of Japan, or Churchill of England?

If you want the "of" to adapt to the selected language, replace line with:

Code:
szTempBuffer = u"%d: <color=%d,%d,%d,%d>%s</color> %s <color=%d,%d,%d,%d>%s</color>" %(gc.getGame().getPlayerScore(ePlayer), gc.getPlayer(ePlayer).getPlayerTextColorR(), gc.getPlayer(ePlayer).getPlayerTextColorG(), gc.getPlayer(ePlayer).getPlayerTextColorB(), gc.getPlayer(ePlayer).getPlayerTextColorA(), gc.getPlayer(ePlayer).getName(), localText.getText("TXT_KEY_FROM", ()), gc.getPlayer(ePlayer).getPlayerTextColorR(), gc.getPlayer(ePlayer).getPlayerTextColorG(), gc.getPlayer(ePlayer).getPlayerTextColorB(), gc.getPlayer(ePlayer).getPlayerTextColorA(), gc.getPlayer(ePlayer).getCivilizationShortDescription(0))

and add the following line to xml-file Assets\XML\Text\CIV4GameTextInfos.xml
Code:
	<TEXT>
		<Tag>TXT_KEY_FROM</Tag>
		<English>of</English>
		<French>de</French>
		<German>von</German>
		<Italian>di</Italian>
		<Spanish>de</Spanish>
	</TEXT>

Now, depending on the language it´s "Tokugawa of Japan" in english or "Tokugawa von Japan" in german etc.

it took me 4 hours to figure that out, because i´ve never worked with python before.
 
I've managed to get the first part right, but I cant find the second file. Are you sure that's right?

EDIT: Dont worry, I've found it. Thanks :)
 
Top Bottom