C2C Pedia

Joined
Jul 5, 2004
Messages
23,562
Location
Canberra, Australia
This is about what pages and what should appear on the pages in the pedia not the individual contents of the page. It is about, for example, what appears on the Building Page not what appears in the entry for the Palace.

I am currently working on a new page for Routes and Cultures. The latter will take the information about C2C Cultures out of the Great Wonder and resources pages. I have already split the Bonuses page into Map Bonuses and Other Bonuses.

What I have not done is go through each page and figured out what needs to be added or changed due to the nature of C2C.

Vicinity resources could be shown better for instance.

Any ideas on changes you think should be made to the Pedia pages?

Status
  • Routes waiting for some dll work
  • Merging of culture building and resource into one page - is this even a good idea?
  • manufactured and culture bonuses need a list of buildings that provide the bonus. It should probably replace the Yield box currently on that page.
  • show work rate for the worker units.

Reported Bugs
  • if terrains are required the wrong icon is being displayed
  • Vicinity bonuses are not showing up in the Required box.
  • units (and others?) with dependencies defined using the "expression system" may not show up in the pedia.
 
Do you mean like how if something requires grassland or plains in the city vicinity it will not give the correct icon/buttons for terrain but give you like a Stone Worker's Camp icon/button instead?

Yes that is the sort of thing I am talking about. I noticed the terrain icon error.

I still need help properly displaying all unit combats (combat and subcombats tags) that start on a given unit in the unit pedia page.

How many are they likely to have. Currently they just have the one and it is displayed up with the icon.
 
There's no limit and the debate over how many they should have is still up in the air. But I'm thinking they'd probably have up to 7 at most. And that would only be under the full Combat Mod application.

And the problem is that currently they only CAN show the one even though at this time, the mod does have units with more than one Combat Class (ex: Rogue: <Combat>UNIT_COMBAT_MELEE</Combat>, <SubCombatTypes><SubCombatType>UNIT_COMBAT_CRIMINAL</SubCombatType></SubCombatTypes>). The SubCombatClasses as programmed on the units don't show there despite being pretty much equal in all ways to the primary combat class - that tag does still exist on units - I didn't want to remove it because I can see how it could be possible that having a defined 'primary' combat class may be useful for further programming down the road. So in the example, the Rogue doesn't currently display anything about being a Criminal CC in the pedia.

This has led to confusion for players wondering what kinds of units the Canine's Anti-Criminal promos would actually have an impact on. Obviously, this toe dip into the pool of SubCombat application has quickly shown the pedia to require an update before we can really open up the development floodgates in this arena.
 
The pedia gets all its information from the dll and displays everything through the graphics engine (simplified I know:D).

So are sub_combat classes exposed to Python, ie can I get at them. I assume they are just combat_calsses so that once I know them I can ask the combat_class for their icons etc.
 
So are sub_combat classes exposed to Python, ie can I get at them.
Yes. I'm not entirely sure how to call things like this in Python but I can (and did) report it ;)

