TAM V.091 Testing

I've made two changes to the scoreboard, which I've been wanting to have. The first one is to show both name of the leader and the civ name like "Viriato of Iberian Tribes". Sometimes I forgot who is leading which civ (and particularly useful, if you are forgetful like me).

Another one is showing AI's attitude toward the player. It's always useful to know right away everyone's feeling toward you when dealing in diplo, or simply wants to get the general feeling of the rest of the world toward you without the need of going into foreign advisor screen. I don't use smilies because that will require changing the gamefont_75.tga, which I don't particularly feel like doing. So, they are showing as text only (Frnd/Plsd/Caus/Annd/Furs) in different colors.

The scoreboard now looks like:


The (trade) (rel) are just representation of the actual icon which the forum doesn't have this icons as smilies.

I include my CvMainInterface.py in this post if anyone want it.

If you want to change it yourself, for the leader/civ naming, in Mods/TAM/Assets/Python/Screens/CvMainInterface.py, around line 2786, you find:

Code:
if (not CyInterface().isFlashingPlayer(ePlayer) or CyInterface().shouldFlash(ePlayer)):
	if (ePlayer == gc.getGame().getActivePlayer()):
		szTempBuffer = u"%d: [<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())
	else:
		szTempBuffer = u"%d: <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())
else:
	szTempBuffer = u"%d: %s" %(gc.getGame().getPlayerScore(ePlayer), gc.getPlayer(ePlayer).getName())
szBuffer = szBuffer + szTempBuffer

Make changes to the following (insert a line in the begining, as well as changing the parameter in the end of the line of 2nd ifs, and 1st else):

Code:
szTempName = gc.getPlayer(ePlayer).getName() + " of " + gc.getPlayer(ePlayer).getCivilizationShortDescription(0)
if (not CyInterface().isFlashingPlayer(ePlayer) or CyInterface().shouldFlash(ePlayer)):
	if (ePlayer == gc.getGame().getActivePlayer()):
		szTempBuffer = u"%d: [<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(), szTempName)
	else:
		szTempBuffer = u"%d: <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(), szTempName)
else:
	szTempBuffer = u"%d: %s" %(gc.getGame().getPlayerScore(ePlayer), szTempName)
szBuffer = szBuffer + szTempBuffer

For the AI attitude, go down below around 10-15 lines further, and you'll find:

Code:
if (gc.getTeam(eTeam).isAlive()):
	if ( not (gc.getTeam(gc.getGame().getActiveTeam()).isHasMet(eTeam)) ):
		szBuffer = szBuffer + (" ?")
	if (gc.getTeam(eTeam).isAtWar(gc.getGame().getActiveTeam())):
		szBuffer = szBuffer + "("  + localText.getColorText("TXT_KEY_CONCEPT_WAR", (), gc.getInfoTypeForString("COLOR_RED")).upper() + ")"

Press enter after that last line, and insert the following code (make sure the "if" has the same indent has the previous "if"):

Code:
#attitude
if not gc.getPlayer(ePlayer).isHuman():
	iAtt = gc.getPlayer(ePlayer).AI_getAttitude(gc.getGame().getActivePlayer())
	if iAtt == 0:
		iAttWord = localText.getColorText("Furs", (), gc.getInfoTypeForString("COLOR_RED"))
	elif iAtt == 1:
		iAttWord = localText.getColorText("Annd", (), gc.getInfoTypeForString("COLOR_PLAYER_DARK_CYAN"))
	elif iAtt == 2:
		iAttWord = localText.getColorText("Caus", (), gc.getInfoTypeForString("COLOR_LIGHT_GREY"))
	elif iAtt == 3:
		iAttWord = localText.getColorText("Plsd", (), gc.getInfoTypeForString("COLOR_YELLOW"))
	else:
		iAttWord = localText.getColorText("Frnd", (), gc.getInfoTypeForString("COLOR_GREEN"))
	szTempBuffer = " [" + iAttWord + "] "
	szBuffer = szBuffer + szTempBuffer
#attitude end

It's not pretty, but it does what I want it to do. Hope this helps other players too.

Edit: Almost forgot to provide my file as attachment.

Ono-Neko,

nice work, looking forward to it being integrated. are you familar with BUG? its a modified HUD being used in FFH/Wild Mana. With it you can customize a lot of features such as the score board, where it uses the various smiley faces to indicate your diplomatic status. might check it out, and see if there is anything there that would fit.
 
I've played quite number of mods that has BUG incorporated into them. I know what BUG can do, but I don't have the knowledge on the coding end of BUG. I can dig through it for specific, which I did to find out how to add the civ name into scoreboard. However, to merge BUG into TAM, I still have long long way to go to do that. I might check it out to see if I can do that but that will probably take very long time, since this is the first time I am meddling with python (that changes I made is my first piece of python :)) and modding.
 
