Help with getting units into the game

d0minus

Chieftain
Joined
Oct 3, 2013
Messages
50
great job on this danrell!!
I just worndering if u can help me on some adding tips ... (since gedemon is inactive couple of months now)
-Hoplite & Companion Cavarly doesnt seems to work on add through sql, what
heres tables:
HTML:
UPDATE Units SET UnitArtInfoCulturalVariation = 1 WHERE Type = 'UNIT_SPEARMAN';

-- GREECE
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
	SELECT	("ART_DEF_UNIT_U_GREEK_HOPLITE"), "DamageStates", "Formation"
	FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_SPEARMAN");
-- V1
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
	VALUES	("ART_DEF_UNIT_U_GREEK_HOPLITE", "ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE", 4);
-- V2
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
	VALUES	("ART_DEF_UNIT_U_GREEK_HOPLITE", "ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V2", 4);
-- V3
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
	VALUES	("ART_DEF_UNIT_U_GREEK_HOPLITE", "ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V3", 4);
-- V1
INSERT INTO "ArtDefine_UnitMemberCombats" ('UnitMemberType', 'EnableActions', 'DisableActions', 'MoveRadius', 'ShortMoveRadius', 'ChargeRadius', 'AttackRadius', 'RangedAttackRadius', 'MoveRate', 'ShortMoveRate', 'TurnRateMin', 'TurnRateMax', 'TurnFacingRateMin', 'TurnFacingRateMax', 'RollRateMin', 'RollRateMax', 'PitchRateMin', 'PitchRateMax', 'LOSRadiusScale', 'TargetRadius', 'TargetHeight', 'HasShortRangedAttack', 'HasLongRangedAttack', 'HasLeftRightAttack', 'HasStationaryMelee', 'HasStationaryRangedAttack', 'HasRefaceAfterCombat', 'ReformBeforeCombat', 'HasIndependentWeaponFacing', 'HasOpponentTracking', 'HasCollisionAttack', 'AttackAltitude', 'AltitudeDecelerationDistance', 'OnlyTurnInMovementActions', 'RushAttackFormation')
	SELECT	("ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE"), "EnableActions", "DisableActions", "MoveRadius", "ShortMoveRadius", "ChargeRadius", "AttackRadius", "RangedAttackRadius", 
			"MoveRate", "ShortMoveRate", "TurnRateMin", "TurnRateMax", "TurnFacingRateMin", "TurnFacingRateMax", "RollRateMin", "RollRateMax", "PitchRateMin", "PitchRateMax", "LOSRadiusScale", "TargetRadius", "TargetHeight", "HasShortRangedAttack", "HasLongRangedAttack", "HasLeftRightAttack", "HasStationaryMelee", "HasStationaryRangedAttack", "HasRefaceAfterCombat", "ReformBeforeCombat", "HasIndependentWeaponFacing", "HasOpponentTracking", "HasCollisionAttack", "AttackAltitude", "AltitudeDecelerationDistance", "OnlyTurnInMovementActions", "RushAttackFormation"
	FROM "ArtDefine_UnitMemberCombats" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_SPEARMAN");
