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

Orion's Inquisition Mod

Discussion in 'Civ4 - Mod Components' started by OrionVeteran, Nov 28, 2008.

  1. OrionVeteran

    OrionVeteran Deity

    Joined:
    Dec 25, 2003
    Messages:
    2,443
    Location:
    Newport News VA
    Please checkout the inquisition component, (along with the limited religions component), as it contains the latest updates to this mod. I suspect you may find the problem in the CIV4ArtDefines_Building.xml file.
     
  2. TheLopez

    TheLopez Deity

    Joined:
    Jan 16, 2006
    Messages:
    2,525
    Location:
    Oregon
    Huh, cool thanks
     
  3. OrionVeteran

    OrionVeteran Deity

    Joined:
    Dec 25, 2003
    Messages:
    2,443
    Location:
    Newport News VA
  4. Linkman226

    Linkman226 #anarchy

    Joined:
    Sep 14, 2007
    Messages:
    2,493
    A thread necromancer has arrived....

    Can you upload the source code specifically for the Holy City Relocation? I'm trying to incorporate this into a different mod. Thanks!
     
  5. OrionVeteran

    OrionVeteran Deity

    Joined:
    Dec 25, 2003
    Messages:
    2,443
    Location:
    Newport News VA
    This is a value set in XML

    Code:
    def isOC_RESPAWN_HOLY_CITIES():
    	# Orion's Inquisition Mod
    	return gc.getDefineINT("OC_RESPAWN_HOLY_CITIES") != 0
    
    This code performs the respawning of a Holy City

    Code:
    # Set Minimum of Two Cities required for Respawning a Holy City
    minCitiesForInfluence = 2
    
    # Check default -- Respawn Holy City?
    if isOC_RESPAWN_HOLY_CITIES():
    	# Find player with the at least 2 Cities of religious influence to respawn the Holy City.                   
    	eBestPlayer = getPlayerWithMaxInfluenceForReligion(iReligionLoop, minCitiesForInfluence)
    	# If there is a player with enough Religious Influence for Religion
    	if eBestPlayer >= 0:
    		XpPlayer = gc.getPlayer(eBestPlayer)
    		# Respawn the Holy City
    		ReSpawnHolyCity(XpPlayer, iReligionLoop)
    
    This code determines the player with the most number of cities having the specified religion of the Holy City.

    Code:
    	
    def getPlayerWithMaxInfluenceForReligion(MyHCReligion, minCitiesRequired):
    	# Orion's Inquisition Mod
    	eBestPlayer = -1
    	iBestCount = 0
    	
    	for ePlayer in range(gc.getMAX_PLAYERS()):
    		pPlayer = gc.getPlayer(ePlayer)
    		# skip invalid or dead players
    		if not pPlayer.isNone():
    			if pPlayer.isAlive():
    				iCount = pPlayer.getHasReligionCount(MyHCReligion)
    				if iCount > iBestCount:
    					iBestCount = iCount
    					eBestPlayer = ePlayer
    	
    	if iBestCount >= minCitiesRequired:
    		return eBestPlayer
    	else:
    		return -1
    
    
    All of this can be found in Orion's Inquisition Mod in the OIM.py file.
     
  6. Linkman226

    Linkman226 #anarchy

    Joined:
    Sep 14, 2007
    Messages:
    2,493
    Thanks!
     
  7. Linkman226

    Linkman226 #anarchy

    Joined:
    Sep 14, 2007
    Messages:
    2,493
    Ok I did the following:

    1) Merged all XML file differences between my mod and your mod.
    2) Put all your art into my mod's art folder.
    3) Put OIM.py into my Assets\Python folder.
    4) Copy and pasted the changes in your GlobalDefinesAlt file into my GlobalDefinesAlt

    Yet no matter what I set the customizable settings in the GlobalDefinesAlt folder, the game still tells me that Holy City relocation, foreign inquisitions, inquisitions of holy cities, etc. is turned off.

    Also, I didn't see an SDK component to the mod. Does the AI know how to use these?

    And what is the difference between the WoC and Standard files?
     
  8. OrionVeteran

    OrionVeteran Deity

    Joined:
    Dec 25, 2003
    Messages:
    2,443
    Location:
    Newport News VA
    1. For compatibility, there is no SDK in OIM.

    2. The AI does know how to use Inquisitors and very effectively.

    3. Look up World of Civilization (WoC) in the forums and read up on what it is.
     
  9. Linkman226

    Linkman226 #anarchy

    Joined:
    Sep 14, 2007
    Messages:
    2,493
    And what about the fact that the GlobalDefinesAlt options aren't working?
     
  10. OrionVeteran

    OrionVeteran Deity

    Joined:
    Dec 25, 2003
    Messages:
    2,443
    Location:
    Newport News VA
    If the merge is done correctly, then the GlobalDefinesAlt options will work. Since you are new to Civ4, I suggest using the standard version of the mod for your merge.
     
  11. Linkman226

    Linkman226 #anarchy

    Joined:
    Sep 14, 2007
    Messages:
    2,493
    Lol I'm new to modding, not civ 4.

    Alright I must have screwed up something with the merge... I will investigate!
     
  12. Midnight-Blue766

    Midnight-Blue766 The filidh that cam frae Skye

    Joined:
    Sep 24, 2007
    Messages:
    3,449
    Location:
    Bonnie Scoltland
    I'm having difficulty attempting to merge this mod with Fictionalization IV. Although I'm not absolutely certain, I am fairly that the error is in the Python coding, to be specific this:
    Code:
    	def onGameStart(self, argsList):
    		'Called at the start of the game'
    # ###############################################
    #            Orion's Game Options Status
    # ###############################################
    		iPlayerNum = 0
    		iHumanCount = 0
    		
    		if (gc.getGame().getGameTurnYear() == gc.getDefineINT("START_YEAR") and not gc.getGame().isOption(GameOptionTypes.GAMEOPTION_ADVANCED_START)):
    			for iPlayer in range(gc.getMAX_PLAYERS()):
    				player = gc.getPlayer(iPlayer)
    				if player.isAlive():
    					iPlayerNum = iPlayerNum + 1
    					if player.isHuman():
    						iHumanCount = iHumanCount + 1
    						if iHumanCount == 1:
    							# Orion's Game Options Status Popup
    							OIM.DisplayOCCStatus(iPlayer)
    							break
    # End Orion's Game Options Status popup
    		### circus hagenbeck start part 2
    	        if (gc.getGame().getGameTurnYear() <> gc.getDefineINT("START_YEAR")):
                            for i in range (gc.getMAX_PLAYERS()):
                                    player = gc.getPlayer(iPlayer)
    				if player.isAlive():
                                            numbuildings = player.countNumBuildings(gc.getInfoTypeForString("BUILDING_TARDIS"))
                                            if numbuildings>0:
                                                    for iCity in range(player.getNumCities()):
                                                            pCity = player.getCity(iCity)
                                                            if pCity.getNumBuilding(gc.getInfoTypeForString("BUILDING_TARDIS"))>0:
                                                                    self.oldcity = [iPlayer,iCity]
                                                                    return
                    ###circus hagenbeck end part 2     
    Are there any syntax errors that are in here?
     
  13. OrionVeteran

    OrionVeteran Deity

    Joined:
    Dec 25, 2003
    Messages:
    2,443
    Location:
    Newport News VA
    Try This:

    Spoiler :

    Code:
    	def onGameStart(self, argsList):
    		'Called at the start of the game'
    	# ###############################################
    	#            Orion's Game Options Status
    	# ###############################################
    		iPlayerNum = 0
    		iHumanCount = 0
    		self.oldcity = [-1,-1]
    		iCityList = PyPlayer(ePlayer).getCityList()	
    		
    		if (gc.getGame().getGameTurnYear() == gc.getDefineINT("START_YEAR") and not gc.getGame().isOption(GameOptionTypes.GAMEOPTION_ADVANCED_START)):
    			for iPlayer in range(gc.getMAX_PLAYERS()):
    				player = gc.getPlayer(iPlayer)
    				if player.isAlive():
    					iPlayerNum = iPlayerNum + 1
    					if player.isHuman():
    						iHumanCount = iHumanCount + 1
    						if iHumanCount == 1:
    							# Orion's Game Options Status Popup
    							OIM.DisplayOCCStatus(iPlayer)
    							break
    								
    	# End Orion's Game Options Status popup
    		### circus hagenbeck start part 2
    		if (gc.getGame().getGameTurnYear() <> gc.getDefineINT("START_YEAR")):
    			for iPlayer in range (gc.getMAX_PLAYERS()):
    				player = gc.getPlayer(iPlayer)
    				if player.isAlive():
    					numbuildings = player.countNumBuildings(gc.getInfoTypeForString("BUILDING_TARDIS"))
    					if numbuildings > 0:
    						for pyCity in iCityList:
    							pCity = pyCity.GetCy()
    							iCity = pCity.getID()
    					
    							if pCity.getNumBuilding(gc.getInfoTypeForString("BUILDING_TARDIS")) > 0:
    								self.oldcity = [iPlayer, iCity]
    								return
    				###circus hagenbeck end part 2Are there any syntax errors that are in here? 
    


    This mod is obsolete as I have fixed many issues in "Orions Limited Religions" and "Orions Inquisition Component". All of my mods can be found in the latest version of Grand Inquisitions. You might want to check it out and see what else you may want to use. :cool:
     
  14. Midnight-Blue766

    Midnight-Blue766 The filidh that cam frae Skye

    Joined:
    Sep 24, 2007
    Messages:
    3,449
    Location:
    Bonnie Scoltland
    On a related note, how can I add new Inquisitor units?
     
  15. OrionVeteran

    OrionVeteran Deity

    Joined:
    Dec 25, 2003
    Messages:
    2,443
    Location:
    Newport News VA
    In addition to the art files, you have to add a new inquisitor to these XML files:

    CIV4ArtDefines_Unit.xml
    CIV4UnitClassInfos.xml
    CIV4UnitInfos.xml
    CIV4GameText.xml
    CIV4CivilizationInfos.xml

    Use the existing entries in these files as an example for your new Inquisitor.
     
  16. Midnight-Blue766

    Midnight-Blue766 The filidh that cam frae Skye

    Joined:
    Sep 24, 2007
    Messages:
    3,449
    Location:
    Bonnie Scoltland
    Never mind.
     
  17. Linkman226

    Linkman226 #anarchy

    Joined:
    Sep 14, 2007
    Messages:
    2,493
    Hey Orion, I was wondering if you could help me with this bug:

    In my mod, I've included this modcomp, and had no problems until now. The only changes I've made since I last had a working copy that could be relevant are:

    1) I changed the position of the Holy Office Building in the XML so it's right after the monasteries

    2) I deleted the Holy Offices of all religions except Judaism, Christianity, and Islam (Judaism=Protestantism in my mod)

    3) I added a religion (Zoroastrianism)

    So here's the bug:

    Code:
    Traceback (most recent call last):
    
      File "CvScreensInterface", line 736, in forceScreenRedraw
    
      File "CvMainInterface", line 789, in redraw
    
      File "CvMainInterface", line 1712, in updateSelectionButtons
    
      File "OIM", line 799, in showInquisitionButton
    
      File "OIM", line 144, in getReligionInquisitor
    
      File "OIM", line 129, in getReligionHolyOffice
    
    AttributeError: 'NoneType' object has no attribute 'getPrereqReligion'
    ERR: Python function forceScreenRedraw failed, module CvScreensInterface
    And the offending bit of code:

    Code:
    def getReligionHolyOffice(iPlayer, iReligion):
    	# Orion's Inquisition Mod
    	# Returns the Holy Office Name for the specified Religion
    	pPlayer = gc.getPlayer(iPlayer)
    	pCivilization = gc.getCivilizationInfo(pPlayer.getCivilizationType())
    	
    	for iBuildingClass in range(gc.getNumBuildingClassInfos()):
    		kBuilding = gc.getBuildingInfo(pCivilization.getCivilizationBuildings(iBuildingClass))
    		if kBuilding.getPrereqReligion() == iReligion:			
    			iBuilding = pCivilization.getCivilizationBuildings(iBuildingClass)
    			#CyInterface().addImmediateMessage("C", "")
    			if gc.getBuildingInfo(iBuilding).getSpecialBuildingType() == gc.getInfoTypeForString("SPECIALBUILDING_HOLY_OFFICE"):
    				MyHolyOfficeName = gc.getBuildingInfo(iBuilding).getType()
    				#CyInterface().addImmediateMessage(str(MyHolyOfficeName), "")
    				return MyHolyOfficeName
    				break
    Any ideas?
     
  18. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    This is indeed caused by your XML. Orion's original code simply isn't written to handle your custom settings. Mostly you need to make sure that the XML is making sense.
     
  19. Linkman226

    Linkman226 #anarchy

    Joined:
    Sep 14, 2007
    Messages:
    2,493
    Can you elaborate? I don't quite understand what you mean.
     
  20. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    The current code is designed with a standard setup in mind. As long as any changes to the game are in line with the original setup, you should be fine. But anything breaking the logic would cause the mod-comp to falter. It could be something you've overlooked, or something you added by design. Either way the Inquisitor mod-comp isn't computing your setup.
     

Share This Page