View Full Version : Customizable Domestic Advisor - comments welcome


Taelis
Dec 27, 2005, 03:34 PM
Inspired by the fantastic work of Homegrown and Requies, I thought I'd try to extend what they've done and add in game customization - including the ability to add new pages, to add and remove columns from pages, and change the order and width of columns, all from within the advisor itself.

Version 0.93 is ready - this release fixes "Failed to load python module CvEventInterface" errors, adds support for exchanging configuration files across languages, and prevents an incompatiblity in the C++ API between the specialists buttons and resource icons.

The first time you run this, don't use any mods. If mods are active the first time the domestic advisor is loaded the default pages will have the wrong columns for buildings.

README information is actually contained in CvDomesticAdvisor.py itself, so it can never be seperated or lost. ;)

Editions
I've tried to create two independent editions of the advisor - a "flavorful" one for those who'd like to remain immersed in the game, and a purely functional one for those who enjoy looking "under the hood". At the moment, the only differences between the two are the initial pages created when the advisor is first installed, and that the flavorful version hides most of the customization buttons until you click on the first one.

If you've already installed a previous version of the advisor and saved customizations, those customizations will be retained. That also means neither edition will create the default pages, so in that case the only difference is the visibility of the customization buttons.

Features

All the improvements Homegrown and Requies made (thanks, guys!), plus:

Customizable tables
Independent columns for production and turns remaining for easy sorting
Support for the city zoom button from patch 1.52
Correct sorting by date founded
Accurate city selections in sorted lists
City rankings
Real advice (which still needs more work!)

New columns

Threats, which displays an angry icon if enemy units are nearby
Defense bonus, including terrain and bombardment
X and Y location
"Real" population (the "population" displayed on the info screen)
Best conscript unit, and best potential conscript
Electric power
National city ranks
Global city ranks
Can hurry (both slavery and gold)
All the buildings and wonders
All the resources
Advisors (VERY basic at the moment - consult at your own risk!)

Buildings

This advisor includes fields for all the buildings, National Wonders, and World Wonders, with their effects. For example, the advisor displays a food icon for a granary (saved food). It also displays a health icon if the city has a granary AND rice, wheat, corn, or bananas connected; and the health icon disappears if the last of those resources is lost.

The following information is available for buildings:

Working building - (see the next list)
No known benefits - "+"
In production - the icons from the list below surrounded by "()"
Obsolete - "X"
Can't be built - "-"
Just not there - blank
Effects displayed:

Bread slice - stored food or extra food from water tiles
Gold star on the left - capital
Silver star - other government center (e.g. Forbidden Palace, Versailles)
Gold star on the right - World Wonder or shrine
Religion icons - religious buildings
Flexing arm - free experience or promotions for new units
Keep (defense icon) - land, air, or nuke defense bonus
Red cross - health bonuses
Happy face - happiness bonuses
Lightning bolt - electric power
[Angry person] - reduced war weariness or anarchy
Music note - culture bonus
Gold - gold bonus
Beaker - research bonus
Hammer - increase production (general or specific)
3 Arrows (trade icon) - extra trade routes or increased trade income
Coin - reduced maintenance
Green sick face - unhealthiness
Figurehead - great person points

None of this is hardcoded, so the advisor should work with any mod, even fantasy mods and others that redefine the game. It will even display new fields for the buildings from a mod and hide the fields for buildings from the original game.

Installation

To install this mod, simply copy CvDomesticAdvisor.py to CustomAssets\python\screens in your personal Civ4 folder. Don't copy it to Assets\python\screens - the original will be gone and future patches will overwrite this file.

If you've installed another domestic advisor that modifies CvScreensInterface.py, you'll need to remove it. Usually you can just delete CvScreensInterface.py from CustomAssets\python\screens. DO NOT delete CvScreensInterface.py from the main CivIV Assets\python\screens folder, or the game won't work! :eek:

Controls

The controls along the bottom of the advisor interface, from left to right, are:

Page selection drop-down list
Customize columns on page
Rename active page
Add new page
Remove active page
Save current configuration
Restore last saved configuration

The controls on the customization interface, from left to right, are:

Shrink column(s)
Widen column(s)
Promote selected column(s) (moves them toward the left on the main interface)
Demote selected column(s) (moves them toward the right on the main interface)
Add column(s) (adds all columns selected in the list on the right side)
Remove selected column(s)

Columns

NAME - The name of the city
AUTOMATION - What's automated in the city?
BASE_COMMERCE - Base (unmodified) commerce/turn (of all kinds)
CONSCRIPT_UNIT - The best unit the city can conscript
COULD_CONSCRIPT_UNIT - The best unit the city could conscript, if it could conscript
CULTURE - Total culture
CULTURE_RATE - Culture/turn generated
DEFENSE - Defense bonus
FEATURES - Capital, national Wonders, disorder, and trade status
FOOD - Surplus food/turn
FOUNDED - Date founded
GARRISON - Number of military units in the city
GOLD - Gold/turn generated
GREATPEOPLE - Total great people points
GREATPEOPLE_RATE - Great people points/turn
GROWTH - Turns until the city grows
HAPPY - Extra happiness in the city (above the current population)
HEALTH - Extra health in the city (above the current population)
LOCATION_X - Horizontal location of the city
LOCATION_Y - Vertical location of the city
MAINTENANCE - Maintenance costs/turn
POPULATION - Population of the city
POPULATION_REAL - Population of the city in "real" numbers
POWER - Does the city have power?
PRODUCING - What's being built?
PRODUCING_TURNS - How long will it take?
PRODUCTION - Hammers/turn
RELIGIONS - Religions present in the city
RESEARCH - Beakers/turn generated
SPECIALISTS - What kind of specialists are in the city?
THREATS - How many enemy units are in the area?
TRADE - Income from trade routes

