C2C Pedia

@DH

0. I think they are much better set up now. The only thing I wish is that city vicinity would show up. I think the layout of the building produced ones looks great though.

1. Yeah I knew some other things liek that were missing but I was not sure what.

2. Oh very nice!

3. Hmm, but they do show up on the units right?
 
I could remove everything from the effects box and make a building and a units box similar to the improvements box. The base happiness and healthiness for the bonus could go in the statistics next to the bonus icon

I am not totally sure I can but if I can then next to each building would be
1) vicinity or requires or nothing as this includes buildings that have any affect with the resource
2) builds faster

I don't think we need the yield or commerce changes because you can get them from hover over which shows the help.

Similarly for units it would be requires and/or built faster with.
 
Until I can get the array stuff working on the bonus page I wont be able to show vicinity requirements. I'll update with my latest version soon and then start on the building page where I should be able to show vicinity requirements if there is enough space.

Two things to do on building page
- show vicinity bonus needs
- show all bonuses manufactured by the building. Currently only one is shown.

edit Had a break through on the arrays. The problem on the bonus page is that I need really two new boxes but one is a split of the units which I can fit and the other is for buildings that I can't fit.
 
@Thunderbrd I am calling getBonusProductionModifier on unit incorrectly. I assumed it was the same as for getBonusYieldModifier on buildings since they are basically the same structure.

I tried
Code:
				for eYield in range(YieldTypes.NUM_YIELD_TYPES):
					if (unitInfo.getBonusProductionModifier(self.iBonus, eYield) != 0):
						self.aEffectedBuildings[eYield] = eYield
						bShow = True
						break

Which as you can see is basically the same as
Code:
				for eYield in range(YieldTypes.NUM_YIELD_TYPES):
					if (buildingInfo.getBonusYieldModifier(self.iBonus, eYield) != 0):
						self.aEffectedBuildings[iBuilding] = iBuilding
						bShow = True
						break

So what is the difference on the dll side?
 
Well... consider first that there's no variation in the yield type - it IS production. Therefore you do not have to loop through yields. Call for the amount and supply the bonus id only to get the value returned.

An example from the dll:
Code:
	for (iI = 0; iI < GC.getNumBonusInfos(); iI++)
	{
		if (hasBonus((BonusTypes)iI))
		{
			iMultiplier += GC.getUnitInfo(eUnit).getBonusProductionModifier(iI);
		}
	}

I think it would look more like:
buildingInfo.getBonusYieldModifier(self.iBonus)
 
Well... consider first that there's no variation in the yield type - it IS production. Therefore you do not have to loop through yields. Call for the amount and supply the bonus id only to get the value returned.

An example from the dll:
Code:
	for (iI = 0; iI < GC.getNumBonusInfos(); iI++)
	{
		if (hasBonus((BonusTypes)iI))
		{
			iMultiplier += GC.getUnitInfo(eUnit).getBonusProductionModifier(iI);
		}
	}

I think it would look more like:
buildingInfo.getBonusYieldModifier(self.iBonus)

If you meant unitInfo.getBonusProductionModifier(self.iBonus) you are right. I keep blaming things on lack of coffee but the cold is not helping. I have had it for almost 4 weeks now.
 
Bonus production modifier refers to faster production with X bonus, such as wonders with marble or stone.
Bonus yield modifier refers to how much extra % yield a building will produce with access to X bonus, such as ironworks.

Obviously the latter can't exist for unit, and the 2 functions are totally different.
 
If you meant unitInfo.getBonusProductionModifier(self.iBonus) you are right. I keep blaming things on lack of coffee but the cold is not helping. I have had it for almost 4 weeks now.

Oh... yeah... that's what I meant ;) Sorry for being sloppy there.
 
I can't do anything about the Building Pedia page as it stands there are just too many things that would need to be done to make it work. Note that I am not saying we must do anything just that things can't be improved much at the moment.

1, 2 & 4) The special abilities comes from the Help text generated for the building. It contains stuff I can't get to. Mostly stuff in the conditions code. This is impacting elsewhere but it is worse on this page.

3) Hover over is cutting of the most important bit ie the name of whatever it is we are hovering over. In a perfect world the hover over would check that it could all display on the screen before displaying and if it can't then it would show a short version.
 

Attachments

  • building pedia1.jpg
    building pedia1.jpg
    276.4 KB · Views: 87
  • building pedia2.jpg
    building pedia2.jpg
    255.8 KB · Views: 78
  • building pedia3.jpg
    building pedia3.jpg
    327.9 KB · Views: 80
  • building pedia4.jpg
    building pedia4.jpg
    295.1 KB · Views: 75
I'm not sure what the problems are you're suggesting in 1,2 and 3 but 4 does bug me.

There's really not much that can be done unless I take that tag and keep it from hover displays and limit it only to the pedia page display. There's a scrolling feature there but there cannot be one for hovers unfortunately.
 
The expression system being used by C2C means that pedia can't get at some important information. For example the second vicinity bonus requirements for buildings is defined in these expressions. There is no way for the pedia to find and display them in the same way it does for the one defined in the XML tag for prerequisite vicinity bonus.
 