In CyInfoInterface1:
Code:
	python::class_<CvUnitInfo, python::bases<CvInfoBase, CvScalableInfo> >("CvUnitInfo")

		.def("getAIWeight", &CvUnitInfo::getAIWeight, "int ()")
		.def("getProductionCost", &CvUnitInfo::getProductionCost, "int ()")
		.def("getHurryCostModifier", &CvUnitInfo::getHurryCostModifier, "int ()")
		.def("getMinAreaSize", &CvUnitInfo::getMinAreaSize, "int ()")
		.def("getMoves", &CvUnitInfo::getMoves, "int ()")
		.def("getAirRange", &CvUnitInfo::getAirRange, "int ()")
		.def("getAirUnitCap", &CvUnitInfo::getAirUnitCap, "int ()")
		.def("getDropRange", &CvUnitInfo::getDropRange, "int ()")
		.def("getNukeRange", &CvUnitInfo::getNukeRange, "int ()")
		.def("getWorkRate", &CvUnitInfo::getWorkRate, "int ()")
		.def("getBaseDiscover", &CvUnitInfo::getBaseDiscover, "int ()")
		.def("getDiscoverMultiplier", &CvUnitInfo::getDiscoverMultiplier, "int ()")
		.def("getBaseHurry", &CvUnitInfo::getBaseHurry, "int ()")
		.def("getHurryMultiplier", &CvUnitInfo::getHurryMultiplier, "int ()")
		.def("getBaseTrade", &CvUnitInfo::getBaseTrade, "int ()")
		.def("getTradeMultiplier", &CvUnitInfo::getTradeMultiplier, "int ()")
		.def("getGreatWorkCulture", &CvUnitInfo::getGreatWorkCulture, "int ()")
		.def("getEspionagePoints", &CvUnitInfo::getEspionagePoints, "int ()")
		.def("getCombat", &CvUnitInfo::getCombat, "int ()")
		.def("setCombat", &CvUnitInfo::setCombat, "void (int)")
		.def("getCombatLimit", &CvUnitInfo::getCombatLimit, "int ()")
		.def("getAirCombat", &CvUnitInfo::getAirCombat, "int ()")
		.def("getAirCombatLimit", &CvUnitInfo::getAirCombatLimit, "int ()")
		.def("getXPValueAttack", &CvUnitInfo::getXPValueAttack, "int ()")
		.def("getXPValueDefense", &CvUnitInfo::getXPValueDefense, "int ()")
		.def("getFirstStrikes", &CvUnitInfo::getFirstStrikes, "int ()")
		.def("getChanceFirstStrikes", &CvUnitInfo::getChanceFirstStrikes, "int ()")
		.def("getInterceptionProbability", &CvUnitInfo::getInterceptionProbability, "int ()")
		.def("getEvasionProbability", &CvUnitInfo::getEvasionProbability, "int ()")
		.def("getWithdrawalProbability", &CvUnitInfo::getWithdrawalProbability, "int ()")
		.def("getCollateralDamage", &CvUnitInfo::getCollateralDamage, "int ()")
		.def("getCollateralDamageLimit", &CvUnitInfo::getCollateralDamageLimit, "int ()")
		.def("getCollateralDamageMaxUnits", &CvUnitInfo::getCollateralDamageMaxUnits, "int ()")
		.def("getCityAttackModifier", &CvUnitInfo::getCityAttackModifier, "int ()")
		.def("getCityDefenseModifier", &CvUnitInfo::getCityDefenseModifier, "int ()")
		.def("getAnimalCombatModifier", &CvUnitInfo::getAnimalCombatModifier, "int ()")
		.def("getHillsAttackModifier", &CvUnitInfo::getHillsAttackModifier, "int ()")
		.def("getHillsDefenseModifier", &CvUnitInfo::getHillsDefenseModifier, "int ()")
		.def("getBombRate", &CvUnitInfo::getBombRate, "int ()")
		.def("getBombardRate", &CvUnitInfo::getBombardRate, "int ()")
		.def("getSpecialCargo", &CvUnitInfo::getSpecialCargo, "int ()")
		.def("getDomainCargo", &CvUnitInfo::getDomainCargo, "int ()")

		.def("getCargoSpace", &CvUnitInfo::getCargoSpace, "int ()")
		.def("getConscriptionValue", &CvUnitInfo::getConscriptionValue, "int ()")
		.def("getCultureGarrisonValue", &CvUnitInfo::getCultureGarrisonValue, "int ()")
		.def("getExtraCost", &CvUnitInfo::getExtraCost, "int ()")
		.def("getAssetValue", &CvUnitInfo::getAssetValue, "int ()")
		.def("getPowerValue", &CvUnitInfo::getPowerValue, "int ()")
		.def("getUnitClassType", &CvUnitInfo::getUnitClassType, "int ()")
		.def("getSpecialUnitType", &CvUnitInfo::getSpecialUnitType, "int ()")
		.def("getUnitCaptureClassType", &CvUnitInfo::getUnitCaptureClassType, "int ()")
		.def("getUnitCombatType", &CvUnitInfo::getUnitCombatType, "int ()")
		.def("getDomainType", &CvUnitInfo::getDomainType, "int ()")
		.def("getDefaultUnitAIType", &CvUnitInfo::getDefaultUnitAIType, "int ()")
		.def("getInvisibleType", &CvUnitInfo::getInvisibleType, "int ()")
		.def("getNumSeeInvisibleTypes", &CvUnitInfo::getNumSeeInvisibleTypes, "int ()")
		.def("getSeeInvisibleType", &CvUnitInfo::getSeeInvisibleType, "int (int)")
		.def("getAdvisorType", &CvUnitInfo::getAdvisorType, "int ()")
/************************************************************************************************/
/* REVDCM                                 02/16/10                                phungus420    */
/*                                                                                              */
/* CanTrain                                                                                     */
/************************************************************************************************/
		.def("getMaxStartEra", &CvUnitInfo::getMaxStartEra, "int ()")
		.def("getForceObsoleteTech", &CvUnitInfo::getForceObsoleteTech, "int ()")
		.def("isStateReligion", &CvUnitInfo::isStateReligion, "bool ()")
		.def("getPrereqGameOption", &CvUnitInfo::getPrereqGameOption, "int ()")
		.def("getNotGameOption", &CvUnitInfo::getNotGameOption, "int ()")
