The Immigration Mod

OrionVeteran

Deity
Joined
Dec 25, 2003
Messages
2,443
Location
Newport News VA
The Immigration Mod

Do you have a city that breeds like the people are in a constant state of orgy? There is no need to implement birth control to control your population. Just migrate to another city! Announcing the release of the Immigration mod in both standard and WoC formats.

This mod has a new unit called the Immigrant. You use two population points from a city, which has a population of at least 10; to create an immigrant. The immigrant can go and join an existing city that has a population of less than 7. Joining a city adds one population point to that city. Best of all the AI can and does use immigrants effectively. Your cities will welcome immigrants with open arms. :)

Download: http://forums.civfanatics.com/downloads.php?do=file&id=14792


Updates: All the latest updates have been added to the download file.
 
Stolen from Pie's Ancient Europe Mod? ;)

How can the AI use immigrants effectively when they remove more pop than they give? (are they dying on the way? :D)
 
Stolen from Pie's Ancient Europe Mod? ;)

Nope. I wrote all of the Python and XML myself. However, I did pilfer the dds graphic file. That's it.

How can the AI use immigrants effectively when they remove more pop than they give? (are they dying on the way? :D)

Ha Ha. What I should have said was: Tests have shown the AI will produce immigrants and send them to populate other cities.
 
This Mod sounds really interesting, but I have BtS and it the mod does not seem to work with it. I modified the XML so that the mod will actually load. However, when I start a game, the playing area displays perfectly, but nothing else is displayed. Such as the small map in the corner, the tax/research rate adjustments, main task bar(or whatever)

Just curious if there are plans to port it.

Thanks
 
This Mod sounds really interesting, but I have BtS and it the mod does not seem to work with it. I modified the XML so that the mod will actually load. However, when I start a game, the playing area displays perfectly, but nothing else is displayed. Such as the small map in the corner, the tax/research rate adjustments, main task bar(or whatever)

Just curious if there are plans to port it.

Thanks

1. Make sure you have installed the BTS 3.19 patch for Civ4.

2. Make sure you have merged the CvMainInterface.py properly, including the import at the top of the file.
 
OK tried in RoM and got this:

Traceback (most recent call last):

File "CvScreensInterface", line 997, in forceScreenRedraw

File "CvMainInterface", line 1431, in redraw

File "CvMainInterface", line 2745, in updateSelectionButtons

NameError: global name 'iUnitType' is not defined
ERR: Python function forceScreenRedraw failed, module CvScreensInterface


Spoiler :
Code:
# Immigration Mod	
					[B]if iUnitType == gc.getInfoTypeForString("UNIT_IMMIGRANT"):[/B]
						if Immigration.showJoinCityButton(pUnit):
							screen.appendMultiListButton( "BottomButtonContainer", ArtFileMgr.getInterfaceArtInfo("INTERFACE_JOIN_CITY").getPath(), 0, WidgetTypes.WIDGET_GENERAL, 680, 680, False )
							screen.show("BottomButtonContainer")
							iCount = iCount + 1
							return
						# End Immigration Mod
 
OK tried in RoM and got this:

Traceback (most recent call last):

File "CvScreensInterface", line 997, in forceScreenRedraw

File "CvMainInterface", line 1431, in redraw

File "CvMainInterface", line 2745, in updateSelectionButtons

NameError: global name 'iUnitType' is not defined
ERR: Python function forceScreenRedraw failed, module CvScreensInterface


Spoiler :
Code:
# Immigration Mod	
					[B]if iUnitType == gc.getInfoTypeForString("UNIT_IMMIGRANT"):[/B]
						if Immigration.showJoinCityButton(pUnit):
							screen.appendMultiListButton( "BottomButtonContainer", ArtFileMgr.getInterfaceArtInfo("INTERFACE_JOIN_CITY").getPath(), 0, WidgetTypes.WIDGET_GENERAL, 680, 680, False )
							screen.show("BottomButtonContainer")
							iCount = iCount + 1
							return
						# End Immigration Mod

Make sure you have the following definitions (in Red) just above your code:

Spoiler :

