View Full Version : A "Better" Domestic Advisor ?


homegrown
Oct 30, 2005, 07:28 AM
OK, I've taken the plunge and with little more than Gingerbreads "Learn Python" thread, I've been able to make some improvements to the Domestic Advisor in the game.

Here is a screenshot of the advisor that ships with the game.

http://session.apolyton.net/modiki/images/f/ff/Origdomadvisor.jpg

The column headings are: Date founded (capital?), City Name, Population, Happiness, Unhappiness, Angry, Food produced, Healthy, Unhealthy, Food eaten, Hammers, Gold, Science, Culture, Total Culture, Great People, Total Great People, Producing

List of Changes

1. Removed the Capital Star from the Date
2. Add a Religions column
3. Add a City Garrison column
4. Combine Happy/Unhappy/Angry into "Net Happiness"
5. Combine Food produced/eaten into "Food Turns until Growth"
6. Combine Healthy/Unhealthy into "Net Healthiness"
7. Add City Maintenance Cost
8. Add Turns til Production Complete
9. 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.

In the release version, there are still some functions that we can't directly access (or at least I can't) with python yet, but in the future Landmarks will designate whether a city is having We Love the King Day. Other suggestions I've heard were to show World Wonders that allow or create their own unit, airports, courthouses...

Screenshot of the Improved Version

http://session.apolyton.net/modiki/images/d/d5/HomegrownCIV4domadvisor.jpg

Column Headings:

Date founded, City Name (with landmarks), Religions, Population, City Garrison Strength, Net Happiness, Food Turns to Growth, Net Health, Hammers, Gold, City Maintenance, Science, Culture, Total Culture, Great People, Total Great People, Producing, Turns to Production Complete.

In the Landmarks section, The Gold Star is Capital, Silver Star is Versaille/Forbidden Palace, the Bullet is a National Wonder (limit 2), Power, Occupation and Occupation Timer.

You can get the mod here (http://home.houston.rr.com/homegrowns/files/homegrown-domadvisor.zip). Unzip it into your "My Documents/My Games/Civ 4/" folder or whereever you are saving your games via /ALT.

Issues: Might cause an unhandled python exception if you should lose a city to barbarians at some point, but should still display correctly.

Bug reports and comments/suggestions are welcome.

Enjoy
Homegrown

edited to reflect changes since initial posting

edited 26 Dec, 2005 with v.1.52 compatible files, see post #117

Download:

Domestic Advisor v.1.52 (http://home.houston.rr.com/homegrowns/homegrown-domestic152.zip) | Clock Mod v.1.52 (http://home.houston.rr.com/homegrowns/homegrown-clockmod.zip)

CyberTyrant
Oct 30, 2005, 08:06 AM
Cool, I like it. The more info the better.

anjinsan1966
Oct 30, 2005, 08:12 AM
Ahh u can never get to much of info and statistics!!!!
Im gonna try this (that is once i get the game:mischief: ).
:goodjob:

Muad-Dib
Oct 30, 2005, 08:14 AM
Can you make the Advisor actually advise?

BaalRoG
Oct 30, 2005, 09:10 AM
This is great!

Can you mod the other 2 advisors like foreign and military, too?
They are so damn bad... there shoult be more transparancy!

I really miss how many units i can handle until i have to pay money for them on the military advisor screen or even better on the mainscreen near the money on the top left...
also the tech points i generate at the moment...

something like this:
top left should stay -> number of all units now (green until you break the linit than red)/units for free(yellow) -> 22/12
and
top left should also stay -> number of techpoints i generate -> 312 (blue)


Is it possible to realize?

amirsan
Oct 30, 2005, 09:20 AM
Very nice, good job homegrown!!

homegrown
Oct 30, 2005, 09:20 AM
Is it possible to realize?

I was thinking of looking at the Finance Advisor next, but still really unsure how I want to go with it. It looks like all the commerce stuff is exposed, so it's just a matter of deciding what information to show and finding a place on the interface to stick it.

BaalRoG
Oct 30, 2005, 10:07 AM
i dont understand why they didnt break down all the informations which pop up on the finance advisor after going over with the mouse cursor...

it would be much nicer to see the infos directly... maybe with placeholders after the right costs-section...example:

unit costs -> 4
|-> Units free (12) -> 3
|-> blabla -> 1
-------------------
inflation costs -> 5
|-> blabla -> #
|-> blabla -> #
-------------------
and so on...
===============
Total costs


Its only an idea, but the financial advisor now really nervs a lot...

Another missing function is the military advisor screen which misses the "upgrade units" button... or did i oversee it?

dalek master
Oct 30, 2005, 10:52 AM
that is a very nice mod. As soon as the game is installed (if it ever is installed), I'm downloading. congrats on such a good mod

GoldenAge
Nov 01, 2005, 05:57 PM
This looks spectacular. I think I'll wait until the city names are clickable before I give it a shot though. Great work!

Ogedei_the_Mad
Nov 01, 2005, 06:12 PM
Nice changes. That way, there's a lot more useful info given on just one screen. :)

BTW, is this the same "homegrown" on the old Impressions' city-builder forums?

theinsane
Nov 01, 2005, 06:20 PM
Wow! I really like the city maintenance column - keep up the good work! :goodjob:

homegrown
Nov 01, 2005, 07:29 PM
BTW, is this the same "homegrown" on the old Impressions' city-builder forums?

Yes, that's me.

I worked on sorting more today. It's *almost* there, but not quite.

Kolath
Nov 01, 2005, 08:04 PM
Wow! Great work Homegrown! Your setup looks much better. As soon as you get it to sort and link I'll be all over it! Once I get the game that is... (stupid midterms!)

Greek Plunder
Nov 01, 2005, 08:24 PM
Yep, once I'm able to sort and click I'll download it. Sorting is a must. :P

homegrown
Nov 01, 2005, 08:41 PM
Maybe if I explain what the issue is with sorting, someone might have some ideas. It *does* sort, but instead of sorting by integer values, it is sorting by string values. So one list might go ['1','13','16','2','22','3','31','4']. However, most of the time, it does print a coherent sorted list.

Uty
Nov 01, 2005, 09:34 PM
This is really cool. Right now I'm trying to figure out how you did this. (I'm new to Python but not new to programming.)

In CvDomesticAdvisor.py:


# Religions Column
screen.setTableColumnHeader( "CityListBackground", 2, localText.getText("Religions", ()).upper(), 130 )


From the Python for cIV Class Reference:

STRING getText(STRING szTag, TUPLE args)
LPCTSTR getText(const TCHAR * szTag, python::tuple& args)

Here are my questions

- General Python: when you call ()).upper() what object are you referencing?
- cIV: How did you determine the members of python::tuple& args? I'm guessing that any collection of three values qualifies as a tuple. I see the first member is "Religions" and appears as the name of the column so that is a no-brainer. What are ()).upper() and 130?