Plus columns for every building, National Wonder, and World Wonder


Known Issues

Forges, factories, and the Ironworks aren't displaying hammer icons, and nuclear plants aren't displaying power icons. And forges, factories, etc. display single unhealthy faces even after recycling centers are built. I'm working on it. ;)

When changing the width or order of columns, the first selected column description scrolls to the top.

Triggering a Python module reload (by changing a Python file for example) with the game running causes the advisor to go blank, and lose any unsaved customizations. Unless you're modding with Python, you'll probably never run into this. If you are, be sure to save any customizations before changing Python files. And simply close the advisor and press F1 again to fix any funkiness.

If a mod that changes buildings is active the first time the Domestic Advisor is loaded, the wrong buildings are displayed on the default pages.

History

Version 0.90 - Dec 27, 2005:
Initial public beta

Version 0.91 - Dec 28, 2005:
Fixed automation and culture columns, and added ranking, hurry, and advice columns.
Added a more "flavorful" edition

Version 0.92 - Dec 29, 2005:
Fixed a few issues with non-English support
Fixed the display of national wonders in mods
Added columns for the resources

Version 0.93 - Dec 29, 2005:
Fixed a "failed to load python module CvEventInterface" error
Added support for exchanging configuration files across languages

Taelis
Dec 27, 2005, 03:35 PM
Screenshots

1. The main page, based on Homegrown's. The flavorful edition calls this "Executive Summary"
2. A specialists page, like Requies'. The flavorful edition calls this "Specialization"
3. The growth page - this and a fourth page are created when the functional advisor is installed, but can easily be changed or removed.
4. The customization interface.
5. "Top Cities - Global". - Global city rankings. See how your cities compare to your rivals'. This page is only created by the flavorful edition, but all the fields are also available in the functional edition.

Taelis
Dec 27, 2005, 03:35 PM
How to Customize It

General

Save Changes: The fifth button in the bottom left corner saves your changes.

Cancel Changes: The sixth button in the bottom left corner reloads your last saved configuration, or the initial configuration if you've never saved one.

Pages

Choose Pages: The drop down list in the bottom left corner selects the active page.

Rename Page: The second button in the bottom left corner brings up a popup that allows you to rename the active page.

Add Page: The third button in the bottom left corner (the + sign) adds a new page.

Remove Page: The fourth button in the bottom left corner removes the active page.

Fields

The customization screen includes two tables. The table on the left side lists the fields that will be displayed on the selected page. The table on the right side lists all available fields.

Start Customizing Fields: Click on the first button in the bottom left (the scroll) to start customizing fields. Click on it again to finish and view the results.

Add Fields: Choose one or more fields from the table on the right and click on the third button in the upper row of buttons (the + sign) to add the selected fields to the active page.

Remove Fields: Choose one or more fields in the list on the left and click on the fourth button in the upper row (the - sign) to remove the selected fields from the selected page.

Shrink Fields: Select one or more fields in the list on the left and click on the first button in the upper row (the arrow pointing left) to make all the selected fields narrower.

Expand Fields: Select one or more fields in the list on the left and click on the second button in the upper row (the arrow pointing right) to make all the selected fields wider.

Promote Fields: Select one or more fields in the list on the left and click on the fifth button in the upper row (the arrow pointing up) to promote all the selected fields, which moves them to the left on the page.

Demote Fields: Select one or more fields in the list on the left and click on the sixth button in the upper row (the arrow pointing down) to demote all the selected fields, which moves them to the right on the page.

Advanced

The advisor's configuration is saved in a file called CustomDomAdv.txt in the main Civ4 directory (usually C:\Program Files\Firaxis Games\Sid Meier's Civilization 4).

You can copy this file to a different computer to transfer configuration (this requires the same version of the domestic advisor on both computers, naturally).

You can also delete this file to force the domestic advisor to restore the default pages.

Taelis
Dec 27, 2005, 03:36 PM
Featured Customizations

NeverMind
Dec 27, 2005, 04:24 PM
That looks nice. I'll try it in my next game for sure. :)

Impaler[WrG]
Dec 27, 2005, 04:45 PM
It just keeps getting better and better I too will give this thingy a whirl :D

Cammagno
Dec 28, 2005, 12:30 AM
Inspired by the fantastic work of Homegrown and Requies, I thought I'd try to extend what they've done and add in game customization - including the ability to add new pages, to add and remove columns from pages, and change the order and width of columns, all from within the advisor itself.
My first beta release is ready - I hope you all like it. :cool:


I've tried it a bit and... it is wonderful! :)
I'm very surprised that you have managed to obtain such a result using a single file: you are great!

I suggest to put into the zip a readme file with all the useful information you have given us in this thread.
I also suggest (if this is possible) to choose a different location for the CustomDomAdv.txt, not into the main Civ4 directory. I think that it's better to put it into My Doccuments\My Games\Sid Meier's Civilization 4\ (maybe into ...\Saves\??? ).

I've noted a minor (very little indeed) bug (but it may depend on some problem with my Italian localization). The title for the Automation column is wrongly reported as: "TXT_KEY_DOMES...".

Thanks for your great work :)

Cammagno
Dec 28, 2005, 03:01 AM
I've tried it a bit and... it is wonderful! :)
I'm very surprised that you have managed to obtain such a result using a single file: you are great!

