Announcement

Collapse
No announcement yet.

'real' citynames for one earthmap

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 'real' citynames for one earthmap

    Hi there,

    after checking a lot of threads on different civ4-sites to find out, how it is possible to implement 'realistic' citynames on an earthmap, after beginning to try it on my own by learning how to handle all that python-xml-sdk-ffs-stuff, i'm still walking in the dark and need to ask professional civ4modders ^^

    In detail: i want to use the 18civs-earthmap together with one pretty huge list of actual citynames of our real earth - similar to the mod of Rhye, but without changing the names or any specials. Just one list for all civ's and everytime, when a settler wants to found a city, the name will be automatically choosen. I'm sure you know what i mean.

    Beside creating the citylist for nearly all the plots on the map (pretty much work) i need to know, where to implement the little script, which says the settler how to name its city. And how to tell the map to use that script. I tried to create a little mod and started working on it, but it's pretty difficult without nearly no knowledge of - all that ... ^^
    So - maybe someone else did a similar thing and is able to give me some example or hints ..

    thx for all help,
    alex.

  • #2
    The only suggestion I could give you is to basically steal Rhye's scripting, which it looks like you've already looked into, and just modify it to match your specs. That is how I learned how to mod, although I haven't attempted anything like that before. Trial and error is the best way to learn.
    "Our cause is in the hands of fate. We can not guarantee success. But we can do something better; we can deserve it." -John Adams


    One Love.

    Comment


    • #3
      of course the first thing i tried was to modify some Rhye-files ^^ but its pretty difficult to find all necessary stuff for creating cities and for the event, to change their names.

      I found 3 important python-files:
      "CvEventManager.py"
      "CvRFCEventHandler.py"
      "CityNameManager.py"

      the last file sets up map-arrays with all the names and the function """Names a city depending on its plot""" (all the ELIF-lines i don't need, because i just want to have one single citymap for all civs).

      so i created a new mod and deleted all unimportant stuff of those files and tried to modify a little - without success; either there was an errormessage or no changes happened (the 'normal' citynames were used).

      i think there are some problems with importing the files. at least the line "from CvPythonExtensions import *" seems to be important, but there is no files like that (maybe it will be created when starting the game? i don't know).

      also the "CvRFCEventManager.py" seems to be important, although there isn't mentioned any word of citybuilding or else.

      some code from rhye's files:

      from "CityNameManager.py":
      Code:
      tCityMap = (
      #Egypt
      ((	"-1",	"-1", ....... ,"-1",	"Kadesh",	"Kadesh" ..............,	"-1"))
      
      ....
      
              def assignName(self, city):
                      """Names a city depending on its plot"""
                      iOwner = city.getOwner()
                      if (iOwner < iNumMajorPlayers):
                              cityName = tCityMap[iOwner][67-city.getY()][city.getX()]
                              if (cityName != "-1"):
                                      city.setName(cityName, False)
      (iOwner should not be important, because only one citymap for all civs ..)

      from "CvRFCEventHandler.py":
      Code:
      	def __init__(self, eventManager):
      
      ...
      
      		eventManager.addEventHandler("cityBuilt", self.onCityBuilt)
      
      ...
      
      self.cnm = CityNameMap.CityNameMap()
      
      ...
      
              def onCityBuilt(self, argsList):
                      'City Built'
                      city = argsList[0]
                      
                      iOwner = city.getOwner()
                      
                      if (iOwner < con.iNumActivePlayers): 
                              self.cnm.assignName(city)
      and from "CvEventManager.py":
      Code:
      	
      	def onCityBuilt(self, argsList):
      		'City Built'
      		city = argsList[0]
      		#if (city.getOwner() == gc.getGame().getActivePlayer()):
       		#	self.__eventEditCityNameBegin(city, False)	    #Rhye
      		CvUtil.pyPrint('City Built Event: %s' %(city.getName()))
      those files/code should be modified i think, but it's very problematic to me :/ and there are probably missing includes/imports or else

      well - still working on it ...

      everybody: feel free to help ;-)

      greetz - alex.

      Comment

      Working...
      X