• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.

Development Thread

@Ruff: I just took a closer look at the victory screen and encountered a problem:

The text of the object's name is displayed as a whole instead of just the first one before the ":". Can you fix it? :dunno:
This looks pretty straight forward from looking at the code. I cannot see why it is displaying it 3 (or more) times. I'll fire up my Civ4, swap to German and see what I get. The 'gender / plural' stuff my be mucking me up.

Edit: just fired up Civ4 with BUG loaded and it was looking 100% fine in English, French and German. Can you take another look? If it is still broken, search for the 'TXT_KEY_PROJECT_APOLLO_PROGRAM' key in your xml - that is where it is pulling the info from. For me, it is in the 'CIV4GameTextInfos_Objects.xml' file under vanilla Civ4 (C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Assets\XML\Text).
 
There is a new version of the Full of Resources map script: click

@Alerum - Some of the maps have the version # in their name, meaning to add this we'll have to delete the previous version. Is there a reason for this or can I remove the version #s from the names?
 
This looks pretty straight forward from looking at the code. I cannot see why it is displaying it 3 (or more) times. I'll fire up my Civ4, swap to German and see what I get. The 'gender / plural' stuff my be mucking me up.

Edit: just fired up Civ4 with BUG loaded and it was looking 100% fine in English, French and German. Can you take another look? If it is still broken, search for the 'TXT_KEY_PROJECT_APOLLO_PROGRAM' key in your xml - that is where it is pulling the info from. For me, it is in the 'CIV4GameTextInfos_Objects.xml' file under vanilla Civ4 (C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Assets\XML\Text).

Still having the same issue. The tag looks like this:
<German><Text>Apollo-Programm:Apollo-Programmes:Apollo-Programm:Apollo-Programm</Text><Gender>neuter:neuter:neuter:neuter</Gender><Plural>0:0:0:0</Plural></German>
 
well - that is your issue ... my xml code looks like this ...
Code:
	<TEXT>
		<Tag>TXT_KEY_PROJECT_APOLLO_PROGRAM</Tag>
		<English>Apollo Program</English>
		<French>
			<Text>Programme Apollo</Text>
			<Gender>Male</Gender>
			<Plural>0</Plural>
		</French>
		<German>
			<Text>Apollo-Programm</Text>
			<Gender>Male</Gender>
			<Plural>0</Plural>
		</German>
		<Italian>
			<Text>Programma Apollo</Text>
			<Gender>Male</Gender>
			<Plural>0</Plural>
		</Italian>
		<Spanish>
			<Text>el Programa Apollo</Text>
			<Gender>Male</Gender>
			<Plural>0</Plural>
		</Spanish>
	</TEXT>

... and this is from my prog files file(!). Not sure why they are different. I guess there must be some code that I need to add to the 'get info from XML' for gender. Anyone got a suggestion? Or and example?
 
just seen, there are now two victoryscreen files, is there a need for both?

CvVictoryScreen1.py and CvVictoryScreen.py
 
just seen, there are now two victoryscreen files, is there a need for both?

The 1 one should not have been committed. You can safely delete it, though assuming you're using our SVN, it will be deleted for you.
 
thanks.... svn has not deleted it. there was no file and after the update there were those two files. thanks anyway.
 
thanks.... svn has not deleted it. there was no file and after the update there were those two files. thanks anyway.

As I said, we need to delete it from SVN before updating will delete it on your end.
 
@Cam:

I found the solution for the German grammar not showing up correctly in the Autolog messages. Instead of using pWinner.getName() and pLoser.getName() you have to use pWinner.getNameKey() and pLoser.getNameKey() (lines 467, 471, 478, 482 in autologEventManager.py). I'm so glad that I finally found the problem. :D
However, this works only for four of six battle messages as TXT_KEY_AUTOLOG_WHILE_ATTACKING_ESCAPES (line 523 in autologEventManager.py) and TXT_KEY_AUTOLOG_WHILE_ATTACKING_DECIMATES (line 527) are using different commands (.sUnitName). It is possible to replace those with a command that recognizes the <Gender>- and <Plural>-tags?

Another thing is the Ok and Cancel buttons for the log entries of players (lines 113/114 and 131/132 in autologEventManager.py). They are not translatable yet, but I played around with it and came up with this solution:
Code:
popup.addButton(BugUtil.getPlainText("TXT_KEY_MAIN_MENU_OK"))
popup.addButton(BugUtil.getPlainText("TXT_KEY_SCREEN_CANCEL"))
The TXT_KEYs refer to the basic Civ4-XMLs so no need to translate 'em and they definitely work. Are you Ok with it? :)


@Ruff:

I tried to do something similar in CvVictoryScreen.py to solve the problem I mentioned above but it just screws up the screen (half of the text and all tabs missing). I replaced
Code:
localText.getText("TXT_KEY_PROJECT_APOLLO_PROGRAM", ()) [line 878 and 887]
with
Code:
localText.getText[B]Key[/B]("TXT_KEY_PROJECT_APOLLO_PROGRAM", ()).
Any suggestions on that? :dunno:
 
Instead of using pWinner.getName() ...

