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

Accented characters and Favoritecivicdetector

Discussion in 'Civ4 - BTS Unaltered Gameplay (BUG, BAT and BULL)' started by openyourmind, Feb 16, 2020.

  1. openyourmind

    openyourmind Chieftain

    Joined:
    Feb 22, 2016
    Messages:
    51
    Hi there,

    Just quick heads up, Favoritecivicdetector isn't set up to use non standard characters.

    I've added the following lines and all is swell

    Code:
    # encoding=utf8 
    import sys 
    
    reload(sys) 
    sys.setdefaultencoding('utf8')
    For normal users who probably came by error "Error in BeginActivePlayerTurn event handler <bound method FavoriteCivicDetector.onBeginActivePlayerTurn of <FavoriteCivicDetector.FavoriteCivicDetector instance" or "'ascii' codec can't encode character" just do the following.

    1. Find the FavoriteCivicDetector.py file, usually resides at Mod in question\Assets\Python\Contrib
    2. In the beginning you will have this
      Code:
      ## FavoriteCivicDetector
      ##
      ## Keeps track of changing Diplomacy modifiers to guess what an
      ## AI's favorite civic is. The intended use is for the Foreign Advisor
      ## to figure out and then display the correct favorite civic of an
      ## AI leader when playing with the Random Personalities option.
      ##
      ## Copyright (c) 2008 The BUG Mod.
      ##
      ## Author: Dresden
      
      from CvPythonExtensions import *
      
      import AttitudeUtil
      import BugUtil
      import PlayerUtil
      import SdToolKit
      
      # BUG - Mac Support - start
      BugUtil.fixSets(globals())
      # BUG - Mac Support - end
      
    3. Just change it to this:
      Code:
      ## FavoriteCivicDetector
      ##
      ## Keeps track of changing Diplomacy modifiers to guess what an
      ## AI's favorite civic is. The intended use is for the Foreign Advisor
      ## to figure out and then display the correct favorite civic of an
      ## AI leader when playing with the Random Personalities option.
      ##
      ## Copyright (c) 2008 The BUG Mod.
      ##
      ## Author: Dresden
      
      from CvPythonExtensions import *
      
      import AttitudeUtil
      import BugUtil
      import PlayerUtil
      import SdToolKit
      # encoding=utf8  
      import sys  
      
      reload(sys)  
      sys.setdefaultencoding('utf8')
      
      # BUG - Mac Support - start
      BugUtil.fixSets(globals())
      # BUG - Mac Support - end
      
      Don't know if this will cause any more errors but so far works for me. If I find any problems will edit this post.
     

Share This Page