Polytheist buildings - HOW?

killmeplease

Mk Z on Steam
Joined
Nov 22, 2007
Messages
2,794
Location
Samara
Hello!

I want players to be able to purchase some religious buildings with faith before they have found a religion (or instead of founding one). these are pagan buildings like Ziggurat, Sphinx etc.

But it turned out that it seems its necessary to tie a building to some belief for it to show up in the purchase list. Ok, so i can set pantheons to unlock all those pagan buildings? NOT QUITE - one belief can only enable one building. More than that, it seems you cant purchase anything with faith unless you have established a major religion.

What can i do in this situation?
 
Unfortunately your only recourse in this circumstance is to mod the .dll. I'm not even sure if this is possible through that. If it is possible, I'd recommend looking into WHoward's .dll to see if he's already done (some, most or all) of the work for you.

Additionally, you can unlock multiple buildings with the same belief by simply repeating the row. In a lot of circumstances repeating the row causes issues in the database, but the devs made special provisions for unlocking buildings with beliefs due to beliefs such as Jesuit Education. Here's an edited snippet from my Liberty mod where I unlock multiple buildings with the same belief:
Spoiler :
Code:
	<Belief_BuildingClassFaithPurchase>
		<Row> <BeliefType>BELIEF_FEED_WORLD</BeliefType>            <BuildingClassType>BUILDINGCLASS_GOLDENAGE_IND</BuildingClassType>  </Row>
		<Row> <BeliefType>BELIEF_FEED_WORLD</BeliefType>            <BuildingClassType>BUILDINGCLASS_GOLDENAGE_MOD</BuildingClassType>  </Row>
		<Row> <BeliefType>BELIEF_FEED_WORLD</BeliefType>            <BuildingClassType>BUILDINGCLASS_GOLDENAGE_ATOM</BuildingClassType> </Row>
		<Row> <BeliefType>BELIEF_FEED_WORLD</BeliefType>            <BuildingClassType>BUILDINGCLASS_GOLDENAGE_INFO</BuildingClassType> </Row>
	</Belief_BuildingClassFaithPurchase>

I actually went on to repeat this for EVERY belief as I wanted this purchase to be available to anyone (who had taken the Liberty opener at least). However, this still doesn't side step the "Major Religion in City" clause. I believe CvCity::IsCanPurchase() (and possibly CvCity::canConstruct() and/or CvPlayer::canConstruct()) would be a good starting place for modding the .dll for your purposes.
 
thanks for the info!
i tried to set some column enabling a building in the Beliefs table so it was wrong..

i know there are Lua hooks for CityCanConstruct and PlayerCanConstruct - wont it be possible to get round the game's restrictions using them? Or are they only for forbidding something...
 
then.. is it possible to make a building to be only purchaseable with gold but not buildable?
this way it could be given a cost of say 1 gold but also checked for enough faith in CityCanConstruct and that amount of faith was substracted from the faith pool on purchase?
 
then.. is it possible to make a building to be only purchaseable with gold but not buildable?
this way it could be given a cost of say 1 gold but also checked for enough faith in CityCanConstruct and that amount of faith was substracted from the faith pool on purchase?

I believe this approach is doable (more or less). However, you'll end up with a UI claiming the cost is just 1 Gold as you'd literally have to remove the Faith Cost from the building(s) and then subtract it upon completion (Machiavelli has a custom OnBuildingCompleted event available on the Steam Workshop IIRC). Reconciling the UI won't be an easy task and will require you to alter CityView.lua (which will most likely make your mod incompatible with a pretty large chunk of other mods out there).
 
yeah there will be a problem with UI but its better than nothing

i am also wondering if its possible to spread Pantheon? when a missionary is created its labelled with a majority religion so it will spread it. but what if a majority religion is Pantheon and the unit is not bought with faith but with gold? will it be given a pantheon to spread?

is there also a lua event for spreading/conducting a mission/spending a unit (if its consumed)?
 
i am also wondering if its possible to spread Pantheon?

Attempting to spread a pantheon requires major DLL rework - so major that I gave up and created the concept of "local religions" for my "Clans of the Morindim" mod instead (local religions spread to your own cities and city states via pressure/missionaries/prophets but not to foreign cities)
 
Attempting to spread a pantheon requires major DLL rework - so major that I gave up and created the concept of "local religions" for my "Clans of the Morindim" mod instead (local religions spread to your own cities and city states via pressure/missionaries/prophets but not to foreign cities)

