Moving religious buildings out of beliefs?

DeclaredYuppie

Chieftain
Joined
Jun 14, 2014
Messages
26
So as one of my first easy mods for myself, I moved the Cathedral out of the religious beliefs options and instead made it a medieval next step in the shrine-temple chain. In general I've liked this, I don't think it throws any balance off and it mostly just opens the option for some great art slots at the same time you get the Artists Guild.

I'm thinking about moving the remaining "beliefs buildings" (mosque, pagoda, monastery) out into regular buildings as well. Thoughts I'd like to solicit from others:

  • I'd like to make a rule that, while the player has the option to build any of the buildings in any city, they can only have one of the 4 in any given city. This, if nothing else keeps from possibly overloading your faith-per-turn to game breaking levels. Any thoughts on how to implement that?
  • I'd also like the buildings to remain somewhat distinct. To this end, I'm thinking of changing the monastery to be more of the medieval English/Celtic insititution where people could possible be educated. I'd drop the wine/incense bonus and instead give a +2 to science. Overpowered?
  • Also, I'm not sure how to make the pagoda more distinct. At this point the cathedral is good if you're on a great-works/culture strategy, mosque if you're on a faith strategy, and monastery on a science strategy. Is the +2 happiness that valuable or interesting? Would bumping it to +3 make it sexier?

Thanks in advance!
 
[*]I'd like to make a rule that, while the player has the option to build any of the buildings in any city, they can only have one of the 4 in any given city. This, if nothing else keeps from possibly overloading your faith-per-turn to game breaking levels. Any thoughts on how to implement that?

The Nuclear Plant and Solar Plant have a line of code that makes them exclusive; I can't remember what it is off-hand, but I'd look at them to see how they did it.
 
The Nuclear Plant and Solar Plant have a line of code that makes them exclusive; I can't remember what it is off-hand, but I'd look at them to see how they did it.

<MutuallyExclusiveGroup>1</MutuallyExclusiveGroup>

You need to assign a unique number to the group instead of '1'. The numerical value is not a 'true/false' flag, it is a designation for which group the building belongs to. Use a number like 4235 instead of just 2 because there are already a few mods on steam using this command, and some of them have already used group numbers like 2, 3, 4, etc. You don't want your group for the religious buildings to get rolled in with someone else's group of, say, government-type buildings.

errr...I guess that should have been more of a response to DeclaredYuppie
 
<MutuallyExclusiveGroup>1</MutuallyExclusiveGroup>

You need to assign a unique number to the group instead of '1'. The numerical value is not a 'true/false' flag, it is a designation for which group the building belongs to. Use a number like 4235 instead of just 2 because there are already a few mods on steam using this command, and some of them have already used group numbers like 2, 3, 4, etc. You don't want your group for the religious buildings to get rolled in with someone else's group of, say, government-type buildings.

errr...I guess that should have been more of a response to DeclaredYuppie

Ha, no problem. Sounds good. I'm assuming there's a seperate table that I then link that group number to a list of building types that need to be kept exclusive? I'll pop open the XML sometime in the next day or two to find out :)


On actually modifying the buildings, slept on it and thinking now:

-Science is basically valuable to any winning strategy, so I'm really hesitant to give too much science to the monastery. I'm thinking +1 science, +2 faith and +1 culture. It'd have the same building cost as the other buildings. I feel like even with those reduced benefits a lot of people would default to choosing it over others.

-One alternate option: make the monastery +2 faith +2 culture, and give it a scientist worker slot?

-To make the pagoda stick out more, maybe switch from 2/2/2 to +3 happiness, +2 culture and +1 faith? Make it the inverse of the mosque? Would have some value in cases where you're struggling to keep happiness up?
 
Ha, no problem. Sounds good. I'm assuming there's a seperate table that I then link that group number to a list of building types that need to be kept exclusive? I'll pop open the XML sometime in the next day or two to find out :)
It's a command that is entered directly into the definition of the building(s) under the <Buildings> table.
 
It's a command that is entered directly into the definition of the building(s) under the <Buildings> table.

So as long as each of the four buildings has the same exclusivegroup tag number the game knows they're mutually exclusive to each other?

I guess that makes a lot more sense than what I was picturing :)
 
So as long as each of the four buildings has the same exclusivegroup tag number the game knows they're mutually exclusive to each other?

I guess that makes a lot more sense than what I was picturing :)
Yup.

One thing Firaxis did that actually makes sense and is easy to do for modders.:lol:
 
Further (possibly dumb) question.

In the Civilopedia for buildings there's a section for "game info" and "strategy"

I know that the strategy section is updated under the TXT_KEY_BUILDING_XXX_STRATEGY field.

Where/how is "game info" updated?
 
