graywarden
King
- Joined
- Dec 6, 2007
- Messages
- 819
Yay! Testing phase! and ghost units!Can I do a beta testing as well?
![]()
Hi Gray,
I'm back and fully operative now.
Do you see ghostly slinger in civilopedia also?
CyInterface().addImmediateMessage("You recieved 20 gold by plundering!","")
CyInterface().addMessage(pWinner.getOwner(),True,15,localText.getText("TXT_KEY_EVENT_PLUNDER_MERCHANT_VESSEL",()),'AS2D_BUILD_BANK',0,'',gc.getInfoTypeForString("COLOR_GREEN"),-1,-1,false,false)
self.removeWeaponPromotions(objUnit)
# CyInterface().addMessage(pUnit.getOwner(),True,25,'An enemy Treant has appeared in the Ancient Forest.','AS2D_FEATUREGROWTH',1,'Art/Interface/Buttons/Units/Treant.dds',ColorTypes(8),newUnit.getX(),newUnit.getY(),True,True)
# If the city is connected to iron and coal then give the new unit the steel weapons promotion
if(objCity.hasBonus(gc.getInfoTypeForString("BONUS_IRON")) and objCity.hasBonus(gc.getInfoTypeForString("BONUS_TIMBER")) and team.isHasTech(gc.getInfoTypeForString("TECH_STEEL"))):
objUnit.setHasPromotion(gc.getInfoTypeForString("PROMOTION_STEEL_WEAPONS"), True)
##CyInterface().addImmediateMessage("Your unit has been re-outfitted with Steel weapons!","")
CyInterface().addMessage(objUnit.getOwner(),True,25,'Your unit has been re-outfitted with Steel weapons!','AS2D_FEATUREGROWTH',1,'Art/Interface/Buttons/Promotions/weapons_steel.dds',ColorTypes(8),objUnit.getX(),objUnit.getY(),True,True)
# If the city is connected to iron then give the new unit the iron weapons promotion
elif(objCity.hasBonus(gc.getInfoTypeForString("BONUS_IRON"))):
objUnit.setHasPromotion(gc.getInfoTypeForString("PROMOTION_IRON_WEAPONS"), True)
CyInterface().addMessage(objUnit.getOwner(),True,25,'Your unit has been re-outfitted with Iron weapons!','AS2D_FEATUREGROWTH',1,'Art/Interface/Buttons/Promotions/weapons_iron.dds',ColorTypes(8),objUnit.getX(),objUnit.getY(),True,True)
# If the city is connected to copper and tin then give the new unit the bronze weapons promotion
elif(objCity.hasBonus(gc.getInfoTypeForString("BONUS_COPPER")) and objCity.hasBonus(gc.getInfoTypeForString("BONUS_TIN")) ):
objUnit.setHasPromotion(gc.getInfoTypeForString("PROMOTION_BRONZE_WEAPONS"), True)
CyInterface().addMessage(objUnit.getOwner(),True,25,'Your unit has been re-outfitted with Bronze weapons!','AS2D_FEATUREGROWTH',1,'Art/Interface/Buttons/Promotions/weapons_bronze.dds',ColorTypes(8),objUnit.getX(),objUnit.getY(),True,True)
# If the city is connected to copper then give the new unit the copper weapons promotion
elif(objCity.hasBonus(gc.getInfoTypeForString("BONUS_COPPER"))):
objUnit.setHasPromotion(gc.getInfoTypeForString("PROMOTION_COPPER_WEAPONS"), True)
CyInterface().addMessage(objUnit.getOwner(),True,25,'Your unit has been re-outfitted with Copper weapons!','AS2D_FEATUREGROWTH',1,'Art/Interface/Buttons/Promotions/weapons_copper.dds',ColorTypes(8),objUnit.getX(),objUnit.getY(),True,True)
if(objUnit.isHasPromotion(gc.getInfoTypeForString("PROMOTION_STEEL_WEAPONS"))):
iWeaponType = 4
elif(objUnit.isHasPromotion(gc.getInfoTypeForString("PROMOTION_IRON_WEAPONS"))):
iWeaponType = 3
elif(objUnit.isHasPromotion(gc.getInfoTypeForString("PROMOTION_BRONZE_WEAPONS"))):
iWeaponType = 2
elif(objUnit.isHasPromotion(gc.getInfoTypeForString("PROMOTION_COPPER_WEAPONS"))):
iWeaponType = 1
else:
iWeaponType = 0
# If the city is connected to iron and timber then give the new unit the steel weapons promotion
if(objCity.hasBonus(gc.getInfoTypeForString("BONUS_IRON")) and objCity.hasBonus(gc.getInfoTypeForString("BONUS_TIMBER")) and team.isHasTech(gc.getInfoTypeForString("TECH_STEEL"))):
if(iWeaponType < 4):
self.removeWeaponPromotions(objUnit)
objUnit.setHasPromotion(gc.getInfoTypeForString("PROMOTION_STEEL_WEAPONS"), True)
CyInterface().addMessage(objUnit.getOwner(),True,20,localText.getText("TXT_KEY_EVENT_PROMOTION_STEEL_WEAPONS", ()),'AS2D_BUILD_FORGE',1,'Art/Interface/Buttons/Promotions/weapons_steel.dds',gc.getInfoTypeForString("COLOR_LIGHT_GREY"),objUnit.getX(),objUnit.getY(),True,True)
# If the city is connected to iron then give the new unit the iron weapons promotion
elif(objCity.hasBonus(gc.getInfoTypeForString("BONUS_IRON"))):
if(iWeaponType < 3):
self.removeWeaponPromotions(objUnit)
objUnit.setHasPromotion(gc.getInfoTypeForString("PROMOTION_IRON_WEAPONS"), True)
CyInterface().addMessage(objUnit.getOwner(),True,20,localText.getText("TXT_KEY_EVENT_PROMOTION_IRON_WEAPONS", ()),'AS2D_BUILD_FORGE',1,'Art/Interface/Buttons/Promotions/weapons_iron.dds',gc.getInfoTypeForString("COLOR_LIGHT_GREY"),objUnit.getX(),objUnit.getY(),True,True)
# If the city is connected to copper and tin then give the new unit the bronze weapons promotion
elif(objCity.hasBonus(gc.getInfoTypeForString("BONUS_COPPER")) and objCity.hasBonus(gc.getInfoTypeForString("BONUS_TIN")) ):
if(iWeaponType < 2):
self.removeWeaponPromotions(objUnit)
objUnit.setHasPromotion(gc.getInfoTypeForString("PROMOTION_BRONZE_WEAPONS"), True)
CyInterface().addMessage(objUnit.getOwner(),True,20,localText.getText("TXT_KEY_EVENT_PROMOTION_BRONZE_WEAPONS", ()),'AS2D_BUILD_FORGE',1,'Art/Interface/Buttons/Promotions/weapons_bronze.dds',gc.getInfoTypeForString("COLOR_LIGHT_GREY"),objUnit.getX(),objUnit.getY(),True,True)
# If the city is connected to copper then give the new unit the copper weapons promotion
elif(objCity.hasBonus(gc.getInfoTypeForString("BONUS_COPPER"))):
if(iWeaponType < 1):
self.removeWeaponPromotions(objUnit)
objUnit.setHasPromotion(gc.getInfoTypeForString("PROMOTION_COPPER_WEAPONS"), True)
CyInterface().addMessage(objUnit.getOwner(),True,20,localText.getText("TXT_KEY_EVENT_PROMOTION_COPPER_WEAPONS", ()),'AS2D_BUILD_FORGE',1,'Art/Interface/Buttons/Promotions/weapons_copper.dds',gc.getInfoTypeForString("COLOR_LIGHT_GREY"),objUnit.getX(),objUnit.getY(),True,True)
1/ Maybe this feature should be restricted to cities of the same team?
2/Is it normal? I wonder because I saw in python a condition "iscoastal" in comment
3/ Sometimes, when I raze a city, I get a "can't find type enum for type tag EVENTTRIGGER_PARTISANS" error
solutions:
- remove code related to partisan in cvEventManager.py (onCityRazed)
ok I'll send you a PM soon
Anothers issues:
1/ Weapon promotion again
Units can gain these promotions in any cities even those which belong to another civilizations. Maybe this feature should be restricted to cities of the same team?
2/ I see that players with seafaring trait gain a free building in all their cities even those which aren't connected to water. Is it normal? I wonder because I saw in python a condition "iscoastal" in comment
3/ Sometimes, when I raze a city, I get a "can't find type enum for type tag EVENTTRIGGER_PARTISANS" error
Two solutions:
- remove code related to partisan in cvEventManager.py (onCityRazed)
- add tags EVENT_PARTISANS_1 + EVENT_PARTISANS_2 in CIV4EventInfos.xml and EVENTTRIGGER_PARTISANS in CIV4EventTriggerInfos.xml (and modify the civic requirement in this last tag because CIVIC_EMANCIPATION doesn't exist in TAM)
Actually I already did the modifications for my own use1 -> yes
2 -> no (I don't know why "iscoastal" is in comment - may be it doesn't work?)
3 -> I prefer the quoted solution above
Are you able to fix the python issues above?
Regarding the seafaring free building, what about captured cities? Maybe a coastal city captured by a player with seafaring trait could gain the seafaring building (and on the contrary, a city captured by a player without the seafaring trait could lose this free building)?
And, for change, in the file TAM_GameText_Objects_BTS.xml:
TXT_KEY_CIV_BABYLON_DESC, TXT_KEY_CIV_BABYLON_SHORT_DESC and TXT_KEY_CIV_BABYLON_ADJECTIVE tags already exist in Civ_Babylon.xml
The following tags seem useless. I put the tag really used in brackets:
TXT_KEY_UNIT_BABYLON_BOWMAN (TXT_KEY_UNIT_BABYLONIAN_ARCHER in TAM_Units_UnitCombats.xml)
TXT_KEY_BUILDING_BABYLON_GARDEN (TXT_KEY_BUILDING_BABYLON_GARDEN_TAM in TAM_Buildings_Wonders_Projects.xml )
TXT_KEY_LEADER_HAMMURABI (TXT_KEY_LEADER_BABYLON in Civ_Babylon.xml)
TXT_KEY_LEADER_DARIUS (TXT_KEY_LEADER_PERSIA in Civ_Persia.xml)
TXT_KEY_LEADER_BOUDICA (TXT_KEY_LEADER_BRITONS in Civ_Britons.xml)
TXT_KEY_BUILDING_MAUSOLEUM_OF_MAUSSOLLOS (TXT_KEY_BUILDING_MAUSOLOS in TAM_Buildings_Wonders_Projects.xml)
TXT_KEY_BUILDING_STATUE_OF_ZEUS (TXT_KEY_BUILDING_PARTHENON_ZEUS in TAM_Buildings_Wonders_Projects.xml)
1234: Hiram of Phoenicia [Annd] (trade) (rel)-Urbanization (9)
1111: Viriato of Iberian Tribe [Plsd] (trade) (rel)-Mathematics (4)
if (not CyInterface().isFlashingPlayer(ePlayer) or CyInterface().shouldFlash(ePlayer)):
if (ePlayer == gc.getGame().getActivePlayer()):
szTempBuffer = u"%d: [<color=%d,%d,%d,%d>%s</color>]" %(gc.getGame().getPlayerScore(ePlayer), gc.getPlayer(ePlayer).getPlayerTextColorR(), gc.getPlayer(ePlayer).getPlayerTextColorG(), gc.getPlayer(ePlayer).getPlayerTextColorB(), gc.getPlayer(ePlayer).getPlayerTextColorA(), gc.getPlayer(ePlayer).getName())
else:
szTempBuffer = u"%d: <color=%d,%d,%d,%d>%s</color>" %(gc.getGame().getPlayerScore(ePlayer), gc.getPlayer(ePlayer).getPlayerTextColorR(), gc.getPlayer(ePlayer).getPlayerTextColorG(), gc.getPlayer(ePlayer).getPlayerTextColorB(), gc.getPlayer(ePlayer).getPlayerTextColorA(), gc.getPlayer(ePlayer).getName())
else:
szTempBuffer = u"%d: %s" %(gc.getGame().getPlayerScore(ePlayer), gc.getPlayer(ePlayer).getName())
szBuffer = szBuffer + szTempBuffer
szTempName = gc.getPlayer(ePlayer).getName() + " of " + gc.getPlayer(ePlayer).getCivilizationShortDescription(0)
if (not CyInterface().isFlashingPlayer(ePlayer) or CyInterface().shouldFlash(ePlayer)):
if (ePlayer == gc.getGame().getActivePlayer()):
szTempBuffer = u"%d: [<color=%d,%d,%d,%d>%s</color>]" %(gc.getGame().getPlayerScore(ePlayer), gc.getPlayer(ePlayer).getPlayerTextColorR(), gc.getPlayer(ePlayer).getPlayerTextColorG(), gc.getPlayer(ePlayer).getPlayerTextColorB(), gc.getPlayer(ePlayer).getPlayerTextColorA(), szTempName)
else:
szTempBuffer = u"%d: <color=%d,%d,%d,%d>%s</color>" %(gc.getGame().getPlayerScore(ePlayer), gc.getPlayer(ePlayer).getPlayerTextColorR(), gc.getPlayer(ePlayer).getPlayerTextColorG(), gc.getPlayer(ePlayer).getPlayerTextColorB(), gc.getPlayer(ePlayer).getPlayerTextColorA(), szTempName)
else:
szTempBuffer = u"%d: %s" %(gc.getGame().getPlayerScore(ePlayer), szTempName)
szBuffer = szBuffer + szTempBuffer
if (gc.getTeam(eTeam).isAlive()):
if ( not (gc.getTeam(gc.getGame().getActiveTeam()).isHasMet(eTeam)) ):
szBuffer = szBuffer + (" ?")
if (gc.getTeam(eTeam).isAtWar(gc.getGame().getActiveTeam())):
szBuffer = szBuffer + "(" + localText.getColorText("TXT_KEY_CONCEPT_WAR", (), gc.getInfoTypeForString("COLOR_RED")).upper() + ")"
#attitude
if not gc.getPlayer(ePlayer).isHuman():
iAtt = gc.getPlayer(ePlayer).AI_getAttitude(gc.getGame().getActivePlayer())
if iAtt == 0:
iAttWord = localText.getColorText("Furs", (), gc.getInfoTypeForString("COLOR_RED"))
elif iAtt == 1:
iAttWord = localText.getColorText("Annd", (), gc.getInfoTypeForString("COLOR_PLAYER_DARK_CYAN"))
elif iAtt == 2:
iAttWord = localText.getColorText("Caus", (), gc.getInfoTypeForString("COLOR_LIGHT_GREY"))
elif iAtt == 3:
iAttWord = localText.getColorText("Plsd", (), gc.getInfoTypeForString("COLOR_YELLOW"))
else:
iAttWord = localText.getColorText("Frnd", (), gc.getInfoTypeForString("COLOR_GREEN"))
szTempBuffer = " [" + iAttWord + "] "
szBuffer = szBuffer + szTempBuffer
#attitude end