[ModComp] Home Cities on Map - playable beta

Does anyone have a copy of the Mare Nostrum 003 I could use for testing this? I am attempting to help add this to the Wild West mod and could use a working version?

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.
 
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.
 
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.

Yeah, I think it will work fine.
 
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.)
 
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.
 
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.

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())
 
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.
 
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.

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.
 
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.

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.
 
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.
 
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.)
 
Top Bottom