Hyborem and Free Units

Hyborem's spawning does not reference that file when deciding what units to place (although I wish it would), but is instead hardcoded in python. (The same goes for Basium.)

You would need to edit C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\Fall from Heaven 2 034\Assets\python\CvEventManager.py

Code:
		if gc.getGame().isOption(GameOptionTypes.GAMEOPTION_NO_HYBOREM_OR_BASIUM) == false:
			if (iTechType == gc.getInfoTypeForString('TECH_INFERNAL_PACT') and iPlayer != -1):
				iCount = 0
				for iTeam in range(gc.getMAX_TEAMS()):
					eTeam = gc.getTeam(iTeam)
					if eTeam.isHasTech(gc.getInfoTypeForString('TECH_INFERNAL_PACT')):
						iCount = iCount + 1
				if iCount == 1:
					iInfernalPlayer = cf.getOpenPlayer()
					pBestPlot = -1
					iBestPlot = -1
					for i in range (CyMap().numPlots()):
						pPlot = CyMap().plotByIndex(i)
						iPlot = -1
						if pPlot.isWater() == False:
							if pPlot.getNumUnits() == 0:
								if pPlot.isCity() == False:
									if pPlot.isImpassable() == False:
										iPlot = CyGame().getSorenRandNum(500, "Place Hyborem")
										iPlot = iPlot + (pPlot.area().getNumTiles() * 2)
										iPlot = iPlot + (pPlot.area().getNumUnownedTiles() * 10)
										if pPlot.isOwned() == False:
											iPlot = iPlot + 500
										if pPlot.getOwner() == iPlayer:
											iPlot = iPlot + 200
						if iPlot > iBestPlot:
							iBestPlot = iPlot
							pBestPlot = pPlot
					if (iInfernalPlayer != -1 and pBestPlot != -1):
						CyGame().addPlayerAdvanced(iInfernalPlayer, -1, gc.getInfoTypeForString('LEADER_HYBOREM'), gc.getInfoTypeForString('CIVILIZATION_INFERNAL'))
						iFounderTeam = gc.getPlayer(iPlayer).getTeam()
						eFounderTeam = gc.getTeam(gc.getPlayer(iPlayer).getTeam())
						iInfernalTeam = gc.getPlayer(iInfernalPlayer).getTeam()
						eInfernalTeam = gc.getTeam(iInfernalTeam)
						for iTech in range(gc.getNumTechInfos()):
							if eFounderTeam.isHasTech(iTech):
								eInfernalTeam.setHasTech(iTech, true, iInfernalPlayer, true, false)
						eFounderTeam.signOpenBorders(iFounderTeam)
						eInfernalTeam.signOpenBorders(iInfernalTeam)
						iBarbTeam = gc.getPlayer(gc.getBARBARIAN_PLAYER()).getTeam()
						eInfernalTeam.makePeace(iBarbTeam)
						newUnit1 = gc.getPlayer(iInfernalPlayer).initUnit(gc.getInfoTypeForString('UNIT_HYBOREM'), pBestPlot.getX(), pBestPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
						newUnit1.setHasPromotion(gc.getInfoTypeForString('PROMOTION_IMMORTAL'), true)
						newUnit1.setHasCasted(true)
						newUnit2 = gc.getPlayer(iInfernalPlayer).initUnit(gc.getInfoTypeForString('UNIT_LONGBOWMAN'), pBestPlot.getX(), pBestPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
						newUnit2.setHasPromotion(gc.getInfoTypeForString('PROMOTION_MOBILITY1'), true)
						newUnit3 = gc.getPlayer(iInfernalPlayer).initUnit(gc.getInfoTypeForString('UNIT_LONGBOWMAN'), pBestPlot.getX(), pBestPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
						newUnit3.setHasPromotion(gc.getInfoTypeForString('PROMOTION_MOBILITY1'), true)
						newUnit4 = gc.getPlayer(iInfernalPlayer).initUnit(gc.getInfoTypeForString('UNIT_CHAMPION'), pBestPlot.getX(), pBestPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
						newUnit4.setHasPromotion(gc.getInfoTypeForString('PROMOTION_IRON_WEAPONS'), true)
						newUnit4.setHasPromotion(gc.getInfoTypeForString('PROMOTION_MOBILITY1'), true)
						newUnit5 = gc.getPlayer(iInfernalPlayer).initUnit(gc.getInfoTypeForString('UNIT_CHAMPION'), pBestPlot.getX(), pBestPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
						newUnit5.setHasPromotion(gc.getInfoTypeForString('PROMOTION_IRON_WEAPONS'), true)
						newUnit5.setHasPromotion(gc.getInfoTypeForString('PROMOTION_MOBILITY1'), true)
						newUnit6 = gc.getPlayer(iInfernalPlayer).initUnit(gc.getInfoTypeForString('UNIT_WORKER'), pBestPlot.getX(), pBestPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
						newUnit6.setHasPromotion(gc.getInfoTypeForString('PROMOTION_DEMON'), true)
						newUnit7 = gc.getPlayer(iInfernalPlayer).initUnit(gc.getInfoTypeForString('UNIT_IMP'), pBestPlot.getX(), pBestPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
						newUnit7.setHasPromotion(gc.getInfoTypeForString('PROMOTION_MOBILITY1'), true)
						newUnit8 = gc.getPlayer(iInfernalPlayer).initUnit(gc.getInfoTypeForString('UNIT_MANES'), pBestPlot.getX(), pBestPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
						newUnit9 = gc.getPlayer(iInfernalPlayer).initUnit(gc.getInfoTypeForString('UNIT_MANES'), pBestPlot.getX(), pBestPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
						newUnit10 = gc.getPlayer(iInfernalPlayer).initUnit(gc.getInfoTypeForString('UNIT_MANES'), pBestPlot.getX(), pBestPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
						newUnit11 = gc.getPlayer(iInfernalPlayer).initUnit(gc.getInfoTypeForString('UNIT_SETTLER'), pBestPlot.getX(), pBestPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
						newUnit11.setHasPromotion(gc.getInfoTypeForString('PROMOTION_MOBILITY1'), true)
						newUnit11.setHasPromotion(gc.getInfoTypeForString('PROMOTION_SENTRY'), true)
						newUnit11.setHasPromotion(gc.getInfoTypeForString('PROMOTION_SENTRY2'), true)
						newUnit11.setHasPromotion(gc.getInfoTypeForString('PROMOTION_DEMON'), true)
						if gc.getPlayer(iPlayer).isHuman():
							popupInfo = CyPopupInfo()
							popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON)
							popupInfo.setText(CyTranslator().getText("TXT_KEY_POPUP_CONTROL_INFERNAL",()))
							popupInfo.setData1(iPlayer)
							popupInfo.setData2(iInfernalPlayer)
							popupInfo.addPythonButton(CyTranslator().getText("TXT_KEY_POPUP_YES", ()), "")
							popupInfo.addPythonButton(CyTranslator().getText("TXT_KEY_POPUP_NO", ()), "")
							popupInfo.setOnClickedPythonCallback("reassignPlayer")
							popupInfo.addPopup(iPlayer)



It isn't hard to copy parts of the code to make newUnit12, newUnit13, newUnit14, etc.
 
Uh, yeah, I did things a little differently in my version.
Basically what I did was make it so that the Mercurians/Infernals enter the game with armies scaled to how many cities are in the game. If you want a certain size army, just make iCities a fixed number instead of a function.
Infernals Code:
Code:
newUnit = pInfernalPlayer.initUnit(gc.getInfoTypeForString('UNIT_HYBOREM'), pBestPlot.getX(), pBestPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
newUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_IMMORTAL'), true)
newUnit.setHasCasted(true)
iCities = CyGame().getNumCities()
iModLongbowman = 3
iModChampion = 2
iModWorker = 4
iModAdept = 5
iModMane = 1
iModSettler = 6
for i in range(iCities):
	if (i % iModLongbowman == 0):
		longbowman = pInfernalPlayer.initUnit(gc.getInfoTypeForString('UNIT_LONGBOWMAN'), pBestPlot.getX(), pBestPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
		longbowman.setHasPromotion(gc.getInfoTypeForString('PROMOTION_MOBILITY1'), true)
	if (i % iModChampion == 0):
		champion = pInfernalPlayer.initUnit(gc.getInfoTypeForString('UNIT_CHAMPION'), pBestPlot.getX(), pBestPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
		champion.setHasPromotion(gc.getInfoTypeForString('PROMOTION_IRON_WEAPONS'), true)	
		champion.setHasPromotion(gc.getInfoTypeForString('PROMOTION_MOBILITY1'), true)
	if (i % iModWorker == 0):
		worker = pInfernalPlayer.initUnit(gc.getInfoTypeForString('UNIT_WORKER'), pBestPlot.getX(), pBestPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
		worker.setHasPromotion(gc.getInfoTypeForString('PROMOTION_DEMON'), true)
	if (i % iModAdept == 0):
		adept = pInfernalPlayer.initUnit(gc.getInfoTypeForString('UNIT_IMP'), pBestPlot.getX(), pBestPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
		adept.setHasPromotion(gc.getInfoTypeForString('PROMOTION_MOBILITY1'), true)
	if (i % iModMane == 0):
		mane = pInfernalPlayer.initUnit(gc.getInfoTypeForString('UNIT_MANES'), pBestPlot.getX(), pBestPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
	if (i % iModSettler == 0):
		settler = pInfernalPlayer.initUnit(gc.getInfoTypeForString('UNIT_SETTLER'), pBestPlot.getX(), pBestPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
		settler.setHasPromotion(gc.getInfoTypeForString('PROMOTION_DEMON'), true)
		if (i == 0):
			settler.setHasPromotion(gc.getInfoTypeForString('PROMOTION_STARTING_SETTLER'), true)
Mercurians Code:
Code:
gc.getPlayer(iMercurianPlayer).initUnit(gc.getInfoTypeForString('UNIT_BASIUM'), pPlot.getX(), pPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
pMercurianPlayer = gc.getPlayer(iMercurianPlayer)
iCities = CyGame().getNumCities()
iModAngel = 2
iModSettler = 6
for i in range(iCities):
	if (i % iModAngel == 0):
		angel = pMercurianPlayer.initUnit(gc.getInfoTypeForString('UNIT_ANGEL'), pPlot.getX(), pPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
		angel.setHasPromotion(gc.getInfoTypeForString('PROMOTION_MOBILITY1'), true)
	if (i % iModSettler == 0):
		settler = pMercurianPlayer.initUnit(gc.getInfoTypeForString('UNIT_SETTLER'), pPlot.getX(), pPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
		if (i == 0):
			settler.setHasPromotion(gc.getInfoTypeForString('PROMOTION_STARTING_SETTLER'), true)
 
Back
Top Bottom