/************************************************************************************************/
/* REVDCM                                  END                                                  */
/************************************************************************************************/
		.def("getHolyCity", &CvUnitInfo::getHolyCity, "int ()")
		.def("getReligionType", &CvUnitInfo::getReligionType, "int ()")
		.def("getStateReligion", &CvUnitInfo::getStateReligion, "int ()")
		.def("getPrereqReligion", &CvUnitInfo::getPrereqReligion, "int ()")
		.def("getPrereqCorporation", &CvUnitInfo::getPrereqCorporation, "int ()")
		.def("getPrereqBuilding", &CvUnitInfo::getPrereqBuilding, "int ()")
		.def("getPrereqOrBuildingsNum", &CvUnitInfo::getPrereqOrBuildingsNum, "int ()")
		.def("getPrereqOrBuilding", &CvUnitInfo::getPrereqOrBuilding, "int (int)")
		.def("getPrereqAndTech", &CvUnitInfo::getPrereqAndTech, "int ()")
		.def("getPrereqAndBonus", &CvUnitInfo::getPrereqAndBonus, "int ()")
		.def("getGroupSize", &CvUnitInfo::getGroupSize, "int ()")
		.def("getGroupDefinitions", &CvUnitInfo::getGroupDefinitions, "int ()")
		.def("getMeleeWaveSize", &CvUnitInfo::getMeleeWaveSize, "int ()")
		.def("getRangedWaveSize", &CvUnitInfo::getRangedWaveSize, "int ()")
		.def("getNumUnitNames", &CvUnitInfo::getNumUnitNames, "int ()")
		.def("getCommandType", &CvUnitInfo::getCommandType, "int ()")

		.def("isAnimal", &CvUnitInfo::isAnimal, "bool ()")
		.def("isFoodProduction", &CvUnitInfo::isFoodProduction, "bool ()")
		.def("isNoBadGoodies", &CvUnitInfo::isNoBadGoodies, "bool ()")
/************************************************************************************************/
/* UNOFFICIAL_PATCH                       03/20/10                       Afforess & jdog5000    */
/*                                                                                              */
/* Bugfix                                                                                       */
/************************************************************************************************/
		.def("isOnlyDefensive", &CvUnitInfo::isOnlyDefensive, "bool ()")
/************************************************************************************************/
/* UNOFFICIAL_PATCH                        END                                                  */
/************************************************************************************************/
		.def("isNoCapture", &CvUnitInfo::isNoCapture, "bool ()")
		.def("isRivalTerritory", &CvUnitInfo::isRivalTerritory, "bool ()")
		.def("isMilitaryHappiness", &CvUnitInfo::isMilitaryHappiness, "bool ()")
		.def("isMilitarySupport", &CvUnitInfo::isMilitarySupport, "bool ()")
		.def("isMilitaryProduction", &CvUnitInfo::isMilitaryProduction, "bool ()")
		.def("isPillage", &CvUnitInfo::isPillage, "bool ()")
		.def("isSpy", &CvUnitInfo::isSpy, "bool ()")
		.def("isSabotage", &CvUnitInfo::isSabotage, "bool ()")
		.def("isDestroy", &CvUnitInfo::isDestroy, "bool ()")
		.def("isStealPlans", &CvUnitInfo::isStealPlans, "bool ()")
		.def("isInvestigate", &CvUnitInfo::isInvestigate, "bool ()")
		.def("isCounterSpy", &CvUnitInfo::isCounterSpy, "bool ()")
		.def("isFound", &CvUnitInfo::isFound, "bool ()")
		.def("isGoldenAge", &CvUnitInfo::isGoldenAge, "bool ()")
		.def("isInvisible", &CvUnitInfo::isInvisible, "bool ()")
		.def("setInvisible", &CvUnitInfo::setInvisible, "void (bool bEnable)")
		.def("isFirstStrikeImmune", &CvUnitInfo::isFirstStrikeImmune, "bool ()")
		.def("isNoDefensiveBonus", &CvUnitInfo::isNoDefensiveBonus, "bool ()")
		.def("isIgnoreBuildingDefense", &CvUnitInfo::isIgnoreBuildingDefense, "bool ()")
		.def("isCanMoveImpassable", &CvUnitInfo::isCanMoveImpassable, "bool ()")
		.def("isCanMoveAllTerrain", &CvUnitInfo::isCanMoveAllTerrain, "bool ()")
		.def("isFlatMovementCost", &CvUnitInfo::isFlatMovementCost, "bool ()")
		.def("isIgnoreTerrainCost", &CvUnitInfo::isIgnoreTerrainCost, "bool ()")
		.def("isNukeImmune", &CvUnitInfo::isNukeImmune, "bool ()")
