1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Customizable Domestic Advisor - comments welcome

Discussion in 'Civ4 - Mod Components' started by Taelis, Dec 27, 2005.

  1. Taelis

    Taelis Warlord

    Joined:
    Dec 1, 2005
    Messages:
    112
    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...
     
  2. terrasol

    terrasol Chieftain

    Joined:
    Jun 20, 2004
    Messages:
    33
    i use the german version....and i hope it will function cause i like your work :)
     
  3. Taelis

    Taelis Warlord

    Joined:
    Dec 1, 2005
    Messages:
    112
    Thanks :)

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

    Cammagno King

    Joined:
    Dec 15, 2005
    Messages:
    712
    Location:
    Genoa (Italy)
    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: ]
     
  5. Elhoim

    Elhoim Iron Tower Studio Dev

    Joined:
    Nov 3, 2004
    Messages:
    2,039
    Gender:
    Male
    Location:
    San Isidro, Argentina.
    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.
     
  6. Taelis

    Taelis Warlord

    Joined:
    Dec 1, 2005
    Messages:
    112
    elhoim, Cammagno figured out the problem here - I'll have a fix ready soon. :)
     
  7. Cammagno

    Cammagno King

    Joined:
    Dec 15, 2005
    Messages:
    712
    Location:
    Genoa (Italy)
    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:
     
  8. Cammagno

    Cammagno King

    Joined:
    Dec 15, 2005
    Messages:
    712
    Location:
    Genoa (Italy)
    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.
     
  9. Taelis

    Taelis Warlord

    Joined:
    Dec 1, 2005
    Messages:
    112
    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.
     
  10. Cammagno

    Cammagno King

    Joined:
    Dec 15, 2005
    Messages:
    712
    Location:
    Genoa (Italy)
    :)

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

    Taelis Warlord

    Joined:
    Dec 1, 2005
    Messages:
    112
    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.
     
  12. Cammagno

    Cammagno King

    Joined:
    Dec 15, 2005
    Messages:
    712
    Location:
    Genoa (Italy)
    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. :)
     
  13. Elhoim

    Elhoim Iron Tower Studio Dev

    Joined:
    Nov 3, 2004
    Messages:
    2,039
    Gender:
    Male
    Location:
    San Isidro, Argentina.
    Great! Now it works flawlessly!! Thanks!!!
     
  14. mamimo

    mamimo Warlord

    Joined:
    Nov 15, 2005
    Messages:
    101
    This look great, is it compatible with patch 1.52 ?
     
  15. Taelis

    Taelis Warlord

    Joined:
    Dec 1, 2005
    Messages:
    112
    Yep - actually, it requires patch 1.52.
     
  16. terrasol

    terrasol Chieftain

    Joined:
    Jun 20, 2004
    Messages:
    33
    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

    Code:
    *****first part*****
    ("GOLD",			38,	"int",	None,					CyCity.getCommerceRate,		CommerceTypes.COMMERCE_GOLD,		None,					None,					"self.goldIcon"),
    [COLOR="Red"]("GOLD_DIFF",			30,	"int",	None,					None,				0,					self.calculateGoldDiff,			CommerceTypes.COMMERCE_GOLD,		"u\"%c\" % CyGame().getSymbolID(FontSymbols.BAD_GOLD_CHAR)"),[/COLOR]
    ("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,
    [COLOR="red"]	"GOLD_DIFF" : -1,[/COLOR]
                 }
    
    *****third part*****
    def calculateMaintenance (self, city, szKey, arg):
    	return unicode(city.getMaintenance())
    
    [COLOR="red"]def calculateGoldDiff (self, city, szKey, arg):
    	gd = city.getCommerceRate(arg) - city.getMaintenance()
    	return gd[/COLOR]
    
    def calculateTrade (self, city, szKey, arg):
    	nTotalTradeProfit = 0
    
    
    of course this is only a suggestion, but may be some other like this too
     
  17. Taelis

    Taelis Warlord

    Joined:
    Dec 1, 2005
    Messages:
    112
    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.
     
  18. Requies

    Requies Prince

    Joined:
    Nov 15, 2005
    Messages:
    381
    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
     
  19. terrasol

    terrasol Chieftain

    Joined:
    Jun 20, 2004
    Messages:
    33
    hi unfortunatly the advisor has crashed again....but now i can say you the line of code what makes the crash

    Code:
    # 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"]:
            [COLOR="Red"]screen.setImageButton( szWidgetName, zoomArt, 0, 0, 24, 24, WidgetTypes.WIDGET_ZOOM_CITY, cityList[i].getOwner(), cityList[i].getID() )[/COLOR]
            screen.attachControlToTableCell( szWidgetName, page, i, 0 )
    
    if i comment out this lines
    Code:
        #if not self.PAGES[self.currentPageNum]["showSpecControls"]:
            #[COLOR="Red"]screen.setImageButton( szWidgetName, zoomArt, 0, 0, 24, 24, WidgetTypes.WIDGET_ZOOM_CITY, cityList[i].getOwner(), cityList[i].getID() )[/COLOR]
            #screen.attachControlToTableCell( szWidgetName, page, i, 0 )
    
    all is ok...may be it helps you to find the problem
     
  20. alerum68

    alerum68 Priest of Hiroshima

    Joined:
    Jan 3, 2004
    Messages:
    2,518
    Location:
    San Francisco, California, United States
    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.
     

Share This Page