INSERT INTO "ArtDefine_UnitMemberCombatWeapons" ('UnitMemberType', 'Index', 'SubIndex', 'ID', 'VisKillStrengthMin', 'VisKillStrengthMax', 'ProjectileSpeed', 'ProjectileTurnRateMin', 'ProjectileTurnRateMax', 'HitEffect', 'HitEffectScale', 'HitRadius', 'ProjectileChildEffectScale', 'AreaDamageDelay', 'ContinuousFire', 'WaitForEffectCompletion', 'TargetGround', 'IsDropped', 'WeaponTypeTag', 'WeaponTypeSoundOverrideTag')
	SELECT ("ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE"), "Index", "SubIndex", "ID", "VisKillStrengthMin", "VisKillStrengthMax", "ProjectileSpeed", "ProjectileTurnRateMin", "ProjectileTurnRateMax", "HitEffect", "HitEffectScale", "HitRadius", "ProjectileChildEffectScale", "AreaDamageDelay", "ContinuousFire", "WaitForEffectCompletion", "TargetGround", "IsDropped", "WeaponTypeTag", "WeaponTypeSoundOverrideTag"
	FROM "ArtDefine_UnitMemberCombatWeapons" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_SPEARMAN");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
	SELECT	("ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE"), "Scale", "ZOffset", "Domain", 
			("Spearman_Greece.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
	FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_SPEARMAN");
-- V2
INSERT INTO "ArtDefine_UnitMemberCombats" ('UnitMemberType', 'EnableActions', 'DisableActions', 'MoveRadius', 'ShortMoveRadius', 'ChargeRadius', 'AttackRadius', 'RangedAttackRadius', 'MoveRate', 'ShortMoveRate', 'TurnRateMin', 'TurnRateMax', 'TurnFacingRateMin', 'TurnFacingRateMax', 'RollRateMin', 'RollRateMax', 'PitchRateMin', 'PitchRateMax', 'LOSRadiusScale', 'TargetRadius', 'TargetHeight', 'HasShortRangedAttack', 'HasLongRangedAttack', 'HasLeftRightAttack', 'HasStationaryMelee', 'HasStationaryRangedAttack', 'HasRefaceAfterCombat', 'ReformBeforeCombat', 'HasIndependentWeaponFacing', 'HasOpponentTracking', 'HasCollisionAttack', 'AttackAltitude', 'AltitudeDecelerationDistance', 'OnlyTurnInMovementActions', 'RushAttackFormation')
	SELECT	("ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V2"), "EnableActions", "DisableActions", "MoveRadius", "ShortMoveRadius", "ChargeRadius", "AttackRadius", "RangedAttackRadius", 
			"MoveRate", "ShortMoveRate", "TurnRateMin", "TurnRateMax", "TurnFacingRateMin", "TurnFacingRateMax", "RollRateMin", "RollRateMax", "PitchRateMin", "PitchRateMax", "LOSRadiusScale", "TargetRadius", "TargetHeight", "HasShortRangedAttack", "HasLongRangedAttack", "HasLeftRightAttack", "HasStationaryMelee", "HasStationaryRangedAttack", "HasRefaceAfterCombat", "ReformBeforeCombat", "HasIndependentWeaponFacing", "HasOpponentTracking", "HasCollisionAttack", "AttackAltitude", "AltitudeDecelerationDistance", "OnlyTurnInMovementActions", "RushAttackFormation"
	FROM "ArtDefine_UnitMemberCombats" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_SPEARMAN");
INSERT INTO "ArtDefine_UnitMemberCombatWeapons" ('UnitMemberType', 'Index', 'SubIndex', 'ID', 'VisKillStrengthMin', 'VisKillStrengthMax', 'ProjectileSpeed', 'ProjectileTurnRateMin', 'ProjectileTurnRateMax', 'HitEffect', 'HitEffectScale', 'HitRadius', 'ProjectileChildEffectScale', 'AreaDamageDelay', 'ContinuousFire', 'WaitForEffectCompletion', 'TargetGround', 'IsDropped', 'WeaponTypeTag', 'WeaponTypeSoundOverrideTag')
	SELECT ("ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V2"), "Index", "SubIndex", "ID", "VisKillStrengthMin", "VisKillStrengthMax", "ProjectileSpeed", "ProjectileTurnRateMin", "ProjectileTurnRateMax", "HitEffect", "HitEffectScale", "HitRadius", "ProjectileChildEffectScale", "AreaDamageDelay", "ContinuousFire", "WaitForEffectCompletion", "TargetGround", "IsDropped", "WeaponTypeTag", "WeaponTypeSoundOverrideTag"
	FROM "ArtDefine_UnitMemberCombatWeapons" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_SPEARMAN");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
	SELECT	("ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V2"), "Scale", "ZOffset", "Domain", 
			("Spearman_Greece_v2.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
	FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_SPEARMAN");
-- V3
INSERT INTO "ArtDefine_UnitMemberCombats" ('UnitMemberType', 'EnableActions', 'DisableActions', 'MoveRadius', 'ShortMoveRadius', 'ChargeRadius', 'AttackRadius', 'RangedAttackRadius', 'MoveRate', 'ShortMoveRate', 'TurnRateMin', 'TurnRateMax', 'TurnFacingRateMin', 'TurnFacingRateMax', 'RollRateMin', 'RollRateMax', 'PitchRateMin', 'PitchRateMax', 'LOSRadiusScale', 'TargetRadius', 'TargetHeight', 'HasShortRangedAttack', 'HasLongRangedAttack', 'HasLeftRightAttack', 'HasStationaryMelee', 'HasStationaryRangedAttack', 'HasRefaceAfterCombat', 'ReformBeforeCombat', 'HasIndependentWeaponFacing', 'HasOpponentTracking', 'HasCollisionAttack', 'AttackAltitude', 'AltitudeDecelerationDistance', 'OnlyTurnInMovementActions', 'RushAttackFormation')
	SELECT	("ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V3"), "EnableActions", "DisableActions", "MoveRadius", "ShortMoveRadius", "ChargeRadius", "AttackRadius", "RangedAttackRadius", 
			"MoveRate", "ShortMoveRate", "TurnRateMin", "TurnRateMax", "TurnFacingRateMin", "TurnFacingRateMax", "RollRateMin", "RollRateMax", "PitchRateMin", "PitchRateMax", "LOSRadiusScale", "TargetRadius", "TargetHeight", "HasShortRangedAttack", "HasLongRangedAttack", "HasLeftRightAttack", "HasStationaryMelee", "HasStationaryRangedAttack", "HasRefaceAfterCombat", "ReformBeforeCombat", "HasIndependentWeaponFacing", "HasOpponentTracking", "HasCollisionAttack", "AttackAltitude", "AltitudeDecelerationDistance", "OnlyTurnInMovementActions", "RushAttackFormation"
	FROM "ArtDefine_UnitMemberCombats" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_SPEARMAN");
INSERT INTO "ArtDefine_UnitMemberCombatWeapons" ('UnitMemberType', 'Index', 'SubIndex', 'ID', 'VisKillStrengthMin', 'VisKillStrengthMax', 'ProjectileSpeed', 'ProjectileTurnRateMin', 'ProjectileTurnRateMax', 'HitEffect', 'HitEffectScale', 'HitRadius', 'ProjectileChildEffectScale', 'AreaDamageDelay', 'ContinuousFire', 'WaitForEffectCompletion', 'TargetGround', 'IsDropped', 'WeaponTypeTag', 'WeaponTypeSoundOverrideTag')
	SELECT ("ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V3"), "Index", "SubIndex", "ID", "VisKillStrengthMin", "VisKillStrengthMax", "ProjectileSpeed", "ProjectileTurnRateMin", "ProjectileTurnRateMax", "HitEffect", "HitEffectScale", "HitRadius", "ProjectileChildEffectScale", "AreaDamageDelay", "ContinuousFire", "WaitForEffectCompletion", "TargetGround", "IsDropped", "WeaponTypeTag", "WeaponTypeSoundOverrideTag"
	FROM "ArtDefine_UnitMemberCombatWeapons" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_SPEARMAN");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
	SELECT	("ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V3"), "Scale", "ZOffset", "Domain", 
			("Spearman_Greece_v3.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
	FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_SPEARMAN");
UPDATE Units SET UnitArtInfoCulturalVariation = 1 WHERE Type = 'UNIT_HORSEMAN';

-- GREECE HORSEMAN
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
	SELECT	("ART_DEF_UNIT_U_GREEK_COMPANIONCAVALRY"), "DamageStates", "Formation"
	FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_HORSEMAN");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
	SELECT	("ART_DEF_UNIT_U_GREEK_COMPANIONCAVALRY"), ("ART_DEF_UNIT_MEMBER_U_GREEK_COMPANIONCAVALRY"), "NumMembers"
	FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_HORSEMAN");
INSERT INTO "ArtDefine_UnitMemberCombats" ('UnitMemberType', 'EnableActions', 'DisableActions', 'MoveRadius', 'ShortMoveRadius', 'ChargeRadius', 'AttackRadius', 'RangedAttackRadius', 'MoveRate', 'ShortMoveRate', 'TurnRateMin', 'TurnRateMax', 'TurnFacingRateMin', 'TurnFacingRateMax', 'RollRateMin', 'RollRateMax', 'PitchRateMin', 'PitchRateMax', 'LOSRadiusScale', 'TargetRadius', 'TargetHeight', 'HasShortRangedAttack', 'HasLongRangedAttack', 'HasLeftRightAttack', 'HasStationaryMelee', 'HasStationaryRangedAttack', 'HasRefaceAfterCombat', 'ReformBeforeCombat', 'HasIndependentWeaponFacing', 'HasOpponentTracking', 'HasCollisionAttack', 'AttackAltitude', 'AltitudeDecelerationDistance', 'OnlyTurnInMovementActions', 'RushAttackFormation')
	SELECT	("ART_DEF_UNIT_MEMBER_U_GREEK_COMPANIONCAVALRY"), "EnableActions", "DisableActions", "MoveRadius", "ShortMoveRadius", "ChargeRadius", "AttackRadius", "RangedAttackRadius", 
			"MoveRate", "ShortMoveRate", "TurnRateMin", "TurnRateMax", "TurnFacingRateMin", "TurnFacingRateMax", "RollRateMin", "RollRateMax", "PitchRateMin", "PitchRateMax", "LOSRadiusScale", "TargetRadius", "TargetHeight", "HasShortRangedAttack", "HasLongRangedAttack", "HasLeftRightAttack", "HasStationaryMelee", "HasStationaryRangedAttack", "HasRefaceAfterCombat", "ReformBeforeCombat", "HasIndependentWeaponFacing", "HasOpponentTracking", "HasCollisionAttack", "AttackAltitude", "AltitudeDecelerationDistance", "OnlyTurnInMovementActions", "RushAttackFormation"
	FROM "ArtDefine_UnitMemberCombats" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_HORSEMAN");
INSERT INTO "ArtDefine_UnitMemberCombatWeapons" ('UnitMemberType', 'Index', 'SubIndex', 'ID', 'VisKillStrengthMin', 'VisKillStrengthMax', 'ProjectileSpeed', 'ProjectileTurnRateMin', 'ProjectileTurnRateMax', 'HitEffect', 'HitEffectScale', 'HitRadius', 'ProjectileChildEffectScale', 'AreaDamageDelay', 'ContinuousFire', 'WaitForEffectCompletion', 'TargetGround', 'IsDropped', 'WeaponTypeTag', 'WeaponTypeSoundOverrideTag')
	SELECT ("ART_DEF_UNIT_MEMBER_U_GREEK_COMPANIONCAVALRY"), "Index", "SubIndex", "ID", "VisKillStrengthMin", "VisKillStrengthMax", "ProjectileSpeed", "ProjectileTurnRateMin", "ProjectileTurnRateMax", "HitEffect", "HitEffectScale", "HitRadius", "ProjectileChildEffectScale", "AreaDamageDelay", "ContinuousFire", "WaitForEffectCompletion", "TargetGround", "IsDropped", "WeaponTypeTag", "WeaponTypeSoundOverrideTag"
	FROM "ArtDefine_UnitMemberCombatWeapons" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_HORSEMAN");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
	SELECT	("ART_DEF_UNIT_MEMBER_U_GREEK_COMPANIONCAVALRY"), "Scale", "ZOffset", "Domain", 
			("Horseman_Greece.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
	FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_HORSEMAN");
 
I think it's because the Greek Hoplite and Companion Cavalry are listed in that way for the ones that came with the game (as UUs for Greece). Try calling them something different and see if it works.
Actually I did it, by Horseman/Spearman but nothing if thats what u ment.
thanx for repling
 
Actually I did it, by Horseman/Spearman but nothing if thats what u ment.
thanx for repling

It's kind of what I meant, but horseman, spearman, companion cavalry and Greek hoplite are all names of units already in the game, so you need to chose something different or it won't work. Try calling the spearman a phalanx and the horseman "GreekCav" and see what happens.
 
:confused: I have infant knowledge on sql, but the rest skin replacings I did worked...
Anyway I'll try it...
 
It's kind of what I meant, but horseman, spearman, companion cavalry and Greek hoplite are all names of units already in the game, so you need to chose something different or it won't work. Try calling the spearman a phalanx and the horseman "GreekCav" and see what happens.

tryed it but no luck , I also tryed many combinations ... like If u checked the table at FROM ArtDefine_UnitInfos WHERE (Type = 'ART_DEF_UNIT_SPEARMAN/HORSEMAN');
I change it to "U_GREEK_HOPLITE" cause I thought it was wrong but nothing
I also check some others sqls using those skins on some mods, like Gedemon's sql's its completly different written, what kind of coding he's using at Red do u have any clue?
Thanx
 
Are you also changing the line in the Units.xml file to the same name that you're using in the SQL file?

The line I mean is:
<UnitArtInfo>ART_DEF_UNIT_U_GREEK_COMPANIONCAVALRY</UnitArtInfo>

The other thing to re-iterate is to use names other than companion cavalry and greek hoplite, as they're already taken.
 
Are you also changing the line in the Units.xml file to the same name that you're using in the SQL file?

The line I mean is:
<UnitArtInfo>ART_DEF_UNIT_U_GREEK_COMPANIONCAVALRY</UnitArtInfo>

The other thing to re-iterate is to use names other than companion cavalry and greek hoplite, as they're already taken.

Should I change all tables like <MemberTypes> and from UnitMembers.xml too??
 
No - the sql files are sorting that out.

I'm moving this discussion to it's own thread under the main Creation & Customisation forum, entitled "Help with getting units into the game". This way, we don't derail the current thread and also it'll be more likely to attract the attention of people who can help.
 
Are you also changing the line in the Units.xml file to the same name that you're using in the SQL file?

The line I mean is:
<UnitArtInfo>ART_DEF_UNIT_U_GREEK_COMPANIONCAVALRY</UnitArtInfo>

The other thing to re-iterate is to use names other than companion cavalry and greek hoplite, as they're already taken.

Now thats a progress, althouth unfairly changed unit do default spearman skin :lol: ...
 
Now thats a progress, althouth unfairly changed unit do default spearman skin :lol: ...

Congratulations ;)!

This is the code I used to get the Greek spearman that Danrell did into my Anno Domini mod - I'd used it as a Heavy spearman for the Mycenae:

SQL part:
Spoiler :

--HEAVY SPEARMAN-------------------------------------------------------------------------------------------------------------------
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
SELECT ("ART_DEF_UNIT_GUARD_MYCENAE"), "DamageStates", ("Phalanx")
FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_SPEARMAN");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
VALUES ("ART_DEF_UNIT_GUARD_MYCENAE", "ART_DEF_UNIT_MEMBER_GUARD_MYCENAE", "12");
INSERT INTO "ArtDefine_UnitMemberCombats" ('UnitMemberType', 'EnableActions', 'DisableActions', 'MoveRadius', 'ShortMoveRadius', 'ChargeRadius', 'AttackRadius', 'RangedAttackRadius', 'MoveRate', 'ShortMoveRate', 'TurnRateMin', 'TurnRateMax', 'TurnFacingRateMin', 'TurnFacingRateMax', 'RollRateMin', 'RollRateMax', 'PitchRateMin', 'PitchRateMax', 'LOSRadiusScale', 'TargetRadius', 'TargetHeight', 'HasShortRangedAttack', 'HasLongRangedAttack', 'HasLeftRightAttack', 'HasStationaryMelee', 'HasStationaryRangedAttack', 'HasRefaceAfterCombat', 'ReformBeforeCombat', 'HasIndependentWeaponFacing', 'HasOpponentTracking', 'HasCollisionAttack', 'AttackAltitude', 'AltitudeDecelerationDistance', 'OnlyTurnInMovementActions', 'RushAttackFormation')
SELECT ("ART_DEF_UNIT_MEMBER_GUARD_MYCENAE"), "EnableActions", "DisableActions", "MoveRadius", "ShortMoveRadius", "ChargeRadius", "AttackRadius", "RangedAttackRadius",
"MoveRate", "ShortMoveRate", "TurnRateMin", "TurnRateMax", "TurnFacingRateMin", "TurnFacingRateMax", "RollRateMin", "RollRateMax", "PitchRateMin", "PitchRateMax", "LOSRadiusScale", "TargetRadius", "TargetHeight", "HasShortRangedAttack", "HasLongRangedAttack", "HasLeftRightAttack", "HasStationaryMelee", "HasStationaryRangedAttack", "HasRefaceAfterCombat", "ReformBeforeCombat", "HasIndependentWeaponFacing", "HasOpponentTracking", "HasCollisionAttack", "AttackAltitude", "AltitudeDecelerationDistance", "OnlyTurnInMovementActions", "RushAttackFormation"
FROM "ArtDefine_UnitMemberCombats" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_SPEARMAN");
INSERT INTO "ArtDefine_UnitMemberCombatWeapons" ('UnitMemberType', 'Index', 'SubIndex', 'ID', 'VisKillStrengthMin', 'VisKillStrengthMax', 'ProjectileSpeed', 'ProjectileTurnRateMin', 'ProjectileTurnRateMax', 'HitEffect', 'HitEffectScale', 'HitRadius', 'ProjectileChildEffectScale', 'AreaDamageDelay', 'ContinuousFire', 'WaitForEffectCompletion', 'TargetGround', 'IsDropped', 'WeaponTypeTag', 'WeaponTypeSoundOverrideTag')
SELECT ("ART_DEF_UNIT_MEMBER_GUARD_MYCENAE"), "Index", "SubIndex", "ID", "VisKillStrengthMin", "VisKillStrengthMax", "ProjectileSpeed", "ProjectileTurnRateMin", "ProjectileTurnRateMax", "HitEffect", "HitEffectScale", "HitRadius", "ProjectileChildEffectScale", "AreaDamageDelay", "ContinuousFire", "WaitForEffectCompletion", "TargetGround", "IsDropped", "WeaponTypeTag", "WeaponTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberCombatWeapons" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_SPEARMAN");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
SELECT ("ART_DEF_UNIT_MEMBER_GUARD_MYCENAE"), "Scale", "ZOffset", "Domain",
("Spearman_Greece.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_SPEARMAN");


Also, on the same SQL file, I have:
UPDATE Civilizations SET ArtStyleSuffix = "_MYCENAE" WHERE Type = 'CIVILIZATION_MYCENAE';
UPDATE Units SET UnitArtInfoCulturalVariation = 1 WHERE Type = 'UNIT_HEAVY_SPEARMAN';

Then, in the units.xml file, here's how I set up the Heavy Spearman (which is a generic unit - what we did in the SQL part above was to set a cultural variation for Mycanae's Heavy Spearman). Obviously, there's other bits in the xml, such as the promotions, but this is the initial part.

Spoiler :

<Row>
<Class>UNITCLASS_HEAVY_SPEARMAN</Class>
<Type>UNIT_HEAVY_SPEARMAN</Type>
<PrereqTech>TECH_TACTICS</PrereqTech>
<Combat>15</Combat>
<Cost>110</Cost>
<FaithCost>220</FaithCost>
<RequiresFaithPurchaseEnabled>true</RequiresFaithPurchaseEnabled>
<Moves>2</Moves>
<CombatClass>UNITCOMBAT_MELEE</CombatClass>
<Domain>DOMAIN_LAND</Domain>
<DefaultUnitAI>UNITAI_COUNTER</DefaultUnitAI>
<Description>TXT_KEY_UNIT_HEAVY_SPEARMAN</Description>
<Civilopedia>TXT_KEY_CIV5_ANTIQUITY_HEAVY_SPEARMAN_TEXT</Civilopedia>
<Strategy>TXT_KEY_UNIT_HEAVY_SPEARMAN_STRATEGY</Strategy>
<Help>TXT_KEY_UNIT_HELP_HEAVY_SPEARMAN</Help>
<MilitarySupport>true</MilitarySupport>
<MilitaryProduction>true</MilitaryProduction>
<Pillage>true</Pillage>
<AdvancedStartCost>15</AdvancedStartCost>
<ObsoleteTech>TECH_DEFENCE_STRATEGY</ObsoleteTech>
<GoodyHutUpgradeUnitClass>UNITCLASS_GARRISON</GoodyHutUpgradeUnitClass>
<XPValueAttack>3</XPValueAttack>
<XPValueDefense>3</XPValueDefense>
<Conscription>2</Conscription>
<UnitArtInfo>ART_DEF_UNIT_GUARD</UnitArtInfo>
<UnitFlagAtlas>P3_UNIT_FLAG_ATLAS</UnitFlagAtlas>
<UnitFlagIconOffset>2</UnitFlagIconOffset>
<IconAtlas>UNIT_ATLAS_1</IconAtlas>
<PortraitIndex>10</PortraitIndex>
</Row>


Hope that helps.
 
Congratulations ;)!

This is the code I used to get the Greek spearman that Danrell did into my Anno Domini mod - I'd used it as a Heavy spearman for the Mycenae:

SQL part:
Spoiler :

--HEAVY SPEARMAN-------------------------------------------------------------------------------------------------------------------
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
SELECT ("ART_DEF_UNIT_GUARD_MYCENAE"), "DamageStates", ("Phalanx")
FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_SPEARMAN");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
VALUES ("ART_DEF_UNIT_GUARD_MYCENAE", "ART_DEF_UNIT_MEMBER_GUARD_MYCENAE", "12");
INSERT INTO "ArtDefine_UnitMemberCombats" ('UnitMemberType', 'EnableActions', 'DisableActions', 'MoveRadius', 'ShortMoveRadius', 'ChargeRadius', 'AttackRadius', 'RangedAttackRadius', 'MoveRate', 'ShortMoveRate', 'TurnRateMin', 'TurnRateMax', 'TurnFacingRateMin', 'TurnFacingRateMax', 'RollRateMin', 'RollRateMax', 'PitchRateMin', 'PitchRateMax', 'LOSRadiusScale', 'TargetRadius', 'TargetHeight', 'HasShortRangedAttack', 'HasLongRangedAttack', 'HasLeftRightAttack', 'HasStationaryMelee', 'HasStationaryRangedAttack', 'HasRefaceAfterCombat', 'ReformBeforeCombat', 'HasIndependentWeaponFacing', 'HasOpponentTracking', 'HasCollisionAttack', 'AttackAltitude', 'AltitudeDecelerationDistance', 'OnlyTurnInMovementActions', 'RushAttackFormation')
SELECT ("ART_DEF_UNIT_MEMBER_GUARD_MYCENAE"), "EnableActions", "DisableActions", "MoveRadius", "ShortMoveRadius", "ChargeRadius", "AttackRadius", "RangedAttackRadius",
"MoveRate", "ShortMoveRate", "TurnRateMin", "TurnRateMax", "TurnFacingRateMin", "TurnFacingRateMax", "RollRateMin", "RollRateMax", "PitchRateMin", "PitchRateMax", "LOSRadiusScale", "TargetRadius", "TargetHeight", "HasShortRangedAttack", "HasLongRangedAttack", "HasLeftRightAttack", "HasStationaryMelee", "HasStationaryRangedAttack", "HasRefaceAfterCombat", "ReformBeforeCombat", "HasIndependentWeaponFacing", "HasOpponentTracking", "HasCollisionAttack", "AttackAltitude", "AltitudeDecelerationDistance", "OnlyTurnInMovementActions", "RushAttackFormation"
FROM "ArtDefine_UnitMemberCombats" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_SPEARMAN");
INSERT INTO "ArtDefine_UnitMemberCombatWeapons" ('UnitMemberType', 'Index', 'SubIndex', 'ID', 'VisKillStrengthMin', 'VisKillStrengthMax', 'ProjectileSpeed', 'ProjectileTurnRateMin', 'ProjectileTurnRateMax', 'HitEffect', 'HitEffectScale', 'HitRadius', 'ProjectileChildEffectScale', 'AreaDamageDelay', 'ContinuousFire', 'WaitForEffectCompletion', 'TargetGround', 'IsDropped', 'WeaponTypeTag', 'WeaponTypeSoundOverrideTag')
SELECT ("ART_DEF_UNIT_MEMBER_GUARD_MYCENAE"), "Index", "SubIndex", "ID", "VisKillStrengthMin", "VisKillStrengthMax", "ProjectileSpeed", "ProjectileTurnRateMin", "ProjectileTurnRateMax", "HitEffect", "HitEffectScale", "HitRadius", "ProjectileChildEffectScale", "AreaDamageDelay", "ContinuousFire", "WaitForEffectCompletion", "TargetGround", "IsDropped", "WeaponTypeTag", "WeaponTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberCombatWeapons" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_SPEARMAN");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
SELECT ("ART_DEF_UNIT_MEMBER_GUARD_MYCENAE"), "Scale", "ZOffset", "Domain",
("Spearman_Greece.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_SPEARMAN");


Also, on the same SQL file, I have:
UPDATE Civilizations SET ArtStyleSuffix = "_MYCENAE" WHERE Type = 'CIVILIZATION_MYCENAE';
UPDATE Units SET UnitArtInfoCulturalVariation = 1 WHERE Type = 'UNIT_HEAVY_SPEARMAN';

Then, in the units.xml file, here's how I set up the Heavy Spearman (which is a generic unit - what we did in the SQL part above was to set a cultural variation for Mycanae's Heavy Spearman). Obviously, there's other bits in the xml, such as the promotions, but this is the initial part.