/************************************************************************************************/
/* REVDCM_OC                              02/16/10                                phungus420    */
/*                                                                                              */
/* Inquisitions                                                                                 */
/************************************************************************************************/
		.def("isInquisitor", &CvUnitInfo::isInquisitor, "bool ()")
/************************************************************************************************/
/* REVDCM_OC                               END                                                  */
/************************************************************************************************/
		.def("isPrereqBonuses", &CvUnitInfo::isPrereqBonuses, "bool ()")
		.def("isPrereqReligion", &CvUnitInfo::isPrereqReligion, "bool ()")
		.def("isMechUnit", &CvUnitInfo::isMechUnit, "bool ()")
		.def("isRenderBelowWater", &CvUnitInfo::isRenderBelowWater, "bool ()")
		.def("isSuicide", &CvUnitInfo::isSuicide, "bool ()")
		.def("isLineOfSight", &CvUnitInfo::isLineOfSight, "bool ()")
		.def("isHiddenNationality", &CvUnitInfo::isHiddenNationality, "bool ()")
		.def("isAlwaysHostile", &CvUnitInfo::isAlwaysHostile, "bool ()")
/*****************************************************************************************************/
/**  Author: TheLadiesOgre                                                                          **/
/**  Date: 21.09.2009                                                                               **/
/**  ModComp: TLOTags                                                                               **/
/**  Reason Added: New Tag Definition                                                               **/
/**  Notes:                                                                                         **/
/*****************************************************************************************************/
		.def("isFreeDrop", &CvUnitInfo::isFreeDrop, "bool ()")
/*****************************************************************************************************/
/**  TheLadiesOgre; 21.09.2009; TLOTags                                                             **/
/*****************************************************************************************************/

/************************************************************************************************/
/* REVOLUTION_MOD                         01/01/08                                jdog5000      */
/*                                                                                              */
/*                                                                                              */
/************************************************************************************************/
		.def("isCanBeRebel", &CvUnitInfo::isCanBeRebel, "bool ()")
		.def("isCanRebelCapture", &CvUnitInfo::isCanRebelCapture, "bool ()")
		.def("isCannotDeffect", &CvUnitInfo::isCannotDefect, "bool ()")
		.def("isCanQuellRebellion", &CvUnitInfo::isCanQuellRebellion, "bool ()")
/************************************************************************************************/
/* REVOLUTION_MOD                          END                                                  */
/************************************************************************************************/

		.def("getUnitMaxSpeed", &CvUnitInfo::getUnitMaxSpeed, "float ()")
		.def("getUnitPadTime", &CvUnitInfo::getUnitPadTime, "float ()")
		
// BUG - Unit Experience - start
		.def("canAcquireExperience", &CvUnitInfo::canAcquireExperience, "int ()")
// BUG - Unit Experience - end

		// Arrays

		.def("getPrereqAndTechs", &CvUnitInfo::getPrereqAndTechs, "int (int i)")
		.def("getPrereqOrBonuses", &CvUnitInfo::getPrereqOrBonuses, "int (int i)")
		//.def("getProductionTraits", &CvUnitInfo::getProductionTraits, "int (int i)")
		.def("getFlavorValue", &CvUnitInfo::getFlavorValue, "int (int i)")
		.def("getTerrainAttackModifier", &CvUnitInfo::getTerrainAttackModifier, "int (int i)")
		.def("getTerrainDefenseModifier", &CvUnitInfo::getTerrainDefenseModifier, "int (int i)")
		.def("getFeatureAttackModifier", &CvUnitInfo::getFeatureAttackModifier, "int (int i)")
		.def("getFeatureDefenseModifier", &CvUnitInfo::getFeatureDefenseModifier, "int (int i)")
		.def("getUnitClassAttackModifier", &CvUnitInfo::getUnitClassAttackModifier, "int (int i)")
		.def("getUnitClassDefenseModifier", &CvUnitInfo::getUnitClassDefenseModifier, "int (int i)")
		.def("getUnitCombatModifier", &CvUnitInfo::getUnitCombatModifier, "int (int i)")
		.def("getDomainModifier", &CvUnitInfo::getDomainModifier, "int (int i)")
		.def("getBonusProductionModifier", &CvUnitInfo::getBonusProductionModifier, "int (int i)")
		.def("getUnitGroupRequired", &CvUnitInfo::getUnitGroupRequired, "int (int i)")