I suggest to put into the zip a readme file with all the useful information you have given us in this thread.
I also suggest (if this is possible) to choose a different location for the CustomDomAdv.txt, not into the main Civ4 directory. I think that it's better to put it into My Doccuments\My Games\Sid Meier's Civilization 4\ (maybe into ...\Saves\??? ).

Another suggestion: it will be wonderfull if instead of the names of the buildings (or before them), it is possible to have as title of the columns their icons, as it is in the "ModifiedSpecialDomesticAdvisor" mod. So one can reduce the size of their columns to be able to have more of them in the same page.

Obviously instead of this (and even better), it will be great to have the possibility to introduce as many columns as one desires, being able to scroll them with an arrow (again, as in the "ModifiedSpecialDomesticAdvisor" mod) if the resulting total size is greater of the page's one.

Taelis
Dec 28, 2005, 08:36 AM
I've tried it a bit and... it is wonderful! :)
I'm very surprised that you have managed to obtain such a result using a single file: you are great!

I suggest to put into the zip a readme file with all the useful information you have given us in this thread.
I also suggest (if this is possible) to choose a different location for the CustomDomAdv.txt, not into the main Civ4 directory. I think that it's better to put it into My Doccuments\My Games\Sid Meier's Civilization 4\ (maybe into ...\Saves\??? ).

I've noted a minor (very little indeed) bug (but it may depend on some problem with my Italian localization). The title for the Automation column is wrongly reported as: "TXT_KEY_DOMES...".

Thanks for your great work :)

You're welcome. I just started making a few minor changes, and discovered lots of advanced Python toys to play with, and couldn't stop programming. Python's come a long way since the last time I used it. :lol:

I appreciate the feedback (from everyone), I'm still into this project and will probably spend a couple more days making it perfect. Right now I'm thinking about adding actual ADVICE - recommendations, things that need attention, maybe even info about the possible development of a city.

I'm not entirely sure how to safely move the configuration file, but you're right, the personal folder would be better, if I can do it.

And thanks for the info about the automation column - I didn't realize that text was coming from Requies' XML file.

Being Italian, would you prefer having localized column names, or a single file for the mod? I'm not sure I want to add an XML file - especially after hearing all the trouble people have with the cache!

Another suggestion: it will be wonderfull if instead of the names of the buildings (or before them), it is possible to have as title of the columns their icons, as it is in the "ModifiedSpecialDomesticAdvisor" mod. So one can reduce the size of their columns to be able to have more of them in the same page.

Obviously instead of this (and even better), it will be great to have the possibility to introduce as many columns as one desires, being able to scroll them with an arrow (again, as in the "ModifiedSpecialDomesticAdvisor" mod) if the resulting total size is greater of the page's one.

More great ideas - thanks! I'll take a look at the "ModifiedSpecialDomesticAdvisor" mod.

Cammagno
Dec 28, 2005, 09:28 AM
I'm not entirely sure how to safely move the configuration file, but you're right, the personal folder would be better, if I can do it.

Oh, obviously this isn't an important matter, just an idea, to leave the file in the same directory where all other personal configurations are. But otherwise it works great as it is, so if it's a problem to realize it in a safe way, it can stay as it is now :)


I appreciate the feedback (from everyone), I'm still into this project and will probably spend a couple more days making it perfect. Right now I'm thinking about adding actual ADVICE - recommendations, things that need attention, maybe even info about the possible development of a city.

These are great ideas :)
It will be very good if the new version of the mod will be somehow compatible with the CustomDomAdv.txt generated by the previos ones, so who (like me :lol: ) has spent the full afternoon customizing the mod doesn't have to bang their head on the wall :crazyeye:
Obviously I'm joking ;) If the improvement of the mod requires the non-compatibility, it's ok, of course!

And thanks for the info about the automation column - I didn't realize that text was coming from Requies' XML file.
Being Italian, would you prefer having localized column names, or a single file for the mod? I'm not sure I want to add an XML file - especially after hearing all the trouble people have with the cache!

Oh, I strongly prefer the way as it is now, I don't bother localization, particulary if this has to cause a more complex structure of the needed files. Furthermore, the titles of the columns are in Italian right now :D
with the exception of the "new" ones (such as "threats")... so it's ok as it is, IMHO.

Thanks again for your work! (And sorry for my not-so-good English)

Taelis
Dec 28, 2005, 10:04 AM
Don't worry, any future versions will be fully backwards compatible. Even if I make a lot of huge changes, I can still fix the configuration when I read it from the file. ;)

Cammagno
Dec 28, 2005, 12:37 PM
Don't worry, any future versions will be fully backwards compatible. Even if I make a lot of huge changes, I can still fix the configuration when I read it from the file. ;)

Great! ;) ;)

Possible bug: the column of the "Cultural rating per turn" doesn't show any value, it remain blank; I've noted that it's the same also in your screenshot.

terrasol
Dec 28, 2005, 02:36 PM
i have a probelm with this
if i try to use it,the game exit with following error
Runtime Error...pure virtuale call...R6025

i hope this helps you

Taelis
Dec 28, 2005, 03:24 PM
Are you using patch 1.52, and is the saved game from patch 1.52? I hope that's the problem, because I've seen this error before, but only once with an old game.

Edit: Nevermind, I think I found it. Were you using the specialist buttons when that crash occurred?

Taelis
Dec 28, 2005, 05:28 PM
Version 0.91 is ready (see above). I fixed the automation and culture columns (thanks Cammagno!) and I believe I fixed the crash you saw terrasol. :)