Spoiler :

<Row>
<Class>UNITCLASS_HEAVY_SPEARMAN</Class>
<Type>UNIT_HEAVY_SPEARMAN</Type>
<PrereqTech>TECH_TACTICS</PrereqTech>
<Combat>15</Combat>
<Cost>110</Cost>
<FaithCost>220</FaithCost>
<RequiresFaithPurchaseEnabled>true</RequiresFaithPurchaseEnabled>
<Moves>2</Moves>
<CombatClass>UNITCOMBAT_MELEE</CombatClass>
<Domain>DOMAIN_LAND</Domain>
<DefaultUnitAI>UNITAI_COUNTER</DefaultUnitAI>
<Description>TXT_KEY_UNIT_HEAVY_SPEARMAN</Description>
<Civilopedia>TXT_KEY_CIV5_ANTIQUITY_HEAVY_SPEARMAN_TEXT</Civilopedia>
<Strategy>TXT_KEY_UNIT_HEAVY_SPEARMAN_STRATEGY</Strategy>
<Help>TXT_KEY_UNIT_HELP_HEAVY_SPEARMAN</Help>
<MilitarySupport>true</MilitarySupport>
<MilitaryProduction>true</MilitaryProduction>
<Pillage>true</Pillage>
<AdvancedStartCost>15</AdvancedStartCost>
<ObsoleteTech>TECH_DEFENCE_STRATEGY</ObsoleteTech>
<GoodyHutUpgradeUnitClass>UNITCLASS_GARRISON</GoodyHutUpgradeUnitClass>
<XPValueAttack>3</XPValueAttack>
<XPValueDefense>3</XPValueDefense>
<Conscription>2</Conscription>
<UnitArtInfo>ART_DEF_UNIT_GUARD</UnitArtInfo>
<UnitFlagAtlas>P3_UNIT_FLAG_ATLAS</UnitFlagAtlas>
<UnitFlagIconOffset>2</UnitFlagIconOffset>
<IconAtlas>UNIT_ATLAS_1</IconAtlas>
<PortraitIndex>10</PortraitIndex>
</Row>