/************************************************************************************************/
/* REVDCM                                 02/16/10                                phungus420    */
/*                                                                                              */
/* CanTrain                                                                                     */
/************************************************************************************************/
		.def("isPrereqOrCivics", &CvUnitInfo::isPrereqOrCivics, "bool (int i)")
		.def("isPrereqBuildingClass", &CvUnitInfo::isPrereqBuildingClass, "bool (int i)")
		.def("getPrereqBuildingClassOverrideTech", &CvUnitInfo::getPrereqBuildingClassOverrideTech, "int (int i)")
		.def("getPrereqBuildingClassOverrideEra", &CvUnitInfo::getPrereqBuildingClassOverrideEra, "int (int i)")
		.def("getForceObsoleteUnitClass", &CvUnitInfo::getForceObsoleteUnitClass, "bool (int i)")
/************************************************************************************************/
/* REVDCM                                  END                                                  */
/************************************************************************************************/
		.def("getUpgradeUnitClass", &CvUnitInfo::getUpgradeUnitClass, "bool (int i)")
		.def("getTargetUnitClass", &CvUnitInfo::getTargetUnitClass, "bool (int i)")
		.def("getTargetUnitCombat", &CvUnitInfo::getTargetUnitCombat, "bool (int i)")
		.def("getDefenderUnitClass", &CvUnitInfo::getDefenderUnitClass, "bool (int i)")
		.def("getDefenderUnitCombat", &CvUnitInfo::getDefenderUnitCombat, "bool (int i)")
		.def("getUnitAIType", &CvUnitInfo::getUnitAIType, "bool (int i)")
		.def("getNotUnitAIType", &CvUnitInfo::getNotUnitAIType, "bool (int i)")
		.def("getBuilds", &CvUnitInfo::getBuilds, "bool (int i)")
		.def("getReligionSpreads", &CvUnitInfo::getReligionSpreads, "int (int i)")
		.def("getCorporationSpreads", &CvUnitInfo::getCorporationSpreads, "int (int i)")
		.def("getTerrainPassableTech", &CvUnitInfo::getTerrainPassableTech, "int (int i)")
		.def("getFeaturePassableTech", &CvUnitInfo::getFeaturePassableTech, "int (int i)")
		.def("getFlankingStrikeUnitClass", &CvUnitInfo::getFlankingStrikeUnitClass, "int (int i)")
		.def("getGreatPeoples", &CvUnitInfo::getGreatPeoples, "bool (int i)")
		.def("getBuildings", &CvUnitInfo::getBuildings, "bool (int i)")
		.def("getForceBuildings", &CvUnitInfo::getForceBuildings, "bool (int i)")
		.def("getTerrainImpassable", &CvUnitInfo::getTerrainImpassable, "bool (int i)")
		.def("getFeatureImpassable", &CvUnitInfo::getFeatureImpassable, "bool (int i)")
		.def("getTerrainNative", &CvUnitInfo::getTerrainNative, "bool (int i)")
		.def("getFeatureNative", &CvUnitInfo::getFeatureNative, "bool (int i)")
		.def("getFreePromotions", &CvUnitInfo::getFreePromotions, "bool (int i)")
		.def("getLeaderPromotion", &CvUnitInfo::getLeaderPromotion, "int ()")
		.def("getLeaderExperience", &CvUnitInfo::getLeaderExperience, "int ()")
/************************************************************************************************/
/* Afforess	                  Start		 03/10/10                                               */
/*                                                                                              */
/*                                                                                              */
/************************************************************************************************/
		.def("getEarlyArtDefineTag", &CvUnitInfo::getEarlyArtDefineTag, "string (int i, UnitArtStyleTypes eStyle)")
		.def("getClassicalArtDefineTag", &CvUnitInfo::getClassicalArtDefineTag, "string (int i, UnitArtStyleTypes eStyle)")
		.def("getMiddleArtDefineTag", &CvUnitInfo::getMiddleArtDefineTag, "string (int i, UnitArtStyleTypes eStyle)")
		.def("getRennArtDefineTag", &CvUnitInfo::getRennArtDefineTag, "string (int i, UnitArtStyleTypes eStyle)")
		.def("getIndustrialArtDefineTag", &CvUnitInfo::getIndustrialArtDefineTag, "string (int i, UnitArtStyleTypes eStyle)")
		.def("getLateArtDefineTag", &CvUnitInfo::getLateArtDefineTag, "string (int i, UnitArtStyleTypes eStyle)")
		.def("getFutureArtDefineTag", &CvUnitInfo::getFutureArtDefineTag, "string (int i, UnitArtStyleTypes eStyle)")