Cammagno
Dec 29, 2005, 02:08 AM
Version 0.91 - Dec 28, 2005:
Fixed automation and culture columns, and added ranking, hurry, and advice columns.
Added a more "flavorful" edition


I've tried it, and I confirm that it solves the two minor bugs of automation and culture ;)
There is a problem, though. Now, the personalization window (the one in which one can choose the columns and regulate their size) appears as a sort of "demi-trasparent layer" over the normal page, making difficult to read and to use it. :confused: This happens with both the new editions (the functional one and the flavorful one).

About the "flavorful" edition, I haven't managed to understand how to personalize it. But maybe it's intended as a "view only" edition: one can use the functional edition to personalize the configuration file and then switch to the flavorful edition for the normal game use. But in this case, what's the utility of the personalizing button if, clicking it, one can only see the list of the columns but can't change them? If this is the case, maybe it's better to completly remove the personalization botton from the flavorful edition. But I don't know if I've understood the true meaning of the flavorful edition... :confused:

Thanks for yor attention

Taelis
Dec 29, 2005, 08:34 AM
That probably indicates there was a Python error, so the script wasn't able to finish displaying the customization screen. It's strange that you see that error but I do not - would you be willing to enable Python logging?

If you would, in the config file, change ShowPythonDebugMsgs to 1. That will popup messages in the game if any Python errors occur.

Or change both LoggingEnabled and OverwriteLogs to 1, which will create a log file in My Games\Sid Meier's Civilization 4\Logs called PythonErr.log.

Cammagno
Dec 29, 2005, 09:38 AM
That probably indicates there was a Python error, so the script wasn't able to finish displaying the customization screen. It's strange that you see that error but I do not - would you be willing to enable Python logging?

If you would, in the config file, change ShowPythonDebugMsgs to 1. That will popup messages in the game if any Python errors occur.

Or change both LoggingEnabled and OverwriteLogs to 1, which will create a log file in My Games\Sid Meier's Civilization 4\Logs called PythonErr.log.

Well, the log says:

#####
Traceback (most recent call last):
File "CvScreensInterface", line 545, in handleInput
File "CvDomesticAdvisor", line 1850, in handleInput
File "CvDomesticAdvisor", line 1935, in ModifyPage
File "CvDomesticAdvisor", line 1061, in drawScreen
File "CvDomesticAdvisor", line 1661, in drawContents
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 9: ordinal not in range(128)
ERR: Python function handleInput failed, module CvScreensInterface
#####

The customization screen appears and it's usable (I mean, I can scroll the lines, for example), but without buttons (there are only the main buttons, thouse in the inferior part of the window) and this screen is semi-trasparent, (I see the normal page "under" it).
I've tried to put the old file in, and it works normaly (meaning: no "trasparent effect"); then I've tried with the new one again, and that strange effect is back in. :confused:

Note: using the old version, the log is empty, no error is reported.

terrasol
Dec 29, 2005, 10:42 AM
with v0.91 it was better but the growth-page was empty, i tried to change something there(in customization) and then i got the same error before

Taelis
Dec 29, 2005, 10:46 AM
Thanks for that log - as I thought, that indicates that a localized string is causing trouble.

It's clear what's happening now, but not how to fix it. But I'll have version 0.92 with this fixed (plus some other minor changes) soon. :)

Taelis
Dec 29, 2005, 11:01 AM
terrasol: sorry about that. Are you using CivIV in English? If not, I hope the problem you encountered will be fixed along with Cammagno's.

That's a C++ error, not Python, and I haven't seen it, so I don't know what to do. :(

Now if I had access to the C++ source...

terrasol
Dec 29, 2005, 11:10 AM
i use the german version....and i hope it will function cause i like your work :)

Taelis
Dec 29, 2005, 11:26 AM
i use the german version....and i hope it will function cause i like your work :)

Thanks :)

Version 0.92 is ready, with improved localization support. I have hope for this version.

Cammagno
Dec 29, 2005, 12:17 PM
Version 0.92 is ready, with improved localization support. I have hope for this version.

In wy case, 0.92 works fine, no problem anymore! :goodjob:
Furthermore, I like very much the new available columns, and now that I can see how it works, I lke the "flavor" version too (I've installed it).

Very very good job! ;)

[A little suggestion for future releases: maybe you can make different the "global ranking" and the "national ranking" icons, using in one case the icon followed by "#" and in the other case the "#" followed by the icon, or maybe using in one of the cases another simbol instead of "#" Just my two cents, of course :blush: ]

Elhoim
Dec 29, 2005, 01:20 PM
After installing this mod in my custom assets folder, I get the following error message when starting the game: "Failed to load python module CvEventInterface".

I donīt have any domestic mod installed, only this one.

Taelis
Dec 29, 2005, 02:10 PM
elhoim, Cammagno figured out the problem here - I'll have a fix ready soon. :)

Cammagno
Dec 29, 2005, 02:24 PM
Inspired by the fantastic work of Homegrown and Requies, I thought I'd try to extend what they've done and add in game customization - including the ability to add new pages, to add and remove columns from pages, and change the order and width of columns, all from within the advisor itself.

If someone is interested, here there is my configuration file. I've prepared 30 different pages, in which all the available columns are grouped according to different criteria. It may be useful as a starting point for someone who wants a more complex structure of pages than the standard one and who doesn't want to start from "ground zero".
To use it, simply put it in the main Civ4 directory. If you don't like it, remove it and you'll have your standard pages back again. If you have already done some personalization, backup your file before pasting mine in the directory.

