Help Wanted Ads

Is the vicinity bonus requirement for buildings exposed to python? I probably asked this before but I forget. I want to get it showing in the pedia pages correctly. It should show in the Requires box at least. Some buildings are getting a bit of text but the culture ones are not.
 
Is the vicinity bonus requirement for buildings exposed to python? I probably asked this before but I forget. I want to get it showing in the pedia pages correctly. It should show in the Requires box at least. Some buildings are getting a bit of text but the culture ones are not.

I'm not sure which tag(s) you're referring to since I've not interacted with vicinity req's at all myself. It could help to know this then I could track down an answer for ya at least (and possibly get it exposed if its not yet.)
 
BulildingInfos file tag VicinityBonus and PrereqVicinityBonuses in particular.

The yield and commerce changes with vicinity probably as well if I knew what they meant.
 
Ok, so VicinityBonus is exposed:
Code:
.def("getPrereqVicinityBonus", &CvBuildingInfo::getPrereqVicinityBonus, "int ()")

PrereqVicinityBonuses is not (and it would take me a little bit to determine how to with this data type.)

VicinityBonusYieldChanges is also not and will be even more tricky.

You'll have to give me a bit to get to exposing those last two.
 
Ok, so VicinityBonus is exposed:
Code:
.def("getPrereqVicinityBonus", &CvBuildingInfo::getPrereqVicinityBonus, "int ()")

PrereqVicinityBonuses is not (and it would take me a little bit to determine how to with this data type.)

VicinityBonusYieldChanges is also not and will be even more tricky.

You'll have to give me a bit to get to exposing those last two.

Thanks. There is no hurry and I don't know what the last two do anyway.

PrereqVicinityBonuses lets you list multiple bonuses in enclosed VicinityBonus tags and functions as an "or" with them, so you need at least one of them to build the building.

VicinityBonusYieldChanges changes the yields of the building if a bonus is in the vicinity of the city. It can have multiple BonusYieldChange subtags and each of them works.

Example:
Spoiler :

In R2R I modified the Quern building so the the build conditions require you to have stone (just have it, not necessarily in the vicinity) and any one (or more) of a list of resources in the vicinity: wheat, barley, rice, and/or corn. It also gives +1 food for each bonus type in the vicinity from the same list of cereals. The code for these parts looks like this:
Code:
...
			<Bonus>BONUS_STONE</Bonus>
			<PrereqVicinityBonuses>
				<VicinityBonus>BONUS_WHEAT</VicinityBonus>
				<VicinityBonus>BONUS_BARLEY</VicinityBonus>
				<VicinityBonus>BONUS_CORN</VicinityBonus>
				<VicinityBonus>BONUS_RICE</VicinityBonus>
			</PrereqVicinityBonuses>
...
			<VicinityBonusYieldChanges>
				<BonusYieldChange>
					<BonusType>BONUS_WHEAT</BonusType>
					<YieldChanges>
						<iYield>1</iYield>
						<iYield>0</iYield>
						<iYield>0</iYield>
					</YieldChanges>
				</BonusYieldChange>
				<BonusYieldChange>
					<BonusType>BONUS_CORN</BonusType>
					<YieldChanges>
						<iYield>1</iYield>
						<iYield>0</iYield>
						<iYield>0</iYield>
					</YieldChanges>
				</BonusYieldChange>
				<BonusYieldChange>
					<BonusType>BONUS_RICE</BonusType>
					<YieldChanges>
						<iYield>1</iYield>
						<iYield>0</iYield>
						<iYield>0</iYield>
					</YieldChanges>
				</BonusYieldChange>
				<BonusYieldChange>
					<BonusType>BONUS_BARLEY</BonusType>
					<YieldChanges>
						<iYield>1</iYield>
						<iYield>0</iYield>
						<iYield>0</iYield>
					</YieldChanges>
				</BonusYieldChange>
			</VicinityBonusYieldChanges>
Most cities that have on of those resources will only have that one so you'll get the +1 food for that one, but if you happen to find a city with two of them the building will give +2 food. In this case all of the bonuses are in both categorizes so you'll get at least +1 food since the bonus type that lets you construct the building also gives you a +1 food.
 
Thanks. I have gotten side tracked of my main task and I am trying to tidy up problems with the pedia instead.

Can you wait a bit longer until i finish the new Schema Validation?

I redit the Bonus and VicinityBonus prereq tags for Buildings and Units a while ago locally. I do this change including all the Python changes as part of the Schema change because i have to make alot Xml changes. I already made the Bonus Pedia aware of the OrVicinityBonuses and i guess that is what you want to do.
 
I can wait. In fact I got a phone call from my brother 10 mins ago saying my Mum is back in hospital. Minor accident I think but I have no details yet. Sound like RL is about to hit again :sigh:
 
Liangzhou flag.

One was left, Nok Culture.
 

Attachments

  • liangzhuembassy.jpg
    liangzhuembassy.jpg
    3.9 KB · Views: 145
I am experimenting with a different way to allow a building that requires a map resource to have access to it earlier if the resource is in the vicinity of the city. This example is jade and it is not working correctly as the or buildings are not showing up in the pedoa like they should. Have I done something wrong in the XML? Note the not in the same city as building text is also not showing up. This means it is probably some dyslexic mistake in the XML. can someone have a look? Thanks.

What I am attempting to do is have a Jade Carver building available to be built if the city has the Jade Merchant (local) or the jade Importer building in the city and the city has access to jade. Note I have had to move the trade of jade back to gathering which is probably where it should be anyway.
 
Ah... ok, so the one thing I can spot here is:
Code:
		<BuildingClassInfo>
			<Type>BUILDINGCLASS_JADE_CARVER</Type>
			<Description>TXT_KEY_BUILDING_JADE_CARVER</Description>
			<iMaxGlobalInstances>-1</iMaxGlobalInstances>
			<iMaxTeamInstances>-1</iMaxTeamInstances>
			<iMaxPlayerInstances>-1</iMaxPlayerInstances>
			<iExtraPlayerInstances>0</iExtraPlayerInstances>
			<bNoLimit>0</bNoLimit>
			<bMonument>0</bMonument>
			<DefaultBuilding>BUILDING_CARVER</DefaultBuilding>
			<VictoryThresholds/>
		</BuildingClassInfo>
Your default buildings are pointing to incorrect building tags - and the Or prereqs are pointing to the class rather than the building so this would make sense that it would be problematic.

All three are missing the term _JADE_. This one, for example, points to BUILDING_CARVER rather than BUILDING_JADE_CARVER.
 
Your default buildings are pointing to incorrect building tags - and the Or prereqs are pointing to the class rather than the building so this would make sense that it would be problematic.

All three are missing the term _JADE_. This one, for example, points to BUILDING_CARVER rather than BUILDING_JADE_CARVER.

Yep, that was it. Thanks, I could just not see it.
 
Top Bottom