Hope that helps.

Well as I can recognize in your tables u added new civ & new class , plus u didnt add all version of skins (v2+v3.fxsxml)... I dont know if somehow I can use it ,but I will try.
Thanx anyway for your assistance I appreciate it!! :goodjob:
- While I made a carefull study on Gedemons sql I noticed some tables that maybe r usefull , the only think is I dont know how to add them on my sql...:think:
Spoiler :
-- Replace UU (Initialize) -----------------------------------------------------------------------------------------------
DELETE FROM ArtDefine_UnitInfoMemberInfos WHERE UnitInfoType='ART_DEF_UNIT_U_GREEK_HOPLITE';
--------------------------------------------------------------------------------------------------------------------------
UPDATE ArtDefine_UnitMemberInfos SET Model = 'Horseman_Greece.fxsxml' WHERE Type = 'ART_DEF_UNIT_MEMBER_U_GREEK_COMPANIONCAVALRY';
-- Special case for UU replacement (see 'Initialize' above and 'Finalize' in '5-CompleteTable.sql')
SELECT 'TEMP', '_V1', 'Spearman_Greece.fxsxml', 'ART_DEF_UNIT_U_GREEK_HOPLITE', 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE', 2, NULL, 0 UNION ALL
SELECT 'TEMP', '_V2', 'Spearman_Greece_v2.fxsxml', 'ART_DEF_UNIT_U_GREEK_HOPLITE', 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE', 3, NULL, 0 UNION ALL
SELECT 'TEMP', '_V3', 'Spearman_Greece_v3.fxsxml', 'ART_DEF_UNIT_U_GREEK_HOPLITE', 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE', 4, NULL, 0 UNION ALL
SELECT 'TEMP', '_V1', 'Spearman_Greece.fxsxml', 'ART_DEF_UNIT_U_GREEK_HOPLITE', 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE', 4, NULL, 0 UNION ALL
SELECT 'TEMP', '_V2', 'Spearman_Greece_v2.fxsxml', 'ART_DEF_UNIT_U_GREEK_HOPLITE', 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE', 3, NULL, 0 UNION ALL
SELECT 'TEMP', '_V3', 'Spearman_Greece_v3.fxsxml', 'ART_DEF_UNIT_U_GREEK_HOPLITE', 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE', 2, NULL, 0 UNION ALL