/************************************************************************************************/
/* Afforess	                     END                                                            */
/************************************************************************************************/
		.def("getUnitNames", &CvUnitInfo::getUnitNames, "string (int i)")
		.def("getArtInfo", &CvUnitInfo::getArtInfo,  python::return_value_policy<python::reference_existing_object>(), "CvArtInfoUnit* (int i, bool bLate)")
		//TB SubCombat Mod begin  TB Combat Mods Begin
		//integers
		.def("getAttackCombatModifier", &CvUnitInfo::getAttackCombatModifier, "int ()")
		.def("getDefenseCombatModifier", &CvUnitInfo::getDefenseCombatModifier, "int ()")
		.def("getPursuit", &CvUnitInfo::getPursuit, "int ()")
		.def("getEarlyWithdraw", &CvUnitInfo::getEarlyWithdraw, "int ()")
		.def("getVSBarbs", &CvUnitInfo::getVSBarbs, "int ()")
		.def("getArmor", &CvUnitInfo::getArmor, "int ()")
		.def("getPuncture", &CvUnitInfo::getPuncture, "int ()")
		.def("getDigIn", &CvUnitInfo::getDigIn, "int ()")
		.def("getFortCollatDef", &CvUnitInfo::getFortCollatDef, "int ()")
		.def("getOverrun", &CvUnitInfo::getOverrun, "int ()")
		.def("getRepel", &CvUnitInfo::getRepel, "int ()")
		.def("getFortRepel", &CvUnitInfo::getFortRepel, "int ()")
		.def("getUnyielding", &CvUnitInfo::getUnyielding, "int ()")
		.def("getKnockback", &CvUnitInfo::getKnockback, "int ()")
		.def("getStrAdjperRnd", &CvUnitInfo::getStrAdjperRnd, "int ()")
		.def("getStrAdjperAtt", &CvUnitInfo::getStrAdjperAtt, "int ()")
		.def("getStrAdjperDef", &CvUnitInfo::getStrAdjperDef, "int ()")
		.def("getWithdrawAdjperAtt", &CvUnitInfo::getWithdrawAdjperAtt, "int ()")
		.def("getUnnerve", &CvUnitInfo::getUnnerve, "int ()")
		.def("getEnclose", &CvUnitInfo::getEnclose, "int ()")
		.def("getLunge", &CvUnitInfo::getLunge, "int ()")
		.def("getDynamicDefense", &CvUnitInfo::getDynamicDefense, "int ()")
		.def("getFortitude", &CvUnitInfo::getFortitude, "int ()")
		.def("getAid", &CvUnitInfo::getAid, "int ()")
		.def("getFrontSupportPercent", &CvUnitInfo::getFrontSupportPercent, "int ()")
		.def("getShortRangeSupportPercent", &CvUnitInfo::getShortRangeSupportPercent, "int ()")
		.def("getMediumRangeSupportPercent", &CvUnitInfo::getMediumRangeSupportPercent, "int ()")
		.def("getLongRangeSupportPercent", &CvUnitInfo::getLongRangeSupportPercent, "int ()")
		.def("getFlankSupportPercent", &CvUnitInfo::getFlankSupportPercent, "int ()")
		//booleans
		.def("isStampede", &CvUnitInfo::isStampede, "bool ()")
		.def("isAnimalIgnoresBorders", &CvUnitInfo::isAnimalIgnoresBorders, "bool ()")
		.def("isOnslaught", &CvUnitInfo::isOnslaught, "bool ()")
		//boolean vectors
		.def("getSubCombatType", &CvUnitInfo::getSubCombatType, "int (int i)")
		.def("getCureAfflictionType", &CvUnitInfo::getCureAfflictionType, "int (int i)")
		//TB Combat Mods End  TB SubCombat Mod end
		;
Note
Code:
.def("getSubCombatType", &CvUnitInfo::getSubCombatType, "int (int i)")
Hopefully this tells you what you need to know?

Yes, they are just combat classes by class definition.
 
I need to figure out how to use it. I expected a number of elements and an array that I step through but that looks like it only returns one so maybe I have to go through all combat classes and ask if it is a sub combat class on the unit. Neither is a problem and it looks just like some of the others so I just need to see how they are handled.

The problem is where to display them on the screen. Currently I a thinking that I should halve the size of the Promotions box and place the sub combat classes there.
 

Attachments

  • units.jpg
    units.jpg
    289 KB · Views: 183
Do you mean like how if something requires grassland or plains in the city vicinity it will not give the correct icon/buttons for terrain but give you like a Stone Worker's Camp icon/button instead?

I have looked into this and it should be working fine. Unless the dll is passing the improvements not terrains in the list of terrains.
 
I need to figure out how to use it. I expected a number of elements and an array that I step through but that looks like it only returns one so maybe I have to go through all combat classes and ask if it is a sub combat class on the unit. Neither is a problem and it looks just like some of the others so I just need to see how they are handled.

The problem is where to display them on the screen. Currently I a thinking that I should halve the size of the Promotions box and place the sub combat classes there.

