Civilization Fanatics' Forums Exotic Foreign Advisor
 User Name Remember Me? Password
 Home Register Downloads Modiki Gallery Links Chat FAQ Members List Calendar Mark Forums Read

 Notices In order to provide a bit more focus on civilization-related content for the site, we have recruited a number of willing volunteers to help collect, collate and organise civ-related information on the site. Read more about it in Site Feedback, and help us welcome the new staff.

Dec 09, 2005, 04:17 AM   #1
Requies
Prince

Join Date: Nov 2005
Posts: 381

This is currently on version 0.94.

 See this post for 0.95, which is compatible with the 1.61 patch [/Edit]

Code:
Exotic Foreign Advisor
______________________

This advisor came about because the original Advisors seems to have a dearth of important information

Credits: SupremeOverlord - for the Enhanced Foreign Advisor from which the code for the Resource and Tech screens were taken (with a fix or two and some changes)
Bhruic - for the "Tradeable" mod from which the idea was gained to separate the resources into "Surplus" (more than just 1) and "Used" (only 1).
Mysterio10000 - for suggesting adding the qualitative attitude to glance screen and the centering of the Foreign Advisor title
Cammagno - for pointing out and testing a bug related to Glance coloring and translating some of the text into Italian.
Major Tom - for pointing out a bug and providing a save file to fix it with

Features
________

1. Added in a "Glance" screen which shows how each AI feels toward everyone else. Also added in color coding and the ability to sort this screen.
a) This is basically a big table which I generated myself where the ROW leaderhead is the target and the COLUMN leaderhead is the one whose attitude is listed (so if you check on the number where Washington's ROW meets Montezuma's COLUMN, you are viewing Montezuma's attitude TOWARD Washington).
b) The color coding right now is based on player's attitude toward another. If he's friendly to another, it's green. If he's pleased with another, it's cyan. If he's annoyed with another, it's magenta. If he's furious with another, it's red.
d) To change the direction of sorting, click on the big + button in the top left corner.
e) None indicates either the leaders have not met or that they are the same leader.
2. Added in an Info screen with the following information.
a) A player's state religion (and if he has the holy city)
b) The trade is the net trade you have with EACH opponent for ALL your cities. So, if you close open borders, you will LOSE this amount of commerce (and likely gain a much smaller amount)
c) The current civics this player is running (from left to right is Government, Legal, Labor, Economy, Religion)
d) The player's favorite civic (along with the type of civic)
3. Added in resources and technologies that the leader WANTS to the main resource and technology trading screens. Resources are divided into "Surplus" (Player has > 1) and "Used" (Player has ONLY 1) resources. Thanks to Supreme Overlord for the basic code.
4. Added in the technologies that the other players can research BASED ON THE INFORMATION from the technology trading screen. IOW, it will only calculate which technologies the other players can research based on what you know they have.

_____________________________
FEATURES
--------
General:
- Displaying the names of the leaders of the other civs can be switched on or off.
- The border around the rows can be switched on and off.
Resources:
- At the top of the screen the available amount is shown for all the resources that a
player has extra's of.
- The amount can be configured to show the total available amount or the extra available
amount (total - 1).
- The resources that a player can trade with another civ are shown on the same row as the
resources that that civ will or won't trade with the player.
- The resources that a player can trade are divided into two groups. One for the
resources for which the player has extra's available and another for those resources
for which the player has no extra's.
- It is possible to group the columns showing resources together as export or import.
- The amount of gold that a civ can pay per turn is displayed
- It is possible to show two extra columns to display the resources that are traded in
active deals.
- When the active deals are displayed the total gold amount that is traded is also shown,
a positive amount means that the civ is paying the player, a negative amount means that the
player is paying the other civ
Technologies:
- For each other civ three columns are used to display the techs that civ wants, the techs
that civ will trade and the techs that civ won't trade.
- An extra column is used to display the amount of gold that the civ can pay
- You can use small (32x32) and large (64x64) icons for the technologies.

CHANGING THE LAYOUT
-------------------
You can change the layout of the screen by editing the file 'CvForeignAdvisor.py' in the
'Assets\python\screens' folder of the mod.

In this file you need to look for the line 'def __init__(self):' (somewhere at the top of
the file). All the options are listed below this line and have the format
'self.OPTION_NAME = value.

Installation
____________