i meant not by pressure but with pagan missionaries (soothsayers). i know there are no lua functions for adding pressure and theres one ID for every nation's pantheon (0). but for me it'd be sufficient to just increase num followers of pantheon in a city. btw it is historically correct that pantheons dont compete but diffuse. it was only Jahve who didnt want to 'diffuse' and destroyed an other god's statue when those dudes brought the arc of covenant captured from jews into their own temple.

is "Clans of the Morindim" a DLL mod?
 
NOT QUITE - one belief can only enable one building
Not true. One belief can unlock an unlimited number of buildings. And the same building can be unlocked by multiple different beliefs. The problem is with attempting to use a pantheon belief in the <Belief_BuildingClassFaithPurchase> table. Every attempt I have made to use any belief type other than a follower or reformation belief has been ignored by the game.

err...Bobert13 already answered to this...I really should read the whole thread more closer. Though I'm not sure what issue in the database to which he is referring, as I haven't encountered any troubling behavior so long as I always wrote <Row>s to the <Belief_BuildingClassFaithPurchase> table that were for Follower or Reformation beliefs.
 
The standard logic within the DLL to check if a building can be bought with faith is wrapped by a "has this player created a religion" check - and pantheons don't count as religions.
 
The standard logic within the DLL to check if a building can be bought with faith is wrapped by a "has this player created a religion" check - and pantheons don't count as religions.
But I've never been able to get the game to accept a Founder or an Enhancer type belief either. Unless I was doing something dreadfully wrong....which I don't think I was. But on whole your comment makes me think I should re-check my test method under the assumption that I must have been doing something wrong with Founder and Enhancer beliefs.
 
I'll correct that, it's wrapped by a "does this city have a religious majority", but again pantheons don't count (unless you're using my modded DLL :) )
 
I'll correct that, it's wrapped by a "does this city have a religious majority", but again pantheons don't count (unless you're using my modded DLL :) )

well.. not exactly. really, pantheon counts for majority (e.g. on city growth)
BUT they explicitly forbid buying buildings for pantheon



its ridiculous :eek:
why did they do such an evil thing? what was the purpose? :hammer2:
 
its ridiculous :eek:
why did they do such an evil thing? what was the purpose? :hammer2:

Questions to always ask yourself when looking at the BNW (and to some extent, G&K) specific code

1) Does the standard game need this feature/facility? (In the case of buying buildings with faith for a pantheon belief, the answer is "no")
2) Why did Firaxis do it this crazy way? (Answer - because it works for the standard game, and they didn't need any more flexibility, so they didn't bother to code it differently)


PS: For those that may be following and don't know, the code given above is from my modded DLL. MOD_BUGFIX_MINOR is "always on", so buying buildings with faith from pantheon beliefs is fixed in my DLL (there's a bit more to it than given above though)
 
Questions to always ask yourself when looking at the BNW (and to some extent, G&K) specific code

1) Does the standard game need this feature/facility? (In the case of buying buildings with faith for a pantheon belief, the answer is "no")
2) Why did Firaxis do it this crazy way? (Answer - because it works for the standard game, and they didn't need any more flexibility, so they didn't bother to code it differently)


PS: For those that may be following and don't know, the code given above is from my modded DLL. MOD_BUGFIX_MINOR is "always on", so buying buildings with faith from pantheon beliefs is fixed in my DLL (there's a bit more to it than given above though)

yeah thats your DLL code, i get to it while googling for Civ5 sources.
it seems i have to use your DLL for this mod.
is it possible to make units also buyable for pantheon? and certaing units like missionaries would be given <RequiresReligion>true</RequiresReligion> field in the Units table which would be checked in the dll code..
i can do the logic modification (i did dll mods for civ4) but i'm not sure about tables part...
 
have just tried your library
my buildings didnt show (may be my fault), but the missionary shows before religion, is buyable and actually spreads pantheon, though with zero efficiency.



pantheon spreading is prohibited from code, i assume.
it can be changed so if theres no pantheon, the player's pantheon belief is added to the owner (he 'founds' the same pantheon - is it possible? i think yes) and 1000 pressure. if theres already a pantheon, just pressure is added (or a bonus belief as well?). the main purpose of spreading Pantheon (esp for the AI) should be CS influence: +X per mission.
 
ps database log says all is ok
i can see my buildings in the civilopedia
but not in the purchase list
Code:
insert into Belief_BuildingClassFaithPurchase (BeliefType, BuildingClassType) 
	select Type, "BUILDINGCLASS_ZIGGURAT" from Beliefs where Pantheon="true";
 
Top Bottom