New religion - mostly good, but a couple questions

MerakSpielman

Warlord
Joined
Oct 27, 2005
Messages
217
I have created a new religion for Civ4 (Neopaganism, tech requirement Ecology). Everything works flawlessly - it has its own missionaries, buildings, and I even created new icons.

However, though the religion spawns perfectly and spreads, the icon for it doesn't show up above the names of cities. I can't tell where it exists, except by seeing if it's possible to build a temple there. As far as enemy cities go, I have no clue.

Does anybody know how to get that to work?

Second, I'm willing to put in the time and effort to reconfigure the city screen to have an additional religion icon, but I can't figure out what files to edit, or what to do to them if I did find them. Clearly there will need to be an extra "slot" for the icon, and the other "slots" made smaller so there will be room. There will need to be two graphics, one for "religion present" and one for "religion absent."

Does anybody know where I can edit these settings?
 
Update.

Hmm.... the Neopagan religion is on the list of religions on the city screen, but off the right side where I can't see it. I can tell it's there because when I mouse over the edge the tooltip pops up for it.

All I need to do is shrink the religion icon display so the icons are smaller.
 
vbraun said:
Open up an original one and make it the same size.
It's already the same size, the problem is there's no room for it on the screen. It puts it in line with the existing icons for religions, but that means it's off to the side, to the right, and off the screen.

What I really need to do is shrink the religion bar in the city screen, so more icons can fit in the bar.

I need to know whare I go to edit elements of the city screen.
 
I read elsewhere that there was a limit of 7 religions *because* of the religion advisor screen. There just isn't room for more.
 
Well, there's no hard limit of 7 religions, because my 8th religion exists, spreads, and otherwise interacts with the game. It's a soft limit, due to screen real estate.

There must be a way to reconfigure the city screen, rearrange elements, resize them, etc... I guess it might be hard coded, though, making it virtually impossible to change.
 
Maybe I should give up and get rid of Hinduism. I'm not sure I like the sequence of Buddhism, Hinduism, and Judaism all in a row right at the beginning of the game, and I rather like the concept of a late-game religion, giving slow-starters a chance at a Holy City.
 
I found out where the religon advisor is drawn so it will take some playing around with.

Its this file Assests\Python\Screens\CvReligionScreen.py

Remember to make a back-up.
 
Dammit I need to learn Python now.

How about the mini-icon display on the main map above the city name? Where you can see what religions exist in a city, and whether or not they're a Holy City. Can you find the code for that?
 
vbraun said:
I found out where the religon advisor is drawn so it will take some playing around with.

Its this file Assests\Python\Screens\CvReligionScreen.py

Remember to make a back-up.
Just to double-check, this .py file affects the religion readout on the city screen, right, not just the religion advisor screen?
 
The city screen is a whole different animal. Its actually in the CvMainInterface.py

Probably actually harder to change then the religon advisor.
 
This is better:


There is probably even room for a 9th religion! You could then play with the margains to gain even more room.

Instructions:
1. Open up Assests/Python/Screens/CvReligionScreen.py in Notepad
2. Find this variable: self.LEFT_EDGE_TEXT
3. Change whatever it is set to, to be -100.
4. Change the one below it to be 40 (Should be self.X_RELIGION_START)
It should look like this:
Code:
		self.LEFT_EDGE_TEXT = -100
		self.X_RELIGION_START = 40
		self.DX_RELIGION = 98
		self.Y_RELIGION = 35
5. Save file into either your Mod foulder or Custom Assests foulder. DO NOT OVERWRITE THE ORIGINAL!!!
 
The religion icons are in the game font (Assets/res/Fonts/GameFont.tga). You'll need to add your icon to that file (and maybe the 75 file?) twice (one w/ the star for the holy city and once without).

gamefont.jpg


If you added all the stuff to the XML, it just might not spit it back out at you (unexpected end of file error or somesuch). The code that the game uses to display those icons is what I used in my domestic advisor religion column.