Thanks!

Skatanic
Nov 01, 2005, 09:37 PM
Maybe if I explain what the issue is with sorting, someone might have some ideas. It *does* sort, but instead of sorting by integer values, it is sorting by string values. So one list might go ['1','13','16','2','22','3','31','4']. However, most of the time, it does print a coherent sorted list.

Damn... is this changable?

tcwleblanc
Nov 01, 2005, 09:50 PM
very nice work!!

Greek Plunder
Nov 01, 2005, 09:53 PM
This is really cool. Right now I'm trying to figure out how you did this. (I'm new to Python but not new to programming.)

In CvDomesticAdvisor.py:


# Religions Column
screen.setTableColumnHeader( "CityListBackground", 2, localText.getText("Religions", ()).upper(), 130 )


From the Python for cIV Class Reference:

STRING getText(STRING szTag, TUPLE args)
LPCTSTR getText(const TCHAR * szTag, python::tuple& args)

Here are my questions

- General Python: when you call ()).upper() what object are you referencing?
- cIV: How did you determine the members of python::tuple& args? I'm guessing that any collection of three values qualifies as a tuple. I see the first member is "Religions" and appears as the name of the column so that is a no-brainer. What are ()).upper() and 130?

Thanks!

I dunno Python, but I'm guessing 130 has something to do with column size? (width)

Stardog13
Nov 01, 2005, 10:28 PM
Wow, looks great; the more info the better :)

homegrown
Nov 01, 2005, 11:04 PM
I think .upper() is a function of the GFC interface system (tells it where in the widget to display the text?), I just copied that part from every other line. The 130 is the column width.

A tuple in python is a special type of list, so it can contain one or many elements, not necessarily three.

TLHeart
Nov 02, 2005, 02:57 AM
Very good homegrown,

those were the changes I wish were there, so that I could make a quick scan of my cities, and see what I might need to do in any of them. The present screen takes effort to figure out what a city needs, and does not present some of the information I need. YOurs is so much better....
thanks

[Gandalf]
Nov 02, 2005, 03:01 AM
Nice, I like the better interface.

I assume that upper() just refers to the upper-most (last) element in a list/collection?

QueenElizabeth
Nov 02, 2005, 04:55 AM
Brilliant work homegrown.

I really like the bullets for national wonders.. until now I've had to look into each city and check in the building box.. a great time saver. :)

Thanks again.

P.S - I'm stunned you managed to drag yourself from playing the game long enough to mod it. Stunned, but grateful!

Junuxx
Nov 02, 2005, 05:38 AM
looks great :)

Uty
Nov 02, 2005, 08:37 AM
Thanks for answering, homegrown (and others.)

I ordered a Python book from Amazon.com last night so once it arrives I should be able to write some interesting mods.

Corey
Nov 02, 2005, 09:04 AM
Big thanks for this.

Uty
Nov 02, 2005, 09:07 AM
It's a book about the programming language, Python.

http://www.amazon.com/exec/obidos/tg/detail/-/0596002815/002-4457117-5589615?%5Fencoding=UTF8&v=glance

O'Reilly make great books. I learned Perl (another programming language) with a similar book and it worked out just fine.

Spatzimaus
Nov 02, 2005, 12:21 PM
Maybe if I explain what the issue is with sorting, someone might have some ideas. It *does* sort, but instead of sorting by integer values, it is sorting by string values. So one list might go ['1','13','16','2','22','3','31','4'].

Not a Python expert, but the easiest solution for this is to pad with zeroes.
So, if:
X = ['1','13','16','2','22','3','31','4']
define
Y = 100+ X
(i.e., ['101','113','116','102',...])
Then just use Y to determine your sort. For graphical reasons, you should cap X at 99 turns before adding 100, but that won't affect the sort. If the array used to determine sort indices absolutely has to be something plotted as-is on screen, define Z as the last two digits from each element of Y (Z = ['01','13','16','02',etc.]) and use Z instead of X. It'll look a bit messier with the leading zeroes, but it'd still sort correctly as long as python doesn't automatically cast Z back to an integer before sorting.

Eyemaze
Nov 02, 2005, 01:18 PM
you could convert the strings into integers to sort, then go back after sort and convert the integers back in to strings(if that is the required format for them to be in for other operations)

int(x[, base]) -> integer

Convert a string or number to an integer, if possible. A floating point
argument will be truncated towards zero (this does not include a string
representation of a floating point number!) When converting a string, use
the optional base. It is an error to supply a base when converting a
non-string.

Erendir
Nov 02, 2005, 01:28 PM
It looks great, but it doesnt work by me. The game doesnt load the files from the /CustomAssets/ folder, and if i replace some files in game/assets/ folder, it shows while loading a lot of pythonexceptions/errors, and doesnt start.