I'll leave that to your best judgement and just be extraordinarily thankful you're doing this for me :D Thank you!

And yes, you probably will need to do as you stated. It's a vector based tag and perhaps AIAndy can offer more advice on how to work with it properly in Python. It's taken some getting used to working with these vector and struct based tags over array tags since there weren't many examples in the code that was previously highly array reliant but I feel I'm beginning to get the hang of it. (I think ;) ) Unfortunately, I couldn't begin to explain how to best work it in Py.
 
bah humbug! everything else uses something like
Code:
for k in range(gc.getNumPromotionInfos()):
	if (isPromotionValid(k, self.iUnit, False) and not gc.getPromotionInfo(k).isGraphicalOnly()):
		screen.appendMultiListButton(rowListName, gc.getPromotionInfo(k).getButton(), 0, WidgetTypes.WIDGET_PEDIA_JUMP_TO_PROMOTION, k, -1, False)

but because in default BtS there is only one combat class for a unit there isn't an equivalent isCombatClassValid for the unit.

So for a given unit does your getSubCombatType take an integer id of the combat class and return a boolean true if the unit has that sub combat class?
 
Actually... no. You know a bit of c++ so I'll post an example of what has to happen in c++ code to get this to refer correctly:
Code:
					for (iI = 0; iI < kUnit.getNumSubCombatTypes(); iI++)
					{
						eSubCombatType = ((UnitCombatTypes)kUnit.getSubCombatType(iI));
						if ((eSubCombatType) == (eUnitCombat))
						{
							unitItr->second = false;
						}
					}

In reviewing this, apparently it looks like you'll be needing me to report the unit's getNumSubCombatTypes to do this properly huh? I might have to get a new sourcecode to work with to disentangle myself from my current project to do that for you properly.

This is that whole working with a vector issue. It's a totally different method from working with an array.
 
Actually probably all I need is the equivalent of isPromotionValid(k, self.iUnit, False) or isSubCombatValid where k is the integer id of the combat class I am asking is a valid sub combat class for the unit with the integer id of self.iUnit. Not sure what the False is for.

This is all I can do in the mean time:mischief:
 

Attachments

  • units new.jpg
    units new.jpg
    270.9 KB · Views: 200
Actually probably all I need is the equivalent of isPromotionValid(k, self.iUnit, False) or isSubCombatValid where k is the integer id of the combat class I am asking is a valid sub combat class for the unit with the integer id of self.iUnit. Not sure what the False is for.

This is all I can do in the mean time:mischief:

That's a good start. On first impression, it seems like it would be better to adjust the size of those list boxes so that they show only one line without a bleedthrough from the next coming into the picture unless you scroll, but it's probably better to have the lips of the next line showing so the player realizes there's more to see if there is. Seems a shame to scrunch up the promos that much though. But I can't think of what would come across as better. As you said in the other thread, the strength etc under the primary combat class does take up somewhat more space than it may need to, but I'm kinda thinking eventually armor, puncture, dodge and precision may end up being as valued to have up there so that's not the best place to crowd perhaps (and other unit types (like air units) have more info up there too I think...)

Ok, so I've done some code digging here and there's a few places isPromotionValid could be asking for but only one with those parameters, and that's the one that is generated in CvGameCoreUtils.cpp and reported to python through CyGameCoreUtils.cpp. If you want an account of a unit type's subcombats through that sort of method I could program a basic function that returns just that.

However, what I should probably do is enable us to remove the primary combat class as its expressed on that page entirely and include it in the list of all the combat classes of that unit as there's still currently not any real difference in the effect a primary or sub combat class has on a unit.

This would thus do much what the hasCombatClass from CvUnit does except in a manner that asks only for the unit base type and not any one particular unit. Either way that'll take just a bit of programming if that's the syntax you need to make this easier on ya. And I don't mind doing that since THAT is something I KNOW how to do while what you're doing is something I don't ;) Thanks again! :D

