Modern World: Present Day mod in progress

14) About changing Dawn of Man Text. Do I have to edit the CvDawnOfMan python file and make a entry in text? If so i'm going to copy file from RTW and change text.
15) Sometimes the mod loads then half way through loading crashes. This is usaully because iv'e acidently put someting outside a tag (E.g <Description>Bryce3</Description>ledfvd) Can anything else make this happen?
15.1) Is there a program that test whether there any errors. It's happened and I would have to check through 50 Files!
15.11) When it loads at the moment it seems to read all the files (If it does it alphabeticly) because it got to Unit infos which is the last one. Is there a order it does it in.
 
14) no idea
15) Missing entries in Art\ArtDefines_XY. If you e.g. have added a new unit, and forgot to put ART_DEF_NEW_UNIT into ArtDefines_units.xml, then it will crash.
15.1) debug dll. If you're using the standard .dll, then we have a debug dll in the database. IIRC you're using a 50 civs .dll right? Then it's not a problem, you could use the normal debug .dll too, unless you want to test scenarios.
Else this program.

Yes, but it can't hold aircraft. I just found the tag <iDefenseModifier>25</iDefenseModifier>.Is that what I need to change? I suppose its a percentage

:yup:

Does anyone have any ideas about that?

Normally it's done by creating a fake improvement and using Python to spawn a unit. Messy system.
 
14) no idea
OK, I'll just give it a try :)
15) Missing entries in Art\ArtDefines_XY. If you e.g. have added a new unit, and forgot to put ART_DEF_NEW_UNIT into ArtDefines_units.xml, then it will crash.
Thanks
15.1) debug dll. If you're using the standard .dll, then we have a debug dll in the database. IIRC you're using a 50 civs .dll right? Then it's not a problem, you could use the normal debug .dll too, unless you want to test scenarios.
Else this program.
Thanks. How do I use it???
Normally it's done by creating a fake improvement and using Python to spawn a unit. Messy system.

Which file would it be in FF? I really want to do that. I had already seen construction ships have that which confused me

Also, how will barbed wire connect? Should I make it as a route? Also, it's going to upgrade to trench (like cottage>hamlet>village>town) Does anyone have a trench graphic???
 
Which file would it be in FF? I really want to do that. I had already seen construction ships have that which confused me

In CvEventManager, in onImprovementBuilt, add the marked parts:

PHP:
	def onImprovementBuilt(self, argsList):
		'Improvement Built'
		iImprovement, iX, iY = argsList
###spawn unit after improvement ###
		pPlot = CyMap().plot(iX, iY)
		if iImprovement == gc.getInfoTypeForString('IMPROVEMENT_FARM') and pPlot.getOwner()>-1:
                        iPlayer = pPlot.getOwner()
                        pPlayer = gc.getPlayer(iPlayer)                                
                        iUnit = gc.getInfoTypeForString( 'UNIT_WARRIOR' )
                        pNewUnit = pPlayer.initUnit( iUnit, iX, iY, UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION )
###spawn unit after improvement###        
		if (not self.__LOG_IMPROVEMENT):
			return
		CvUtil.pyPrint('Improvement %s was built at %d, %d'
			%(PyInfo.ImprovementInfo(iImprovement).getDescription(), iX, iY))


I'm confused about how to use it(the crash checker). It said to open the config file. I have and now I'm confussed :cry::help::aargh::run::bump::badcomp::hammer: :hammer2:

Just change the path on the top of the file (3rd line), then run the program.
Don't be worried about too many missing graphics, because it cannot look into .fpk files and will report everything within .fpk files as missing.
 
In CvEventManager, in onImprovementBuilt, add the marked parts:

PHP:
	def onImprovementBuilt(self, argsList):
		'Improvement Built'
		iImprovement, iX, iY = argsList
###spawn unit after improvement ###
		pPlot = CyMap().plot(iX, iY)
		if iImprovement == gc.getInfoTypeForString('IMPROVEMENT_FARM') and pPlot.getOwner()>-1:
                        iPlayer = pPlot.getOwner()
                        pPlayer = gc.getPlayer(iPlayer)                                
                        iUnit = gc.getInfoTypeForString( 'UNIT_WARRIOR' )
                        pNewUnit = pPlayer.initUnit( iUnit, iX, iY, UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION )
###spawn unit after improvement###        
		if (not self.__LOG_IMPROVEMENT):
			return
		CvUtil.pyPrint('Improvement %s was built at %d, %d'
			%(PyInfo.ImprovementInfo(iImprovement).getDescription(), iX, iY))
I don't seem to have that file in FF. I have one called CvEventInterface but it doen't have it in. (A) It's hidden B) Iv'e accidently deleted it (unlikely) so could someone upload it (again :rolleyes:))I am already using a event manager so can I just cut and paste the bit of text above into it? If so, where?