Code:
# Inquisition Mod
					# ##### Inquisitor Unit Button ######
					[COLOR="Red"]pUnit = g_pSelectedUnit
					iUnitType = pUnit.getUnitType()
					iUnitOwner = pUnit.getOwner( )
					pUnitOwner = gc.getPlayer(iUnitOwner)[/COLOR]

					if pUnitOwner.isTurnActive( ):						
						if gc.getMap().plot(pUnit.getX(), pUnit.getY() ).isCity():							
							if OIM.showInquisitionButton(pUnit):
								#CyInterface().addImmediateMessage("Test Here!", "")
								screen.appendMultiListButton( "BottomButtonContainer", ArtFileMgr.getInterfaceArtInfo("INTERFACE_GODS_PERSICUTION").getPath(), 0, WidgetTypes.WIDGET_GENERAL, 665, 665, False )
								screen.show("BottomButtonContainer")
								iCount = iCount + 1
								return
						# Immigration Mod	
							if iUnitType == gc.getInfoTypeForString("UNIT_IMMIGRANT"):
								if Immigration.showJoinCityButton(pUnit):
									screen.appendMultiListButton( "BottomButtonContainer", ArtFileMgr.getInterfaceArtInfo("INTERFACE_JOIN_CITY").getPath(), 0, WidgetTypes.WIDGET_GENERAL, 680, 680, False )
									screen.show("BottomButtonContainer")
									iCount = iCount + 1
									return
						# End Immigration Mod
# End Inquisition Mod
 
OK i hope i have it correct?

Spoiler :
Code:
					if (CyInterface().canDeleteGroup()):
						screen.appendMultiListButton( "BottomButtonContainer", ArtFileMgr.getInterfaceArtInfo("INTERFACE_BUTTONS_SPLITGROUP").getPath(), 0, WidgetTypes.WIDGET_DELETE_GROUP, -1, -1, False )
						screen.show( "BottomButtonContainer" )
						
						iCount = iCount + 1
# Immigration Mod
					pUnit = g_pSelectedUnit
					iUnitType = pUnit.getUnitType()
					iUnitOwner = pUnit.getOwner( )
					pUnitOwner = gc.getPlayer(iUnitOwner)
	
					if iUnitType == gc.getInfoTypeForString("UNIT_IMMIGRANT"):
						if Immigration.showJoinCityButton(pUnit):
							screen.appendMultiListButton( "BottomButtonContainer", ArtFileMgr.getInterfaceArtInfo("INTERFACE_JOIN_CITY").getPath(), 0, WidgetTypes.WIDGET_GENERAL, 680, 680, False )
							screen.show("BottomButtonContainer")
							iCount = iCount + 1
							return
						# End Immigration Mod


		elif (CyInterface().getShowInterface() != InterfaceVisibility.INTERFACE_HIDE_ALL and CyInterface().getShowInterface() != InterfaceVisibility.INTERFACE_MINIMAP_ONLY):

I get no errors, but i am at city level 11 and i see NO immigration?
 
OK i hope i have it correct? I get no errors, but i am at city level 11 and i see NO immigration?

You must also have this in the same file:

Spoiler :

Code:
	def handleInput (self, inputClass):
# Immigrant Mod
		if (inputClass.getNotifyCode() == 11 and inputClass.getData1() == 680 and inputClass.getData2() == 680):			
			self.pPushedButtonUnit = g_pSelectedUnit
			#iX = self.pPushedButtonUnit.getX()
			#iY = self.pPushedButtonUnit.getY()
			#pPlot = CyMap().plot(iX, iY)
			iOwner = g_pSelectedUnit.getOwner()
			iUnitID = g_pSelectedUnit.getID()
			pPlayer = gc.getPlayer(iOwner)
			pUnit = pPlayer.getUnit(iUnitID)
			Immigration.doJoinCity(pUnit)
			CyInterface().setDirty(InterfaceDirtyBits.SelectionButtons_DIRTY_BIT, True)
# End Immigrant Mod
 
You must also have this in the same file:

Spoiler :

Code:
	def handleInput (self, inputClass):
# Immigrant Mod
		if (inputClass.getNotifyCode() == 11 and inputClass.getData1() == 680 and inputClass.getData2() == 680):			
			self.pPushedButtonUnit = g_pSelectedUnit
			#iX = self.pPushedButtonUnit.getX()
			#iY = self.pPushedButtonUnit.getY()
			#pPlot = CyMap().plot(iX, iY)
			iOwner = g_pSelectedUnit.getOwner()
			iUnitID = g_pSelectedUnit.getID()
			pPlayer = gc.getPlayer(iOwner)
			pUnit = pPlayer.getUnit(iUnitID)
			Immigration.doJoinCity(pUnit)
			CyInterface().setDirty(InterfaceDirtyBits.SelectionButtons_DIRTY_BIT, True)