(It doesnt load even the XML files from /customassets/, and i cannt understand WHY?)

Can anybody help me to fix this?..

abj9562
Nov 02, 2005, 01:54 PM
Looks Great!

JDexter
Nov 02, 2005, 02:31 PM
@Erendir:
Sounds like you might have put it in the wrong dir. You cannot use mods correctly from the \My Documents\My Games\... folder that cIV creates on install. You have to put it in the regular ...\Firaxis\cIV\ folder!

Hope this helps:goodjob:

homegrown
Nov 02, 2005, 02:35 PM
I have *really* great news. I fixed the sorting problem, with a little help from JonS who pointed out that setTableText and setTableInt will tell it what it's supposed to sort by.

Also, ok... it's not "clickable" in the sense that the whole city screen comes up. I'm still looking into that, but I noticed today that if you select a city, the city screen 'lite' will come up at the bottom and allow you to set the production queue, rush, and fiddle with governors. I didn't do that, it was already in there and I just hadn't noticed it before.

Anyway, the link in the first post now contains the new and improved version.

Happy Civving.

Greek Plunder
Nov 02, 2005, 02:41 PM
I have *really* great news. I fixed the sorting problem, with a little help from JonS who pointed out that setTableText and setTableInt will tell it what it's supposed to sort by.

Also, ok... it's not "clickable" in the sense that the whole city screen comes up. I'm still looking into that, but I noticed today that if you select a city, the city screen 'lite' will come up at the bottom and allow you to set the production queue, rush, and fiddle with governors. I didn't do that, it was already in there and I just hadn't noticed it before.

Anyway, the link in the first post now contains the new and improved version.

Happy Civving.

Woohoo, download, here I come. Get down!

CyberTyrant
Nov 02, 2005, 04:55 PM
I have *really* great news. I fixed the sorting problem, with a little help from JonS who pointed out that setTableText and setTableInt will tell it what it's supposed to sort by.

Also, ok... it's not "clickable" in the sense that the whole city screen comes up. I'm still looking into that, but I noticed today that if you select a city, the city screen 'lite' will come up at the bottom and allow you to set the production queue, rush, and fiddle with governors. I didn't do that, it was already in there and I just hadn't noticed it before.

Anyway, the link in the first post now contains the new and improved version.

Happy Civving.

Sweet. :goodjob:

Nicole
Nov 02, 2005, 06:27 PM
Great work!

As long as we're requesting features, how about being able to click on the production item and change it directly from there via a valuelist, ala Civ III? I really miss that.

Radres
Nov 02, 2005, 09:40 PM
Great work!

As long as we're requesting features, how about being able to click on the production item and change it directly from there via a valuelist, ala Civ III? I really miss that.

Re-read what homegrown just wrote... if you look at the bottom of the screen, the lower-left is your production queue, and you can select what to build from the middle. It's not very obvious that is what it is! I didn't notice it until homegrown pointed it out.

Kamakazie
Nov 03, 2005, 04:01 AM
This is really cool. Right now I'm trying to figure out how you did this. (I'm new to Python but not new to programming.)

In CvDomesticAdvisor.py:


# Religions Column
screen.setTableColumnHeader( "CityListBackground", 2, localText.getText("Religions", ()).upper(), 130 )


From the Python for cIV Class Reference:

STRING getText(STRING szTag, TUPLE args)
LPCTSTR getText(const TCHAR * szTag, python::tuple& args)

Here are my questions

- General Python: when you call ()).upper() what object are you referencing?
- cIV: How did you determine the members of python::tuple& args? I'm guessing that any collection of three values qualifies as a tuple. I see the first member is "Religions" and appears as the name of the column so that is a no-brainer. What are ()).upper() and 130?

Thanks!

I am not at all familiar with Python, but he's referencing ("Religions", ()).toUpper()

Kamakazie
Nov 03, 2005, 04:10 AM
I have *really* great news. I fixed the sorting problem, with a little help from JonS who pointed out that setTableText and setTableInt will tell it what it's supposed to sort by.

Also, ok... it's not "clickable" in the sense that the whole city screen comes up. I'm still looking into that, but I noticed today that if you select a city, the city screen 'lite' will come up at the bottom and allow you to set the production queue, rush, and fiddle with governors. I didn't do that, it was already in there and I just hadn't noticed it before.


For some reason with your mod only some cities will pop up the city queue when you click on them.

Dragonlord
Nov 03, 2005, 08:33 AM
Looks good, I'll DL as soon as I get home!

Thanks for the good work, it's much appreciated! :goodjob:

homegrown
Nov 03, 2005, 08:55 AM
For some reason with your mod only some cities will pop up the city queue when you click on them.

I've noticed this. It's only the capital city that doesn't work, I'm assuming because F10 is the built-in shortcut to the Capital City. But i've reported it as a bug.

Kamakazie
Nov 03, 2005, 11:46 AM
I've noticed this. It's only the capital city that doesn't work, I'm assuming because F10 is the built-in shortcut to the Capital City. But i've reported it as a bug.
Its not just the capital city on my end, and I dont understand why. :\

Nicole
Nov 03, 2005, 03:57 PM
Re-read what homegrown just wrote... if you look at the bottom of the screen, the lower-left is your production queue, and you can select what to build from the middle. It's not very obvious that is what it is! I didn't notice it until homegrown pointed it out.

Yes, but I hate that interface :D I mean, I'm looking at the production item on the RIGHT side of the screen, so I'm supposed to move to the LEFT side of the screen and click the city name, then move to the BOTTOM of screen to change the production item, that's on the opposite corner from where I started. Not user friendly.

homegrown
Nov 03, 2005, 07:18 PM
']Nice, I like the better interface.

I assume that upper() just refers to the upper-most (last) element in a list/collection?