I don't use smilies because that will require changing the gamefont_75.tga, which I don't particularly feel like doing

I can do that into gamefont_75.tga, if you'll give me the smile arts to insert in and if you'll do the python changes ;)

By the way, a BIG THANX to Dertuek and ono-neko for their python fixes :goodjob:
 
I can do that into gamefont_75.tga, if you'll give me the smile arts to insert in and if you'll do the python changes ;)

By the way, a BIG THANX to Dertuek and ono-neko for their python fixes :goodjob:

I don't actually have the graphic files for the smilies. We can (a) use the ones in BUG mod, or (b) make them ourselves. I'd prefer (a), so if you have any mod with BUG mod merged, you may be able to get it from its gamefont_75.tga. Actually, the smilies being in that file is only a "best guest" I have. At least as far as I know, that's where they should be (as said previously, I am pretty much a newbie in modding). Let me know if you want me send you BUG mod's gamefont_75.tga.

Also, I managed to get Civ4lert run in TAM. It appears to be much simpler than I had been trying to do. It's simply a straight copy of the files without the need of fiddling with anything else, except the civ4lert.ini file. It's the version available in this thread. I know that one is pretty old and basic. From what I can tell, any version after that are only developed as part of other mods, primarily BUG.
 
I've played quite number of mods that has BUG incorporated into them. I know what BUG can do, but I don't have the knowledge on the coding end of BUG. I can dig through it for specific, which I did to find out how to add the civ name into scoreboard. However, to merge BUG into TAM, I still have long long way to go to do that. I might check it out to see if I can do that but that will probably take very long time, since this is the first time I am meddling with python (that changes I made is my first piece of python :)) and modding.

I dont neccesarily think that we should merge BUG for TAM, but I thought maybe it would be a good source of backward engineering if you needed it... haha..

BUG would probably detract from the simpleness (in a good way) of TAM, especially in the processing department. I suspect that it contributes to some degree to the Memory Allocation Failures that other mods experience. (I dont know this, just suspicious)
 
I dont neccesarily think that we should merge BUG for TAM, but I thought maybe it would be a good source of backward engineering if you needed it... haha..

BUG would probably detract from the simpleness (in a good way) of TAM, especially in the processing department. I suspect that it contributes to some degree to the Memory Allocation Failures that other mods experience. (I dont know this, just suspicious)

I agree. It's not necessary to have the whole-nine-yard of BUG's features. At least I settle with some alerts (city growth/unhappiness/unhealty) and basic info in the scoreboard. Plus, I think BUG require changes/recompiling of the dll, which I don't have the ability or the required tools to do so. So, reading whatever python code they have is the best I can do.

I have to admit that even though TAM's map is massive, in so many years I've been playing TAM (since the vanilla, I think), I've never encounter MAF or random crashes because of TAM. And, I have a quite old PC too :)

Yes, both gamefont_75.tga and gamefont.tga, please (send me a PM or attach them on a post)

Here's the files in the attachment.
 

Attachments

  • Fonts.rar
    165.4 KB · Views: 199
@ono-neko

Try it (after renaming the tga, of course) ;)
 

Attachments

  • TAM GameFont_75.7z
    50.9 KB · Views: 206
Woah! It works! Big thanks to you, ambrox62, for doing the gamefont. Here's the latest CvMainInterface.py in the attachment.

Note that I moved the attitude icons to the end of the line for better visibility. I am thinking perhaps religion icon can be moved to the end before the attitude icon. However, I am open for any suggestions as to what's best for the scoreboard. You think any other info needs to be there? BUG has a whole lot of options for what to be shown in the scoreboard (delta score, # of cities, too many things to mention). However, I don't think anything else needed there, but I am open to any suggestion.

Another thing I like about BUG's scoreboard is how the lines are aligned for better reading. I am thinking of doing that, but following BUG's python is not easy.
 

Attachments

  • CvMainInterface.rar
    20.2 KB · Views: 193
While I was doing testing, I noticed that once in a while the PythonErr.log logs the following:
Can't find type enum for type tag BONUS_OIL
Can't find type enum for type tag BONUS_URANIUM
Can't find type enum for type tag ERA_INDUSTRIAL
Can't find type enum for type tag TECH_METAL_CASTING
Can't find type enum for type tag BONUS_OIL
Can't find type enum for type tag BONUS_URANIUM
Can't find type enum for type tag RELIGION_ISLAM
Can't find type enum for type tag TECH_METAL_CASTING
Can't find type enum for type tag BONUS_OIL
Can't find type enum for type tag BONUS_URANIUM
Can't find type enum for type tag ERA_INDUSTRIAL
Can't find type enum for type tag TECH_METAL_CASTING