Ok so my first test...not so good. Nothing loaded and not sure why.

-Set the Mod's actions up to update the DB with my 5 XML files onmodactivated
-I have an XML file for each building, and one for the text

Here's a sample of the one I did for the Cathedral- this was working in a one-off Mod that I did a week or so ago, and I don't think I changed anything:

Code:
<GameData>
	<Buildings>
		<Update>
			<Set UnlockedByBelief="FALSE"/>
			<Where Type="BUILDING_CATHEDRAL"/>
		</Update>
		<Update>
			<Set cost="140"/>
			<Where Type="BUILDING_CATHEDRAL"/>
		</Update>
		<Row>
			<Type>BUILDING_CATHEDRAL</Type>
			<PrereqTech>TECH_THEOLOGY</PrereqTech>
			<MutuallyExclusiveGroup>8888</MutuallyExclusiveGroup>
		</Row>
	</Buildings>
	<Building_ClassesNeededInCity>
		<Row>
			<BuildingType>BUILDING_CATHEDRAL</BuildingType>
			<BuildingClassType>BUILDINGCLASS_TEMPLE</BuildingClassType>
		</Row>
	</Building_ClassesNeededInCity>
	<Beliefs>
		<Delete type="BELIEF_CATHEDRALS"/>
	</Beliefs>
</GameData>

Any thoughts on why it all of a sudden wouldn't be doing anything? Everything is basically as-is in vanilla BNW when I loaded up to test. Is having the updates in 4-5 different XML files a problem?



Edit: figured out part of the problem

Code:
<Row>
	<Type>BUILDING_CATHEDRAL</Type>
	<PrereqTech>TECH_THEOLOGY</PrereqTech>
	<MutuallyExclusiveGroup>8888</MutuallyExclusiveGroup>
</Row>

needed to be update statements. Did this in the original mod and not sure why I changed it here. That at least moved Cathedrals and Mosques to their correct "out of faith" states in the civilpedia. Monestaries and Pagodas appear to still be under the religious buildings section, none of the yields are updated (which is where I suspect the problem is for those two somehow) and none of the civilpedia notes are updated. Will continue playing with...
 
Alright so my first few attempts to figure out why Pagodas and Monasteries aren't working have not born fruit. My Monastery update code:

Code:
<GameData>
	
//Building table should update Unlocked by belief, cost, prereq. tech and it's exclucivity group...all of this is done on all 4 buildings and works with  Mosque and Cathedral

      <Buildings>
		<Update>
			<Set UnlockedByBelief="FALSE"/>
			<Where Type="BUILDING_MONASTERY"/>
		</Update>
		<Update>
			<Set Cost="140"/>
			<Where Type="BUILDING_MONASTERY"/>
		</Update>
		<Update>
			<Set PrereqTech="TECH_THEOLOGY"/>
			<Where Type="BUILDING_MONASTERY"/>
		</Update>
		<Update>
			<Set MutuallyExclusiveGroup="8888"/>
			<Where Type="BUILDING_MONASTERY"/>
		</Update>
	</Buildings>

//Deletes all four instances of the Monastery appearing on the ResourceYieldChanges table- removing the improvements to incense and wine

	<Building_ResouceYieldChanges>
		<Delete>
			<Delete BuildingType="BUILDING_MONASTERY"/>
		</Delete>
	</Building_ResouceYieldChanges>

//Should add a row for Monastery providing +1 science in the city it's in, and reduce its culture output to +1

	<Buildings_YieldChanges>
		<Row>
			<BuildingType>BUILDING_MONASTERY</BuildingType>
			<YieldType>YIELD_SCIENCE</YieldType>
			<Yield>1</Yield>
		</Row>
		<Update>
			<Set Yield="1"/>
			<Where BuildingType="BUILDING_MONASTERY" YieldType="YIELD_CULTURE"/>
		</Update>
	</Buildings_YieldChanges>

//Adds the Temple (or Temple class buildings) as a prereq to building this in the city

	<Building_ClassesNeededInCity>
		<Row>
			<BuildingType>BUILDING_MONASTERY</BuildingType>
			<BuildingClassType>BUILDINGCLASS_TEMPLE</BuildingClassType>
		</Row>
	</Building_ClassesNeededInCity>

//Deletes the Monastery from the Beliefs selection table

	<Beliefs>
		<Delete type="BELIEF_MONASTERIES"/>
	</Beliefs>
  
</GameData>



Right now nothing is being changed on the Monastery in game, which seems really odd. Again, the Cathedral in the prior post is now working and appearing in the general build options/etc...the big difference between the two XMLs is the various resource/yield adjustments. Am I doing something weird there?
 
