Hi, In a mod I am using the shielding from Next War mod. When the shielding buildings are present in a city with other buildings like World Trade Center, Communication Satellties, Radar Station and other tall buildings the sheilding size goes absolutely huge. Going nearly 10times the normal size in with Radar Station present.
Ive taken this python coding from NextWar and added to BuG folders and files.
NeotericWorld.py
Neoteric World.xml inside Config folder
Init.xml inside config folder
OnGameStart is the AlwaysWar mod by The_J and is working. The rest does not seem to be working? Does this code even negate the shielding resizing?
Spoiler the crazy image :
Ive taken this python coding from NextWar and added to BuG folders and files.
NeotericWorld.py
Code:
# NeotericWorld
from CvPythonExtensions import *
import BugUtil
gc = CyGlobalContext()
def onGameStart(argsList):
'Called at the start of the game'
if gc.getGame().isOption(GameOptionTypes.GAMEOPTION_ALWAYS_WAR):
for i in xrange(gc.getMAX_CIV_TEAMS ()):
FirstTeam = gc.getTeam(i)
if FirstTeam.isHuman():continue
for j in xrange(gc.getMAX_CIV_TEAMS ()):
SecondTeam = gc.getTeam(j)
if SecondTeam.isHuman():continue
if i==j:continue
FirstTeam.declareWar(j,False,WarPlanTypes.WARPLAN_TOTAL)
FirstTeam.setPermanentWarPeace(j,True)
SecondTeam.declareWar(i,False,WarPlanTypes.WARPLAN_TOTAL)
SecondTeam.setPermanentWarPeace(i,True)
def onBuildingBuilt(rgsList):
'Building Completed'
pCity, iBuildingType = argsList
game = gc.getGame()
if ((not gc.getGame().isNetworkMultiPlayer()) and (pCity.getOwner() == gc.getGame().getActivePlayer()) and isWorldWonderClass(gc.getBuildingInfo(iBuildingType).getBuildingClassType())):
# If this is a wonder...
popupInfo = CyPopupInfo()
popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON_SCREEN)
popupInfo.setData1(iBuildingType)
popupInfo.setData2(pCity.getID())
popupInfo.setData3(0)
popupInfo.setText(u"showWonderMovie")
popupInfo.addPopup(pCity.getOwner())
CvAdvisorUtils.buildingBuiltFeats(pCity, iBuildingType)
if iBuildingType == CvUtil.findInfoTypeNum(gc.getBuildingInfo, gc.getNumBuildingInfos(), "BUILDING_ARCOLOGY_SHIELDING"):
pCity.setNumRealBuilding(CvUtil.findInfoTypeNum(gc.getBuildingInfo, gc.getNumBuildingInfos(), "BUILDING_ARCOLOGY"), False)
elif iBuildingType == CvUtil.findInfoTypeNum(gc.getBuildingInfo, gc.getNumBuildingInfos(), "BUILDING_DEFLECTOR_SHIELDING"):
pCity.setNumRealBuilding(CvUtil.findInfoTypeNum(gc.getBuildingInfo, gc.getNumBuildingInfos(), "BUILDING_ARCOLOGY_SHIELDING"), False)
if (not self.__LOG_BUILDING):
return
CvUtil.pyPrint('%s was finished by Player %d Civilization %s'
%(PyInfo.BuildingInfo(iBuildingType).getDescription(), pCity.getOwner(), gc.getPlayer(pCity.getOwner()).getCivilizationDescription(0)))
def onCityRazed(self, argsList):
'City Razed'
city, iPlayer = argsList
iOwner = city.findHighestCulture()
# Partisans!
if city.getPopulation > 1 and iOwner != -1 and iPlayer != -1:
owner = gc.getPlayer(iOwner)
if not owner.isBarbarian() and owner.getNumCities() > 0:
if gc.getTeam(owner.getTeam()).isAtWar(gc.getPlayer(iPlayer).getTeam()):
if gc.getNumEventTriggerInfos() > 0: # prevents mods that don't have events from getting an error
iEvent = CvUtil.findInfoTypeNum(gc.getEventTriggerInfo, gc.getNumEventTriggerInfos(),'EVENTTRIGGER_PARTISANS')
if iEvent != -1 and gc.getGame().isEventActive(iEvent) and owner.getEventTriggerWeight(iEvent) < 0:
triggerData = owner.initTriggeredData(iEvent, true, -1, city.getX(), city.getY(), iPlayer, city.getID(), -1, -1, -1, -1)
#Raze the Arcology
owner = PyPlayer(city.getOwner())
razor = PyPlayer(iPlayer)
self.iArcologyCityID = -1
if city.getNumRealBuilding(gc.getInfoTypeForString("BUILDING_ARCOLOGY")) or city.getNumRealBuilding(gc.getInfoTypeForString("BUILDING_ARCOLOGY_SHIELDING")) or city.getNumRealBuilding(gc.getInfoTypeForString("BUILDING_DEFLECTOR_SHIELDING")):
self.iArcologyCityID = city.getID()
CvUtil.pyPrint('Player %d Civilization %s City %s was razed by Player %d'
%(owner.getID(), owner.getCivilizationName(), city.getName(), razor.getID()))
CvUtil.pyPrint("City Razed Event: %s" %(city.getName(),))
def onCityLost(argsList):
'City Lost'
city = argsList[0]
player = PyPlayer(city.getOwner())
if city.getID() == self.iArcologyCityID:
city.plot().setImprovementType(gc.getInfoTypeForString("IMPROVEMENT_CITY_RUINS_ARCOLOGY"))
if (not self.__LOG_CITYLOST):
return
CvUtil.pyPrint('City %s was lost by Player %d Civilization %s'
%(city.getName(), player.getID(), player.getCivilizationName()))
def cannotConstruct(argsList):
pCity = argsList[0]
eBuilding = argsList[1]
bContinue = argsList[2]
bTestVisible = argsList[3]
bIgnoreCost = argsList[4]
# player can't build an arcology if they have shielding or advanced shielding
if eBuilding == gc.getInfoTypeForString("BUILDING_ARCOLOGY"):
if pCity.getNumRealBuilding(gc.getInfoTypeForString("BUILDING_ARCOLOGY_SHIELDING")) or pCity.getNumRealBuilding(gc.getInfoTypeForString("BUILDING_DEFLECTOR_SHIELDING")):
return True
# player can't build shielding if they have advanced
if eBuilding == gc.getInfoTypeForString("BUILDING_ARCOLOGY_SHIELDING"):
if pCity.getNumRealBuilding(gc.getInfoTypeForString("BUILDING_DEFLECTOR_SHIELDING")):
return True
return False
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!--
NeotericWorld - Code for Arcology Shielding, Always War
-->
<mod id="NeotericWorld" module="NeotericWorld">
<event type="GameStart" function="onGameStart"/>
<event type="BuildingBuilt" function="onBuildingBuilt"/>
<event type="CityRazed" function="onCityRazed"/>
<event type="CityLost" function="onCityLost"/>
<gameutils/>
</mod>
Init.xml inside config folder
Code:
<bug>
....
[/screen]
<load mod="Neoteric World"/>
</bug>
OnGameStart is the AlwaysWar mod by The_J and is working. The rest does not seem to be working? Does this code even negate the shielding resizing?