Just change the path on the top of the file (3rd line), then run the program.
Don't be worried about too many missing graphics, because it cannot look into .fpk files and will report everything within .fpk files as missing.

It didn't find the problem. It just said:
Edit C:/Users/nathan/Desktop/New folder/Mods/crash checker/civcheck.config and then use File=>Run
Status: loaded 5045 art files from cache, 0 duplicate
Status: total art load time 1 seconds
SUMMARY: 0 missing art files
SUMMARY: 0 undefined symbols found
Status: Results written to C:/Users/nathan/Desktop/New folder/Mods/crash checker/civcheck.txt
The txt document said nothing. I think i'll just have to look at the recently changed files manually.

Again:
How will barbed wire connect? Should I make it as a route?

Does anyone know what the answer to this is: When it loads at the moment it seems to read all the files (If it does it alphabeticly) because it got to Unit infos which is the last one. Is there a order it does it in??????????????????????????
 
I think I found the problem. I accidently had I file in Assets called assets :)
Spoiler :
Untitled.png

I'm assuming I can keep the other folders but if not I will put them somewhere else.

I only have today left on my free trial for Winrar and I won't be able to buy it for a while so if anybody has anyideas of what to download then thanks. I have downloaded most civs and modern looking leaders from the database.
 
I don't seem to have that file in FF. I have one called CvEventInterface but it doen't have it in. (A) It's hidden B) Iv'e accidently deleted it (unlikely) so could someone upload it (again :rolleyes:))I am already using a event manager so can I just cut and paste the bit of text above into it? If so, where?

Check CvFinalFrontierEvents, and search for onImprovementBuilt ;).


It didn't find the problem. It just said:
The txt document said nothing. I think i'll just have to look at the recently changed files manually.

:dunno:

Again:

Does anyone know what the answer to this is: When it loads at the moment it seems to read all the files (If it does it alphabeticly) because it got to Unit infos which is the last one. Is there a order it does it in??????????????????????????

What has that to do with the wire :confused:?

I think I found the problem. I accidently had I file in Assets called assets :)
Spoiler :
Untitled.png

I'm assuming I can keep the other folders but if not I will put them somewhere else.

If there's nothing in the folder, then it normally should not do anything :dunno:.

I only have today left on my free trial for Winrar and I won't be able to buy it for a while so if anybody has anyideas of what to download then thanks. I have downloaded most civs and modern looking leaders from the database.

You should be able to open most (not all, but most) .rar files with either WinZip or 7zip.
 
What should be in the art files. The files are:
-post01_eu_an (NIF FILE)
-wall_an (DDS)
-wall01_eu_an (NIF)
-wall02_eu_an (NIF)
-wall04_eu_an (NIF)
 
Once I have finished Barbed Wire ect, I am going to make a new unit category called train. There will be early,middle and late trains. Railways will now be exactly the same as roads, movement wise. Trains will be able to move loads but only on railways (z-routes ,although can I make it just for railways?). There will be several promotions: 1 carriage, 2 carriage, ect... They will work like the cargo bay promotions in FF, although if it needs python-more FF python stealing!:lol: EDIT:Does anyone have a unit and possibly some promotion buttons? If someone has a way to make them it would be apprectiated. If not just post the blue background.
 
Search for onImprovementBuilt in that file, and paste the parts between the two
###spawn unit after improvement ###
into the file.

What should be in the art files. The files are:
-post01_eu_an (NIF FILE)
-wall_an (DDS)
-wall01_eu_an (NIF)
-wall02_eu_an (NIF)
-wall04_eu_an (NIF)

One of the .nifs.

Adding this and making it look good will be a bit more complicated, and only at that point you will need all the .nifs.

Trains will be able to move loads

The AI is not able to use that sadly :sad:.
(no land transports for the AI at all)
 
Search for onImprovementBuilt in that file, and paste the parts between the two
###spawn unit after improvement ###
into the file.
OK, well I can't find it in the file so i'll just copy it from your post. So all I need is:
Code:
###spawn unit after improvement ###
        pPlot = CyMap().plot(iX, iY)
        if iImprovement == gc.getInfoTypeForString('IMPROVEMENT_FARM') and pPlot.getOwner()>-1:
                        iPlayer = pPlot.getOwner()
                        pPlayer = gc.getPlayer(iPlayer)                                
                        iUnit = gc.getInfoTypeForString( 'UNIT_WARRIOR' )
                        pNewUnit = pPlayer.initUnit( iUnit, iX, iY, UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION )
###spawn unit after improvement###


One of the .nifs.

Adding this and making it look good will be a bit more complicated, and only at that point you will need all the .nifs.

I'll see if I can ask for it in the thread. I was going to just use the top one but that might just make loads of walls. Maybe i'll just use one of the others.


