The FF traits have been totally removed from XML but not from Python. I tried it once and the mod failed to load after i had removed the python stuff for traits. So i'm looking to find out what specific bits of Python i need to remove to allow the mod to stll load.
OK, here's the basics for traits - if you have any that should duplicate the effects you should just change the TRAIT_WHATEVER instead of removing the section(s) of code for that trait.
Keep in mind that I am not actually trying any of this, but it should remove the references to traits that don't exist for you and also remove the code for the effects the traits are supposed to have. (It looks like the reason you are getting all of the effect for everybody is that the check to get the integer value for the traits are returning -1 when it can't find it and then checking to see if a player has that "-1" trait seems to always return True which causes all of the trait specific code to be run.)
In CvFinalFrontierEvents.py, in the onGameStart function:
Code:
if (pPlayer.isAlive()):
# XXX - This only works because at the start of the game we know player's starting city exists
pCity = pPlayer.getCity(0)
pSystem = self.getSystemAt(pCity.getX(), pCity.getY())
[COLOR="Red"]# New Earth gets extra population when city built
iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_NEW_EARTH')
if (pPlayer.hasTrait(iTrait)):
if not ('.CivBeyondSwordWBSave' in CyMap().getMapScriptName()): #Added to stop New Earth from getting 3 population when loading a scenario, pop is stored there anyway
pCity.changePopulation(1)
# Paradise gets free Mag-Lev on every planet
iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_PARADISE')
if (pPlayer.hasTrait(iTrait)):
iBuildingMagLev = gc.getCivilizationInfo(pPlayer.getCivilizationType()).getCivilizationBuildings(CvUtil.findInfoTypeNum(gc.getBuildingClassInfo, gc.getNumBuildingClassInfos(), "BUILDINGCLASS_MAG_LEV_NETWORK")) # this civ's mag lev network
for iPlanetLoop in range(pSystem.getNumPlanets()):
pPlanet = pSystem.getPlanetByIndex(iPlanetLoop)
pPlanet.setHasBuilding(iBuildingMagLev, true)
pCity.setNumRealBuilding(iBuildingMagLev, pSystem.getNumPlanets())
# Red Syndicate gets 1 free trade routes when city built
iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_SYNDICATE')
if (pPlayer.hasTrait(iTrait)):
pCity.changeExtraTradeRoutes(1)
# Halis's unique unit is of the unitclass that the free starting ship is, so swap out
# the starting planetary defense ship for a system defense boat
iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_HALIS')
if (pPlayer.hasTrait(iTrait)):
iPlanetDefShip = CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_PLANETARY_DEFENSE_I')
iSysDefBoat = CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_SYSTEM_DEFENSE_BOAT_I')
pyPlayer = PyPlayer(iPlayerLoop)
apUnitList = pyPlayer.getUnitList()
pUnitToKill = -1
for pUnitLoop in apUnitList:
if (pUnitLoop.getUnitType() == iPlanetDefShip):
# flag the unit for removal (don't modify the list when we are looping through it)
pUnitToKill = pUnitLoop
printd("Found unit to kill, id = %d" %(pUnitToKill.getID()))
# kill the unit that was flagged (if one was) and add the replacement unit
if (pUnitToKill != -1):
pUnitToKill.kill(false, -1)
#add a system defense boat
pPlayer.initUnit(iSysDefBoat, pCity.getX(), pCity.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION)[/COLOR]
# Set up Player stuff: Star Systems & Gold
for iPlayerLoop in range(gc.getMAX_CIV_PLAYERS()):
If you have no civs with UUs that should replace the starting unit(s) supplied by the map script and will never add any you can just remove all the stuff that is in red.
Otherwise, remove all the stuff in red and put this in instead:
(OK, at this point I have to warn you that I have not actually tested this piece of code - it should be doing what the comments indicate. It is the same general idea as the existing code for TRAIT_HALIS at the end of the stuff-to-be-removed, but run as a check for everybody instead of being hardcoded for players with a specific trait.)
Code:
# Check the player for unique units, swapping out the starting ship(s) for the player's UU if appropriate
pCivilization = gc.getCivilizationInfo(pPlayer.getCivilizationType())
pyPlayer = PyPlayer(iPlayerLoop)
apUnitList = pyPlayer.getUnitList()
for pUnitLoop in apUnitList :
iUnitType = pUnitLoop.getUnitType() # this unit's unit type
iUnitClass = pUnitLoop.getUnitClassType() # this unit's unit class
iCivUnitType = pCivilization.getCivilizationUnits(iUnitClass) # this civ's unit type of this class
if (iUnitType != iCivUnitType ):
# existing unit's type does not match this civ's unit for the unit's class
printd("Found unit to swap: id = %d, from type = %d to type = %d" %(pUnitLoop.getID(), iUnitType, iCivUnitType))
# add new unit
pNewUnit = pPlayer.initUnit(iCivUnitType, pCity.getX(), pCity.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION)
# remove old unit
pUnitLoop.kill(false, -1)
Shortly after that in the same function you should also remove all of this:
Code:
# Paradise starts with 10x normal amount of gold
iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_PARADISE')
if (pPlayer.hasTrait(iTrait)):
pPlayer.setGold(pPlayer.getGold() * 10)
In the same file, in updatePlotYield remove all of this:
Code:
# The Forge get's 1 fewer food in all cities
iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_THE_FORGE')
if (pPlayer.hasTrait(iTrait)):
aiSystemYield[0] -= 1
# if (pCity.isCapital()):
# aiSystemYield[1] += 1
# else:
# aiSystemYield[1] += 1
# Red Syndicate gets +1 food and production for each Trade Route
iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_SYNDICATE')
if (pPlayer.hasTrait(iTrait)):
for iTradeCity in range (pCity.getTradeRoutes()):
pTradeCity = pCity.getTradeCity(iTradeCity)
# printd("Trade city object:")
# printd(pTradeCity)
if (pTradeCity):
if (pTradeCity.getName() != ""):
# printd("entering trade route additions")
aiSystemYield[0] += 1
aiSystemYield[1] += 1
Still in the same file, in onCityBuilt remove all of this:
Code:
# New Earth gets extra population when city built
iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_NEW_EARTH')
if (pPlayer.hasTrait(iTrait)):
pCity.changePopulation(1)
# Paradise gets free Mag-Lev on every planet
iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_PARADISE')
if (pPlayer.hasTrait(iTrait)):
iBuildingMagLev = gc.getCivilizationInfo(pPlayer.getCivilizationType()).getCivilizationBuildings(CvUtil.findInfoTypeNum(gc.getBuildingClassInfo, gc.getNumBuildingClassInfos(), "BUILDINGCLASS_MAG_LEV_NETWORK")) # this civ's mag lev network
for iPlanetLoop in range(pSystem.getNumPlanets()):
pPlanet = pSystem.getPlanetByIndex(iPlanetLoop)
pPlanet.setHasBuilding(iBuildingMagLev, true)
pCity.setNumRealBuilding(iBuildingMagLev, pSystem.getNumPlanets())
# Red Syndicate gets 1 free trade route when city built
iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_SYNDICATE')
if (pPlayer.hasTrait(iTrait)):
pCity.changeExtraTradeRoutes(1)
Also in the same file, in onUnitBuilt remove this:
Code:
iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_BROTHERHOOD')
if (pPlayer.hasTrait(iTrait)):
pUnit.changeExperience(4, 100, false, false, false)
And one more thing in the same file, in the onCityAcquired function remove this:
Code:
# Red Syndicate gets 1 free trade route in captured cities
iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_SYNDICATE')
if (pPlayer.hasTrait(iTrait)):
if (pCity.getExtraTradeRoutes() < 1):
pCity.changeExtraTradeRoutes(1)
# Paradise gets free Mag-Lev on every planet
iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_PARADISE')
if (pPlayer.hasTrait(iTrait)):
iBuildingMagLev = gc.getCivilizationInfo(pPlayer.getCivilizationType()).getCivilizationBuildings(CvUtil.findInfoTypeNum(gc.getBuildingClassInfo, gc.getNumBuildingClassInfos(), "BUILDINGCLASS_MAG_LEV_NETWORK")) # this civ's mag lev network
for iPlanetLoop in range(pSystem.getNumPlanets()):
pPlanet = pSystem.getPlanetByIndex(iPlanetLoop)
pPlanet.setHasBuilding(iBuildingMagLev, true)
pCity.setNumRealBuilding(iBuildingMagLev, pSystem.getNumPlanets())
That should be everything in that file.
There is also one trait-specific thing in CvSolarSystem.py in the getExtraYield function remove the lines in red:
Code:
def getExtraYield(self, iOwner, iYieldID):
pPlayer = gc.getPlayer(iOwner)
iExtraYield = 0
[COLOR="Red"]iTrait = gc.getInfoTypeForString('TRAIT_THE_FORGE')
iBuildingMiningFacility = gc.getInfoTypeForString('BUILDING_MINING_FACILITY')[/COLOR]
#Yields from buildings (XML tags can be used, except for the Forge trait providing extra for the mining facility)
for iBuildingLoop in range(gc.getNumBuildingInfos()):
if (self.isHasBuilding(iBuildingLoop)):
iYieldChange = gc.getBuildingInfo(iBuildingLoop).getPlanetYieldChanges(iYieldID)
iExtraYield += iYieldChange
[COLOR="Red"]# Production boost for the Forge's Mining Facilities & Capital
if (iYieldID == 1):
if (pPlayer.hasTrait(iTrait)):
if (iBuildingLoop == iBuildingMiningFacility):
iExtraYield += 1[/COLOR]
#Yields from civics (again, XML tags can be used)
for iCivicOption in range(gc.getNumCivicOptionInfos()):
for iCivic in range(gc.getNumCivicInfos()):
if pPlayer.getCivics(iCivicOption) == iCivic:
iYieldChange = gc.getCivicInfo(iCivic).getPlanetYieldChanges(iYieldID)
iExtraYield += iYieldChange
# CP - add golden age effect, thanks for the idea of doing it here go to TC01
if pPlayer.isGoldenAge():
if (self.getBaseYield(iYieldID) + iExtraYield) >= gc.getYieldInfo(iYieldID).getGoldenAgeYieldThreshold() :
iExtraYield += gc.getYieldInfo(iYieldID).getGoldenAgeYield()
return iExtraYield
This should remove every effect caused by traits in the Python.
There are still references to buildings, units, and unit classes in a bunch of places.