Making buildings that have no Civilopedia entry

seasnake

Conquistador
Joined
Apr 21, 2006
Messages
1,892
Location
California, United States
Hi there, I'm wondering if there is an article or a tutorial on how to make buildings that do not have a civpedia entry? I'm planning to give each Civ it's own unique palace building so they enjoy unique benefits, but don't want 34 Palace buildings to scroll through in the Civpedia!
 
You could look at The_J's 'Invisible dummy techs' mod. SaibotLieh used a variation on it for his
female missionaries mod. Basically you put "missing" in the pedia tag value then in the python for the civlopedia you drop any entries after you read them in but befor they are displayed.

Post 2 heading Civilopedia: Invisible dummy techs of thread.
 
If you simple want nothing to be in the civilopedia, how about changing this:

<Civilopedia>TXT_KEY_BUILDING_PALACE_PEDIA</Civilopedia>

to this:

<Civilopedia/>

In my mod I do not reference any text files (unless already present) and simply feed in my data (etc..) right between the open and closed remarks.
 
If you simple want nothing to be in the civilopedia, how about changing this:

<Civilopedia>TXT_KEY_BUILDING_PALACE_PEDIA</Civilopedia>

to this:

<Civilopedia/>

In my mod I do not reference any text files (unless already present) and simply feed in my data (etc..) right between the open and closed remarks.

Unfortunately with this method you will still have many palace entries in the pedia they just wont have any text.
 
Use the <bGraphicalOnly> tag to hide buildings from civilopedia. You have to add it to the schema, but it will work, as DLL reads this for any info class, and the Civilopedia python files are already set to use it.

EDIT:

In CIV4BuildingSchema.XML

CTRL-F for iOrderPriority, then add this to the line below it:
<ElementType name="bGraphicalOnly" content="textOnly" dt:type="boolean"/>

search again, and add this below the next one:
<element type="bGraphicalOnly" minOccurs="0"/>

Then in CIV4BuildingInfos.XML you can add this at the very end of each building info, to hide it:
<bGraphicalOnly>1</bGraphicalOnly>
 
I wonder if there is an equivalent bGraphicalOnly tag for units and techs. It would replace The_J's mods and simplify the femalemissionary mod too. ;)
 
I wonder if there is an equivalent bGraphicalOnly tag for units and techs. It would replace The_J's mods and simplify the femalemissionary mod too. ;)

Yes, bGraphicalOnly tag is valid for every info class, though:
- it's not present in the schema, so you have to add it
- the effect is not always satisfactory, so some fixes are needed; I use it in the Sword of Islam to hide everything, including multiple versions of GPs and terrains, but it requires some extra coding to make it look right... for instance, a bGraphicalOnly unit is hidden in civilopedia list, but it still shows up in the "Replaced by..." link if it's a unique unit; to get rid of that you have to edit CvGameTextMgr.cpp (DLL)
- bGraphicalOnly stuff is also hidden from WorldBuilder, so depending on whether you're OK with it or not, you might need to edit CvWorldBuilderScreen.py
 
Wow, some great feedback. I'll try a few approaches out and see what happens. the idea is to have 40 different palaces because than each one can give special bonuses to the entire civ and it respawns in a new city if you lose the old one. For example, England will have a bonus to worker speed to building improvements like the Hagai Sophia does. Also thanks to Tsentom I can now use Python to link resources to buildings, so Civs like Mali will start with a gold resource.
 
Yes, bGraphicalOnly tag is valid for every info class, though:
- it's not present in the schema, so you have to add it
- the effect is not always satisfactory, so some fixes are needed; I use it in the Sword of Islam to hide everything, including multiple versions of GPs and terrains, but it requires some extra coding to make it look right... for instance, a bGraphicalOnly unit is hidden in civilopedia list, but it still shows up in the "Replaced by..." link if it's a unique unit; to get rid of that you have to edit CvGameTextMgr.cpp (DLL)
- bGraphicalOnly stuff is also hidden from WorldBuilder, so depending on whether you're OK with it or not, you might need to edit CvWorldBuilderScreen.py

Wow, works perfectly. The female unit does not appear in the index which is what I wanted but you can see both as a unique units for the religion and get to the description for the female unit. So as I said perfect. Thank you.

Wow, some great feedback. I'll try a few approaches out and see what happens. the idea is to have 40 different palaces because than each one can give special bonuses to the entire civ and it respawns in a new city if you lose the old one. For example, England will have a bonus to worker speed to building improvements like the Hagai Sophia does. Also thanks to Tsentom I can now use Python to link resources to buildings, so Civs like Mali will start with a gold resource.
Be warned that if you have a building that provides a resource it may break buildings that consume resources eg corporations. I have had trouble with a building that providing horses working but the corporation that consumed them not working. I have not investigated fully so it maybe a "removes access to" rather than just consumes that is causing my problem.
 
Wow, works perfectly. The female unit does not appear in the index which is what I wanted but you can see both as a unique units for the religion and get to the description for the female unit. So as I said perfect. Thank you.


Be warned that if you have a building that provides a resource it may break buildings that consume resources eg corporations. I have had trouble with a building that providing horses working but the corporation that consumed them not working. I have not investigated fully so it maybe a "removes access to" rather than just consumes that is causing my problem.