Value of <GlobalExtraCommerces> tag is not shown properly in main tabs.
 

Attachments

  • 01.jpg
    01.jpg
    282.1 KB · Views: 100
  • 02.jpg
    02.jpg
    281 KB · Views: 50
Sorry, which is wrong? The stuff in the hover over is done by the dll not the Pedia Python, so is it the pedia or the hover over that is wrong?.
 
Interesting... those tags have been oddly problematic like that. Apparently the tag is located within brackets that are eliminating it from displaying if it's a pedia display.
 
Oh, I see what you mean. Yea, I don't do anything in the pedia just put the text from the help into a string which is displayed.
 
Value of <GlobalExtraCommerces> tag is not shown properly in main tabs.

hmm... @Alberts2 or any other programmer... I'm not seeing what's wrong here. Do you? This all seems to say it should be working on both the hover and the pedia display!
Code:
			int iCount = 0;
			for (int iJ = 0; iJ < NUM_COMMERCE_TYPES; iJ++)
			{
				iLast = 0;

				for (int iI = 0; iI < GC.getNumBuildingClassInfos(); iI++)
				{
					BuildingTypes eLoopBuilding;
					if (!bCivilopediaText && NO_PLAYER != GC.getGameINLINE().getActivePlayer())
					{
						eLoopBuilding = (BuildingTypes)GC.getCivilizationInfo(GC.getGameINLINE().getActiveCivilizationType()).getCivilizationBuildings(iI);
					}
					else
					{
						eLoopBuilding = (BuildingTypes)GC.getBuildingClassInfo((BuildingClassTypes)iI).getDefaultBuildingIndex();
					}
					
					if (eLoopBuilding != NO_BUILDING && kBuilding.getGlobalBuildingCommerceChange(iI, iJ) != 0)
					{
						szFirstBuffer.Format(L"%s%s", NEWLINE, gDLL->getText("TXT_KEY_CIVIC_BUILDING_COMMERCE_CHANGE", kBuilding.getGlobalBuildingCommerceChange(iI, iJ), GC.getCommerceInfo((CommerceTypes)iJ).getChar()).c_str());
						CvWString szBuilding;
						szBuilding.Format(L"<link=literal>%s</link>", GC.getBuildingInfo(eLoopBuilding).getDescription());
						setListHelp(szBuffer, szFirstBuffer, szBuilding, L", ", (kBuilding.getGlobalBuildingCommerceChange(iI, iJ) != iLast));
						if (iLast == kBuilding.getGlobalBuildingCommerceChange(iI, iJ)) iCount++;
						iLast = kBuilding.getGlobalBuildingCommerceChange(iI, iJ);
						if (iCount > 3) iCount = iLast = 0;
					}
				}
			}
so I need another pair of eyes on this one!
 
hmm... @Alberts2 or any other programmer... I'm not seeing what's wrong here. Do you? This all seems to say it should be working on both the hover and the pedia display!
Code:
			int iCount = 0;
			for (int iJ = 0; iJ < NUM_COMMERCE_TYPES; iJ++)
			{
				iLast = 0;

				for (int iI = 0; iI < GC.getNumBuildingClassInfos(); iI++)
				{
					BuildingTypes eLoopBuilding;
					if (!bCivilopediaText && NO_PLAYER != GC.getGameINLINE().getActivePlayer())
					{
						eLoopBuilding = (BuildingTypes)GC.getCivilizationInfo(GC.getGameINLINE().getActiveCivilizationType()).getCivilizationBuildings(iI);
					}
					else
					{
						eLoopBuilding = (BuildingTypes)GC.getBuildingClassInfo((BuildingClassTypes)iI).getDefaultBuildingIndex();
					}
					
					if (eLoopBuilding != NO_BUILDING && kBuilding.getGlobalBuildingCommerceChange(iI, iJ) != 0)
					{
						szFirstBuffer.Format(L"%s%s", NEWLINE, gDLL->getText("TXT_KEY_CIVIC_BUILDING_COMMERCE_CHANGE", kBuilding.getGlobalBuildingCommerceChange(iI, iJ), GC.getCommerceInfo((CommerceTypes)iJ).getChar()).c_str());
						CvWString szBuilding;
						szBuilding.Format(L"<link=literal>%s</link>", GC.getBuildingInfo(eLoopBuilding).getDescription());
						setListHelp(szBuffer, szFirstBuffer, szBuilding, L", ", (kBuilding.getGlobalBuildingCommerceChange(iI, iJ) != iLast));
						if (iLast == kBuilding.getGlobalBuildingCommerceChange(iI, iJ)) iCount++;
						iLast = kBuilding.getGlobalBuildingCommerceChange(iI, iJ);
						if (iCount > 3) iCount = iLast = 0;
					}
				}
			}
so I need another pair of eyes on this one!

The code works but i think it belongs outside if (!bCivilopediaText). The other much bigger problem with that Tag is that there is no cache write and read code.

Edit:
I fixed this Tag but i can't put the fix into the svn today.
 
Top Bottom