SELECT 'GREECE', 'GREECE','Assets/Units/U_Greek_Hoplite/U_Greek_Hoplite.fxsxml','ART_DEF_UNIT_SPEARMAN', 'ART_DEF_UNIT_MEMBER_SPEARMAN', 0, NULL, 0 UNION ALL

When I tryed I got a crash...
Any idea??
 
I didn't put all the skins in there as what I posted was meant to serve as an example. You just need to copy, paste and edit to get other units into the game.

I honestly don't know how I can help you any further as I don't really know much about SQL - just copied from other people and edited, but I'm sure others will have a look at this and put you on the right path.
 
If I understand what you're trying to do (i.e., replace the Companion Cavalry and Hoplite with new models), the code is pretty easy. Note you don't need to enable CulturalVariation (because we're only talking about Greece).

Just one line for the Companion Cavalry:
Code:
UPDATE ArtDefine_UnitMemberInfos
  SET Model = 'Horseman_Greece.fxsxml'
  WHERE Type = 'ART_DEF_UNIT_MEMBER_U_GREEK_COMPANIONCAVALRY';

If you only wanted one model for the Hoplite it would be just as easy. It takes a bit more doing to add more models:
Code:
--V1
UPDATE ArtDefine_UnitMemberInfos
  SET Model = 'Spearman_Greece.fxsxml'
  WHERE Type = 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE';
UPDATE ArtDefine_UnitInfoMemberInfos
  SET NumMembers = 4
  WHERE UnitInfoType = 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE';

--V2
INSERT INTO ArtDefine_UnitInfoMemberInfos (UnitInfoType, UnitMemberInfoType, NumMembers)
  VALUES ('ART_DEF_UNIT_U_GREEK_HOPLITE', 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V2', 4);
INSERT INTO ArtDefine_UnitMemberInfos (Type, Scale, Domain, Model, MaterialTypeTag, MaterialTypeSoundOverrideTag)
  SELECT 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V2', Scale, Domain, 'Spearman_Greece_v2.fxsxml', MaterialTypeTag, MaterialTypeSoundOverrideTag
  FROM ArtDefine_UnitMemberInfos
  WHERE Type = 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE';
INSERT INTO ArtDefine_UnitMemberCombats (UnitMemberType, EnableActions, ShortMoveRadius, ShortMoveRate, TargetHeight, HasRefaceAfterCombat, ReformBeforeCombat, RushAttackFormation)
  SELECT 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V2', EnableActions, ShortMoveRadius, ShortMoveRate, TargetHeight, HasRefaceAfterCombat, ReformBeforeCombat, RushAttackFormation
  FROM ArtDefine_UnitMemberCombats
  WHERE UnitMemberType = 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE';
INSERT INTO ArtDefine_UnitMemberCombatWeapons (UnitMemberType, 'Index', 'SubIndex', WeaponTypeTag, WeaponTypeSoundOverrideTag)
  SELECT 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V2', "Index", "Subindex", WeaponTypeTag, WeaponTypeSoundOverrideTag
  FROM ArtDefine_UnitMemberCombatWeapons
  WHERE UnitMemberType = 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE';

--V3
INSERT INTO ArtDefine_UnitInfoMemberInfos (UnitInfoType, UnitMemberInfoType, NumMembers)
  VALUES ('ART_DEF_UNIT_U_GREEK_HOPLITE', 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V3', 4);
INSERT INTO ArtDefine_UnitMemberInfos (Type, Scale, Domain, Model, MaterialTypeTag, MaterialTypeSoundOverrideTag)
  SELECT 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V3', Scale, Domain, 'Spearman_Greece_v3.fxsxml', MaterialTypeTag, MaterialTypeSoundOverrideTag
  FROM ArtDefine_UnitMemberInfos
  WHERE Type = 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE';
INSERT INTO ArtDefine_UnitMemberCombats (UnitMemberType, EnableActions, ShortMoveRadius, ShortMoveRate, TargetHeight, HasRefaceAfterCombat, ReformBeforeCombat, RushAttackFormation)
  SELECT 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V3', EnableActions, ShortMoveRadius, ShortMoveRate, TargetHeight, HasRefaceAfterCombat, ReformBeforeCombat, RushAttackFormation
  FROM ArtDefine_UnitMemberCombats
  WHERE UnitMemberType = 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE';
INSERT INTO ArtDefine_UnitMemberCombatWeapons (UnitMemberType, 'Index', 'SubIndex', WeaponTypeTag, WeaponTypeSoundOverrideTag)
  SELECT 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V3', "Index", "SubIndex", WeaponTypeTag, WeaponTypeSoundOverrideTag
  FROM ArtDefine_UnitMemberCombatWeapons
  WHERE UnitMemberType = 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE';

EDIT: Note I'm setting NumMembers to 4 in each case, for a total of 12; the default for Spearmen. R.E.D. uses a smaller scale and more individual models per unit.
 
If I understand what you're trying to do (i.e., replace the Companion Cavalry and Hoplite with new models), the code is pretty easy. Note you don't need to enable CulturalVariation (because we're only talking about Greece).

Just one line for the Companion Cavalry:
Code:
UPDATE ArtDefine_UnitMemberInfos
  SET Model = 'Horseman_Greece.fxsxml'
  WHERE Type = 'ART_DEF_UNIT_MEMBER_U_GREEK_COMPANIONCAVALRY';

If you only wanted one model for the Hoplite it would be just as easy. It takes a bit more doing to add more models:
Code:
--V1
UPDATE ArtDefine_UnitMemberInfos
  SET Model = 'Spearman_Greece.fxsxml'
  WHERE Type = 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE';
UPDATE ArtDefine_UnitInfoMemberInfos
  SET NumMembers = 4
  WHERE UnitInfoType = 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE';

--V2
INSERT INTO ArtDefine_UnitInfoMemberInfos (UnitInfoType, UnitMemberInfoType, NumMembers)
  VALUES ('ART_DEF_UNIT_U_GREEK_HOPLITE', 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V2', 4);
INSERT INTO ArtDefine_UnitMemberInfos (Type, Scale, Domain, Model, MaterialTypeTag, MaterialTypeSoundOverrideTag)
  SELECT 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V2', Scale, Domain, 'Spearman_Greece_v2.fxsxml', MaterialTypeTag, MaterialTypeSoundOverrideTag
  FROM ArtDefine_UnitMemberInfos
  WHERE Type = 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE';
INSERT INTO ArtDefine_UnitMemberCombats (UnitMemberType, EnableActions, ShortMoveRadius, ShortMoveRate, TargetHeight, HasRefaceAfterCombat, ReformBeforeCombat, RushAttackFormation)
  SELECT 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V2', EnableActions, ShortMoveRadius, ShortMoveRate, TargetHeight, HasRefaceAfterCombat, ReformBeforeCombat, RushAttackFormation
  FROM ArtDefine_UnitMemberCombats
  WHERE UnitMemberType = 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE';
INSERT INTO ArtDefine_UnitMemberCombatWeapons (UnitMemberType, 'Index', 'SubIndex', WeaponTypeTag, WeaponTypeSoundOverrideTag)
  SELECT 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V2', "Index", "Subindex", WeaponTypeTag, WeaponTypeSoundOverrideTag
  FROM ArtDefine_UnitMemberCombatWeapons
  WHERE UnitMemberType = 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE';

--V3
INSERT INTO ArtDefine_UnitInfoMemberInfos (UnitInfoType, UnitMemberInfoType, NumMembers)
  VALUES ('ART_DEF_UNIT_U_GREEK_HOPLITE', 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V3', 4);
INSERT INTO ArtDefine_UnitMemberInfos (Type, Scale, Domain, Model, MaterialTypeTag, MaterialTypeSoundOverrideTag)
  SELECT 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V3', Scale, Domain, 'Spearman_Greece_v3.fxsxml', MaterialTypeTag, MaterialTypeSoundOverrideTag
  FROM ArtDefine_UnitMemberInfos
  WHERE Type = 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE';
INSERT INTO ArtDefine_UnitMemberCombats (UnitMemberType, EnableActions, ShortMoveRadius, ShortMoveRate, TargetHeight, HasRefaceAfterCombat, ReformBeforeCombat, RushAttackFormation)
  SELECT 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V3', EnableActions, ShortMoveRadius, ShortMoveRate, TargetHeight, HasRefaceAfterCombat, ReformBeforeCombat, RushAttackFormation
  FROM ArtDefine_UnitMemberCombats
  WHERE UnitMemberType = 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE';
INSERT INTO ArtDefine_UnitMemberCombatWeapons (UnitMemberType, 'Index', 'SubIndex', WeaponTypeTag, WeaponTypeSoundOverrideTag)
  SELECT 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE_V3', "Index", "SubIndex", WeaponTypeTag, WeaponTypeSoundOverrideTag
  FROM ArtDefine_UnitMemberCombatWeapons
  WHERE UnitMemberType = 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE';

EDIT: Note I'm setting NumMembers to 4 in each case, for a total of 12; the default for Spearmen. R.E.D. uses a smaller scale and more individual models per unit.

GREAT! Thanx man u saved me a lot of time...:woohoo:
Also I thank u Rob for ur time :cheers:
 
d0minus sent this to me by private message, but I think it's a good question if someone else has followed this conversation this far to take it to its natural conclusion.

d0minus said:
Hello Nutty nice that u helped me last time
I wonder if u can repeat it :please:
I try to understand on using sql but sometimes is difficult... for instance :
- I tryed to add greek infantry as usualy way I insert to other skins but nothing
what is wrong here?
Spoiler :
-- GREECE infantry
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
SELECT ("ART_DEF_UNIT_INFANTRY_GREECE"), "DamageStates", "Formation"
FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_INFANTRY");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
SELECT ("ART_DEF_UNIT_INFANTRY_GREECE"), ("ART_DEF_UNIT_MEMBER_INFANTRY_GREECE"), "NumMembers"
FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_INFANTRY");
INSERT INTO "ArtDefine_UnitMemberCombats" ('UnitMemberType', 'EnableActions', 'DisableActions', 'MoveRadius', 'ShortMoveRadius', 'ChargeRadius', 'AttackRadius', 'RangedAttackRadius', 'MoveRate', 'ShortMoveRate', 'TurnRateMin', 'TurnRateMax', 'TurnFacingRateMin', 'TurnFacingRateMax', 'RollRateMin', 'RollRateMax', 'PitchRateMin', 'PitchRateMax', 'LOSRadiusScale', 'TargetRadius', 'TargetHeight', 'HasShortRangedAttack', 'HasLongRangedAttack', 'HasLeftRightAttack', 'HasStationaryMelee', 'HasStationaryRangedAttack', 'HasRefaceAfterCombat', 'ReformBeforeCombat', 'HasIndependentWeaponFacing', 'HasOpponentTracking', 'HasCollisionAttack', 'AttackAltitude', 'AltitudeDecelerationDistance', 'OnlyTurnInMovementActions', 'RushAttackFormation')
SELECT ("ART_DEF_UNIT_MEMBER_INFANTRY_GREECE"), "EnableActions", "DisableActions", "MoveRadius", "ShortMoveRadius", "ChargeRadius", "AttackRadius", "RangedAttackRadius",
"MoveRate", "ShortMoveRate", "TurnRateMin", "TurnRateMax", "TurnFacingRateMin", "TurnFacingRateMax", "RollRateMin", "RollRateMax", "PitchRateMin", "PitchRateMax", "LOSRadiusScale", "TargetRadius", "TargetHeight", "HasShortRangedAttack", "HasLongRangedAttack", "HasLeftRightAttack", "HasStationaryMelee", "HasStationaryRangedAttack", "HasRefaceAfterCombat", "ReformBeforeCombat", "HasIndependentWeaponFacing", "HasOpponentTracking", "HasCollisionAttack", "AttackAltitude", "AltitudeDecelerationDistance", "OnlyTurnInMovementActions", "RushAttackFormation"
FROM "ArtDefine_UnitMemberCombats" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_INFANTRY");
INSERT INTO "ArtDefine_UnitMemberCombatWeapons" ('UnitMemberType', 'Index', 'SubIndex', 'ID', 'VisKillStrengthMin', 'VisKillStrengthMax', 'ProjectileSpeed', 'ProjectileTurnRateMin', 'ProjectileTurnRateMax', 'HitEffect', 'HitEffectScale', 'HitRadius', 'ProjectileChildEffectScale', 'AreaDamageDelay', 'ContinuousFire', 'WaitForEffectCompletion', 'TargetGround', 'IsDropped', 'WeaponTypeTag', 'WeaponTypeSoundOverrideTag')
SELECT ("ART_DEF_UNIT_MEMBER_INFANTRY_GREECE"), "Index", "SubIndex", "ID", "VisKillStrengthMin", "VisKillStrengthMax", "ProjectileSpeed", "ProjectileTurnRateMin", "ProjectileTurnRateMax", "HitEffect", "HitEffectScale", "HitRadius", "ProjectileChildEffectScale", "AreaDamageDelay", "ContinuousFire", "WaitForEffectCompletion", "TargetGround", "IsDropped", "WeaponTypeTag", "WeaponTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberCombatWeapons" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_INFANTRY");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
SELECT ("ART_DEF_UNIT_MEMBER_INFANTRY_GREECE"), "Scale", "ZOffset", "Domain",
("Infantry_Greece.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_INFANTRY");

thanx in advance

So those are the art defines, which look OK.

But I don't see any code to actually APPLY the art define. To do so you have 2 options:
1. Make a unique unit by making a copy of the Infantry; or
2. Apply cultural variation to the Infantry, and set Greece to use a specific suffix.

Note that since G+K, 'ART_DEF_UNIT_INFANTRY' isn't used anymore, and 'ART_DEF_UNIT_WW2_INFANTRY' is the one you're replacing (though the unit is still called just 'UNIT_INFANTRY'). It should work as-is for #1, but if you use #2, you will need to change it to 'ART_DEF_UNIT_WW2_INFANTRY_GREECE'.

#1:
Code:
INSERT INTO Units (Type, Description, Civilopedia, Strategy, Help, Requirements, Combat, RangedCombat, Cost, Moves, Immobile, Range, BaseSightRange, Class, Special, Capture, CombatClass, Domain, CivilianAttackPriority, DefaultUnitAI, Food, NoBadGoodies, RivalTerritory, MilitarySupport, MilitaryProduction, Pillage, Found, FoundAbroad, CultureBombRadius, GoldenAgeTurns, IgnoreBuildingDefense, PrereqResources, Mechanized, Suicide, CaptureWhileEmbarked, PrereqTech, ObsoleteTech, GoodyHutUpgradeUnitClass, HurryCostModifier, AdvancedStartCost, MinAreaSize, AirUnitCap, NukeDamageLevel, WorkRate, NumFreeTechs, RushBuilding, BaseHurry, HurryMultiplier, BaseGold, NumGoldPerEra, SpreadReligion, CombatLimit, RangeAttackOnlyInDomain, RangeAttackIgnoreLOS, RangedCombatLimit, XPValueAttack, XPValueDefense, Conscription, ExtraMaintenanceCost, NoMaintenance, Unhappiness, UnitArtInfo, UnitArtInfoCulturalVariation, UnitArtInfoEraVariation, LeaderExperience, DontShowYields, ShowInPedia, MoveRate, UnitFlagIconOffset, PortraitIndex, IconAtlas, UnitFlagAtlas)
  SELECT 'UNIT_INFANTRY_GREECE', Description, Civilopedia, Strategy, Help, Requirements, Combat, RangedCombat, Cost, Moves, Immobile, Range, BaseSightRange, Class, Special, Capture, CombatClass, Domain, CivilianAttackPriority, DefaultUnitAI, Food, NoBadGoodies, RivalTerritory, MilitarySupport, MilitaryProduction, Pillage, Found, FoundAbroad, CultureBombRadius, GoldenAgeTurns, IgnoreBuildingDefense, PrereqResources, Mechanized, Suicide, CaptureWhileEmbarked, PrereqTech, ObsoleteTech, GoodyHutUpgradeUnitClass, HurryCostModifier, AdvancedStartCost, MinAreaSize, AirUnitCap, NukeDamageLevel, WorkRate, NumFreeTechs, RushBuilding, BaseHurry, HurryMultiplier, BaseGold, NumGoldPerEra, SpreadReligion, CombatLimit, RangeAttackOnlyInDomain, RangeAttackIgnoreLOS, RangedCombatLimit, XPValueAttack, XPValueDefense, Conscription, ExtraMaintenanceCost, NoMaintenance, Unhappiness, 'ART_DEF_UNIT_INFANTRY_GREECE', UnitArtInfoCulturalVariation, UnitArtInfoEraVariation, LeaderExperience, DontShowYields, 0, MoveRate, UnitFlagIconOffset, PortraitIndex, IconAtlas, UnitFlagAtlas
  FROM Units WHERE Type = 'UNIT_INFANTRY';
INSERT INTO Civilization_UnitClassOverrides (CivilizationType, UnitClassType, UnitType)
  VALUES ('CIVILIZATION_GREECE', 'UNITCLASS_INFANTRY', 'UNIT_INFANTRY_GREECE');

#2:
Code:
UPDATE Units SET UnitArtInfoCulturalVariation = 1
  WHERE Type = 'UNIT_INFANTRY';
UPDATE Civilizations SET ArtStyleSuffix = '_GREECE'
  WHERE Type = 'CIVILIZATION_GREECE';

Note that if you do #2, you would have to make all cultural variation now end with _GREECE. In the base game, the only unit with cultural variation is the Settler. Because Greece uses the Euro settler, you don't have to worry about making a new Settler with _GREECE suffix, since it'll fall back to the default Euro one if ART_DEF_UNIT__SETTLER_GREECE doesn't exist. However, if you were to do this same trick for an Asian, African, or Native American civ, then you'd also have to make new art defines for the regional Settler with the appropriate civ suffix.

EDIT: For a one-off mod it doesn't make much of a difference which of the two methods you use, but if you want to do a large number of units with cultural variation, #1 is easier to make a bunch of cookie-cutter files, but #2 is better so you don't have weird user interface issues with the civ's UB or UI being hidden by one of your dummy UUs (for example, on the Choose a Civ and Dawn of Man screens).
 
d0minus sent this to me by private message, but I think it's a good question if someone else has followed this conversation this far to take it to its natural conclusion.



So those are the art defines, which look OK.

But I don't see any code to actually APPLY the art define. To do so you have 2 options:
1. Make a unique unit by making a copy of the Infantry; or
2. Apply cultural variation to the Infantry, and set Greece to use a specific suffix.

Note that since G+K, 'ART_DEF_UNIT_INFANTRY' isn't used anymore, and 'ART_DEF_UNIT_WW2_INFANTRY' is the one you're replacing (though the unit is still called just 'UNIT_INFANTRY'). It should work as-is for #1, but if you use #2, you will need to change it to 'ART_DEF_UNIT_WW2_INFANTRY_GREECE'.

#1:
Code:
INSERT INTO Units (Type, Description, Civilopedia, Strategy, Help, Requirements, Combat, RangedCombat, Cost, Moves, Immobile, Range, BaseSightRange, Class, Special, Capture, CombatClass, Domain, CivilianAttackPriority, DefaultUnitAI, Food, NoBadGoodies, RivalTerritory, MilitarySupport, MilitaryProduction, Pillage, Found, FoundAbroad, CultureBombRadius, GoldenAgeTurns, IgnoreBuildingDefense, PrereqResources, Mechanized, Suicide, CaptureWhileEmbarked, PrereqTech, ObsoleteTech, GoodyHutUpgradeUnitClass, HurryCostModifier, AdvancedStartCost, MinAreaSize, AirUnitCap, NukeDamageLevel, WorkRate, NumFreeTechs, RushBuilding, BaseHurry, HurryMultiplier, BaseGold, NumGoldPerEra, SpreadReligion, CombatLimit, RangeAttackOnlyInDomain, RangeAttackIgnoreLOS, RangedCombatLimit, XPValueAttack, XPValueDefense, Conscription, ExtraMaintenanceCost, NoMaintenance, Unhappiness, UnitArtInfo, UnitArtInfoCulturalVariation, UnitArtInfoEraVariation, LeaderExperience, DontShowYields, ShowInPedia, MoveRate, UnitFlagIconOffset, PortraitIndex, IconAtlas, UnitFlagAtlas)
  SELECT 'UNIT_INFANTRY_GREECE', Description, Civilopedia, Strategy, Help, Requirements, Combat, RangedCombat, Cost, Moves, Immobile, Range, BaseSightRange, Class, Special, Capture, CombatClass, Domain, CivilianAttackPriority, DefaultUnitAI, Food, NoBadGoodies, RivalTerritory, MilitarySupport, MilitaryProduction, Pillage, Found, FoundAbroad, CultureBombRadius, GoldenAgeTurns, IgnoreBuildingDefense, PrereqResources, Mechanized, Suicide, CaptureWhileEmbarked, PrereqTech, ObsoleteTech, GoodyHutUpgradeUnitClass, HurryCostModifier, AdvancedStartCost, MinAreaSize, AirUnitCap, NukeDamageLevel, WorkRate, NumFreeTechs, RushBuilding, BaseHurry, HurryMultiplier, BaseGold, NumGoldPerEra, SpreadReligion, CombatLimit, RangeAttackOnlyInDomain, RangeAttackIgnoreLOS, RangedCombatLimit, XPValueAttack, XPValueDefense, Conscription, ExtraMaintenanceCost, NoMaintenance, Unhappiness, 'ART_DEF_UNIT_INFANTRY_GREECE', UnitArtInfoCulturalVariation, UnitArtInfoEraVariation, LeaderExperience, DontShowYields, 0, MoveRate, UnitFlagIconOffset, PortraitIndex, IconAtlas, UnitFlagAtlas
  FROM Units WHERE Type = 'UNIT_INFANTRY';
INSERT INTO Civilization_UnitClassOverrides (CivilizationType, UnitClassType, UnitType)
  VALUES ('CIVILIZATION_GREECE', 'UNITCLASS_INFANTRY', 'UNIT_INFANTRY_GREECE');

#2:
Code:
UPDATE Units SET UnitArtInfoCulturalVariation = 1
  WHERE Type = 'UNIT_INFANTRY';
UPDATE Civilizations SET ArtStyleSuffix = '_GREECE'
  WHERE Type = 'CIVILIZATION_GREECE';

Note that if you do #2, you would have to make all cultural variation now end with _GREECE. In the base game, the only unit with cultural variation is the Settler. Because Greece uses the Euro settler, you don't have to worry about making a new Settler with _GREECE suffix, since it'll fall back to the default Euro one if ART_DEF_UNIT__SETTLER_GREECE doesn't exist. However, if you were to do this same trick for an Asian, African, or Native American civ, then you'd also have to make new art defines for the regional Settler with the appropriate civ suffix.

EDIT: For a one-off mod it doesn't make much of a difference which of the two methods you use, but if you want to do a large number of units with cultural variation, #1 is easier to make a bunch of cookie-cutter files, but #2 is better so you don't have weird user interface issues with the civ's UB or UI being hidden by one of your dummy UUs (for example, on the Choose a Civ and Dawn of Man screens).

Suberb!:goodjob:
Thanx Nutty I am really greatfull to u for ur assistance, u r trully sql moding Pro! :salute:
-I knew theres something about editing 'WW2', although Im already using _GREECE suffix to all skins, when I tryed doing #2 I failed and I dont know y? Anyway #1 worked for now.
Thanx again
 
Top Bottom