(But it'll take me a totally unknown amount of time here to get my current bug sorted out so I can find a moment to get this done and safely committed so you can do the rest here... sorry for that.)


PS: (The parameter that is showing as false in your isPromotionValid example there btw is asking if we should include promotions that are denoted as being for leaders or not. (bLeader tag in the xml of the promotion info.) A false basically says "don't include leader promos in this evaluation".)
 
Terrains work fine, but Terrain Features do not. (see picture below)

Thanks. Found and fix on its way to SVN soon.

However, what I should probably do is enable us to remove the primary combat class as its expressed on that page entirely and include it in the list of all the combat classes of that unit as there's still currently not any real difference in the effect a primary or sub combat class has on a unit.

There is a pedia page that lists units by combat class. It currently uses primary combat class. Will that page have to change also?
 
There is a pedia page that lists units by combat class. It currently uses primary combat class. Will that page have to change also?
Ah yeah, I'd forgotten about that one. Well... it wouldn't HAVE to change as the primary combat class remains as such. But it probably would be good if it did, even though a unit will show up in multiple places thereafter.
 
Ok, so I've done some code digging here and there's a few places isPromotionValid could be asking for but only one with those parameters, and that's the one that is generated in CvGameCoreUtils.cpp and reported to python through CyGameCoreUtils.cpp. If you want an account of a unit type's subcombats through that sort of method I could program a basic function that returns just that.

However, what I should probably do is enable us to remove the primary combat class as its expressed on that page entirely and include it in the list of all the combat classes of that unit as there's still currently not any real difference in the effect a primary or sub combat class has on a unit.

This would thus do much what the hasCombatClass from CvUnit does except in a manner that asks only for the unit base type and not any one particular unit. Either way that'll take just a bit of programming if that's the syntax you need to make this easier on ya. And I don't mind doing that since THAT is something I KNOW how to do while what you're doing is something I don't ;) Thanks again! :D

(But it'll take me a totally unknown amount of time here to get my current bug sorted out so I can find a moment to get this done and safely committed so you can do the rest here... sorry for that.)


PS: (The parameter that is showing as false in your isPromotionValid example there btw is asking if we should include promotions that are denoted as being for leaders or not. (bLeader tag in the xml of the promotion info.) A false basically says "don't include leader promos in this evaluation".)
I recommend that you just expose those three functions in CvUnitInfo to Python:
Code:
	int getSubCombatType(int i) const;
	int getNumSubCombatTypes() const;
	bool isSubCombatType(int i);
You do that by adding lines to CyInfoInterface1.cpp.
Actually, you already exposed getSubCombatType there so you just need to add the other two. Then all the combat type querying for unit types can be done from Python.
 
Ah yeah, I'd forgotten about that one. Well... it wouldn't HAVE to change as the primary combat class remains as such. But it probably would be good if it did, even though a unit will show up in multiple places thereafter.

I would be in favor of the Pedia categorizing every unit by the combat class it has in the <unitcombat> tag (which is what I assume you mean by Primary class). At least in the core that will still be the main grouping mechanism of units, and from what you've said it will also be that way in the Combat Mod too.
 
I recommend that you just expose those three functions in CvUnitInfo to Python:
Code:
	int getSubCombatType(int i) const;
	int getNumSubCombatTypes() const;
	bool isSubCombatType(int i);
You do that by adding lines to CyInfoInterface1.cpp.
Actually, you already exposed getSubCombatType there so you just need to add the other two. Then all the combat type querying for unit types can be done from Python.

That's what I was planning to do but I got the impression that DH wouldn't have any good examples in Python to work with these methods to generate a list. If he feels he can work with these, or if he can't, you could step in and offer some guidance or help, then yes, that would probably be optimal. And then from there it would stand as an example for future python modding on similar tasks.

I would be in favor of the Pedia categorizing every unit by the combat class it has in the <unitcombat> tag (which is what I assume you mean by Primary class). At least in the core that will still be the main grouping mechanism of units, and from what you've said it will also be that way in the Combat Mod too.
Yeah, I'm on the fence with this.

I guess it all depends on the purpose in which the player is referring to this page. If you see in game, for example, the Canine Promotion that reads +X vs Criminals and wonder, 'what all units comprise the units that this promotion would give my dogs a bonus against?' and then go into the pedia to look up that page to find out, only to confusingly find none there because all the Criminals are sub-combats rather than primary combats... then in THAT application, the page was useless and perceivably bugged.

BUT if you're looking at it for another reason... examples of other reasons that would fit this case are eluding me... then its possible that its best to keep that to a primary combat class application only. Or maybe we should actually have two of these pages for this reason. Actually, at the moment, with primary and sub combats being pretty much equal in all ways on a unit, then there would not be much reason to want to only know what units have what primary combat class (though this may not ALWAYS be true. As we playtest we may find we want to vary the way a primary and sub combat interact with the unit in some ways. I know you've suggested handling them differently in some cases and in those cases I'm just waiting to see if playtesting confirms the need to do so somehow.)

I agree that the primary Combat Class should be respected in our designs as the primary grouping mechanism. I just wonder if this would matter to the player who would refer to this screen? There are other CATEGORIES of groupings that are emerging and I've been thinking of actually giving CCs a category and limiting units to only 1 CC of any given category. Maybe at that point, pages like these would benefit from showing units by Combat Class within given categories of Combat Classes huh?
 
Top Bottom