No. The big difference is this if this is actually in your code
Code:
 [COLOR="Red"]//[/COLOR]Building table should update Unlocked by belief, cost, prereq. tech and it's exclucivity group...all of this is done on all 4 buildings and works with  Mosque and Cathedral

a comment opener and closer should look like
Code:
 [COLOR="Blue"]<!--[/COLOR]Building table should update Unlocked by belief, cost, prereq. tech and it's exclucivity group...all of this is done on all 4 buildings and works with  Mosque and Cathedral[COLOR="blue"]-->[/COLOR]

As a side note you can also do this since these are all 'Sets' pointing to the same value of 'Where':
Code:
<GameData>
	<Buildings>
		<Update>
			<Set UnlockedByBelief="FALSE" [COLOR="Blue"]C[/COLOR]ost="140" PrereqTech="TECH_THEOLOGY" MutuallyExclusiveGroup="8888" />
			<Where Type="BUILDING_CATHEDRAL"/>
		</Update>
	</Buildings>
	<Building_ClassesNeededInCity>
		<Row>
			<BuildingType>BUILDING_CATHEDRAL</BuildingType>
			<BuildingClassType>BUILDINGCLASS_TEMPLE</BuildingClassType>
		</Row>
	</Building_ClassesNeededInCity>
	<Beliefs>
		<Delete [COLOR="blue"]T[/COLOR]ype="BELIEF_CATHEDRALS"/>
	</Beliefs>
</GameData>
I also corrected lower-case / upper-case errors in the previous code-drop. Uppercase is important where Firaxis used it. Copy-paste of the correct format from one of the firaxis xml files is a good strategy. Some commands it doesn't seem to matter whether you use upper/lower-case, but for the stuff where it is necessary it really is necessary, so you should get in the habit of always ensuring 1st that you have the correct combinations of upper case and lower case.
 
No. The big difference is this if this is actually in your code
Code:
 [COLOR="Red"]//[/COLOR]Building table should update Unlocked by belief, cost, prereq. tech and it's exclucivity group...all of this is done on all 4 buildings and works with  Mosque and Cathedral

a comment opener and closer should look like
Code:
 [COLOR="Blue"]<!--[/COLOR]Building table should update Unlocked by belief, cost, prereq. tech and it's exclucivity group...all of this is done on all 4 buildings and works with  Mosque and Cathedral[COLOR="blue"]-->[/COLOR]

I actually just added that comment code in here, but regardless I should do that in my actual code just as a best practice. Thanks :)

Also I'll make the uppercase/lowercase corrections and give it a try. Thanks!



Edit- aahhhahaha Building_YieldChanges not Buildings_YieldChanges ok there's one problem fixed.
 