The AI is not able to use that sadly :sad:.
(no land transports for the AI at all)

Never Mind :(
 
In the FF file there seems to be something about starbase but not what you said. Shall I just copy what you posted? if so, where in the event infos? Top, Bottom, somewhere in the middle?
Spoiler :
Code:
#############################################################################################
#		Starbase Stuff
#############################################################################################
	
	def onUnitBuildImprovement(self, argsList):
		'Unit begins enacting a Build (building an Improvement or Route)'
		pUnit, iBuild, bFinished = argsList
		
		iBuildStarbaseID = CvUtil.findInfoTypeNum(gc.getBuildInfo,gc.getNumBuildInfos(),'BUILD_STARBASE')
		
		# Starbase WAS built
		if (iBuild == iBuildStarbaseID):
			pUnit.setScriptData("BuildingStarbase")

	def onImprovementBuilt(self, argsList):
		'Improvement Built'
		iImprovement, iX, iY = argsList
		
		iImprovementStarbaseID = CvUtil.findInfoTypeNum(gc.getImprovementInfo,gc.getNumImprovementInfos(),'IMPROVEMENT_STARBASE')
		iUnitConstructShipID = CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_CONSTRUCT_SHIP')
		
		# Starbase finished
		if (iImprovement == iImprovementStarbaseID):
			
			pPlot = CyMap().plot(iX, iY)
			pPlot.setImprovementType(-1)
			
			# Look for Construction Ship on this plot
			for iUnitLoop in range(pPlot.getNumUnits()):
				pUnit = pPlot.getUnit(iUnitLoop)
				
				if (pUnit.getScriptData() == "BuildingStarbase"):
					self.doMakeStarbase(pUnit.getOwner(), iX, iY)
					self.aiKillTimerData = [3, pUnit.getOwner(), pUnit.getID()]
#					pUnit.kill(true, -1)
	
	def doMakeStarbase(self, iPlayer, iX, iY):
		
		pPlayer = gc.getPlayer(iPlayer)
		pPlot = CyMap().plot(iX, iY)
		
		# Create Starbase Unit
		iUnitStarbaseID = CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_STARBASE_I')
		pPlayer.initUnit(iUnitStarbaseID, iX, iY, UnitAITypes.UNITAI_ATTACK, DirectionTypes.NO_DIRECTION)
		
		self.updateStarbaseCulture(iPlayer, iX, iY)
		
	def updateStarbaseCulture(self, iPlayer, iX, iY):
		
		# Create culture around unit
		for iXLoop in range(iX-2, iX+3):
			for iYLoop in range(iY-2, iY+3):
				
				iActiveX = iXLoop
				iActiveY = iYLoop
				
				if (iActiveX < 0):
					iActiveX = CyMap().getGridWidth() + iActiveX
				if (iActiveY < 0):
					iActiveY = CyMap().getGridHeight() + iActiveY
				
				pLoopPlot = CyMap().plot(iActiveX, iActiveY)
#				pPlotLoop = CyMap().plot(iXLoop, iYLoop)
#				printd("Setting Player %d as the owner of %d, %d" %(iPlayer, iXLoop, iYLoop))
				# Don't override culture that's already here
				if (pLoopPlot.getOwner() == -1):
					pLoopPlot.setOwner(iPlayer)
		
	def updateAllStarbases(self):
		
		# Update Starbase culture
		iUnitStarbaseID = CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_STARBASE_I')
		iUnitStarbaseIID = CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_STARBASE_II')
		iUnitStarbaseIIID = CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_STARBASE_III')
		iUnitMissileI = CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_MISSILE_I')
		iUnitMissileII = CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_MISSILE_II')
		iUnitMissileIII = CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_MISSILE_III')
		
		# List made to preserve culture of units built first
		aaiStarbaseList = []
		
		for iPlayerLoop in range(gc.getMAX_CIV_PLAYERS()):
			pPlayer = gc.getPlayer(iPlayerLoop)
			pTeam = gc.getTeam(pPlayer.getTeam())
			pyPlayer = PyPlayer(iPlayerLoop)
			
			iUnitToCreate = -1
			aiPossibleUnitList = [iUnitMissileI, iUnitMissileII, iUnitMissileIII]
			
			for iUnitLoop in aiPossibleUnitList:
				
				pUnitInfo = gc.getUnitInfo(iUnitLoop)
				iNeededTech = pUnitInfo.getPrereqAndTech()
				
				if (pTeam.isHasTech(iNeededTech)):
					iUnitToCreate = iUnitLoop
			
			apUnitList = pyPlayer.getUnitList()
			for pUnitLoop in apUnitList:
				if (pUnitLoop.getUnitType() == iUnitStarbaseID or pUnitLoop.getUnitType() == iUnitStarbaseIID or pUnitLoop.getUnitType() == iUnitStarbaseIIID):
					aaiStarbaseList.append([pUnitLoop.getGameTurnCreated(), iPlayerLoop, pUnitLoop.getX(), pUnitLoop.getY()])
					
					# Need appropriate tech to create Missile
					if (iUnitToCreate != -1):
						# Need appropriate turn to create
						iTurnCreated = pUnitLoop.getGameTurnCreated()
						iCurrentTurn = CyGame().getGameTurn()
						
						if (iTurnCreated != iCurrentTurn):
							iTurnsSinceCreation = iCurrentTurn - iTurnCreated
							# Produce Missile every 15 turns
							if (iTurnsSinceCreation % 15 == 0):
								pPlayer.initUnit(iUnitToCreate, pUnitLoop.getX(), pUnitLoop.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION)
		
#		printd("\n\nXXX: There are %d Starbases on the map" %(len(aaiStarbaseList)))
#		printd(aaiStarbaseList)
			
		if (len(aaiStarbaseList) > 0):
			
			# Make order such that units built first get culture preference
			aaiStarbaseList.sort()
			aaiStarbaseList.reverse()
			
			for iStarbaseLoop in range(len(aaiStarbaseList)):
				self.updateStarbaseCulture(aaiStarbaseList[iStarbaseLoop][1], aaiStarbaseList[iStarbaseLoop][2], aaiStarbaseList[iStarbaseLoop][3])
		
	def canBuildStarbase(self, pPlot, iOffset=0):
		
		# Starbase restriction
		iBuildStarbase = CvUtil.findInfoTypeNum(gc.getBuildInfo,gc.getNumBuildInfos(),'BUILD_STARBASE')
		
		# Can't build on a Solar System
		iFeatureIDSolarSystem = CvUtil.findInfoTypeNum(gc.getFeatureInfo,gc.getNumFeatureInfos(),'FEATURE_SOLAR_SYSTEM')
		if (pPlot.getFeatureType() == iFeatureIDSolarSystem):
			return 0
		
		# Can't build on top of another Starbase
		iUnitStarbaseI = CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_STARBASE_I')
		iUnitStarbaseII = CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_STARBASE_II')
		iUnitStarbaseIII = CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_STARBASE_III')
		
		iNumUnits = iOffset # Offset so that Interface can disable button
		
		# Loop through all units on the plot
		for iUnitLoop in range(pPlot.getNumUnits()):
			pUnit = pPlot.getUnit(iUnitLoop)
			
			# Can't build on top of another Starbase
			if (pUnit.getUnitType() == iUnitStarbaseI or pUnit.getUnitType() == iUnitStarbaseII or pUnit.getUnitType() == iUnitStarbaseIII):
				return 0
			
			# if there are any Construction Ships already building a Starbase then disallow more	
			if (pUnit.getBuildType() == iBuildStarbase):
				iNumUnits += 1
				if (iNumUnits > 1):	# Account for the one unit actually performing the mission
					return 0
		
		return 1
		
#############################################################################################
 
OK, well I can't find it in the file so i'll just copy it from your post. So all I need is:

I actually meant that you should do that, copy that part over :D.
Yes, copy it, and exchange the improvement and the unit.

Edit: Add it after the line iImprovement, iX, iY = argsList in onImprovementBuilt
 
Is it this bit:
Code:
	def onImprovementBuilt(self, argsList):
		'Improvement Built'
		[B]iImprovement, iX, iY = argsList[/B]
		if (not self.__LOG_IMPROVEMENT):
			return
		CvUtil.pyPrint('Improvement %s was built at %d, %d'
			%(PyInfo.ImprovementInfo(iImprovement).getDescription(), iX, iY))

	def onImprovementDestroyed(self, argsList):
		'Improvement Destroyed'
		iImprovement, iOwner, iX, iY = argsList
		if (not self.__LOG_IMPROVEMENT):
			return
?
 
One final check (sorry :)):
Code:
[COLOR="Green"]
		iImprovement, iX, iY = argsList
[COLOR="Orange"]###spawn unit after improvement ###
        pPlot = CyMap().plot(iX, iY)
        if iImprovement == gc.getInfoTypeForString('IMPROVEMENT_BUNKER') and pPlot.getOwner()>-1:
                        iPlayer = pPlot.getOwner()
                        pPlayer = gc.getPlayer(iPlayer)                                
                        iUnit = gc.getInfoTypeForString( 'UNIT_BUNKER' )
                        pNewUnit = pPlayer.initUnit( iUnit, iX, iY, UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION )
###spawn unit after improvement###[/COLOR]
		if (not self.__LOG_IMPROVEMENT):
			return[/COLOR]
 
Back
Top Bottom