[GS] Replacing Old Civ

Riker13

King
Joined
Nov 9, 2001
Messages
859
Location
UK
Hi All,
I have made a new Civ "Britannia" and I want it to replace England so when I let a new game pick other random players it wont pick England.
I thought there was a <Replace> tag that could be used under Civilization.xml but Im not sure.
Anybody know?

Regards
Riker13:crazyeye:
 
<Replace> does not work that way.

Code:
<GameData>
	<LocalizedText>
		<Row Tag="LOC_BUILDING_LRS_A" Language="en_US">
			<Text>Building A</Text>
		</Row>
		<Row Tag="LOC_BUILDING_LRS_B" Language="en_US">
			<Text>Building B</Text>
		</Row>
		<Replace Tag="LOC_BUILDING_LRS_B" Language="en_US">
			<Text>Cows eat grass, yes they do!</Text>
		</Replace>
	</LocalizedText>
</GameData>
<Replace> is the XML version of SQL's INSERT OR REPLACE INTO. It tells the game to first find a row within the given table that "matches" to the primary column-data (in this example "Tag" and "Language") and literally replace the data for that row if and only if there is already a matching row within the table. Otherwise, <Replace> will add a new row to the table with the data found within the <Replace> wrappers.

So in the example above the player would see
Code:
Cows eat grass, yes they do!
instead of
Code:
Building B

[edit] Edited to clean up some of my phrasing for better clarity

------------------------------------------------------------------------------------------------------------------------

These two sets of code will give the exact same result in-game:
Code:
<GameData>
	<LocalizedText>
		<Row Tag="LOC_BUILDING_LRS_A" Language="en_US">
			<Text>Building A</Text>
		</Row>
		<Row Tag="LOC_BUILDING_LRS_B" Language="en_US">
			<Text>Building B</Text>
		</Row>
		<Replace Tag="LOC_BUILDING_LRS_B" Language="en_US">
			<Text>Cows eat grass, yes they do!</Text>
		</Replace>
	</LocalizedText>
</GameData>
and
Code:
<GameData>
	<LocalizedText>
		<Row Tag="LOC_BUILDING_LRS_A" Language="en_US">
			<Text>Building A</Text>
		</Row>
		<Replace Tag="LOC_BUILDING_LRS_B" Language="en_US">
			<Text>Cows eat grass, yes they do!</Text>
		</Replace>
	</LocalizedText>
</GameData>
 
Last edited:
I see but what then do I use to disallow England to be picked it I choose Britannia?
 
Try using this table in the FrontEnd
Code:
TABLE 'DuplicateCivilizations' (
	'Domain' TEXT DEFAULT 'Players:StandardPlayers',
	'CivilizationType' TEXT NOT NULL,
	'OtherCivilizationType' TEXT NOT NULL
);
Firaxis does not use it, but I think (hope) it is probably implemented in the game-code, since they do use this table
Code:
TABLE 'DuplicateLeaders' (
	'Domain' TEXT DEFAULT 'Players:StandardPlayers',
	'LeaderType' TEXT NOT NULL,
	'OtherLeaderType' TEXT NOT NULL
);
With the following:[table=head]Domain | LeaderType | OtherLeaderType
Players:Expansion2_Players | LEADER_ELEANOR_ENGLAND | LEADER_ELEANOR_FRANCE[/table]
 
LeeS, just as a side note there is the <LeaderPlayable> within .modinfo is there a <LeaderUnPlayable>?
 
Not to my knowledge.

<LeaderPlayable> is meant to register whether a Leader is playable for a given expansion or scenario or whatever, not that the leader is playable for a specific play-through of the game.

If you want to make a leader unplayable when mod-X is active you can just delete that Player Row from the FrontEnd table <Players>. Just be aware this is really only going to work right for Vanilla and probably the Expacs -- because of the way the FrontEnd database is re-configured as mods are enabled and turned off in the additional content menu, adjusting the FrontEnd database based on whether some other mod leader is in existence is often difficult to get to work correctly because the order everything loads in the FrontEnd is for all practical purposes random and cannot be controlled by LoadOrder as it reliably can on the InGame side.
 
Last edited:
Going to start another play through so will give both above suggestions a go.
Thanks LeeS.
Have a good Christmas.
 
Back
Top Bottom