Note: The size of the columns is optimized for the Italian titles, so a different optimization may be needed in some cases (for aestetical porpouses only).
I've translated the titles of the pages into English, but some little errors are possible (due to my not-so-good English... for example I'm not sure at all that the names of the religions are correct); however, you can change them easily using the mod interface.

Note #2: Now (version 0.93) the sharing of config files works across languages! Thanks one more time, Taelis! :goodjob:

Cammagno
Dec 29, 2005, 02:33 PM
After installing this mod in my custom assets folder, I get the following error message when starting the game: "Failed to load python module CvEventInterface".

I have the same error if I remove the CustomDomAdv.txt file from the main Civ directory (I did this for a test). Putting it back in the directory, the mod loads without problems again.

Taelis
Dec 29, 2005, 02:40 PM
If someone is interested, here there is my configuration file. I've prepared 30 different pages, in which all the available columns are grouped according to different criteria. It may be useful as a starting point for someone who wants a more complex structure of pages than the standard one and who doesn't want to start from "ground zero".

I was hoping people would share their configurations, but just realized - it doesn't work across languages. :eek: :(

I'm not sure how to do it yet, but I promise version 0.93 will somehow support exchanging configuration files despite language differences. :)

Thanks for figuring out the problem on loading too - I'll get to work on 0.93 right away.

Cammagno
Dec 29, 2005, 03:45 PM
I was hoping people would share their configurations, but just realized - it doesn't work across languages. :eek: :(
I'm not sure how to do it yet, but I promise version 0.93 will somehow support exchanging configuration files despite language differences. :)
Thanks for figuring out the problem on loading too - I'll get to work on 0.93 right away.

:)

(I've edited my message to inform of the language poblem in exchanging configuration files)

Taelis
Dec 29, 2005, 03:49 PM
Fixed the loading problem, and the language difficulties in the configuration file. So version 0.93 is ready. :)

Configuration files saved with version 0.93 or later can be exchanged between users with different languages. The column headers for buildings and resources will be automatically translated too (but not the page names).

Configuration files from version 0.92 can only be loaded intact by users with the same language - if you'd like, Cammagno, I can fix your CustomDomAdv.txt and add it to the first page of this thread. (with credit, of course :goodjob:).

You can update it yourself too - just load it with the new advisor and save it again.

Cammagno
Dec 30, 2005, 12:44 AM
Configuration files saved with version 0.93 or later can be exchanged between users with different languages. The column headers for buildings and resources will be automatically translated too (but not the page names).
Configuration files from version 0.92 can only be loaded intact by users with the same language - if you'd like, Cammagno, I can fix your CustomDomAdv.txt and add it to the first page of this thread. (with credit, of course :goodjob:).
You can update it yourself too - just load it with the new advisor and save it again.

Thanks again for your wonderful job :goodjob:

