1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Help with getting units into the game

Discussion in 'Civ5 - Creation & Customization' started by d0minus, Jan 23, 2014.

  1. d0minus

    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");
     
  2. Rob (R8XFT)

    Rob (R8XFT) Ancient Briton Super Moderator

    Joined:
    Aug 11, 2002
    Messages:
    10,867
    Location:
    Leeds (UK)
    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.
     
  3. d0minus

    d0minus Chieftain

    Joined:
    Oct 3, 2013
    Messages:
    50
    Actually I did it, by Horseman/Spearman but nothing if thats what u ment.
    thanx for repling
     
  4. Rob (R8XFT)

    Rob (R8XFT) Ancient Briton Super Moderator

    Joined:
    Aug 11, 2002
    Messages:
    10,867
    Location:
    Leeds (UK)
    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.
     
  5. d0minus

    d0minus Chieftain

    Joined:
    Oct 3, 2013
    Messages:
    50
    :confused: I have infant knowledge on sql, but the rest skin replacings I did worked...
    Anyway I'll try it...
     
  6. Rob (R8XFT)

    Rob (R8XFT) Ancient Briton Super Moderator

    Joined:
    Aug 11, 2002
    Messages:
    10,867
    Location:
    Leeds (UK)
    You and me both; I found getting these units into the game tricky at first, but once you've got it, it's quite straightforward.
     
  7. d0minus

    d0minus Chieftain

    Joined:
    Oct 3, 2013
    Messages:
    50
    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
     
  8. Rob (R8XFT)

    Rob (R8XFT) Ancient Briton Super Moderator

    Joined:
    Aug 11, 2002
    Messages:
    10,867
    Location:
    Leeds (UK)
    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.
     
  9. d0minus

    d0minus Chieftain

    Joined:
    Oct 3, 2013
    Messages:
    50
    No, I didnt knew I had to edit on database... although I'll try
     
  10. d0minus

    d0minus Chieftain

    Joined:
    Oct 3, 2013
    Messages:
    50
    Should I change all tables like <MemberTypes> and from UnitMembers.xml too??
     
  11. Rob (R8XFT)

    Rob (R8XFT) Ancient Briton Super Moderator

    Joined:
    Aug 11, 2002
    Messages:
    10,867
    Location:
    Leeds (UK)
    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.
     
  12. d0minus

    d0minus Chieftain

    Joined:
    Oct 3, 2013
    Messages:
    50
    Now thats a progress, althouth unfairly changed unit do default spearman skin :lol: ...
     
  13. Rob (R8XFT)

    Rob (R8XFT) Ancient Briton Super Moderator

    Joined:
    Aug 11, 2002
    Messages:
    10,867
    Location:
    Leeds (UK)
    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.
     
  14. d0minus

    d0minus Chieftain

    Joined:
    Oct 3, 2013
    Messages:
    50
    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??
     
  15. Rob (R8XFT)

    Rob (R8XFT) Ancient Briton Super Moderator

    Joined:
    Aug 11, 2002
    Messages:
    10,867
    Location:
    Leeds (UK)
    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.
     
  16. Nutty

    Nutty Deity

    Joined:
    Mar 9, 2011
    Messages:
    3,181
    Gender:
    Male
    Location:
    Orange County, California, U.S.A.
    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.
     
  17. d0minus

    d0minus Chieftain

    Joined:
    Oct 3, 2013
    Messages:
    50
    GREAT! Thanx man u saved me a lot of time...:woohoo:
    Also I thank u Rob for ur time :cheers:
     
  18. Rob (R8XFT)

    Rob (R8XFT) Ancient Briton Super Moderator

    Joined:
    Aug 11, 2002
    Messages:
    10,867
    Location:
    Leeds (UK)
    It was Nutty who sorted me out too - he's a top man!

    Glad you have it sorted out, d0minus.
     
  19. Nutty

    Nutty Deity

    Joined:
    Mar 9, 2011
    Messages:
    3,181
    Gender:
    Male
    Location:
    Orange County, California, U.S.A.
    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).
     
  20. d0minus

    d0minus Chieftain

    Joined:
    Oct 3, 2013
    Messages:
    50
    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
     

Share This Page