# End Immigrant Mod

Yeppers got that also. here's the whole file:

I betcha i have to add: Modules/blah/Immigration/Art/Units/Immigrant/Settler_Male.nif
 
Yeppers got that also. here's the whole file:

I betcha i have to add: Modules/blah/Immigration/Art/Units/Immigrant/Settler_Male.nif

For the art files you need to place them in the following folder:

Modules\OrionsMods\Immigration\Art\Units\Immigrant

Make sure these files are placed in that folder:

settler_male.dds
settler_male.kfm
settler_male.nif
settler_male_128.dds
 
OK i got it to go to the city, just like mine did when i tried to get it working, but now there is NO OPTIONS?

OK. Check the following folder:

Code:
Modules\OrionsMods\Immigration\Art\Interface\Buttons\Units

Make sure these files are placed in that folder:

Immigrant.dds
JoinCity.dds
 
Yeppers got that also. here's the whole file:


I took a look at your CvMainInterface file: Please add the following red lins:

Spoiler :

Code:
pUnit = g_pSelectedUnit
iUnitType = pUnit.getUnitType()
iUnitOwner = pUnit.getOwner( )
pUnitOwner = gc.getPlayer(iUnitOwner)

[COLOR="Red"]if pUnitOwner.isTurnActive( ):						
	if gc.getMap().plot(pUnit.getX(), pUnit.getY() ).isCity():[/COLOR]
	# Immigration Mod	
		if iUnitType == gc.getInfoTypeForString("UNIT_IMMIGRANT"):
			if Immigration.showJoinCityButton(pUnit):
				screen.appendMultiListButton( "BottomButtonContainer", ArtFileMgr.getInterfaceArtInfo("INTERFACE_JOIN_CITY").getPath(), 0, WidgetTypes.WIDGET_GENERAL, 680, 680, False )
				screen.show("BottomButtonContainer")
				iCount = iCount + 1
				return
	# End Immigration Mod
 
OK tried that and got this:

Traceback (most recent call last):
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 "CvEventManager", line 12, in ?
File "<string>", line 52, in load_module
File "CvScreensInterface", line 3, in ?
File "<string>", line 35, in load_module
File "<string>", line 13, in _get_code
File "CvMainInterface", line 2753
if iUnitType == gc.getInfoTypeForString("UNIT_IMMIGRANT"):
^
IndentationError: expected an indented block
load_module CvAppInterface


Spoiler :
Code:
# Immigration Mod
					pUnit = g_pSelectedUnit
					iUnitType = pUnit.getUnitType()
					iUnitOwner = pUnit.getOwner( )
					pUnitOwner = gc.getPlayer(iUnitOwner)
					
					if pUnitOwner.isTurnActive( ):						
						if gc.getMap().plot(pUnit.getX(), pUnit.getY() ).isCity():
	
					if iUnitType == gc.getInfoTypeForString("UNIT_IMMIGRANT"):
						if Immigration.showJoinCityButton(pUnit):
							screen.appendMultiListButton( "BottomButtonContainer", ArtFileMgr.getInterfaceArtInfo("INTERFACE_JOIN_CITY").getPath(), 0, WidgetTypes.WIDGET_GENERAL, 680, 680, False )
							screen.show("BottomButtonContainer")
							iCount = iCount + 1
							return
						# End Immigration Mod



EDIT: OK changed it to this and it worked, but now i get a repeatable error?

Spoiler :
Code:
# Immigration Mod
					pUnit = g_pSelectedUnit
					iUnitType = pUnit.getUnitType()
					iUnitOwner = pUnit.getOwner( )
					pUnitOwner = gc.getPlayer(iUnitOwner)

					if pUnitOwner.isTurnActive( ):
						if gc.getMap().plot(pUnit.getX(), pUnit.getY() ).isCity():	
							if iUnitType == gc.getInfoTypeForString("UNIT_IMMIGRANT"):
								if Immigration.showJoinCityButton(pUnit):
									screen.appendMultiListButton( "BottomButtonContainer", ArtFileMgr.getInterfaceArtInfo("INTERFACE_JOIN_CITY").getPath(), 0, WidgetTypes.WIDGET_GENERAL, 680, 680, False )
									screen.show("BottomButtonContainer")
									iCount = iCount + 1
									return
	# End Immigration Mod
 
Back
Top Bottom