Code:
# Religions...
szReligions = ""
        lHolyCity = pLoopCity.getHolyCity()
        if lHolyCity:
                iI = 0
                for iI in range(len(lHolyCity)):
                        szReligions = szReligions + u"%c" %(gc.getReligionInfo(lHolyCity[iI]).getHolyCityChar())
        lReligions = pLoopCity.getReligions()
        if lReligions:
                iI = 0
                for iI in range(len(lReligions)):
                        if lReligions[iI] in lHolyCity:
                                continue
                        szReligions = szReligions + u"%c" %(gc.getReligionInfo(lReligions[iI]).getChar())
 
vbraun said:
This is better:


There is probably even room for a 9th religion! You could then play with the margains to gain even more room.

Instructions:
1. Open up Assests/Python/Screens/CvReligionScreen.py in Notepad
2. Find this variable: self.LEFT_EDGE_TEXT
3. Change whatever it is set to, to be -100.
4. Change the one below it to be 40 (Should be self.X_RELIGION_START)
It should look like this:
Code:
		self.LEFT_EDGE_TEXT = -100
		self.X_RELIGION_START = 40
		self.DX_RELIGION = 98
		self.Y_RELIGION = 35
5. Save file into either your Mod foulder or Custom Assests foulder. DO NOT OVERWRITE THE ORIGINAL!!!
Excellent, that's very helpful. This will make the religion advisor screen work just right, I figure. Thanks!
 
homegrown said:
The religion icons are in the game font (Assets/res/Fonts/GameFont.tga). You'll need to add your icon to that file (and maybe the 75 file?) twice (one w/ the star for the holy city and once without).

gamefont.jpg


If you added all the stuff to the XML, it just might not spit it back out at you (unexpected end of file error or somesuch). The code that the game uses to display those icons is what I used in my domestic advisor religion column.

Code:
# Religions...
szReligions = ""
        lHolyCity = pLoopCity.getHolyCity()
        if lHolyCity:
                iI = 0
                for iI in range(len(lHolyCity)):
                        szReligions = szReligions + u"%c" %(gc.getReligionInfo(lHolyCity[iI]).getHolyCityChar())
        lReligions = pLoopCity.getReligions()
        if lReligions:
                iI = 0
                for iI in range(len(lReligions)):
                        if lReligions[iI] in lHolyCity:
                                continue
                        szReligions = szReligions + u"%c" %(gc.getReligionInfo(lReligions[iI]).getChar())
OK, it doesn't look like it would be too hard to add 2 more icons to the .tga file. But I'm much better at manipulating images than I am at understanding code... What exactly does this bit of code do? How does the program know which bit of the .tga file to bring up when a particular religion is in the city?
 
MerakSpielman said:
OK, it doesn't look like it would be too hard to add 2 more icons to the .tga file. But I'm much better at manipulating images than I am at understanding code... What exactly does this bit of code do? How does the program know which bit of the .tga file to bring up when a particular religion is in the city?

This particular loop is inside a for statement that defines pLoopCity.. basically, it goes thru each city and first checks if that city is a Holy City. If it is a holy city, it grabs the appropriate icon and adds it to the display string.

How exactly it picks the icon is probably based on the number and order of ReligionInfos since they are in the font in a specific order, it's easy to bounce thru them until it grabs the correct one.

I only experimented with this a little by trying to add a red power icon. I defined it in CvUtils (where the game font is broken down into the specific sections), but ran into a problem with CvPythonExtensions coughing up a "reached end of line" error or something. From the API Reference, in the bottom left, I clicked on FontSymbols, and saw that entry 22 = MAX_NUM_SYMBOLS. So until I find the (I hope XML) file that list is kept in, I can't add more symbols there.

You may be lucky in that ReligionTypes don't seem to have a end of file built-in. As long as there is an entry in ReligionTypes (7 = RELIGION_NEOPAGANISM), theoretically, the game should be able to find and process your new icon.

Hope this helps. I'm not a programmer, I know just enough self-taught python to get me into trouble. :D
 
Back
Top Bottom