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

[BtS 3.19 Mod] Culturally Linked Starts

Discussion in 'Civ4 - Mod Components' started by Jean Elcard, Sep 10, 2008.

  1. JA_Lamb

    JA_Lamb Chieftain

    Joined:
    Aug 19, 2009
    Messages:
    231
    Location:
    The changing Dark Continent
    Hi, thank you for making this mod available. Excellent work. :goodjob:
    The ludicrous situation of having half naked Egyptians trying to work tundra tiles seems to have considerably lessened.
    This is a repeat question that you have answered but I don't understand the terms. CLS from my youger days meant "Clear Screen".
    What are CLS files? If I want to incorporate your mod, into a simple mod that has only XML and ART changes do I

    1 Copy Paste all the XML entries in their appropriate XML files.
    2 Copy the Python Entry screen file along with the rest of the Python files from the Unofficial Patch 3.19
    3 finally copy the dll supplied in the Assets folder of MyMod.

    What can I expect then, does it kick in at the start of MyMod every time or do I have to initialize it in any other way?
    Thanks fo a great Mod once again.
     
  2. klaidonis

    klaidonis Chieftain

    Joined:
    Dec 8, 2009
    Messages:
    90
    Location:
    Toronto, Canada
    So the only reason you modified the CvGameCoreDLL.dll is the checkbox "Culturally Linked Starts", isn't it? In this case could you please provide a guide how to incorporate your mod into one of the default map scripts (for example, Fractal.py or Continents.py) or at least suggest a resource where to read about it?
     
  3. Opera

    Opera Chieftain

    Joined:
    Sep 21, 2008
    Messages:
    4,643
    Would it be possible to use coordinates for fictional civilizations? It wouldn't be actual coordinates, of course, so I'm just wondering if it would accept them without a decimal, just like [17,-5] for example.
     
  4. Antmanbrooks

    Antmanbrooks Chieftain

    Joined:
    Jun 20, 2007
    Messages:
    436
    Location:
    The Cheshire Plain.
    Would it be possible for someone to convert this for Rise of Mankind mod? I would do it myself but I lack the know how to even begin to figure out how to mess round with the dll files etc...
     
  5. klaidonis

    klaidonis Chieftain

    Joined:
    Dec 8, 2009
    Messages:
    90
    Location:
    Toronto, Canada
    Well, I did what the author recommended not to do: I kept the dll intact, but I modified default mapscripts Continents.py and Fractal.py. Then I generated a game with a Continents map, random leaders. The generation was without errors.

    Now I have Tokugawa, Ragnar, Mehmed and Charlemagne sharing the same continent; the other civs are not known yet.

    If you're interested, I can try to figure out whether the cultural linker was called properly, but as I intend to finish the current game it could take a while.
     
  6. Antmanbrooks

    Antmanbrooks Chieftain

    Joined:
    Jun 20, 2007
    Messages:
    436
    Location:
    The Cheshire Plain.
    Good news, it being without errors... I tried messing around with some stuff too but it was with errors :(

    The fact Japan, The Vikings, The Ottomans and The Holy Roman Empire are all together sounds like it's grouping them wierdly? Any chance you could generate a few 20 Civ maps, check the clumping of civs and see how it's working?

    If it is culturally linking them I would love the files and the directory structure!
     
  7. klaidonis

    klaidonis Chieftain

    Joined:
    Dec 8, 2009
    Messages:
    90
    Location:
    Toronto, Canada
    Either that or the cultural linker was not called properly.

    Sure I do, I just can't promise I would do it soon. For me it's still more interesting to play Civ than to mod it.
     
  8. klaidonis

    klaidonis Chieftain

    Joined:
    Dec 8, 2009
    Messages:
    90
    Location:
    Toronto, Canada
    Well I tried it twice. By the way, there can't be more than 18 cvis on Fractal map.

    The distribution looks weird. It could be "culturally linked" and I don't understand how the script works; or may be the script doesn't work at all. So I'll have to look into the code to be sure.
     
  9. Antmanbrooks

    Antmanbrooks Chieftain

    Joined:
    Jun 20, 2007
    Messages:
    436
    Location:
    The Cheshire Plain.
    Thanks, much appreciated. :goodjob:
     
  10. fdgsgds

    fdgsgds Mustard Enthusiast

    Joined:
    Feb 16, 2009
    Messages:
    558
    Location:
    The Empire State
    Poor, poor Ethiopia!
     
  11. Jean Elcard

    Jean Elcard The Flavournator

    Joined:
    Feb 26, 2006
    Messages:
    1,008
    Location:
    Leipzig, Germany
    The check box is the only reason (aside from the 40 civs limit). It think it is an important feature, because I wanted the mod to be easily accessible for everybody. If you want to convert it to a map script mod without an dll, you might want to take a look at my first version of FlavourMod. Its structure is similar to CLS, but came without a dll.

    It would work. The coordinates are simply given in degrees int the ranges [-90 south, +90 north] and [-180 west, +180 east].
     
  12. Thomas SG

    Thomas SG CCV-designer

    Joined:
    Aug 10, 2007
    Messages:
    1,164
    Location:
    Germany
    Please update post #1- there is a new Community Civ V! It's version 4.05. :D
     
  13. klaidonis

    klaidonis Chieftain

    Joined:
    Dec 8, 2009
    Messages:
    90
    Location:
    Toronto, Canada
    Yes, now I see your point. I just like various mods and I like culturally linked starts as well, so for me it's better to add several strings to a sound Python interface than to carefully merge the mod into 2-3 dll's. And Visual Studio has to be somehow, you know, obtained.

    Thank you very much, that's what I was going to implement myself. I greatly appreciate your answer.

    I have one more question if I may.

    As I understand, the distribution algorithm uses only the distance matrix and no other data. I'd like to add a feature that civs originally located on different landmasses on Earth would be less probably put on the same landmass on a Civ map. Unfortunately, I am not a GIS professional; could you please refer me to relevant literature sources or discourage me to do it due to algorithm complexity?
     
  14. Jean Elcard

    Jean Elcard The Flavournator

    Joined:
    Feb 26, 2006
    Messages:
    1,008
    Location:
    Leipzig, Germany
    It's done. It's no longer "unreleased". :)

    Microsoft distributes some free versions of Visual Studio for different programming languages. The so called "Express Editions". I'm using the "Microsoft Visual C++ 2008 Express Edition" for modding Civilization.

    You are right, the algorithm only uses the distance matrix, but I'm artificially enlarging the distance between cities located on different continents in the real world by a certain factor. You can change this factor in __computeSPDistanceMatrix(). For some unknown reason I didn't make it a constant variable.
     
  15. hachejay

    hachejay beta shopper

    Joined:
    Dec 30, 2009
    Messages:
    43
    Location:
    United Kingdom
    Hi,

    I've merged this into my mod that I'm working on and while it by all accounts works, the option doesn't show up in the custom game option screen at all. I've set it to 'on' by default and in game it's definately function properly, just no option for it?

    I've looked over every file again and all your additions are all properly merged into my .dll and assets, any idea where I might have made a mistake?

    cheers.

    H.
     
  16. Jean Elcard

    Jean Elcard The Flavournator

    Joined:
    Feb 26, 2006
    Messages:
    1,008
    Location:
    Leipzig, Germany
    Important for the game option to display correctly are the changes in those four files:

    CvEnums.h
    CyEnumsInterface
    CIV4GameOptionInfos.xml
    CIV4GameText_CultureLink.xml

    Furthermore make sure that the order of options is the same in the first three files.
     
  17. hachejay

    hachejay beta shopper

    Joined:
    Dec 30, 2009
    Messages:
    43
    Location:
    United Kingdom
    Thanks!

    turns it was the order, though not just in those files.... apparently revDCM adds in an option below where your code would be in CvGame.cpp so I had to move the option to be above that one in the other files.

    cheers for you help, great mod btw, makes random maps much more appealing to me :goodjob:

    H.
     
  18. klaidonis

    klaidonis Chieftain

    Joined:
    Dec 8, 2009
    Messages:
    90
    Location:
    Toronto, Canada
    I modified (sorry, Jean Elcard!) 4 default map scripts (Archipelago.py, Continents.py, Fractal.py, and Pangaea.py) to have "Culturally linked" option as a map script option, not a game dll one. As far as I figure out how to properly add the file with XML descriptions into Assets\XML\Text I can upload it somewhere.

    Also, I would appreciate translating a phrase "No translation available" into French, German, Italian, and Spanish or providing a link to the existing translation.
     
  19. mynystry

    mynystry jaguar warrior from hell

    Joined:
    Jan 18, 2005
    Messages:
    276
    Location:
    Guanaguashington, Mexico
    Hello, I was wondering if it is possible to add the *culturally linked start option to the BUG mode?
     
  20. Dancing Hoskuld

    Dancing Hoskuld Warlord

    Joined:
    Jul 5, 2004
    Messages:
    23,290
    Gender:
    Male
    Location:
    Canberra, Australia
    As far as I know it has both an SDK and Python component so you would be better off asking the BUG team. If it is just Python then the answer would probably be yes. (The version I use has been merged into RevDCM which includes BUG also.)

    I do have a minor suggestion to improve the code.
    Code:
    	def __initRWCoordinatesList(self):
    		iNumPlayers = game.countCivPlayersEverAlive()
    		for iPlayer in range(iNumPlayers):
    			pPlayer = gc.getPlayer(iPlayer)
    			eCivilization = pPlayer.getCivilizationType()
    			if eCivilization in CoordinatesDictionary:
    				pCoordinate = CoordinatesDictionary[eCivilization]
    			else:
    				BugUtil.error(" Culturally Linked Starts ERROR: civilization %s (%d) not defined:", gc.getCivilizationInfo(eCivilization).getDescription(), eCivilization)
    				pCoordinate = CoordinatesDictionary[eCivilization]
    			CultureLink.pRWCoordinatesList.append(pCoordinate)
    
    This was you still get the KeyError:0 in the Logs/PtyhonErr.Log but you also get messages telling you which one(s) are causing the problem in the PythonDbg,Log.
     

Share This Page