If you use Python instead of XML the resource just shows up as one in your cities' inventory and that's it. It's not linked to the building, it's just used and traded as if you had built your city on it.
 
If you use Python instead of XML the resource just shows up as one in your cities' inventory and that's it. It's not linked to the building, it's just used and traded as if you had built your city on it.

Where abouts in the tsentom1 code? I have been modularising some of his python wonders but have not seen this.
 
Well, it's been a while, but this is from my wonder the World Trade Center:
### WTC Start ###

if ( iBuildingType == gc.getInfoTypeForString("BUILDING_WTC") ):

pPlayer = gc.getPlayer(pCity.plot().getOwner())
iPID = pPlayer.getID()
iTID = pPlayer.getTeam()
iX = pCity.getX()
iY = pCity.getY()
b_school = gc.getInfoTypeForString("BUILDING_WTC")
C1uilding = "BUILDING_CORPORATION_1"
C2Building = "BUILDING_CORPORATION_2"
C3Building = "BUILDING_CORPORATION_3"
C4Building = "BUILDING_CORPORATION_4"
C5Building = "BUILDING_CORPORATION_5"
C6Building = "BUILDING_CORPORATION_6"
C7Building = "BUILDING_CORPORATION_7"

self.iGreatPeopleNumberOne = self.getRandomNumber( 6 )

for i in range(1):
if self.iGreatPeopleNumberOne == 0:
pCity.setNumRealBuilding(gc.getInfoTypeForString(C1Building), 1)
pCity.changeFreeBonus (gc.getInfoTypeForString("BONUS_CORN"), 1)
if self.iGreatPeopleNumberOne == 1:
pCity.setNumRealBuilding(gc.getInfoTypeForString(C2Building), 1)
pCity.changeFreeBonus (gc.getInfoTypeForString("BONUS_CRAB"), 1)
if self.iGreatPeopleNumberOne == 2:
pCity.setNumRealBuilding(gc.getInfoTypeForString(C3Building), 1)
pCity.changeFreeBonus (gc.getInfoTypeForString("BONUS_SUGAR"), 1)
if self.iGreatPeopleNumberOne == 3:
pCity.setNumRealBuilding(gc.getInfoTypeForString(C4Building), 1)
pCity.changeFreeBonus (gc.getInfoTypeForString("BONUS_STONE"), 1)
if self.iGreatPeopleNumberOne == 4:
pCity.setNumRealBuilding(gc.getInfoTypeForString(C5Building), 1)
pCity.changeFreeBonus (gc.getInfoTypeForString("BONUS_GOLD"), 1)
if self.iGreatPeopleNumberOne == 5:
pCity.setNumRealBuilding(gc.getInfoTypeForString(C6Building), 1)
pCity.changeFreeBonus (gc.getInfoTypeForString("BONUS_COAL"), 1)
if self.iGreatPeopleNumberOne == 6:
pCity.setNumRealBuilding(gc.getInfoTypeForString(C7Building), 1)
pCity.changeFreeBonus (gc.getInfoTypeForString("BONUS_SILVER"), 1)
### WTC end ###
In Civ Event Manager. Basically it uses the random factor from School of Confucius to found 1 Random Corporation. if that corporation is founded, you get a free bonus necessary to make the corporation active.

You can use the system to limit it to one option and just add the resource instead of the corporation. I've tried it before and it works well.

As for my latest project, the Sevopedia is NOT proving easy to work with.
 
Okay, so I've given up on Invisible Palace changes, it just means there'll be 40 more national wonders in the game. That's okay, with the Sevopedia it's pretty easy to scroll past them. I'll even write each name as "Palace of ____________" so they're all stuck together. It isn't worth the aggravation.

I did however use The_J's dummy techs mod to create invisible techs. I also discovered, by accident, that if you give a technology itself as its own prerequisite no civilization can build it. This is perfect, as I plan to give each Civ a distinct UA and some of those will come from techs not-buildable by others. For example, the Iroquois will be able to build Forest Preserves from the start of the game.
 
Well, it's been a while, but this is from my wonder the World Trade Center:

In Civ Event Manager. Basically it uses the random factor from School of Confucius to found 1 Random Corporation. if that corporation is founded, you get a free bonus necessary to make the corporation active.

You can use the system to limit it to one option and just add the resource instead of the corporation. I've tried it before and it works well.

As for my latest project, the Sevopedia is NOT proving easy to work with.

Excellent, thank you.

Edit: does this mean that a city can only have one free bonus?

Edit2: I can't find changeFreeBonus on the cyCity object in the doco

Edit3: OK got the code running without an error but it does not provide the resource. Maybe I should move my questions to the Python forum ;)
 
I did however use The_J's dummy techs mod to create invisible techs.

:)

I also discovered, by accident, that if you give a technology itself as its own prerequisite no civilization can build it.

There's even an easier option: The bDisable tag ;).
Circular things sure also work, but i once stumpled upon a crash in a very special case, so it's maybe better not to use it, if you have another option.
 
:)



There's even an easier option: The bDisable tag ;).
Circular things sure also work, but i once stumpled upon a crash in a very special case, so it's maybe better not to use it, if you have another option.

Awesome, used it and it works great, of course. Thanks for the pointers, for the awesome invisible techs, everything. This new mod is still very early on, but I'm laying the groundwork and it's been quite rewarding.
 
Top Bottom