I've updated my config file with version 0.93, and I've translated the titles of the pages into English (some little errors are possible, due to my not-so-good English... for example I'm not sure at all that the names of the religions are correct); I've uploaded it editing my previous message.

Of course you can add it to the first page of this thread! You (and everybody else) can use it as you want, edit it as you want (and of course correct it if it has some English error), upload it where you want (with or without credits, I don't care :) )... its use is absolutly free. :)

Elhoim
Dec 30, 2005, 01:51 AM
Great! Now it works flawlessly!! Thanks!!!

mamimo
Dec 30, 2005, 02:09 AM
This look great, is it compatible with patch 1.52 ?

Taelis
Dec 30, 2005, 03:25 AM
Yep - actually, it requires patch 1.52.

terrasol
Dec 30, 2005, 02:10 PM
with V0.93 all is ok

i have a suggestion, cause in older versions i had a column for the really goldproduction of a city and i have tested with your advisor with the following code

*****first part*****
("GOLD", 38, "int", None, CyCity.getCommerceRate, CommerceTypes.COMMERCE_GOLD, None, None, "self.goldIcon"),
("GOLD_DIFF", 30, "int", None, None, 0, self.calculateGoldDiff, CommerceTypes.COMMERCE_GOLD, "u\"%c\" % CyGame().getSymbolID(FontSymbols.BAD_GOLD_CHAR)"),
("GRANK_BASE_COMMERCE", 38, "int", None, None, 0, self.findGlobalBaseYieldRateRank, YieldTypes.YIELD_COMMERCE, "self.commerceIcon + u\"#\""),

*****second part*****
self.PROBLEM_VALUES_DICT = {
"GARRISON" : 0,
"HAPPY" : -1,
"HEALTH" : -1,
"GROWTH" : -1,
"FOOD" : -1,
"GOLD_DIFF" : -1,
}

*****third part*****
def calculateMaintenance (self, city, szKey, arg):
return unicode(city.getMaintenance())

def calculateGoldDiff (self, city, szKey, arg):
gd = city.getCommerceRate(arg) - city.getMaintenance()
return gd

def calculateTrade (self, city, szKey, arg):
nTotalTradeProfit = 0



of course this is only a suggestion, but may be some other like this too

Taelis
Dec 31, 2005, 11:01 AM
Thanks terrasol, I've added that to the version that's in the works. Once I figure out how to calculate potential yields, I'll upload v0.94.

Requies
Dec 31, 2005, 05:14 PM
Nice job :goodjob:. Definitely incorporated some features that I was thinking about (including the flavor domestic advisor).

Interesting what you did with the dictionaries.... :lol:

If I get around to it (I'm currently focusing on the Foreign Advisor and other projects), I'll see what I can incorporate into the Domestic Advisor.

Req

terrasol
Jan 02, 2006, 08:27 AM
hi unfortunatly the advisor has crashed again....but now i can say you the line of code what makes the crash


# Add blank rows to the table
for i in cityRange:
screen.appendTableRow (page)
szWidgetName = "ZoomCity" + str(i)
if (cityList[i].getName() in self.listSelectedCities):
screen.selectRow( page, i, True )
if not self.PAGES[self.currentPageNum]["showSpecControls"]:
screen.setImageButton( szWidgetName, zoomArt, 0, 0, 24, 24, WidgetTypes.WIDGET_ZOOM_CITY, cityList[i].getOwner(), cityList[i].getID() )
screen.attachControlToTableCell( szWidgetName, page, i, 0 )


if i comment out this lines

#if not self.PAGES[self.currentPageNum]["showSpecControls"]:
#screen.setImageButton( szWidgetName, zoomArt, 0, 0, 24, 24, WidgetTypes.WIDGET_ZOOM_CITY, cityList[i].getOwner(), cityList[i].getID() )
#screen.attachControlToTableCell( szWidgetName, page, i, 0 )


all is ok...may be it helps you to find the problem

alerum68
Jan 03, 2006, 10:22 PM
Taelis, I'm having a slight issue with the advisor. It's a late era Marathon Game, and when I hurry production from the advisor screen, the advisor goes blank. The advisor is still open, just has no information. It started doing it only later in the game, when my cities went over 21 and need to scroll down to be viewed.

Litcube
Jan 05, 2006, 05:17 PM
My game just crashed while in the diplomacy screen using this mod, with a C++ runtime error. The last action I performed was changing the production from research to walls.

Also, there's a bug that's cropped up. It seems as though when I change production, the columns dissapear, and I'm left with only the city icons. Sometimes, only a few city icons will appear.

alerum68
Jan 05, 2006, 06:48 PM
Same thing is happening with me. It only happens when my cities go beyond 20. I've notice that if it's blank, and i don't do anything but exit out and hit F1 it comes up fine. The C++ runtime error makes me nervous, because that's something with Civ that's crashing, even if it's caused by the MOD.

http://img333.imageshack.us/img333/2430/civ4screenshot00002jf.th.jpg (http://img333.imageshack.us/my.php?image=civ4screenshot00002jf.jpg)

Another bug, which I don't have a screenshot for is on some screen the Examine City Button isn't present.

Litcube
Jan 05, 2006, 07:30 PM
Yup. That's the same sort of thing that mine does as well. When you say, "cities beyond 20", are you referring to the number of cities or their population?

alerum68
Jan 05, 2006, 07:42 PM
The actual numbers of cities. From the Main Screen of the advisor, when you go beyond 20 it has to scroll off the page. The 21st city causes this to scroll. It's doing it in another game I'm playing on as well and it's gone beyond 20 cities, but worked fun until we reached that point.

terrasol
Jan 06, 2006, 08:34 AM
@Litcube and alerum68

look at the modification code in my last post...cause you have the same errors i had, i think the reason ist the new image button for the citymanger

unfortunatly i dont know how i can do this to run correct, but if you deactivate this button, then the customizable domestor works fine

p.s. i hope taelis will find a better solution

Cammagno
Jan 06, 2006, 01:55 PM
Same thing is happening with me. It only happens when my cities go beyond 20. I've notice that if it's blank, and i don't do anything but exit out and hit F1 it comes up fine.

Oh, yeah, I had forgotten to report this bug. But it just happens the first time you load a game with more of 20 cities. After you have closed it and reopened it the first time, it works fine for that session.

Another bug, which I don't have a screenshot for is on some screen the Examine City Button isn't present.

The second page of the standard version didn't have those buttons (I don't remember about the third one). But you may create a new page with the same columns of that page, and it'll have the buttons (then obviously you may delete the original one).

Taelis
Jan 06, 2006, 07:56 PM
Sorry I've been absent for a few days (business) - but terrasol figured it out, I think. Every time I've seen a crash it's been caused by the new city zoom button (or some other button). :(

In fact, that's the reason the second page doesn't have the examine city icon - the game was crashing when the specialist buttons were used while that button was displayed. There's nothing I can do to fix the problem, it's in the C++ code. Hopefully Firaxis will fix whatever's wrong.

Perhaps I should remove those buttons - I'd also have to remove the icons for resources, sadly. They use the same code.

Cammagno
Jan 07, 2006, 01:27 AM
Perhaps I should remove those buttons - I'd also have to remove the icons for resources, sadly. They use the same code.

I don't know, they are minor bugs, IMHO, and I don't mind, while I like the buttons and the icons for resources.
Maybe you can add an option in the personalization page in which the user can select if he wants or not the bottons and the icons? :blush:
This IMHO will be the best choice, if it's possible to realize it. If not, maybe even the possibility to set this option directly into the file (with an explained editing) will be fine. But please, don't completly remove those features from future releases, 'cause the buttons are very useful and the icons are nice. :)

BrianDH
Jan 09, 2006, 01:53 PM
Excellent stuff - just picked it up from Alerum's Unaltered Gameplay collection.
Some suggestions (really just icing):
- create a .bak of the config file on startup, in case you totally muck it up (like I did)
- [optionally] protect the default set of pages, maybe an ini file flag that says whether or not they can be touched
- tooltips on the buttons
- maximize the screen [on lower resolutions] like the other advisors do

alerum68
Jan 09, 2006, 08:29 PM
@Taelis - I think the buttons should be kept in as well. If there's an option that's given like Camm says, maybe it should be along the lines of having either Buttons or the older View button?

@Brian - There is an .ini file, but it's put in the Main Civ directory, not in your My Documents folder. To restore the default settings just delete that file. I believe it's called 'CustomDomAdv.txt'. I'm glad you're enjoying the MODs.:) And welcome to CFC!:)

