1.20 released!

Timur's missing some diplomacy text.

Ah so he is. Fixed. Probably still a fair few missing diplomacy texts out there, they're all too easy to link up incorrectly. Poor old Dharmasetu hasn't got at all yet, still ><
 
The Financial trait appears to not be giving the +1:commerce:/city it is supposed to.
 

Attachments

  • Missing City Commerce.jpg
    Missing City Commerce.jpg
    156.4 KB · Views: 86
The Financial trait appears to not be giving the +1:commerce:/city it is supposed to.

It's working, we just changed how it is implemented. The extra yield is no longer placed on the city tile but instead added directly to the city's base yield. Solved a number of potential issues. This applies to Expansive and Industrial as well.
 
Two more leaders with missing diplomacy text: Joshua and Mangammal (though the screenshot for the latter didn't come out right for some reason). I believe both were for POWER_EQUAL.

Edit: Also Ataturk. As far as I can tell, all of the ones I've encountered in my current game were for DEMAND_TRIBUTE_POWER_EQUAL. Pattern or coincidence?
 

Attachments

  • Joshua.jpg
    Joshua.jpg
    90.8 KB · Views: 76
  • Ataturktext.jpg
    Ataturktext.jpg
    80.3 KB · Views: 60
I'm pretty sure this is a Colosseum bug, as it hit right after I built my first Horseman (which stayed a Horseman instead of becoming the expected Asvaka) in that city.
 

Attachments

  • Screen shot 2013-06-06 at 4.36.26 PM.jpg
    Screen shot 2013-06-06 at 4.36.26 PM.jpg
    90.6 KB · Views: 79
  • Screen shot 2013-06-06 at 4.36.34 PM.jpg
    Screen shot 2013-06-06 at 4.36.34 PM.jpg
    90.8 KB · Views: 101
  • Screen shot 2013-06-06 at 4.36.40 PM.jpg
    Screen shot 2013-06-06 at 4.36.40 PM.jpg
    94.1 KB · Views: 59
Two more leaders with missing diplomacy text: Joshua and Mangammal (though the screenshot for the latter didn't come out right for some reason). I believe both were for POWER_EQUAL.

Edit: Also Ataturk. As far as I can tell, all of the ones I've encountered in my current game were for DEMAND_TRIBUTE_POWER_EQUAL. Pattern or coincidence?

The power weaker/equal/stronger diplomacy text tags are inconsistently named in standard BTS - some end in (e.g.) _LEADER_ATATURK, some end in just _ATATURK. This gets replicated through copy/pasting with the new leaders. It's annoying, I need to go through and change all of them to the _LEADER_ variant, which is consistent with how the other tags are named.

I'm pretty sure this is a Colosseum bug, as it hit right after I built my first Horseman (which stayed a Horseman instead of becoming the expected Asvaka) in that city.

Yes. Misnamed variable in the Colosseum code, which will prevent it from working. May be time for a small patch or reupload soon.
 
Yes. Misnamed variable in the Colosseum code, which will prevent it from working.
From the error messages, I'm guessing the offender is this line:

iUnitType = unit.getUnitType()

Looking at the context, I'm thinking it should be this instead:

iUnitType = pUnit.getUnitType()

Or am I completely off base? (I know absolutely nothing about Python, after all.)

Edit: Nope, that didn't work. I also tried changing "unit" to "ac" (which generated a "global name 'ac' is not defined" error), so I think I've got the right line, I just have no idea what it *ought* to be.
 
From the error messages, I'm guessing the offender is this line:

iUnitType = unit.getUnitType()

Looking at the context, I'm thinking it should be this instead:

iUnitType = pUnit.getUnitType()

That should be the correct solution, so I'm not sure why it's not working for you. I haven't had a chance to test it yet myself.
 
Here's a screenshot of the error I get when I replace unit with pUnit.
 

Attachments

  • Screen shot 2013-06-06 at 8.49.11 PM.jpg
    Screen shot 2013-06-06 at 8.49.11 PM.jpg
    113 KB · Views: 52
Replace
iUnitClass = gc.getUnitClassInfo(pUnit.getUnitClassType())

with

iUnitClass = pUnit.getUnitClassType()
 
What Platyping said, but there's another error a bit further down. I'll get it fixed and post the file shortly.
 
Ok I'm stumped. I've attached the corrected file but it's still throwing an error for line 1097:

Code:
Traceback (most recent call last):
  File "BugEventManager", line 361, in _handleDefaultEvent
  File "CvEventManager", line 1097, in onUnitBuilt
TypeError: initUnit() takes at most 5 arguments (6 given)

The line in question is:

Code:
pNewUnit = pPlayer.initUnit(iNewUnit, iX, iY, UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION)

I cannot see where this supposed 6th argument is coming from, I checked iNewUnit and it definitely only contains 1 value. The other arguments are used elsewhere in initUnit() without problem. Any idea what's going on Platyping?
 

Attachments

I now get the following Python Exceptions when loading:

File "<string>", line 1, in ?
File "<string>", line 52, in load_module
File "CvEventInterface", line 17, in ?
File "<string>", line 52, in load_module
File "BugEventManager", line 102, in ?
File "<string>", line 52, in load_module
File "CvEventInterface", line 20, in ?
ImportError
:
No module named NaturalWonders

Failed to load python module CvEventInterface.

Edit: Reverted to the older file, then overwrote the Colosseum code (and *only* that) with the relevant lines from the new file. No problems when loading this time, but got the errors shown in the screenshots upon advancing the turn. And, as before, the Horseman stayed a Horseman.
 

Attachments

  • Screen shot 2013-06-06 at 11.03.25 PM.jpg
    Screen shot 2013-06-06 at 11.03.25 PM.jpg
    113.8 KB · Views: 63
  • Screen shot 2013-06-06 at 11.03.32 PM.jpg
    Screen shot 2013-06-06 at 11.03.32 PM.jpg
    113.8 KB · Views: 130
  • Screen shot 2013-06-06 at 11.03.37 PM.jpg
    Screen shot 2013-06-06 at 11.03.37 PM.jpg
    113.3 KB · Views: 45
This file breaks the events overlay.

I now get the following Python Exceptions when loading:

File "<string>", line 1, in ?
File "<string>", line 52, in load_module
File "CvEventInterface", line 17, in ?
File "<string>", line 52, in load_module
File "BugEventManager", line 102, in ?
File "<string>", line 52, in load_module
File "CvEventInterface", line 20, in ?
ImportError
:
No module named NaturalWonders

Failed to load python module CvEventInterface.

Edit: Reverted to the older file, then overwrote the Colosseum code (and *only* that) with the relevant lines from the new file. No problems when loading this time, but got the errors shown in the screenshots upon advancing the turn. And, as before, the Horseman stayed a Horseman.

Sorry, that file wasn't meant for everyone to patch, just for Platyping in case he can see what's causing the error described above. The Colosseum won't work until we solve it, even with the previous fixes.
 
Code:
	def onUnitBuilt(self, argsList):
		'Unit Completed'
		pCity = argsList[0]
		pUnit = argsList[1]
		player = PyPlayer(pCity.getOwner())

	### Colosseum - Build Rival UUs
		if pCity.getNumActiveBuilding(gc.getInfoTypeForString("BUILDING_COLOSSEUM")) > 0:
			iPlayer = pCity.getOwner()
			pPlayer = gc.getPlayer(iPlayer)
			# Is the unit built of a compatible type?
			if pUnit.getUnitCombatType() == gc.getInfoTypeForString("UNITCOMBAT_MELEE") or pUnit.getUnitCombatType() == gc.getInfoTypeForString("UNITCOMBAT_ARCHER") or pUnit.getUnitCombatType() == gc.getInfoTypeForString("UNITCOMBAT_MOUNTED"):
				iUnitType = pUnit.getUnitType()
				iUnitClass = pUnit.getUnitClassType()
				iDefaultUnit = gc.getUnitClassInfo(iUnitClass).getDefaultUnitIndex()
				if iUnitType == iDefaultUnit:
					lUniqueUnits = []
					# Loop through players
					for iPlayerX in xrange(gc.getMAX_CIV_PLAYERS()):
						pPlayerX = gc.getPlayer(iPlayerX)
						# Is the rival civilization a valid player?
						if pPlayerX.isAlive():
							# Is the rival civilization part of the city's trade network?
							if pPlayerX.canTradeNetworkWith(iPlayer):
								iUniqueUnit = gc.getCivilizationInfo(pPlayerX.getCivilizationType()).getCivilizationUnits(iUnitClass)
								# Does this civilization have a unique version of this unit?
								if (iDefaultUnit > -1 and iUniqueUnit > -1 and iDefaultUnit != iUniqueUnit):
									# Allow the UU only if its civilization can also build it
									if pPlayerX.canTrain(iUniqueUnit, False, False):
										# Add the UU to the list of candidates
										lUniqueUnits.append(iUniqueUnit)

				# Continue if the list is not empty
				if len(lUniqueUnits) >= 1:
					# Randomly choose and setup one of the UUs in the list
					chance = CyGame().getSorenRandNum(len(lUniqueUnits), "Colosseum UU")
					iNewUnit = lUniqueUnits[chance]
					iX = pUnit.getX()
					iY = pUnit.getY()
					pNewUnit = pPlayer.initUnit(iNewUnit, iX, iY, UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION)
					# Convert the built unit to the chosen rival UU
					pNewUnit.convert(pUnit)
 

Attachments

  • Civ4ScreenShot0009.JPG
    Civ4ScreenShot0009.JPG
    160.6 KB · Views: 59
Just found the problem too (PyPlayer not the same thing as CyPlayer). I'll put together a proper patch for this and other issues later tonight after the kids are in bed.
 
Glad to see a new version! Do we have civil wars or revolutions or anything that splits an empire too huge or illy ruled?
 
Glad to see a new version! Do we have civil wars or revolutions or anything that splits an empire too huge or illy ruled?

Not yet, it proved a much bigger task than I anticipated and thus not something I wanted to attempt with my recent family commitments. Eventually though.
 
While designing my new Settler Promotion mod component, I figured out something.
Sending of modnet messages does not work when sender is AI.

In other words, I highly doubt if your colonists and inquistions are working for AI
 
Back
Top Bottom