It finally occurred to me what .upper() does... prints it in upper case. doh!

Also, I've figurered out what the problem with the clicking cities is sometimes. Apparently, it's coded in the GFC interface, and it's not liking that I'm adding characters to a field *it* thinks is just the city name.

So the plan is to try to find a few pixels from somewhere to add a separate column for the landmark, or possibly, add them to the Date, like in the retail version, because who ever wants to sort by date? ;)

Please stand by...

Dragyn
Nov 03, 2005, 11:18 PM
Also, I've figurered out what the problem with the clicking cities is sometimes. Apparently, it's coded in the GFC interface, and it's not liking that I'm adding characters to a field *it* thinks is just the city name.

Please stand by...

I went ahead and hacked together my own version from Homegrown's that adds all the extra symbols to the Date column rather than name. So it's exactly like Homegrown's but this fixes the problem where you click on a city in the list and you do not get the production queue to popup at the bottom. I had to widen the date field and shorten the name field in order for all the symbols to fit in the date field.

I'm not trying to steal all the hardwork you've put into this Homegrown, just wanted to supply an interim fix for people while you're working on the next great version :)

Screenshot can be seen below and zip file is attached (install it just like Homegrown's and having his first is not required to install this)

Gr3yHound
Nov 04, 2005, 08:29 AM
whatever = localtext.gettext("religions",())
something = whatever.upper()
screen.setTableColumnHeader( "CityListBackground", 2, something, 130 )

isnīt it just that, just stripped down to one bigger command?

Khaim
Nov 04, 2005, 02:48 PM
Can you maybe mod it so that it shows how MUCH negative happiness/health/food there is, instead of just a symbol? It would be helpful to know how much trouble I'm in from this screen.

That said, I'm still switching to this right now.

XF Clohvn
Nov 04, 2005, 02:49 PM
Very nice features. I'm a giant fan of modding and can't wait to see more like this in the future :D

killaer
Nov 04, 2005, 03:01 PM
Well..im pretty stupid and I cant get this thing working -_-
What folder do I put it in? I put it into my civ folder but that didnt do anything.

Kamakazie
Nov 04, 2005, 03:16 PM
Well..im pretty stupid and I cant get this thing working -_-
What folder do I put it in? I put it into my civ folder but that didnt do anything.
Homegrown said in the first post -

My Documents/My Games/Civ 4/

homegrown
Nov 04, 2005, 04:10 PM
That's cool, Dragyn. I went and added another column last night and it fried on me, so I downloaded your quick fix to get me going again. :D

Elhoim
Nov 04, 2005, 09:57 PM
Is there any way to change the Diplomacy advisor so it shows in the resource tab what they´re willing to trade, what they are not, and WHAT THEY NEED, along with how much GOLD and GOLD PER TURN they are willing to give?

I wish I knew python... And have the time to do it!!! :p

AceChilla
Nov 05, 2005, 07:11 AM
Great stuff Homegrown, really usefull. :goodjob:

Im looking forwards to other mods, this kinda thing really shows how much you can do if you know Python.

killaer
Nov 05, 2005, 10:00 AM
Homegrown said in the first post -

My Documents/My Games/Civ 4/
Thats what I did. Cept for me its Sid Meiers civilization 4 instead of just civ 4. I tried putting it in every folder I could think of and it didnt do a thing :/

homegrown
Nov 05, 2005, 12:53 PM
Thats what I did. Cept for me its Sid Meiers civilization 4 instead of just civ 4. I tried putting it in every folder I could think of and it didnt do a thing :/

OK, you've likely just unzipped it to the wrong place... When you unzip it, tell it to "use folder names", that will write the files to the appropriate place in My Documents/My Games/Civ 4/CustomAssets/python/screens. There should be one file (PyHelper.py) in /python/ and one file in /screens/ (CvDomesticAdvisor.py). Hope that helps.

BTW, would people rate this thread please after they've tried it out and fallen in love with it... Thanks. :goodjob:

Dearmad
Nov 05, 2005, 02:48 PM
Hey... I'd like to add this in to the mod I'm doing- may I? (Full credit and pointer your thread of course).

My thread is over at:
http://apolyton.net/forums/showthread.php?s=&threadid=141059&perpage=30&pagenumber=1

Dearmad
Nov 05, 2005, 03:07 PM
Oh... one thing... I can't get it to work. Installed as directed and the old menues keep popping up. Gr.

homegrown
Nov 05, 2005, 03:38 PM
Can you maybe mod it so that it shows how MUCH negative happiness/health/food there is, instead of just a symbol?

It actually started that way, and I just made the decision to change "action items" to the symbols to give them more visual emphasis. It's much easier to spot the icon than a negative numbers, especially in large empires.

Hey... I'd like to add this in to the mod I'm doing- may I?

Suuuuuure!

I went and added another column last night and it fried on me, so I downloaded your quick fix to get me going again.

I found this in the CvPythonExtenions help and am making the changes today. This will move the landmark icons off the Date (again *sigh*) and into their own column, hopefully replacing whatever sorting functionality Date had to begin with.

edited to add: The link in the first post now contains the most current version.

Thanks again for the all the comments and ratings. Also, check out my new Clock Mod (http://forums.civfanatics.com/showthread.php?t=137980).

jpinard
Nov 06, 2005, 08:20 AM
Super job guys.

-- queue beer commercial -- I love you man! :)

the100thballoon
Nov 06, 2005, 12:46 PM
very very nice! thx!

ZyZ
Nov 06, 2005, 01:21 PM
Thats what I did. Cept for me its Sid Meiers civilization 4 instead of just civ 4. I tried putting it in every folder I could think of and it didnt do a thing :/

i hope this will help (worked for me)

Ok, I've been playing around with that.

From what I found the way it works is:

If you add anything to customassets or change anything there you MUST clear the cache before it takes effect. Otherwise the game won't look at it at all, you can throw gibberish in there and it won't matter.

If you change a mod that previously exists on your computer without changing the name of the mod in any way you MUST clear the cache before any of your changes will take effect in the game.


This all seems like a rather odd and confusing way to do things, especially since clearing the cache didn't seem to have that much of an effect on my load times.

cache is loacted in /Documents and Settings/<your profile>/Application Data/My Games/<civ4>/cache

SilentMage
Nov 06, 2005, 11:52 PM
Very very nice!! I've been following this mod when it first appeared here and patiently waited till I could sort the columns! I'm lovin' it man! Invaluable addition to my empire! :goodjob:

tek1979
Nov 07, 2005, 12:12 AM
VERY VERY VERY NICE!!! my hats off to you .. now why the heck couldent of they just done that to begin with .. its not like it takes hardcore civ players to relise thats whats needed for better gameplay and easier information access for city management .. again well done
:goodjob:

neriana
Nov 07, 2005, 12:50 AM
Great job! You might want to double-check that the PyHelpers file is inside the pyhelper folder in the .zip. When I unzipped it, the CvDomesticAdvisor file went to the right place, but the PyHelpers file unzipped to the python folder, but not the screens subfolder. No biggy, I just moved it, but something to check.

Again, great job and thanks!

homegrown
Nov 07, 2005, 01:19 AM
Great job! You might want to double-check that the PyHelpers file is inside the pyhelper folder in the .zip. When I unzipped it, the CvDomesticAdvisor file went to the right place, but the PyHelpers file unzipped to the python folder, but not the screens subfolder. No biggy, I just moved it, but something to check.

Again, great job and thanks!

It goes right under python. The folder PyHelper is a totally different thing. If you moved it to inside PyHelper, the game won't find it and some of the function calls in the advisor won't work and probably crash. If you ever have any questions when you're installing a mod, look in your original Civ4/Assets folder to double check. The structure and files should be exactly the same.

PyHelpers --> CustomAssets/python
CvDomesticAdvisor --> CustomAssets/python/screens

This also matters for multiplayer. With this under CustomAssets, you shouldn't get versioning errors. That would happen if you altered the original game files in Civ 4/Assets instead.

BuddhaLite
Nov 07, 2005, 01:51 PM
It actually started that way, and I just made the decision to change "action items" to the symbols to give them more visual emphasis. It's much easier to spot the icon than a negative numbers, especially in large empires.

I modified my copy to show numbers and left the icon appended (had to widen the columns, however). It works well, but I think an even better idea would be to use the negative number and change the text color to red/green (as appropriate). That would give the value AND stand out (except for someone who is red/green colorblind, though).

Any idea how to change the text color in the table?

ikarius
Nov 08, 2005, 12:09 AM
Hmm. I've run into problems shortly after installing this on two different computers.

Installed this on a friends system and immediately after installing it, loaded up a saved game, and what was shown on the domestic advisor screen was the name of his capitol city, and nothing else; no columns, no information, nothing. This system was definitely at the bottom end of the minimum system requirements, however. Uninstalled it there.

Installed this on my system, which is significantly better than the recommended system specs. Everything seemed fine for a time, but suddenly I'm having difficulties. My "resources" screen is now displaying no resources, even though I've got at least a half-dozen linked up. Additionally, I keep loosing the mouse-over info on both my build items, and my tech tree. I've played through 2 games previously and never saw these problems before.

I'm not certain if either occurrence is truly the fault of this mod, or simply problems with civ 4. Any guesses?

ZanThrax
Nov 08, 2005, 12:40 AM
what was shown on the domestic advisor screen was the name of his capitol city, and nothing else; no columns, no information, nothing.

That's what it does for me as well. Tried it with a new game. Shows all the headings properly, until I founded a city. Then it just has 4000 BC <Capital>. No headings, no other info.

snepp
Nov 08, 2005, 12:51 AM
Does this problem occur when you start a new game?

Try emptying your cache folder.

Kamakazie
Nov 08, 2005, 02:24 AM
This happened to me when I was trying to run a mod that was not the default.

ikarius
Nov 08, 2005, 05:10 AM
Snepp-

The game I am currently playing which has no information available on the "resources" screen was a new game I started after installing the mod. I just looked around further, and the "technology" screen under the foreign advisor is also broken- once again, no information whatsoever.


When you suggest clearing my "cache" folder, what folder do you mean? I ran quick searches of both civ4 under program files, and under my documents revealed nothing with "cache" in the name except a couple of compiled python scripts under the system folder.

--Ikarius

ZanThrax
Nov 08, 2005, 08:55 AM
Yeah, I can't find a cache folder to empty either.

homegrown
Nov 08, 2005, 09:46 AM
Hmmm, well, the issues with the F1 advisor not displaying anything but the headers and the first day or city is definately a problem. I *suspect* something isn't in the correct folder. Try getting the zip again and reinstalling. I'll be adding a read me to the zip later today, but if you have any questions, join the chat room and hopefully someone can help you.

As far as the resources go... that's not me, I promise. Not sure what the deal is with that, as I've never seen it and this is the first I'm hearing of it.

The cache folder is a little hard to find as Application Data is usually a hidden file. The full path is "C:\Documents and Settings\%userprofile%\Application Data\My Games\Sid Meier's Civilization 4\cache". Select all the files and delete them, then restart Civ 4.

patgarr
Nov 08, 2005, 12:06 PM
hi, i have installed your mod but i got some column error :
look that screenshot :

Gr3yHound
Nov 08, 2005, 12:26 PM
i got a fixed version.....you´re probably using german or any other not englisch language.

there´re 2 ways

a)
this solution is unique for every language and i wouldn´t recomment it.
the only works for german language way (you will have to change the code yourself)
http://www.civforum.de/showpost.php?p=772142&postcount=14
(both ways are explained in this thread, and even if you are not german, you´ll get how to fix stuff)