Taelis
Jan 13, 2006, 08:06 PM
Hey guys - I've been preoccupied with work, and I just bought Age of Empires III, so I have no ETA on the next release. Nothing major in the works anyway, except real advice. That's complicated though, gonna have to wait for Civ4 to reclaim possession of my soul. :satan:

In the meantime, anyone who wants to is welcome to take this version and improve it further.

Everyone who responded seems to agree, so I'll leave the buttons in for now, and hope Firaxis fixes whatever causes the exceptions. Civ4's Python interface isn't quite finished yet - for example, I'd love to add an option for turning off the icons, but I couldn't get a checkbox on the popup. The call to create checkboxes in a Python popup exists, it just doesn't seem to work. :( Anyone get them to work, or seen a mod that uses checkboxes?

Brian reminded me of another request if anyone has any pull at Firaxis - the tooltips are hardcoded in C, a Python mod just specifies a tooltip type and a couple of integers for data, but we'd all love to create custom tooltips, please. :D

@Brian - as alerum said, you can delete CustomDomAdv.txt from your Civ4 directory to restore the default pages. Or replace it with Cammagno's config and get 30 pages full of info.

Gamesmaster
Jan 21, 2006, 12:53 PM
Very nice mod, i appreciate the work you put in, ty :)

mgdpublic
Feb 03, 2006, 07:07 PM
Can someone help me out? I originally installed the mod "ModifiedSpecialDomesticAdvisor" and since I installed this one I only get the bottom line on the old screen and the rest of the screen is blank. Can someone tell me how to fix this? Thanks. I've also installed the Exotic Foreign and Military advisor.

Cammagno
Feb 04, 2006, 12:46 AM
Can someone help me out? I originally installed the mod "ModifiedSpecialDomesticAdvisor" and since I installed this one I only get the bottom line on the old screen and the rest of the screen is blank. Can someone tell me how to fix this? Thanks. I've also installed the Exotic Foreign and Military advisor.

Well, did you uninsall MSDA before installing CDA? If not, you have to remove all MSDA'files, then install again CDA, then replace 2 files of the mod with my merged files ( http://forums.civfanatics.com/attachment.php?attachmentid=111537&d=1137234299 ) to ensure compatibility with EFA.

Nials
Feb 04, 2006, 09:06 AM
I really like this mod, great job!

However, I have a small perk with it which exists in the default Domestic Advisor as well. Whenever you sort by a specific category, for instance commerce, and then decide to perform an action such as hurrying production, the screen resets to default sorting.

Is it somehow possible to configure the mod in such a way that it does not reset its sorting options to default when you decide to perform an action from the screen?

Other than that I like it a lot. Keep up the good work!

mgdpublic
Feb 04, 2006, 09:13 AM
Well, did you uninsall MSDA before installing CDA? If not, you have to remove all MSDA'files, then install again CDA, then replace 2 files of the mod with my merged files ( http://forums.civfanatics.com/attachment.php?attachmentid=111537&d=1137234299 ) to ensure compatibility with EFA.

Well I didn't uninstall MSDA because I figured the new ones would overwrite any files that mattered and any extra just simply wouldn't be accessed. The MSDA has alot more files than the CDA so I figured I might be deleting something the CDA needs. So all I have to do is delete any files that the MSDA put in, reinstall the other two and then your combined file and it should work?

Cammagno
Feb 04, 2006, 10:48 AM
Well I didn't uninstall MSDA because I figured the new ones would overwrite any files that mattered and any extra just simply wouldn't be accessed. The MSDA has alot more files than the CDA so I figured I might be deleting something the CDA needs. So all I have to do is delete any files that the MSDA put in, reinstall the other two and then your combined file and it should work?

Yeah, I think so.

mgdpublic
Feb 04, 2006, 03:34 PM
Cammango,

I did all that but now I get an "Can't load CVEventsInterface" error, and no interface at all is on screen.

This is driving me nuts. :cry:

Cammagno
Feb 04, 2006, 04:08 PM
Cammango,

I did all that but now I get an "Can't load CVEventsInterface" error, and no interface at all is on screen.

This is driving me nuts. :cry:

Probably something wrong happened with your installing/deleting the files. If I were you, I'll clean the CustomAssets directory and I'll start again to instal only the mods you need, and then I'll use the merged files for the overlapping mods.

mgdpublic
Feb 04, 2006, 05:00 PM
Probably something wrong happened with your installing/deleting the files. If I were you, I'll clean the CustomAssets directory and I'll start again to instal only the mods you need, and then I'll use the merged files for the overlapping mods.

But if I install the ones from the mods I need, why does it matter what else is in there? Are you saying I should just empty all folders and subfolders in my custom assests dir?

Also, it appears other people had this error at some point in the dev of this mod because Taelis references it in his notes.


EDIT: Ok, by reinstalling the MSDA I got rid of the error. I now have the right FA and MA, but the MSDA rather than this new one. Any ideas how I can change to this new one without getting that error?

Cammagno
Feb 05, 2006, 01:38 AM
But if I install the ones from the mods I need, why does it matter what else is in there? Are you saying I should just empty all folders and subfolders in my custom assests dir?

