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

[ModComp] Home Cities on Map - playable beta

Discussion in 'Civ4Col - Mare Nostrum' started by koma13, Mar 31, 2009.

  1. koma13

    koma13 Chieftain

    Joined:
    Sep 29, 2008
    Messages:
    662
    Here is a short description how you can make Home Cities on Map Beta 002b playable in vanilla c4c.

    1. Extract HomeCitiesOnMap_002b.rar into your mod directory.
    2. Delete /XML/Civilizations
    3. Copy CvUtil.py and sdToolKit.py from MN into Assets/python
    4. Edit CvEventManager.py and rename civs in 1113-1122 to vanilla names (eg. England, France, Spain).

    Europe screen graphics are messed up but you can fix that by getting background.dds from MN and ship graphics from my Europe Screen 4.

    You don't have to play on inland sea, any map should work.
     
  2. TC01

    TC01 Chieftain

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    For the record, Westward Ho uses different "Europe" civs, MEXICO, MEXICO_2, UNITED_STATES and UNITED_STATES_2.

    So you'd need to use those instead.
     
  3. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    Thanks for the info. Westward Ho is still basiclly Vanilla Col at the moment as far as trading with Europe I should be able to do this with the Westward Ho mod right? If I do as TC01 says it should work as well it would stand to reason.
     
  4. TC01

    TC01 Chieftain

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    Yeah, I think it will work fine.
     
  5. TC01

    TC01 Chieftain

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    First, I get this:

    Code:
    Traceback (most recent call last):
    
      File "CvEventInterface", line 23, in onEvent
    
      File "CvEventManager", line 185, in handleEvent
    
      File "CvEventManager", line 341, in onGameStart
    
      File "CvEventManager", line 1155, in initKingCities
    
    UnboundLocalError: local variable 'pCityPlot' referenced before assignment
    ERR: Python function onEvent failed, module CvEventInterface
    Then I get quite alot of these:

    Code:
    Traceback (most recent call last):
    
      File "CvScreensInterface", line 556, in forceScreenRedraw
    
      File "CvMainInterface", line 1120, in redraw
    
      File "CvMainInterface", line 1756, in updateSelectionButtons
    
    RuntimeError: unidentifiable C++ exception
    ERR: Python function forceScreenRedraw failed, module CvScreensInterface
    If I disable python exceptions, the map loads, but I have no Unit control panel, everything is blacked out, and when I go into Worldbuilder there are no home cities.

    The way I did it was manually copy over everything except the GameText_Objects file, since Westward Ho already modifies it. At least, I think I did everything.

    I turned the event manager code into this:

    Code:
    				if loopPlayer.getCivilizationType() == gc.getInfoTypeForString("CIVILIZATION_UNITED_STATES"):
    					pStartPlot = CyMap().plot(iW / 3, iH)
    				if loopPlayer.getCivilizationType() == gc.getInfoTypeForString("CIVILIZATION_UNITED_STATES_2"):
    					pStartPlot = CyMap().plot(iW, iH / 2)
    				if loopPlayer.getCivilizationType() == gc.getInfoTypeForString("CIVILIZATION_MEXICO"):
    					pStartPlot = CyMap().plot(iW, iH / 2)
    				if loopPlayer.getCivilizationType() == gc.getInfoTypeForString("CIVILIZATION_MEXICO_2"):
    					pStartPlot = CyMap().plot(iW / 3, 0)
    (Note that this was using both the InlandSea_HCOM and the WildWest (Great_Plains) mapscripts.)
     
  6. koma13

    koma13 Chieftain

    Joined:
    Sep 29, 2008
    Messages:
    662
    Try CIVILIZATION_TEXAS, CIVILIZATION_CALIFORNIA, CIVILIZATION_OREGON ....
    And make sure your map has enough coastal land for city initialization, CvEventManager.py is optimized for inland sea script.
     
  7. TC01

    TC01 Chieftain

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    Inland_Sea_HCOM works fine now. I still get the error in WildWest, mainly because WildWest is 80%/90% land.

    Would Kailric (SDK end) or me (Python/XML end) need to alter the Home City code to start you on land instead? Or both? I want my home cities to spawn in the eastern green region, which represents the Mississippi River area. They would have to be on land.

    I guess I'd need to alter starting units, obviously, as well as the water start tag in CIV4CivilizationInfos.xml. But apart from that... would I just have to change this code?

    Code:
    					if CyMap().isPlot(pLoopPlot.getX(), pLoopPlot.getY()):
    						if pLoopPlot.isCoastalLand() and not pLoopPlot.waterArea().isLake():
    							if not (iW * 3 / 4 - 5) < pLoopPlot.getX() < (iW * 3 / 4 + 5) or not pLoopPlot.getY() < iH / 2:
    								if loopPlayer.AI_foundValue(pLoopPlot.getX(), pLoopPlot.getY(), -1, true) > 1:
    									iDistance = plotDistance(pLoopPlot.getX(), pLoopPlot.getY(), pStartPlot.getX(), pStartPlot.getY())
     
  8. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    The water start tag doesn't do it all together. You'd need to change the SDK where the King checks every turn if you have a ship or if the player can afford to buy one on his own. If not the king automaticlly gives you one and raises your taxes. So by Vanilla rules after the first turn of a land start, the king would raise your taxes and give you a ship in Europe. This would need to be changed so that the king checks to see if you have a wagon train instead of a ship... or just do away with this altogether, but I guess it depends on how easy it is to lose your first wagon train.
     
  9. TC01

    TC01 Chieftain

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    Well, since I plan on adding "Train Robber" units to replace Privateers, it might become pretty easy to loose a Wagon Train.

    I guess for now it should be changed to check if you have a Wagon Train. We can decide to do away with it in the future.
     
  10. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    K, I guess we sorta "highjacked" this thread for the moment, but I'll make some of the mentioned changes we talked about in the SDK and merge in the Home CIties on the map and hopefully we can get it working with Westward Ho.
     
  11. TC01

    TC01 Chieftain

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    Alright, sorry to keep "hijacking" this thread, but I have another question.

    What graphics were used for the popup you get that lets you pick where you sail to? I'm guessing it's in Europe Screen 4? Currently that popup is just a pink box.
     
  12. koma13

    koma13 Chieftain

    Joined:
    Sep 29, 2008
    Messages:
    662
    DialogBox.dds. Get it from MN or AOD2. ;)
     
  13. LeftoverNoodles

    LeftoverNoodles Chieftain

    Joined:
    Oct 26, 2009
    Messages:
    1
    This Mod still being worked on? Does it work with Beta5? If not any idea where I can find Beta3?
     
  14. TC01

    TC01 Chieftain

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    Found a HCOM bug. I fixed it in Westward Ho, but I thought I'd post it here as well.

    You pass "player.getName()" into the array that you then pickle and save to script data. But "player.getName()" can change, very easily, by using the "Your Details" button in the options menu. So with the value of player.getName() changed, the game won't be able to find the correct home city data.

    I made it use the player number intead, something more unique and something that will not change throughout the game. (0 for the human player, 1 for the first AI player, etc.)
     

Share This Page