TXT_KEY_AUTOLOG_WHILE_ATTACKING_DECIMATES (line 527) are using different commands (.sUnitName)...
pWinner is a pointer at a particular unit. The .sUnitName is not an actual pointer - it is a dumbed down version. This is because the event driving these two items returns different parameters - totally stupid, but there you go.

Do you have a modified victory screen py file that I can take a look at. Or if you just added the 'key' part - I can go from there. Actually - not sure if that will help as I did swap to German and it came thru ok for me. Maybe attach your version of the project xml file and I'll take a look at it.
 
I just added the 'key' in both lines. The German entry of the Apollo Program looks like this:
<German><Text>Apollo-Programm:Apollo-Programmes:Apollo-Programm:Apollo-Programm</Text><Gender>neuter:neuter:neuter:neuter</Gender><Plural>0:0:0:0</Plural></German>

I thought if it works for the Autolog messages, maybe it will do so for this issue aswell. I searched the Python reference and found "getTextKey" as a valid command. But it didn't work. :dunno:
 
@Cam:

I found the solution for the German grammar not showing up correctly in the Autolog messages. Instead of using pWinner.getName() and pLoser.getName() you have to use pWinner.getNameKey() and pLoser.getNameKey() (lines 467, 471, 478, 482 in autologEventManager.py). I'm so glad that I finally found the problem. :D

:goodjob:
If they works even with other languages (as I suppose) fell free to change them :)

However, this works only for four of six battle messages as TXT_KEY_AUTOLOG_WHILE_ATTACKING_ESCAPES (line 523 in autologEventManager.py) and TXT_KEY_AUTOLOG_WHILE_ATTACKING_DECIMATES (line 527) are using different commands (.sUnitName). It is possible to replace those with a command that recognizes the <Gender>- and <Plural>-tags?

No idea, this is a question for our coders ;)

Another thing is the Ok and Cancel buttons for the log entries of players (lines 113/114 and 131/132 in autologEventManager.py). They are not translatable yet, but I played around with it and came up with this solution:
Code:
popup.addButton(BugUtil.getPlainText("TXT_KEY_MAIN_MENU_OK"))
popup.addButton(BugUtil.getPlainText("TXT_KEY_SCREEN_CANCEL"))
The TXT_KEYs refer to the basic Civ4-XMLs so no need to translate 'em and they definitely work. Are you Ok with it? :)

So OK that I have already thought to do something like this while on bus, and then forgot to do it later :D So I'm very happy that you did :)
 
:goodjob:
If they works even with other languages (as I suppose) fell free to change them :)

No idea, this is a question for our coders ;)

So OK that I have already thought to do something like this while on bus, and then forgot to do it later :D So I'm very happy that you did :)

Ok, I've commited the stuff. :cool:
Works with all languages as this function is used in the standard Civ4-files aswell. Actually, that's where I found it in the first place. :D
 
I think the problem you're having using getTextKey() on the Victory screen is that you're using it on the CyTranslator (localText) object which doesn't have that function. It's only available on CvInfo objects (like CvUnitClassInfo and CvBuildingInfo).
 
I think the problem you're having using getTextKey() on the Victory screen is that you're using it on the CyTranslator (localText) object which doesn't have that function. It's only available on CvInfo objects (like CvUnitClassInfo and CvBuildingInfo).

So, is there a way to solve this and the issue with the two Autolog messages that utilize the sUnitName command (see above)? :dunno:
 
So, is there a way to solve this and the issue with the two Autolog messages that utilize the sUnitName command (see above)? :dunno:

What's the first one you mention?

The two sUnitName ones can't be fixed. The DLL only reports the units' names in the CombatLogHit event along with all the modifiers and hit points. It passes along the units' owners, but not their IDs.
 
What's the first one you mention?
The one I quoted. :D
The two sUnitName ones can't be fixed. The DLL only reports the units' names in the CombatLogHit event along with all the modifiers and hit points. It passes along the units' owners, but not their IDs.

What about wrapping the function up into a variable and use that one with 'getNameKey'? Don't hit me if this is total BS. :D

Edit: I scanned the SDK and found 'pDefender', 'pAttacker' commands. Could these be used instead of the currently utilized code?
 
What about wrapping the function up into a variable and use that one with 'getNameKey'? Don't hit me if this is total BS. :D

I'm afraid a beat down is necessary at this point. ;) The DLL gives the Python code the units' names. Without changing the DLL, we can't get the units' IDs.

Think of it like this. A cop sees a car speeding away from a bank robbery and calls it in as "a yellow car". Sure, the police can look up the car registrations to find all the yellow cars, but without the license plate number (unique identifier), they can't know which one was used in the bank robbery. The DLL is the cop.

As for the CyTranslator issue, there's simply no function with the name you are using. You may as well be telling it to "fooble" a "barzelblat". :D Given that the same code works to display the German AP for Ruff, I think there's something else going on here. I'll let Ruff speak to it. ;)
 
Is it possible to make the prefix for user comments (currently "Player Comment") and the "DEFAULT" text at the unit naming tab translatable (and perhaps the default naming convention)? Not a big thing but they are the last parts of the options screen that are not yet "XMLified". :D

 
Back
Top Bottom