C2C Pedia

I have looked at the code for the promotions available to the unit. It is basically what it always has been. It goes through the list of promotions and then asks the dll if the promotion is valid for this particular unit. The actual code is
Code:
if (isPromotionValid(k, self.iUnit, False) and not gc.getPromotionInfo(k).isGraphicalOnly()):

I can't find where the isPromotionValid is defined anywhere in our python folders so assume it is a standard part of the Civ python.

The only other usage I can find is on the CyUnit
Code:
pUnit.isPromotionValid(iGuerilla3)

I could try using this other usage to see if it does return a better list of promotions.
 
I may be able to find some time to look at that further then for you in the dll. Additionally, I believe one of my next tasks relates to this thread and that's helping you with those routes. I know its been a task that's been sitting there on the plate long enough to mold but I think I may have a timeslot to knock it out coming up later tonight. Along the way, it would be now interesting to look further into how the dll informs along the isPromotionValid line.

I may even build you a new function because I'm thinking that some changes to isPromotionValid that were made to allow for it to stop filtering out on some basises may be at fault here. It may be that the way its supposed to operate now is no longer greatly valid for THIS feature and a better, simpler, more specialized function would be in order here. Shouldn't be tough to build a report for specific use in the pedia.
 
I was looking for some mounted unit (raider line as it turns out) promotions in the Pedia, when I couldn't remember the promotion names, so I went in through the promotion tree. The top half of it appeared to be blank at first sight, and the ones I wanted didn't appear in any of the trees as I scrolled down. It turns out that they were there in the 'blank' area near the top - the trees in that part of the view for some reason are scrolled off way to the right (so don't appear without horizontal scrolling). Anyone know why this is?
 
I was looking for some mounted unit (raider line as it turns out) promotions in the Pedia, when I couldn't remember the promotion names, so I went in through the promotion tree. The top half of it appeared to be blank at first sight, and the ones I wanted didn't appear in any of the trees as I scrolled down. It turns out that they were there in the 'blank' area near the top - the trees in that part of the view for some reason are scrolled off way to the right (so don't appear without horizontal scrolling). Anyone know why this is?

If you scroll down from where you start you will see why. there are a bunch of tactics and morale promotions that fit before some of the usual ones.
 
@Thunderbrd did you end up exposing these to python?

Also the stuff I need done for routes is apparently done in the modules as described here, I think. I need a WIDGET_PEDIA_JUMP_TO_ROUTE.

This is done on my end in the dll and awaits the final steps to complete in python.
 
I had a little bug SO pointed out that was impeding Improvements and may have been messing with this too - though I'm not seeing any change right away on any of the routes either so see if there's something you need to do there.

I'm compiling the debug dll now and will update the new bugfix in just a moment here.
 
bumping because I am working on the pedia at the moment if anyone has anything they think should be done to improve it.

It would be useful if when you bring up a resource it shows under the "Allows" field it shows buildings that require that resource for city vicinity.

It would be useful if when you bring up a resource it shows under the "Building" field it shows buildings that have a bonus with that resource such as Private School gives +1% :science: with Pencils. It would be great to bring up Pencils resource and see that building showing up on related buildings.

So many resources look like they give nothing, when they really do.
 
That is because the pedia only shows Yields and not Commerces at the moment. There is a function to get commerces so that can be done.

So how would we show that a resource is needed in the vicinity. Just text or something about the icon?

@Thunderbrd, I looked in CyInfoInterface1.cpp but could not find functions exposed to python for
  • Vicinity bonus requirements
  • Array of bonuses produced by the city. C2C allows more than one but the interface to python only has the default which shows one resource only.
 
@DH

1. Oh good.

2. At the moment on the resource pedia page it shows the icon/button under "Allows" field in the lower left part of the screen. City vicinity should show up there along with normal resource requirements. Such as in a building requires cows resource it should show up there and then another building requires cows in the city vicinity it should also show up there.

attachment.php
 

Attachments

  • cowz.jpg
    cowz.jpg
    386.3 KB · Views: 164
We probably should have a different Bonus page set up for Map and the rest since the rest don't have improvements associated with them.

For some unknown reason buildings have been added to the Allows section which should only be units.

What we want on all of the Bonus pedia pages is to
1) Show commerce as well as yields both in the stats and effects areas.
2) replace the current Buildings and Allows with three areas Buildings, Vicinity Buildings and Units.​

On the Culture and Other (Manufacture) Bonus page we want the Improvements area replaced with the building(s) that provide the resource called Source.

Is that right?
 
Ok... next update will include the following exposures to python:
Code:
		.def("getPrereqVicinityBonus", &CvBuildingInfo::getPrereqVicinityBonus, "int ()")
and
Code:
		.def("getNumExtraFreeBonuses", &CvBuildingInfo::getNumExtraFreeBonuses, "int ()")
		.def("getExtraFreeBonus", &CvBuildingInfo::getExtraFreeBonus, "int (int i)")
		.def("getExtraFreeBonusNum", &CvBuildingInfo::getExtraFreeBonusNum, "int (int i)")
		.def("hasExtraFreeBonus", &CvBuildingInfo::hasExtraFreeBonus, "bool (BonusTypes eBonus)")
 
Ok... next update will include the following exposures to python:
Code:
		.def("getPrereqVicinityBonus", &CvBuildingInfo::getPrereqVicinityBonus, "int ()")
and
Code:
		.def("getNumExtraFreeBonuses", &CvBuildingInfo::getNumExtraFreeBonuses, "int ()")
		.def("getExtraFreeBonus", &CvBuildingInfo::getExtraFreeBonus, "int (int i)")
		.def("getExtraFreeBonusNum", &CvBuildingInfo::getExtraFreeBonusNum, "int (int i)")
		.def("hasExtraFreeBonus", &CvBuildingInfo::hasExtraFreeBonus, "bool (BonusTypes eBonus)")

Just to be certain I should be calling hasExtraFreeBonus on the building and passing it the bonus integer? eg building(i).hasExtraFreeBonus(iBonus)? I am getting a syntax error at the moment but then I have not cleared the cache and turned around three times yet :D
 
In the dll it would need to be more than an integer ((BonusTypes)Int)
I'm not sure how you'd do that from python.
So the alternative might be to loop through the building's ExtraFreeBonuses itself (as a vector).

in C++ it would look like

for (int iI = 0; iI < kBuilding.getNumExtraFreeBonuses(); iI++)
{
if (kBuilding.getExtraFreeBonus(iI) == the bonus you're looking for)
{
Do what you want to do with it
}
}
 
OK. I don't do anything with it. On the Bonus page the question is whether or not to display the building as a source of the bonus. The "has" would just have been easier, I am fairly sure the iBonus I am using is the same one used elsewhere but is spelt eBonus, ie the assignment to the variable is the same, I'll check tomorrow.
 
@Hydro I need some feedback on the new bonus pedia page :D. I should note that

1) the old page did not do unhealthy nor unhappy in the effects either

2) you can hover over the buildings to see what changes they make to yields and commerce so do we really need it in the effects as well.

3) There is nowhere on the old that shows the increase in the speed of building units or buildings if you have this resource.
 
Back
Top Bottom