Quantcast
Channel: Civilization Fanatics' Forums
Viewing all articles
Browse latest Browse all 12856

Can't make building/unit unique to civ; overrides cause problems

$
0
0
Hey guys, I had a problem that I've been trying to solve but I am just unable to do it.

I have one building and one unit that I would like to make unique to one civilization. The problem is that it won't do it.

This is what I have as the overrides:

Code:

<GameData>
        <Civilization_BuildingClassOverrides>
                <Row>
                        <CivilizationType>CIVILIZATION_VIRTUCON</CivilizationType>
                        <BuildingClassType>BUILDINGCLASS_GLOBAL_HEADQUARTERS</BuildingClassType>
                        <BuildingType>BUILDING_GLOBAL_HEADQUARTERS</BuildingType>
                </Row>
        </Civilization_BuildingClassOverrides>
        <Civilization_UnitClassOverrides>
                <Row>
                        <CivilizationType>CIVILIZATION_VIRTUCON</CivilizationType>
                        <UnitClassType>UNITCLASS_VIRTUCON_HENCHMEN</UnitClassType>
                        <UnitType>UNIT_VIRTUCON_HENCHMEN</UnitType>
                </Row>
        </Civilization_UnitClassOverrides>
</GameData>

(I've kept the UnitClassType and UnitType pretty similar as you can see.)

Now, in my unit.xml and building.xml (which contain my unit and my building), I have left the
Code:

<DefaultBuilding>BUILDING_GLOBAL_HEADQUARTERS</DefaultBuilding>
and
Code:

<DefaultUnit>UNIT_VIRTUCON_HENCHMEN</DefaultUnit>
Now, as I understand it, the <DefaultBuilding> tag means that this building/unit will be available for all civilizations (The opposite of what I want).

"So why don't you just remove the <defaultbuilding> or <defaultunit> tag since that is precisely what is keeping said building/unit from being unique to said civilization?"

I have. And when I do, the building/unit DOES become unique to the civilization that I want to have it unique to (i.e. it solves the problem that I've put forth to you).

"Then what seems to be the problem?" The problem is if I do that (remove the <defaultbuilding> or <defaultunit> tag), suddenly (and magically I've come to think), all the text on the respective building/unit page goes blank. There is no writing or headers, nothing. So, with the <defaultbuilding> or <defaultunit> tag removed, if I were to head over to, say, the GLOBAL_HEADQUARTERS page, I would be facing a blank page (there would be the cost/the picture/requirements/[the things on the left hand side] but nothing on the right hand side). Even though such writings and civopedia entries come out perfectly when I leave the <defaultbuilding> or <defaultunit> tag on (but if said tags on, then the building/unit won't be unique to the civilization).

So I was hoping someone would know how to fix this? Kind of a weird problem and it has been making me really confused. I have attached my mod.

Here is the building.xml (not all of it, just the part that is relevant I assume)

Code:

<GameData>
        <BuildingClasses>
                <Row>
                        <Type>BUILDINGCLASS_GLOBAL_HEADQUARTERS</Type>
                        <!-- DEFAULTBUILDING tag apparently makes it so that everyone gets the building. but if you take it out, then magically all the text on the civelopida page goes blank... -->
                        <DefaultBuilding>BUILDING_GLOBAL_HEADQUARTERS</DefaultBuilding>
                        <Description>TXT_KEY_BUILDING_GLOBAL_HEADQUARTERS_HELP</Description>
                        <MaxPlayerInstances>1</MaxPlayerInstances>
                </Row>
        </BuildingClasses>
        <Buildings>
                <Row>
                        <Type>BUILDING_GLOBAL_HEADQUARTERS</Type>
                        <BuildingClass>BUILDINGCLASS_GLOBAL_HEADQUARTERS</BuildingClass>
                        <Description>TXT_KEY_BUILDING_GLOBAL_HEADQUARTERS_DESC</Description>
                        <Civilopedia>TXT_KEY_CIV5_BUILDING_GLOBAL_HEADQUARTERS_PEDIA</Civilopedia>
                        <Strategy>TXT_KEY_BUILDING_GLOBAL_HEADQUARTERS_STRATEGY</Strategy>
                        <Help>TXT_KEY_BUILDING_GLOBAL_HEADQUARTERS_HELP</Help>
                        <Quote></Quote>
                        <GoldMaintenance>0</GoldMaintenance>
                        <MutuallyExclusiveGroup>-1</MutuallyExclusiveGroup>

and units.xml (also just the relevant parts)
Code:

<GameData>
        <UnitClasses>
                <Row>
                        <Type>UNITCLASS_VIRTUCON_HENCHMEN</Type>
                        <Description>TXT_KEY_UNIT_VIRTUCON_HENCHMEN</Description>
                        <DefaultUnit>UNIT_VIRTUCON_HENCHMEN</DefaultUnit>
                </Row>
        </UnitClasses>
        <Units>
                <Row>
                        <Class>UNITCLASS_VIRTUCON_HENCHMEN</Class>
                        <Type>UNIT_VIRTUCON_HENCHMEN</Type>
                        <Description>TXT_KEY_UNIT_VIRTUCON_HENCHMEN</Description>
                        <Civilopedia>TXT_KEY_CIVILOPEDIA_UNITS_MODERN_VIRTUCON_HENCHMEN_TEXT</Civilopedia>
                        <Strategy>TXT_KEY_UNIT_VIRTUCON_HENCHMEN_STRATEGY</Strategy>
                        <Help>TXT_KEY_UNIT_HELP_VIRTUCON_HENCHMEN</Help>
                        <Requirements></Requirements>
                        <Combat>25</Combat>
                        <RangedCombat>0</RangedCombat>
                        <Cost>250</Cost>

The GameData tag and other tags are there I'm just posting the relevant parts.

~~
As a side note: Special Thanks to e-clipze-ea from whose "The Frisian Kingdom (Friesland)" mod I used as a general civilization template. Also here is the link to the mod if you prefer to download it that way

Attached Files
File Type: 7z Virtucon Dr. Evil Civilization (v 1).7z (538.7 KB)

Viewing all articles
Browse latest Browse all 12856

Trending Articles