Anyone has any idea what causes them?
 
While I was doing testing, I noticed that once in a while the PythonErr.log logs the following:


Anyone has any idea what causes them?

ono-neko,

wouldnt that be from removed xml tags?

i seem to recall deleting some tags a long time ago, not realizing they might cause a python error. so if this is a correct theory, can you do a search for the python command that looks for the xml tags, and remove them?

@ Duertek, is this something you would know about?

edit 1) the majority of tags in question are industrial age tags which i remember deleting some (cant remember exactly where) trying to clean up some files.
 
Not much info given in the log, so I am not sure where to start in the search. However, checking the xml.log, I found the following, which may be related:
[85185.172] SetGlobalClassInfo (Civ4EspionageMissionInfo/EspionageMissionInfos/EspionageMissionInfo)
[85185.172] info type NONE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85185.172] info type NONE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85185.172] info type NONE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85185.172] info type NONE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85185.172] info type NONE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85185.172] info type NONE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85185.172] info type NONE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85185.172] info type NONE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85185.172] info type NONE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85185.172] info type NONE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85185.172] info type NONE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85185.172] info type NONE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85185.172] info type NONE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85185.172] info type NONE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85185.172] info type NONE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85185.172] info type NONE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85185.172] info type NONE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85185.188] info type NONE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85270.625] info type BONUS_OIL not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85270.625] info type BONUS_URANIUM not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85270.625] info type ERA_INDUSTRIAL not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85270.625] info type TECH_METAL_CASTING not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85283.531] info type BONUS_OIL not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85283.531] info type BONUS_URANIUM not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85283.531] info type RELIGION_ISLAM not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85283.531] info type TECH_METAL_CASTING not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85318.141] info type BONUS_OIL not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85318.141] info type BONUS_URANIUM not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85318.141] info type ERA_INDUSTRIAL not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[85318.141] info type TECH_METAL_CASTING not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
[86004.703] info type TECH_METAL_CASTING not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml

Do you know from which file(s) you removed those tags?
 
Do you know from which file(s) you removed those tags?

Most likely the tags i removed were strategy tags, so those probably are not causing the error.

I just did a quick search for "TECH_METAL_CASTING" on my xml editor, and it only returned one result

which was the quote tag, so that tells me all the other related tags/files were removed as unneeded for this mod.

so it would seem to me, that removing any calls for the above tag in python, should remove your error message???

i have not worked in python yet, so i dont Know that with certainty, but it seems logical.
 
As far as I know, those things, or tech/info are not hard coded in Python, but rather everything is read from XML. It seems something, whatever that is, is looking for those info, and couldn't find them anywhere.

Maybe I am wrong. I will keep looking.
 
As far as I know, those things, or tech/info are not hard coded in Python, but rather everything is read from XML. It seems something, whatever that is, is looking for those info, and couldn't find them anywhere.

Maybe I am wrong. I will keep looking.

What about a schema file, though I dont recall any in TAM?

but essentially im sure you are right, something is making it look for files/tags that are non existent and returning an error.
 
I did a research on this, and found a thread with similar issue. I am not sure if it explains the same issue with TAM. However, I can't seem to find anything wrong anywhere. I did a search on all TAM's files and found none of those tags.
 
I think we can ignore those tag warning/error, since it doesn't seem to affect the game play in anyway. Unless someone else has some idea how to resolve that.

I've been making some changes with Civ4lert and testing it in my game. So far it works as expected:
1) report if a city's pop will grow to next level the next turn
2) report if a city will be unhealthy the next turn
3) report if a city will be unhappy the next turn
4) #1-#3 will only be reported if the city has Avoid Growth turned off.
5) report when the city's pop has grown to next level in the current turn

I removed the report about how much gold AI has for trading because there is an error with the original code. Plus, I don't find it particular useful to know about it (I usually go through most of my allies to see what they can offer, when I am on diplo spree).

You can find the attachment in this post. Simply copy the folders/files to the exact same place in TAM's mod folder.

Any other alerts that you guys think might be useful?
 

Attachments

  • Civ4lerts for TAM.rar
    7.9 KB · Views: 187
I think we can ignore those tag warning/error, since it doesn't seem to affect the game play in anyway.

May be they come from events mechanic. I play with python exception display ON, and these warnings pop up in the mid-late game at the beginning of each turn. I suspect that regular BTS event files were always processed, but I may be 100% wrong... :confused:
 
Top Bottom