Making unit art civ specific?

LakeTroll

Chieftain
Joined
Feb 21, 2009
Messages
23
I'm trying to give each civ in my mod unique art for each of their units. I am having trouble figuring out how to apply the new art to a specific civ rather than replacing the art for all civs. I'm sure I am missing an obvious line somewhere... Any help would be much appreciated!
 
Why not check out the Ethnic Units or R.E.D. mods and see how they handled this?
 
The easiest way for us to help is to attach the built mod that you have so far.

Regardless, there's two ways to do it.

One is to make lots of unique units. There are UI issues with that approach, and only some of them are solveable by modding. R.E.D. used to do it this way

The better way is the way R.E.D. and Ethnic Units now does it, by coopting the method that settlers use for regional variation. Taking apart Ethnic Units is probably easier to understand, but R.E.D. makes it really easy to edit all of the unit choices.

For this method, each Civ has to be coded in to change it from regional to Civ-specific. From Ethnic Units, here's America's entry to do so:
Spoiler :
Code:
-- AMERICA
UPDATE Civilizations SET ArtStyleSuffix = "_AMERICA" WHERE Type = 'CIVILIZATION_AMERICA';
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
	SELECT	REPLACE("Type", '_EURO', '_AMERICA'), "DamageStates", "Formation"
	FROM "ArtDefine_UnitInfos" WHERE Type LIKE '%_EURO';
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
	SELECT	REPLACE("UnitInfoType", '_EURO', '_AMERICA'), "UnitMemberInfoType", "NumMembers"
	FROM "ArtDefine_UnitInfoMemberInfos" WHERE UnitInfoType LIKE '%_EURO';

Then you need to set UnitArtInfoCulturalVariation in the Units table to 1 for each unit you want to change from the default unit. Note that UnitArtEraVariation (e.g., used for great people and workers) trumps the cultural, so you can't have both.
 
What table are the different cultural variants of units (i.e. settlers) stored in? I don't see it in the units.xml.
 
ArtDefine_UnitInfos
ArtDefine_UnitInfoMemberInfos
ArtDefine_UnitMemberCombatWeapons
ArtDefine_UnitMemberCombats
ArtDefine_UnitMemberInfos

edit: you should use a SQL database viewer to look at those table, like the SQlite Manager extansion for Firefox, as the XML defining those entries for the game does not use the same tags as the one you must use in a mod. Or simply look at Whoward's templates for examples.
 
Back
Top Bottom