Exotic Foreign Advisor should NOT be installed in your main Civ IV location, as it will overwrite one necessary file.
Instead, it should be installed at:  "My Documents\My Games\Civilization 4\.
Prior to installation make sure you have upgraded to patch 1.09 as the compatibility changed when Civ IV upgraded (some functions were renamed).
Please note that you MAY have to clear your cache once or twice before the installation/uninstallation will be complete. To do this, hold down the SHIFT button right after you launch Civ IV (i.e., double click the icon). Or go to your cache folder (for me it's My Documents\TempSettings\(UserName)\AppData\My Games\Civilization 4\cache) and delete everything from the directory (this is the recommended method).
To install: Just unzip the zip file with the target being the above indicated directory (may be different for different languages).
Installation will create many new files. The following is the list:

-CvExoticForeignAdvisor.py in subdirectory CustomAssets\python\screen
-TechTree.py in subdirectory CustomAssets\python\screen
-IconGrid.py in subdirectory CustomAssets\python\screen
-CvReqScreensInterface.py in subdirectory CustomAssets\python\entrypoints,
-DomPyHelpers.py in subdirectory CustomAssets\python
-CIV4AdvisorInfo.xml in subdirectory CustomAssets\xml\text
-CIV4EnhancedTextInfos.xml in subdirectory CustomAssets\xml\text
-white_circle_50.tga and white_circle_50.dds in subdirectory CustomAssets\art\Interface\buttons
-white_circle_40.tga and white_circle_40.dds in subdirectory CustomAssets\art\Interface\buttons
-white_circle_20.tga and white_circle_20.dds in subdirectory CustomAssets\art\Interface\buttons
-up_arrow.xcf, up_arrow.tga and up_arrow.dds in subdirectory CustomAssets\art\Interface\buttons
-down_arrow.xcf, down_arrow.tga and down_arrow.dds in subdirectory CustomAssets\art\Interface\buttons

and will create a new copy of two files:

-CvScreensInterface.py in CustomAssets\python\entrypoints
-CIV4ArtDefines_Interface.xml in CustomAssets\xml\art

To uninstall, all that is needed is to move, remove, or rename the CvScreensInterface.py from the My Documents\My Games\Civilization 4\ directory AND ANY SUBDIRECTORIES OF IT.
Note: If you have BOTH the Special Domestic Advisor and the Exotic Foreign Advisor, install the CvReqScreensInterface.py AS CvScreensInterface.py in the aforementioned directory.
To combine this mod to another mod, just add the new files CvExoticForeignAdvisor.py, DomPyHelpers.py, and Civ4AdvisorInfo to the aforementioned My Documents directory (or your mod directory) and make the changes documented in CvScreensInterface.py if you have changed it in your mod.

Known Problems
______________

None

Future TODO
___________

History
_______

v0.94
- Fixed a major bug where if another civ can trade a technology but "can't research" it, the foreign advisor screen becomes unresponsive.

v0.93
- Fixed a bug where the glance screen wasn't colored correctly for Italian
- Added in the technologies which another player can research to the technology trading screen.
- Added in cammagno's italian translated xml file

v0.92
- Fixed a bug where the glance screen wasn't colored correctly for foreign languages.
- Changed the Foreign Advisor Title so that it's in the center of the screen.

v0.91
- Colored the glance number based on the qualitative attitude one player has toward another
- Changed the resource and tech trading screens to SupremeOverlord's version because they were far superior to mine
- Added in religion, civic, and favorite civic information to the renamed "Info" screen (was "Gold")
- Made it compatible with v1.52 patch
- Changed Exotic Foreign Advisor so that it actually inherits from the Foreign Advisor so that the code we actually don't change is used (in case Firaxis makes some improvements in other areas).

v0.9
- beta version of release (waiting for feedback on it and still need to pretty up and document a lot of the code).
Attached Files
 ExoticForeignAdvisor v0.94.zip (66.8 KB, 2378 views)

Last edited by Dianthus; Apr 19, 2006 at 09:32 AM.

 Dec 09, 2005, 04:18 AM #2 Requies Prince   Join Date: Nov 2005 Posts: 381 Screenshots! New Screenshot! Spoiler: Basic Glance Screen Spoiler: Sorted Glance Screen Spoiler: Info Screen Spoiler: Resource Trading Spoiler: Tech Trading Spoiler: Last edited by Requies; Jan 04, 2006 at 06:48 AM.
 Dec 09, 2005, 04:19 AM #3 Requies Prince   Join Date: Nov 2005 Posts: 381 Future Issues
 Dec 09, 2005, 04:20 AM #4 Requies Prince   Join Date: Nov 2005 Posts: 381 Reserved for future use
 Dec 09, 2005, 04:35 AM #5 Major Tom Chieftain   Join Date: Jun 2005 Posts: 32 This is great work, Requies. Seems to be a must have. Had a quick glance at it and it works fine. However, as you point out it is unfortunately not to find Gold/Turn amount that the opponent is willing to trade. The treasury amount of an AI in the "gold screen" is not the same amount as in the trade screen. Am I missing something? Last edited by Major Tom; Dec 09, 2005 at 05:47 AM.
 Dec 09, 2005, 05:58 AM #6 Mysterio10000 Prince     Join Date: Nov 2005 Location: Wesley Chapel, FL Posts: 309 Excellent job, Requies! Thanks for incorporating Bhruic's mod, since it's very useful and one whose functions should have been in Civ IV from the start. I have a suggestion: Since +3 net relations (as an example) with one leader doesn't always equate to the same attitude as +3 net relations with another leader, it'd be helpful to see the leader's attitude toward the target listed below the net relations number, if possible. Also, in your readmes, I'd suggest indenting the required files and their path locations instead of listing them all in a single paragraph. It'd make it more user friendly on the reader. Keep up the good work!
Dec 09, 2005, 06:04 AM   #7
Mysterio10000
Prince

Join Date: Nov 2005
Location: Wesley Chapel, FL
Posts: 309
Quote:
 Originally Posted by Major Tom The treasury amount of an AI in the "gold screen" is not the same amount as in the trade screen. Am I missing something?
I can confirm, as well, that this is a bug.

Dec 09, 2005, 06:45 AM   #8
Requies
Prince

Join Date: Nov 2005
Posts: 381
Quote:
 Originally Posted by Major Tom This is great work, Requies. Seems to be a must have. Had a quick glance at it and it works fine. However, as you point out it is unfortunately not to find Gold/Turn amount that the opponent is willing to trade. The treasury amount of an AI in the "gold screen" is not the same amount as in the trade screen. Am I missing something?
Thanks! That's because it seems as though in the diplomacy screen, they round down the actual gold they have to the nearest 10 . Ever wonder why their treasury is always a multiple of 10?

Hmmmm, I wonder if I should change it.... Well, what do you guys think? Change it so the gold is always rounded down?

Req

Dec 09, 2005, 06:48 AM   #9
Requies
Prince

Join Date: Nov 2005
Posts: 381
Quote:
 Originally Posted by Mysterio10000 Excellent job, Requies! Thanks for incorporating Bhruic's mod, since it's very useful and one whose functions should have been in Civ IV from the start. I have a suggestion: Since +3 net relations (as an example) with one leader doesn't always equate to the same attitude as +3 net relations with another leader, it'd be helpful to see the leader's attitude toward the target listed below the net relations number, if possible. Also, in your readmes, I'd suggest indenting the required files and their path locations instead of listing them all in a single paragraph. It'd make it more user friendly on the reader. Keep up the good work!

Heh, I do.

The only problem is that these forums take out all white space . If you look at the actual README file, you'll see the indentation.... I could put it as a code snippet, if that would help?

Req

 Dec 09, 2005, 07:00 AM #10 Major Tom Chieftain   Join Date: Jun 2005 Posts: 32 Regerding treasury. It is not a matter of rounding down (not important). I am trying to persuade Cathrine into something and in gold screen she has 3517 gold (or is it commerce?). In diploscreen she has 1720 available.
Dec 09, 2005, 07:12 AM   #11
Requies
Prince

Join Date: Nov 2005
Posts: 381
Quote:
 Originally Posted by Major Tom Regerding treasury. It is not a matter of rounding down (not important). I am trying to persuade Cathrine into something and in gold screen she has 3517 gold (or is it commerce?). In diploscreen she has 1720 available.
It's gold.... hmmmm, that could be the case. All my games, nobody had accumulated that much gold .

Hmmm, not sure what to do since the diplomacy screen seems to be written in C++ and I don't have access to the same functions.

I'll try looking for another function which simulates the diplo screen function.

Req

 Dec 09, 2005, 07:18 AM #12 Requies Prince   Join Date: Nov 2005 Posts: 381 Can you post a save file where the leaders have a larger amount of gold? I want to see if I can come up with the formula that they use in the diplomacy screen. Thanks, Req
Dec 09, 2005, 07:33 AM   #13
Requies
Prince

Join Date: Nov 2005
Posts: 381
Quote:
 Originally Posted by Mysterio10000 Since +3 net relations (as an example) with one leader doesn't always equate to the same attitude as +3 net relations with another leader, it'd be helpful to see the leader's attitude toward the target listed below the net relations number, if possible.
I'll see if this is possible, though space IS at a premium....

Req

 Dec 09, 2005, 07:38 AM #14 Bhruic Emperor   Join Date: Nov 2005 Posts: 1,455 Hmm, looks like you should be able to get the Gold they'll trade from the Civ4LeaderHeadInfos table. getMaxGoldPerTurnTradePercent() getMaxGoldTradePercent() Problem is, it seems most leaders have 10 and 5/10 respectively. From the above description of Catherine (who has a '5' for iMaxGoldTradePercent), that means she should have only been willing to trade 175 gold. Bh Last edited by Bhruic; Dec 09, 2005 at 07:45 AM.
Dec 09, 2005, 07:44 AM   #15
Requies
Prince

Join Date: Nov 2005
Posts: 381
Quote:
 Originally Posted by Bhruic That's why I never added it - the actual amount of gold they have isn't the same as what they'll trade. I could find any function that determined exactly how much they'd trade either. Bh
Hmmm, that's good to know. I'd like to see if I can try to determine the formula they are using. Unfortunately, I need saves which have those large amounts of gold.

Otherwise, I might have to scrap the Gold part, and since that's a part that so many people clamor for, I'd hate to do that.

Thanks for the input!
Req

 Dec 09, 2005, 07:44 AM #16 Tubby Rower Chronic Slacker     Join Date: Nov 2004 Location: Middle of Virginia Hair: None Posts: 5,832 in your demo screens, How does everyone have extra hit singles, movies, and musicals? __________________ Mii Wii Number - 8312 8910 9560 5088 NEVER UNDERESTIMATE THE POWER OF STUPID PEOPLE IN LARGE GROUPS --never fight with an idiot, for he'll bring you down to his level and beat you by experience.-- >>>>"imagine a super idiot so idiotic you don't even say a word and he starts laughing at what you said. That'd be amazing" - B <<<< "Stupid is forever. You can't change stupidity." - Temple's Basketball Coach John Chaney to the home crowd
Dec 09, 2005, 07:45 AM   #17
Requies
Prince

Join Date: Nov 2005
Posts: 381
Quote:
 Originally Posted by Bhruic Hmm, looks like you should be able to get the Gold they'll trade from the Civ4LeaderHeadInfos table. getMaxGoldPerTurnTradePercent() getMaxGoldTradePercent() Problem is, it seems most (all?) leaders have 10 and 5 respectively. From the above description of Catherine, that means she should have only been willing to trade 175 gold. Bh
Yeah, that was the first place I looked to. Plus, it isn't even completely correct since if their treasury is low enough, they're willing to trade much more than 5% (or even 50% which would be my guess).

Req

Dec 09, 2005, 07:49 AM   #18
Requies
Prince

Join Date: Nov 2005
Posts: 381
Quote:
 Originally Posted by Tubby Rower in your demo screens, How does everyone have extra hit singles, movies, and musicals?
They don't, surplus shows what YOU have which they don't.

It basically combines both what they might want to trade for and what YOU might want to trade for on the same line.

I was trying to figure out a better way to do it, but this was the best so far. I also posted a poll (which only 4 people responded too ) and 3 of them liked the new screen while 1 wasn't sure why he didn't like it....

If you have a better idea of how to divide it up and still show all the data, please let me know!

Req

 Dec 09, 2005, 08:00 AM #19 Tubby Rower Chronic Slacker     Join Date: Nov 2004 Location: Middle of Virginia Hair: None Posts: 5,832 I don't look for polls.. sorry. But I do have a suggestion... Eliminate the Used section from the AI's line. You can see your used resources at the top. I just now saw the "Will Trade" section . __________________ Mii Wii Number - 8312 8910 9560 5088 NEVER UNDERESTIMATE THE POWER OF STUPID PEOPLE IN LARGE GROUPS --never fight with an idiot, for he'll bring you down to his level and beat you by experience.-- >>>>"imagine a super idiot so idiotic you don't even say a word and he starts laughing at what you said. That'd be amazing" - B <<<< "Stupid is forever. You can't change stupidity." - Temple's Basketball Coach John Chaney to the home crowd
Dec 09, 2005, 08:03 AM   #20
Requies
Prince

Join Date: Nov 2005
Posts: 381
Quote:
 Originally Posted by Tubby Rower I don't look for polls.. sorry. But I do have a suggestion... Eliminate the Used section from the AI's line. You can see your used resources at the top. I just now saw the "Will Trade" section .
Hmmm, that's true, you don't usually want to trade from your used resources in regular trades....

Any other thoughts on this?

I was also wondering what to do with the top row, but I might just leave it as is if I remove the used resources from the line for each player.

Req

 Bookmarks

 Civilization Fanatics' Forums > Exotic Foreign Advisor