Ok, the problem is that if you have in your custom assests dir a file which refers to another file that isn't there (because you have deleted it) or that is not made as it was supposed to be (because you have overwritten it with another one), you'll get an error or some strange effects, like blank pages etc.
So, if you already have at least one mod and you want to install another one, you'll have to pay attention: if some of the files of the new mod have the same name and location of some of the file of the old one, you can't simply overwrite the old ones with the new ones, but you have to merge them (I've posted in various threads my merged files for the most common "unaltered gameplay mods"). Of course if the 2 files are identical, you don't have to merge anything.
On the other hand, if you want to replace a mod with a new version, or with a different version made by some other guy, before installing the new one you'll have to delete all the files of the old version, but the ones that are in common with other mods. "In common" means that two mods use the SAME files, not a merged one. If the old version needed a merged file, you'll probably have to overwrite it with the original file from the other mod and leave it there or merge it with the new file, depending on the circumstances (if the new version has or has not a file with that name, and if that file is the same or is different from the file of the old version).
If you don't do in this manner, you'll be lucky and have no probglem (if the two mods have no file with the same name or if they have in common the same file), but you have a big chance of getting a loading error, or some strange effect, or to loose some function of the mod.

EDIT: Ok, by reinstalling the MSDA I got rid of the error. I now have the right FA and MA, but the MSDA rather than this new one. Any ideas how I can change to this new one without getting that error?

I was in the same situation when I changed from MSDA to CDA. You simply have to delete all the MSDA files which aren't in common with another mod, check if there is some MSDA files that you have previously merged with some other mod (in this case you have to replace them with the original files from the other mod) and finally install the CDA file. It worked fine for me.

jray
Mar 08, 2006, 10:12 AM
FYI, I'm getting this crash:

i have a probelm with this
if i try to use it,the game exit with following error
Runtime Error...pure virtuale call...R6025

i hope this helps you

fairly often now whenever I have 21 or more cities. It crashes upon simply opening up the advisor, and sometimes it crashes even after it has opened successfully at least once in the current gaming session. It doesn't require the pressing of any buttons, and I don't even use the city zoom.

Hopefully Firaxis will fix this in the next patch! In the meantime I've made up my own play mode, the "20 City Challenge" where I don't let myself get 21 cities :cool:.

jray
Mar 08, 2006, 10:45 AM
Oops, sorry-- double post.

Elhoim
Apr 14, 2006, 10:35 AM
Hope it works with the new patch!

Elhoim
Jun 08, 2006, 09:43 PM
In the meantime, anyone who wants to is welcome to take this version and improve it further.

Anyone up to it? This is the best Domestic Advisor out there, as it is customizable, it´s fast and have a great look. The only problem is the c++ crash when there are 20+ cities, if anyone can fix it, it would be great! THX!

mikezang
Jul 21, 2006, 12:28 AM
Can this be used for v1.61?

Elhoim
Jul 21, 2006, 07:43 AM
Yes, I´m using it right now. I fear for it´s compatibility (?) with warlords...

Elhoim
Aug 03, 2006, 08:40 AM
Well, is somewhat compatible, but it has lost some of its features in the transition. It would be nice if someone could pick this mod up...

TheLopez
Sep 20, 2006, 11:31 AM
I have posted a new warlords version of this mod in the file database... here is the direct link to it. http://forums.civfanatics.com/downloads.php?do=file&id=523

Ket
Sep 21, 2006, 01:51 AM
I know I PM'd the error already, but I think all that is wrong is that the art define for the widget and the graphic is missing.

TheLopez
Sep 21, 2006, 06:44 AM
Nope, that's not the problem. You didn't merge in the modded C++ code into your own DLL or you didn't use the DLL provided.

Ket
Sep 21, 2006, 06:51 AM
I'll try a re-merge, merged it.... Will double check...

Ket
Sep 21, 2006, 06:57 AM
HAHAHA Ok I'm a moron....

// < CDA Start >
.value("WIDGET_ZOOM_CITY_CDA", WIDGET_ZOOM_CITY_CDA)
// < CDA End >
.value("NUM_WIDGET_TYPES", NUM_WIDGET_TYPES)
;
Forgot to merge cyenumsinterface.cpp

Ok...
ok....
geeze i feel dumb...

DrJambo
Sep 25, 2006, 12:48 PM
Is there no way to have the domestic advisor without the dll? It doesn't seem to be compatible with the great generals for barbarians mod. :/

TheLopez
Sep 26, 2006, 11:18 AM
You need to merge the C++ source files and rebuild the DLL to get them both to work together correctly.

Thornburgh
Oct 06, 2006, 09:09 PM
This is a very nice mod.

However, it has one problem: if you sort by production (or other) and then change the production for one city from the domestic advisor, it goes back to the default sort.

This is unfortunate because I like to build factories or expensive units in my most productive cities (or universities in my best science cities, etc.), so I need them to stay sorted while I work through the list. It's annoying to have to keep resorting.

The default domestic advisor has this same problem. However, the special advisor and modified special advisor mods avoid the problem (though I like this one better for other reasons).

Any chance of fixing?

Thanks!

Thornburgh
Oct 11, 2006, 01:13 AM
I've also now gotten to the crash with 21 cities (especially if I use the domestic advisor to change production, which is its best use). I get the 6025 error.

I'm using 1.61.

Is this possibly fixed in Warlords with its never version of the mod?

I really like this mod, but it's not useable in the endgame.

BTW, I noticed modified special domestic advisor also crashes with 21 cities when you change production. Same R6025 error.

Thornburgh
Nov 02, 2006, 11:03 PM
The Warlords version of this mod doesn't work with 2.08. Any chance of a fix? Thanks for the hard work.