or
b)
the general solution, already done, just copy over-way
http://www.bindig.net/dunno/CvDomesticAdvisor.fixed.icons.zip
link http://www.civforum.de/showpost.php?p=756588&postcount=4

the easiest way is to use b) and substitute
\My Games\Civilization 4\CustomAssets\python\screens\CvDomesticAdvisor.py

BeefontheBone
Nov 08, 2005, 01:44 PM
Hey, good idea - it took me ages to see which religions were in my cities earlier (it shows up in the Religion advisor, of course) which is kind of important when you're running Free Religion. I have a couple of suggestions though - any chance of centering the map on a city somehow, perhaps with a rightclick on the name? Secondly, looking at the screenshot above (patgarr's) is it possible to have the columns, particularly Religions, alter their size to fit the necessary contents? In that shot, the Religions column is taking space that could be used to better display the city names; might be a bit harder to code though. Thirdly, in order to help out the guys who wanted to see negative totals (personally I agree with homegrown, the big red icon is easier to see) maybe mousing over entries could display the information from the relevant city screen (if it doesn't already do so - I've not noticed if it does); for example, mousing over the Happiness entry for a city would display its positive and negative factors in the same way that it does in the city display - handy for working out why your empire is unhappy or unhealthy.

Great job though, and the same goes for the (incredibly obvious - there's a bloomin' great gap there just the right size for both date and time to display) clock mod.