Ok so Building_YieldChanges fixed Pagodas and moved them out to the Medeival section of civilpedia (my unit testing right now is just checking the entry info in the in-game civilpedia to make sure everything is showing as expected, haven't gotten to more play tests yet), but Monasteries are still giving me problems. Current code:

Code:
<GameData>
	<Buildings>
		<Update>
			<Set UnlockedByBelief="FALSE" Cost="140" PrereqTech="TECH_THEOLOGY" MutuallyExclusiveGroup="8888"/>
			<Where Type="BUILDING_MONASTERY"/>
		</Update>
	</Buildings>
	<Building_ResouceYieldChanges>
		<Delete>
			<Delete BuildingType="BUILDING_MONASTERY"/>
		</Delete>
	</Building_ResouceYieldChanges>
	<Building_YieldChanges>
		<Update>
			<Set Yield="1"/>
			<Where BuildingType="BUILDING_MONASTERY" YieldType="YIELD_SCIENCE"/>
		</Update>
		<Update>
			<Set Yield="1"/>
			<Where BuildingType="BUILDING_MONASTERY" YieldType="YIELD_CULTURE"/>
		</Update>
	</Building_YieldChanges>
	<Building_ClassesNeededInCity>
		<Row>
			<BuildingType>BUILDING_MONASTERY</BuildingType>
			<BuildingClassType>BUILDINGCLASS_TEMPLE</BuildingClassType>
		</Row>
	</Building_ClassesNeededInCity>
	<Beliefs>
		<Delete Type="BELIEF_MONASTERIES"/>
	</Beliefs>
  
</GameData>

I figure 1 of 3 things is going on and I'm missing it or not understanding something:

-my delete function on the Building_ResourceYieldChanges table is doing something funky
-my adding of Science yield on Building_ResourceYields is doing something funky
-there's another typo in there that I am missing



Also, non of the text updates for the strategy/help sections are updating either. That may be some sort of dependency issue with the Monastery code above, or something different...but that code seems even simpler. Below:

Code:
<GameData>
	<Language_en_US>
		<Update>
			<Where Tag="TXT_KEY_BUILDING_CATHEDRAL_STRATEGY"/>
			<Set Text="Can only be built in cities where a Temple has already been constructed and does not have a Monastery, Mosque or Pagoda. May be purchased with [ICON_PRODUCTION] production, [ICON_FAITH] faith or [ICON_GOLD] gold.  Provides a Great Works slot for Art, as well as some happiness, culture and faith."/>
		</Update>
		<Update>
			<Where Tag="TXT_KEY_BUILDING_MOSQUE_STRATEGY"/>
			<Set Text="Can only be built in cities where a Temple has already been constructed and does not have a Cathedral, Monastery or Pagoda. May be purchased with [ICON_PRODUCTION] production, [ICON_FAITH] faith or [ICON_GOLD] gold.  Provides Faith, as well as some happiness and culture."/>
		</Update>
		<Update>
			<Where Tag="TXT_KEY_BUILDING_MONASTERY_STRATEGY"/>
			<Set Text="Can only be built in cities where a Temple has already been constructed and does not have a Cathedral, Mosque or Pagoda. May be purchased with [ICON_PRODUCTION] production, [ICON_FAITH] faith or [ICON_GOLD] gold.  Provides a small amount of science as well as faith and culture."/>
		</Update>
		<Update>
			<Where Tag="TXT_KEY_BUILDING_PAGODA_STRATEGY"/>
			<Set Text="Can only be built in cities where a Temple has already been constructed and does not have a Cathedral, Monastery or Mosque. May be purchased with [ICON_PRODUCTION] production, [ICON_FAITH] faith or [ICON_GOLD] gold.  Provides Happiness, as well as some faith and culture."/>
		</Update>
		<Delete>
			<Delete Tag="TXT_KEY_BUILDING_MONASTERY_HELP"/>
		</Delete>
	</Language_en_US>
  
</GameData>


Thanks again for everyone's help on this!


edit- also I previously had the science yield entry as a new row instead of an update (and I think the new row is the correct method), but it was still not working as intended.

editx2- ok did some code isolation. By cutting out the Building_ResourceYieldChanges delete Monasteries have moved appropriately. Is there something generally wrong with my delete command? I suppose I could work around and update all the entries where BuildingType="BUILDING_MONASTERY" to have YIELD=0?

Text updates still not working. This is the boring part of modding!!!

editx3- ok the delete entry in gametext.xml was causing nothing to update. Pulled that out and the strategy updates all too effect. What am I not understanding in using Delete commands?
 
Edge of your seat updates here :)

- There was a typo in my Building_ResourceYieldChanges tag. I fixed that and set it to an update of set yield=0 when Building=... and everything appears in order

-I set the Monastery Help text to an update instead of a delete (update is "") which doesn't cause any issues, but instead if dropping that section it simply leaves the Game Info box blank. Not ideal, but at least everything works.

Tested with Rome and Songhai (to make sure my Temple class stuff was in order) and everything seems to be working as intended.


In anyone can help with my delete statements, particularly in the Help Text file, I'd be much appreciative. But I think I'm going to post this to Steam :)


Link: Steam Download
 
Code:
		[COLOR="Red"]<Delete>[/COLOR]
			<Delete Tag="TXT_KEY_BUILDING_MONASTERY_HELP"/>
		[COLOR="red"]</Delete>[/COLOR]
you don't need nor want those. The delete command sandwiched in-between is its own sufficient command. Not sure if these errors in and of themselves (and you've made them in several places) are enough to cause a file discard, but they should certainly be causing the game to discard either the command or the entire group of commands for the individual game-table.

You can do
Code:
<Delete>
	something or other in here
</Delete>
but in such a method the 'something or other in here' is never another Delete command.
Here is a correctly-formatted example from a Unit table
Code:
    <Delete>
      <UnitType>UNIT_GREAT_ADMIRAL</UnitType>
      <UniqueName>TXT_KEY_GREAT_PERSON_MATTHEW_PERRY</UniqueName>
    </Delete>
And this you did correctly:
Code:
	<Beliefs>
		<Delete Type="BELIEF_MONASTERIES"/>
	</Beliefs>
Either of these two methods is good, just not the top one.

The science in <Building_YieldChanges> for the monastery should be a <Row> command since it is adding something new in the <Building_YieldChanges> table. Changing it to an <Update> was not / did not solve anything since your actual problem was the game discarding the entire file because of not enough 'r' in <Building_ResouceYieldChanges>, which it looks like you found.
 
LeeS, thanks for all your help.

The double-delete does look to be the problem that resulted in a file discard- although my first attempt at using an appropriate Delete on the game text file resulted in the game info box going away (good) and switching the strategy box to german (not so good) :eek:

So I'll keep playing- but definitely way happy with getting this thing working!
 
Top Bottom