This idea came about after seeing homegrown's re-write of the Domestic Advisor. There were some additional ideas which surfaced on the thread he started which unfortunately weren't completely implemented or were not incorporated into the original "Better Domestic Advisor." So, I decided to re-write the code integrating all the feasible suggestions and making some additional changes. As such, it is not meant to be a replacement to Homegrown's work, but rather an additional option.
New Domestic Advisor ____________________ This idea came about after seeing homegrown's re-write of the Domestic Advisor. There were some additional ideas which surfaced on the thread he started which unfortunately weren't completely implemented or were not incorporated into the original "Better Domestic Advisor." So, I decided to re-write the code integrating all the feasible suggestions and making some additional changes. As such, it is not meant to be a replacement to Homegrown's work, but rather an additional option. Credits: Homegrown - for the original idea of the Better Domestic Advisor and the basis of a lot of the code changes (including combining Happiness/Unhappiness, Health/Unhealth, Food/Food Used, adding City Maintenance, and Garrison Strength, for full list see below) terrasol - for the changes to the color of the text to indicate problem values and for changes which fix the non-English language problems and additional small changes Arkeide - for the base code to jumping to a city on the list. Features ________ Columns and symbol meaning (also column order from left to right). Note: symbolsand words might be different depending on any mods you might have installed or your language. Founded = Date Founded Name = Name Add Buildings = Landmarks POP = Population Arm Flexing = Garrison Happy Face = Net Happiness (Happy faces - Unhappy faces) Red Cross = Net Health (Health - Unhealth) Red Bread Slice = Turns Until City Growth Bread Slice = Net Food (Food - Food Used) Hammer = Net Production (including any bonuses) Red Gold Piece = Maintenance Cost Arrow Triangle = Trade (from all trade routes) Commerce = Commerce (Total Commerce gained in city) Gold = Total Gold Beaker = Total Research Musical Note = Culture gained per turn TOT = Total Culture Figurehead = Great Person points gained per turn TOT = Great Person points accumulated toward next Great Person Producing = (How many turns until production is done) What the city is producing Exit = Allows you to exit the Domestic Advisor View = Allows you to view a selected city from the Domestic Advisor screen with a caveat (see Known Problem #2 Redraw = Allows you to get the table back to the "original" state Homegrown's original features (reimplemented similarly) 1. Removed the Capital Star from the Date 2. Add a City Garrison column 3. Combine Happy/Unhappy/Angry into "Net Happiness" 4. Combine Food produced/eaten into "Food Turns until Growth" 5. Combine Healthy/Unhealthy into "Net Healthiness" 6. Add City Maintenance Cost 7. Add Turns til Production Complete 8. Institute Landmarks Landmarks are to visually represent which cities contain special buildings or special situations. Examples are Versaille/Forbidden Palace, National Wonders, Power Plants, Revolt, Occupation. Landmarks are represented as following: Gold Star = Palace Silver Star = Versailles/Forbidden Palace Bullet Point = One National Wonder Lightning Bolt = Power Available Fist = Occupation Rebel = Revolt Additional Features (including work by terrasol and Arkeide): 9. Added coloring of text to problem values (e.g., starvation, unhealthy city, angry citizens, etc.). 10. Added code to allow jumping to the city screen of a city on the list according to where it is on the ORIGINAL list. 11. Removed Homegrown's religion column as it duplicates the Religion Advisor. 12. Added a Net Food Column in addition to the Turns Until Food Growth 13. Actually calculated how many turns until the city will lose a person to starvation and added it to the Turns Until Food Growth column if the Net Food is negative. 14. Added a Trade Column which lists the total trade a city takes in 15. Separated out the Commerce and Gold columns (and changed the icons to reflect this) so that you can tell how much of each you're actually making. 16. Removed Net Gold as it didn't really indicate how much a city was contributing. 17. Combined the Producing and # of rounds until production is complete into one column (and instead of having it at the end like in patch 1.09, added the # of rounds to the front so that you won't miss how many turns you have left). 18. Fixed problems with the Production column not showing the complete amount of production. 19. Re-wrote a lot of the code so that it is easily integratable with other mods. 20. Stretched out the Advisor so that there's a little more space for information. 21. Added in code so that updates work (somewhat) when changing production items while in the Domestic Advisor. 22. Re-wrote code so that it is easier to change in case of future new ideas or better access to data in cIV. 23. Documented a LOT of the class so that it is easier for others to change. Installation ____________ New Domestic 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). To install: Just unzip the zip file with the target being the above indicated directory (may be different for different languages). Installation will create two new files (CvNewDomesticAdvisor.py in subdirectory CustomAssets\python\screen and DomPyHelpers.py in subdirectory CustomAssets\python) and will create a new copy of CvScreensInterface.py in CustomAssets\python\entrypoints. 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. Please note that you MAY have to clear your cache once or twice before the uninstallation will be complete. To do this, hold down the SHIFT button right after you launch Civ IV (i.e., double click the icon). To combine this mod to another mod, just add the new files CvNewDomesticAdvisor.py and DomPyHelpers.py to the aforementioned My Documents directory (or your mod directory) and change the following lines from CvScreensInterface.py if you have changed it: Old: import CvDomesticAdvisor New: import CvNewDomesticAdvisor Old: domesticAdvisor = CvDomesticAdvisor.CvDomesticAdvisor() New: domesticAdvisor = CvNewDomesticAdvisor.CvNewDomesticAdvisor() Known Problems ______________ 1. If you choose another production item for a city to make while in the Domestic Advisor, and then you attempt to sort by Net Food, Growth, or Production, the sorting will be alphanumerically rather than by Number (i.e., "123" will be before "98" when sorting ascending). This occurs because 1) Sorting is ubiquitous to the Python modder and 2) the interface doesn't allow the Python modder access to data being displayed. As such, you need to use a key to change the correct fields. However, the only way to update using a key is through CyGInterfaceScreen's setTableTextKey method. There is NO equivalent for Ints. Therefore the sorting is by text. Workaround: Basically, if you want to sort using those columns, exit the Domestic Advisor and come back in again. Sorting will work fine, then. 2. Because of the limitations specified in KP #1 above, after you sort your cities by any criteria except Date Founded ascending, you will NOT be able to correct jump to a City Screen from the Domestic Advisor. Workaround: To jump to the City Screen. Click on the Redraw word in the lower part of the Domestic Advisor. This should set the table back to the order that the Python code can know about. After that, select the city you want to jump to and click on View, you should be able to jump to the correct city screen. History _______ v1.0 - first release (combined Homegrown's, terrasol's, Arkeide's and my own changes into a first release)
There are no comments yet. Be the first!