Incidentally, the zip for this doesn't contain the installation instructions/documentation, which might be nice.

@Gr3yHound: That's French.

homegrown
Nov 08, 2005, 04:10 PM
OK, I hadn't even thought about foreign language editions of the game. I think Gr3yHound has the right idea though. Open up CvUtil.py and go down to the bottom of the file where the icons are extracted from the font map. Each one is "named" there. Just change the name of the icon in the appropriate place in CvDomesticAdvisor, def drawHeaders function.

Mouseovers, flexible columns, and closing one screen to open another are currently outside my abilities. But noted.

Ooops, I wrote the readmes and added them to the zips, then forgot to upload the new versions to my server. They are there now.

HeroFromHyrule
Nov 08, 2005, 06:33 PM
I love this mod, this is exactly what I've been looking for. My biggest gripe with the game is that the Advisors really don't Advise you of anything, and I miss that. I miss seeing how many military units I can support and getting recommendations of what my cities need. Thanks a lot for this mod! Now, get to work on improving more advisors!!

Gr3yHound
Nov 08, 2005, 08:35 PM
@Gr3yHound: That's French.


ahh, bottom right corner, and the whole production, didn´t look at that =)
nevertheless, the 2nd way will work.

Mujadaddy
Nov 08, 2005, 09:10 PM
This looks spectacular. I think I'll wait until the city names are clickable before I give it a shot though. Great work!
I miss that, too... but it looks great so far :D

ZanThrax
Nov 08, 2005, 10:09 PM
OK, clearing the cache worked. Guess I wasn't looking closely enough at the descriptions of where it was. Thought it was in the My Documents/My Games along with all the other folders.

Really don't like the idea of a games files being in three different areas of the directory structure.

Ben Music
Nov 09, 2005, 06:47 AM
Great looking mod! I can't wait to download it when I get home.

kalder
Nov 09, 2005, 04:05 PM
Hi, thanks a lot for you job, it's really great.
I'd like just to point out that the 10th column's heading actually is the total commerce produced in the city (before the splitting between science, culture and gold) and not the gold production. Maybe it would be more correct to make it show the exact gold production...Have you guys the same outcome?

P.S.: anyone has the same problem with me with the domestic advisor? I see some upside-down question marks instead of some icons, in particular instead of "food turn to growth", "hammers" and "gold". I had the same problem with the default advisor (i can't remember which were the icons...)

BeefontheBone
Nov 09, 2005, 04:17 PM
If you look at the previous page of this thread, that's an issue with non-English localised versions of the game.

kalder
Nov 09, 2005, 06:16 PM
Thank you BeefontheBone...I had missed that issue... I installed the fixed patch, cleaned the cache BUT now it only remains one column with that awfuol symbol...
Ironically, it is the one that reports the total commerce produced by the city...Anyone can help me fixing this last one?

thanks in advance!

terrasol
Nov 11, 2005, 12:31 AM
Hello homegrown
I don't want do steal your work, but I haved change your Advisor a little bit, I hope this is ok so.

I have changed some Details and have worked on the localization of this file.

Following Files are changed/new
1.python/PyHelpers.py - original from homeground
2.python/screens/CvDomesticAdvisor.py
3.xml/text/CIV4GameText_Misc1.xml

It should work with all languages, but i have only translated for the german version, file no.3 can be changed for other languages..at the end of file(actually all in english)

snepp
Nov 11, 2005, 01:14 AM
Hello homegrown
I don't want do steal your work, but I haved change your Advisor a little bit, I hope this is ok so.

I like the red numerics, more useful than an icon (imo). Question, what is determining the red numbers under the strength column?

terrasol
Nov 11, 2005, 01:21 AM
oh this was a gimmick for me ;)

i have said, if my town has less then three combat-units in it, then i want to see this in red

jack-itb
Nov 11, 2005, 01:44 AM
Thank you BeefontheBone...I had missed that issue... I installed the fixed patch, cleaned the cache BUT now it only remains one column with that awfuol symbol...
Ironically, it is the one that reports the total commerce produced by the city...Anyone can help me fixing this last one?

thanks in advance!

Perhaps the order of the columns got wrong:

# Food Turns to Growth
szText = u"%c" %(gc.getYieldInfo(YieldTypes.YIELD_FOOD).getChar() )
screen.setTableColumnHeader( "CityListBackground", 6, szText, 30 )

# Net Health Column
screen.setTableColumnHeader( "CityListBackground", 7, unicode(CvUtil.getIcon('healthy')), 30 )

# Production Column
szText = u"%c" %(gc.getYieldInfo(YieldTypes.YIELD_PRODUCTION).get Char())
screen.setTableColumnHeader( "CityListBackground", 10, szText, 40 )

# Gold Column
screen.setTableColumnHeader( "CityListBackground", 9, unicode(CvUtil.getIcon('gold')), 40 )

The bold numbers must be numbered ascending.

snepp
Nov 11, 2005, 02:04 AM
oh this was a gimmick for me ;)

i have said, if my town has less then three combat-units in it, then i want to see this in red

Gotcha, and thanks.

kalder
Nov 11, 2005, 03:26 AM
Perhaps the order of the columns got wrong:


The bold numbers must be numbered ascending.

Thanks a lot for answering!! However, I must admit I'm not very strong in modifying the code. Would you please explain me where I can find the file and how should it be corrected?
It would be a great help.

I'd like to thank also terrasol, you modifications are interesting!!
May I ask you where should I install the 3rd file? xml/text is always in the "usual" MY GAME folder?

Thank you

terrasol
Nov 11, 2005, 03:47 AM
you can install this in
'dummy'\My Games\Sid Meier's Civilization 4\CustomAssets\xml\text

'dummy' appends from your computer-settings....unfortunately i only know in german settings, there this is named 'Eigenen Dateien'...but i think someone can tell you this in english settings

I have changed the DomesticAdvisor again, now you can see the really gold production of your town, depent on your percent settings

see http://forums.civfanatics.com/showpost.php?p=3301432&postcount=88

didaskalia7
Nov 11, 2005, 09:35 AM
This looks great! Thanks, I will try tonight when
I get home:thumbsup: :thumbsup: :dance:

Arkeide
Nov 12, 2005, 10:00 PM
Hello guys!!

First, i would thank everyone who contributed tor the new advisor. :D

I have just added a few line into it ... I somewhat managed to make the city screen appear in the back when you select a city in the table.
Look at this:

103584

I added a VIEW button on the bottom. If you click on VIEW, you'll go in the city. If you quit, you'll go back where you were before.

But there is problem : what i get when someone click in the table, is the index of the selected row in the table, which is NOT the city index when the table has been ordered in a other way than the 'standard' order.
Maybe someone will find a way to fix that, I have to :sleep: for now.
Look at the handleInput function, everything is there


def handleInput (self, inputClass):
' Calls function mapped in DomesticAdvisorInputMap'
# only get from the map if it has the key

if ( inputClass.getNotifyCode() == NotifyCode.NOTIFY_LISTBOX_ITEM_SELECTED ):
screen = CyGInterfaceScreen( "DomesticAdvisor", CvScreenEnums.DOMESTIC_ADVISOR )
# Index in the table
iIndex = inputClass.getData()
self.chosenCity = iIndex
# Old behaviour
# screen.updateAppropriateCitySelection( "CityListBackground", len( PyPlayer(CyGame().getActivePlayer()).getCityList() ) )
# Automatically close the screen when select
# screen.hideScreen()
# Go to the city
# CyInterface().lookAtCityOffset(iIndex)

city = CyGlobalContext().getActivePlayer().getCity(iIndex )
# Select the city
CyInterface().selectCity(city, True)

# Make the city screen appear
CyEngine().setCityBillboardVisibility(True)
else:
if (inputClass.getFunctionName() != "DomesticView"):
return 0
# Handle the view 'button'
screen = CyGInterfaceScreen( "DomesticAdvisor", CvScreenEnums.DOMESTIC_ADVISOR )
screen.hideScreen()
# CvUtil.pyPrint('funName = %s' %(inputClass.getFunctionName()))
city = CyGlobalContext().getActivePlayer().getCity(self.c hosenCity)
CyInterface().selectCity(city, True)
CyEngine().setCityBillboardVisibility(True)
return 0


Here is the new domestic.zip attached
103585

JakeCourtney
Nov 12, 2005, 11:53 PM
People should consider combining their specific mods together.

prologos
Nov 13, 2005, 06:44 AM
I downloaded the advisor and placed the files where there should be as mentioned here and in the readme but the advisor i see in the game is the one that shiped with the game. If i place the files in "program files/firaxis games/civ4/assets" etc and replace the original files ( or rename the originals) and then put the files from the zip in their place i also see the original advisor and as a bonus i can no longer load a saved game!!!!
Anyone knows what i should do?

I also tried cleaning the cashe but after i did that and tried to load the game i got a "can't load CvWBInterface" error when the game tried to load python and inside the game i had no interface. I quitted abd loaded again to no vain. All I got was the original advisor...

Orion66
Nov 13, 2005, 06:44 AM
Hi

I do not understand. This mod doesn't work. Also flags mods dont work.
I copy all files into folders that are mentioned in instruction. Then I play new game. And nothing.....

What am I doing wrong?? :confused: :confused: :confused: :confused: :confused:

kittenOFchaos
Nov 13, 2005, 07:38 AM
Keep up the good work Homegrown, with this and your clocks mod you've been doing sterling service for all Civ4 fanatics :)

RoyalPrecision
Nov 13, 2005, 08:12 AM
Thx god. You are the MAN

prologos
Nov 13, 2005, 09:33 AM
It appears that the international windows versions have the folder "My Documents" translated into the language of that version (i use the greek version of XP). The solution to the various problems conserning custom maps, assets etc is to rename the folder to "My Documents" as it should have been in the first place.... so simple and yet soooo annoying!!!:mad:

DeathCyclops
Nov 13, 2005, 09:41 AM
I cant get this to work!:mad: It worked the first time and now it just shows the name of my first city and nothing else. Does anyone know what happened?

1c0n
Nov 16, 2005, 09:31 AM
yeah me too, never worked. cool idea tho
i put it in ***\customassets
that the right place for it?

ps the clock one doesnt work either

Shevek
Nov 20, 2005, 05:27 PM
you can install this in
'dummy'\My Games\Sid Meier's Civilization 4\CustomAssets\xml\text

'dummy' appends from your computer-settings....unfortunately i only know in german settings, there this is named 'Eigenen Dateien'...but i think someone can tell you this in english settings


'Eigenen Dateien' is 'My Documents' in English. :)

Taronas
Nov 22, 2005, 09:45 AM
Mouseovers, flexible columns, and closing one screen to open another are currently outside my abilities. But noted.


Gues that answers my question but just to be sure:

Would it be possible to make the F1 screen open the city detail screen if you double-click on a city name in the table (or press ENTER with a city row highlighted).

Or at least, center the selected city on the map on double-click


or how do you guys go about finding specific cities on a large map?

terrasol
Nov 22, 2005, 09:53 AM
you can use the domestic advisor for this (also the standard game version)

in german version this is done so:

open domestic advisor
click on needed town
press 'C' on keyboard
then 'ESC' for closing the advisor
then 'Einfg'---in english 'Insert' ????
and you have the city screen of your town

..a long list but if you know it ,it's a really quick thing to open the right cityscreen

for english shortcuts perhaps some other can help here

Jaybe
Nov 23, 2005, 10:27 PM
Since the domestic advisor has been changed so sorting can be done by year founded in the 1.09 patch:
I am awaiting an update of this mod.

Pilotis
Nov 24, 2005, 11:34 AM
Excellent tool. Thanks. Soooo much more useful !:) :) :) :)

Small issue. The final right-hand column - turns to completion I think - disappears under the slide bar when the number of cities exceeeds one screen. Y'get me ?

Bigger issue ? Can you link from a city in the domestic advisor to the city management screen, and then back to domestic advisor. Twud ne soooo nice !

Spock1979
Nov 25, 2005, 10:02 AM
great addon !!! :goodjob:
i love more statistic ! :scan: :scan: :scan:
One suggestion is:
is it possible to make the original window resizable because i cannot see some of the info because it is too short in column width.
Either that or to make it resolution dependant.
I have 1600 x 1200 resolution and the main domestic window is the same size as the one in 1024x768....:(

thanks again...

anton_z1
Nov 27, 2005, 11:39 PM
:mad ARGHHH. My adviser is completly screwed up. all icons disappeared. Did i do something wrong. I downloaded the file then unizipped it to my custom assets and now i dont see anything on my domestic adviser.(exept the name of my main city and some numbers. no icons no other cities).

JohnSearle
Nov 27, 2005, 11:44 PM
Is this mod a single side mod? Like could I play with it against someone who isn't using it as well?

DrJambo
Nov 28, 2005, 06:09 AM
Is this mod compatible with 1.09?

Cheers

Requies
Nov 28, 2005, 06:47 AM
Ok, I've integrated a whole bunch of the disparate versions of the Domestic Advisors and made it so that it's compatible with 1.09 (well, it already was, anyways) and easier to add into a New Mod (this is the problem with compatibility to 1.09). I also added a lot of my own touches so, I'm going to post it in another thread, but I will be crediting everyone who contributed some code to it (even though I ended up re-writing a lot of it).

I hope that's all right with you guys. :p

Req

mgdpublic
Nov 29, 2005, 11:34 AM
Cool mod. Is there a way to add base f/p/c production that is independent of specialist additions?

Willowmound
Dec 25, 2005, 09:59 PM
Hey, where did the file go? With patch 1.52 I need to see if the files in this mod have been affected. Can someone plese tell me what files this mod uses?

Thanks.

homegrown
Dec 26, 2005, 02:27 PM
Well, mine are still where they were, and they probably still work under 1.52 but...

Here are the new "Original Improved Domestic Advisor (http://home.houston.rr.com/homegrowns/homegrown-domestic152.zip)" and "Clock Mod (http://home.houston.rr.com/homegrowns/homegrown-clockmod.zip)". Unzip either or both into your My Games/Civ 4 folder and they will automatically go to CustomAssets/python/screens for you.

The domestic advisor incorporates the Zoom to City View icon added in 1.52, otherwise, it follows my original proposal.

Hehe, I forgot that I actually have improved it a little bit. When you load it up, you'll see that most columns have been reordered into what I think are more logical groups. I also added the distinct Gold per city column, in addition to the commerce column. More landmarks are fleshed out, including We Love the King Day, Airports (A) and Drydocks (D).
Hope you like. :)

The clock mod only displays both the real time, and the game year, and while it still does a little flashie thing, unless you're looking for it, you'll never see it.

Happy Civing!

Willowmound
Dec 26, 2005, 07:50 PM
Hey thanks! How about a screenshot? :)

Rabbit, White
Feb 11, 2006, 04:27 PM
Well, it looks like this thread's been dead for a while, probably because of the other domestic advisor enhancements from Requies, 12monkeys and Taelis. And while they're all great I personally still prefere to use homegrown's DA (the good ol' classics ;)). Anyway, since I play at 1280x1024 I decided to add automatic resizing to this DA to take advantage of all that extra space. I post this here in case someone is interested (I hope homegrown doesn't mind).

I tried to keep the code clean, simple and well commented. All the possible things you might want to do with the window size, that I could think of, are placed together, so even if you don't know python you can still change how the window is resized, just look for the ## Auto Resize Values ## comment. To fill the extra space the window has at higher resolutions I made the Name and Production columns dynamic. They grow proportionally to the window, but at different rates - Production grows more than Name.

The only changes I made are in the CvDomesticAdvisor.py file, so to add automatic resizing just replace homegrown's original file with this one.