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

Add a new unit in the game (using SQL)

Discussion in 'Civ5 - Modding Tutorials & Reference' started by Gedemon, May 10, 2012.

  1. Rob (R8XFT)

    Rob (R8XFT) Ancient Briton Super Moderator

    Joined:
    Aug 11, 2002
    Messages:
    10,783
    Location:
    Leeds (UK)
    The size now works, so thanks Nutty ;)!!

    Still having probs with the slinger's sound and the Heqetai; will experiment further tomorrow.
     
  2. Nutty

    Nutty Chieftain

    Joined:
    Mar 9, 2011
    Messages:
    3,156
    Gender:
    Male
    Location:
    Orange County, California, U.S.A.
    As for the Heqetai, the part you haven't posted is your entries for the Units table. I assume you've made sure UnitArtInfo is set to ART_DEF_UNIT_HEQETAI?
     
  3. Rob (R8XFT)

    Rob (R8XFT) Ancient Briton Super Moderator

    Joined:
    Aug 11, 2002
    Messages:
    10,783
    Location:
    Leeds (UK)
    I have indeed. In the units.xml, I've used the tag:
    <UnitArtInfo>ART_DEF_UNIT_HEQETAI</UnitArtInfo>
     
  4. JFD

    JFD Kathigitarkh

    Joined:
    Oct 19, 2010
    Messages:
    9,103
    Location:
    The Kingdom of New Zealand
  5. JJimmyJ

    JJimmyJ Chieftain

    Joined:
    Jul 15, 2012
    Messages:
    15
    Hello

    I love this forum.
    Nutty, thank you so much for the pointers. Now I understand why my army was triplicated :)
    I now have my mod fully working, and have altered the unit art work slightly so a couple members look different.
    Thanks
     
  6. Nutty

    Nutty Chieftain

    Joined:
    Mar 9, 2011
    Messages:
    3,156
    Gender:
    Male
    Location:
    Orange County, California, U.S.A.
    You want the UnitGameplay2DScripts table: Set "UnitType" to your unit, "SelectionSound" to AS2D_SELECT_INFANTRY, and "FirstSelectionSound" to AS2D_BIRTH_INFANTRY.
     
  7. JFD

    JFD Kathigitarkh

    Joined:
    Oct 19, 2010
    Messages:
    9,103
    Location:
    The Kingdom of New Zealand
    Thanks very much.
     
  8. Rob (R8XFT)

    Rob (R8XFT) Ancient Briton Super Moderator

    Joined:
    Aug 11, 2002
    Messages:
    10,783
    Location:
    Leeds (UK)
    I've sorted out the Heqetai, and, as these things often are, the solution was staring me in the face. I needed to use "ART_DEF_UNIT_U_GREEK_HOPLITE" and "ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE". Adding the extra "U_" made all the difference and so now I'm up and running!

    The next thing for me to try is to add a unit as a flavour unit rather than an actual unit in the game; there's the code earlier in the thread, so I'll get experimenting. Thanks again to Nutty in particular (as well as everyone else who helped).
     
  9. nokmirt

    nokmirt Emperor

    Joined:
    Feb 14, 2009
    Messages:
    5,087
    Location:
    Iowa USA
    I have a strange problem. I noticed that when I got done with my units and testing them in game, they cannot be purchased with faith. So, I added FaithCost, RequiresFaith PurchaseEnabled, to the unit SQL. However for some reason my Arabian Longswordsman end up in the civilopedia as a religious unit. Do you have any idea why this would be?

    Here is my SQL code for that unit. It is the first one I have tried to change by adding add a faith purchase cost.

    Spoiler :
    Code:
    INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
    	SELECT	("ART_DEF_UNIT_ARABIAN_LONGSWORDSMAN"), "DamageStates", "Formation"
    	FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_LONGSWORDSMAN");
    INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
    	SELECT	("ART_DEF_UNIT_ARABIAN_LONGSWORDSMAN"), ("ART_DEF_UNIT_MEMBER_ARABIAN_LONGSWORDSMAN"), "NumMembers"
    	FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_LONGSWORDSMAN");
    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_ARABIAN_LONGSWORDSMAN"), "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_LONGSWORDSMAN");
    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_ARABIAN_LONGSWORDSMAN"), "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_LONGSWORDSMAN");
    INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
    	SELECT	("ART_DEF_UNIT_MEMBER_ARABIAN_LONGSWORDSMAN"), "Scale", "ZOffset", "Domain", 
    			("Longswordsman_Arabia.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
    	FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_LONGSWORDSMAN");
    INSERT INTO "Units" ('Type', 'Description', 'Civilopedia', 'Strategy', 'Help', 'Requirements', 'Combat', 'RangedCombat', 'Cost', '[B]FaithCost[/B]', '[B]RequiresFaithPurchaseEnabled[/B]', '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', 'SpecialCargo', 'DomainCargo', 'Conscription', 'ExtraMaintenanceCost', 'NoMaintenance', 'Unhappiness', 'UnitArtInfo', 'UnitArtInfoCulturalVariation', 'UnitArtInfoEraVariation', 'ProjectPrereq', 'SpaceshipProject', 'LeaderPromotion', 'LeaderExperience', 'DontShowYields', 'ShowInPedia', 'MoveRate', 'UnitFlagIconOffset', 'PortraitIndex', 'IconAtlas', 'UnitFlagAtlas')
    	SELECT	("UNIT_ARABIAN_LONGSWORDSMAN"), ("Arabian Longswordsman"), "Civilopedia", "Strategy", "Help", "Requirements",
    			"Combat", "RangedCombat", "Cost", "240", "true", "Moves", "UNITCOMBAT_MELEE", "Immobile", "Range", "BaseSightRange", ("UNITCLASS_LONGSWORDSMAN"), "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", "SpecialCargo", "DomainCargo", "Conscription", "ExtraMaintenanceCost", "NoMaintenance", "Unhappiness",
    			("ART_DEF_UNIT_ARABIAN_LONGSWORDSMAN"), "UnitArtInfoCulturalVariation", "UnitArtInfoEraVariation", "ProjectPrereq", "SpaceshipProject", "LeaderPromotion", "LeaderExperience", "DontShowYields", "ShowInPedia", "MoveRate",
    			"UnitFlagIconOffset", "PortraitIndex", "IconAtlas", "UnitFlagAtlas"
    	FROM "Units" WHERE (Type = "UNIT_LONGSWORDSMAN");
    INSERT INTO "Unit_AITypes" ('UnitType', 'UnitAIType')
    	SELECT ("UNIT_ARABIAN_LONGSWORDSMAN"), "UnitAIType"
    	FROM "Unit_AITypes" WHERE (UnitType = "UNIT_LONGSWORDSMAN");
    INSERT INTO "Unit_ClassUpgrades" ('UnitType', 'UnitClassType')
    	SELECT ("UNIT_ARABIAN_LONGSWORDSMAN"), "UnitClassType"
    	FROM "Unit_ClassUpgrades" WHERE (UnitType = "UNIT_LONGSWORDSMAN");
    INSERT INTO "Unit_Flavors" ('UnitType', 'FlavorType', 'Flavor')
    	SELECT ("UNIT_ARABIAN_LONGSWORDSMAN"), "FlavorType", "Flavor"
    	FROM "Unit_Flavors" WHERE (UnitType = "UNIT_LONGSWORDSMAN");
    INSERT INTO "Unit_FreePromotions" ('UnitType', 'PromotionType')
    	SELECT ("UNIT_ARABIAN_LONGSWORDSMAN"), "PromotionType"
    	FROM "Unit_FreePromotions" WHERE (UnitType = "UNIT_LONGSWORDSMAN");
    INSERT INTO "Unit_ResourceQuantityRequirements" ('UnitType', 'ResourceType', 'Cost')
    	SELECT ("UNIT_ARABIAN_LONGSWORDSMAN"), "ResourceType", "Cost"
    	FROM "Unit_ResourceQuantityRequirements" WHERE (UnitType = "UNIT_LONGSWORDSMAN");
    INSERT INTO "Civilization_UnitClassOverrides" ( 'CivilizationType', 'UnitClassType', 'UnitType' )
    	VALUES ( 'CIVILIZATION_ARABIA', 'UNITCLASS_LONGSWORDSMAN', 'UNIT_ARABIAN_LONGSWORDSMAN' );    


    Am I missing anything that should be added? Is this updated code for GnK? Anyway, since this mod is in a time of religious upheaval, the units should be able to be purchased with faith like any unit in the game from the Medieval era. I just want them to be listed in the right place in the unit civilopedia. All units should be listed in the Medieval era, not in the religious category with missionary and the inquisitor.

    For this Mod all I have added is ethnic units to civs, a pike, crossbow, knight, and longsword with the unit graphics currently available from danrell.
     
  10. Hypereon

    Hypereon He was a Consul of Rome!

    Joined:
    Jun 19, 2012
    Messages:
    414
    Location:
    Helsinki, Finland
    Hi! I have been doing successful custom units with this tutorial, but now I have a problem. Does anybody know how to add new units which have several (4) different unit members?

    I've been trying to make a Bandeirante unit for my Portugal mod that consists of a "leader soldier", "basic soldiers", "native soldiers" and a flagbearer. Could somebody help me to get it working, because I can't relly do/understand SQL myself, apart from a basic one-member unit creation? Bandeirante uses a Great Artist as a base unit, with musketeer, minuteman, musketman and the great artist flagbearer as the member models. In the game, it just shows up as a "invisible" unit. Here's the code:
    Spoiler :
    INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
    SELECT ("ART_DEF_UNIT_PORTUGUESE_BANDEIRANTE"), "DamageStates", "HonorableGunpowder"
    FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_ARTIST");
    INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
    SELECT ("ART_DEF_UNIT_PORTUGUESE_BANDEIRANTE"), ("ART_DEF_UNIT_MEMBER_PORTUGUESE_BANDEIRANTE_MAIN"), "1"
    FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_ARTIST");
    INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
    SELECT ("ART_DEF_UNIT_PORTUGUESE_BANDEIRANTE"), ("ART_DEF_UNIT_MEMBER_PORTUGUESE_BANDEIRANTE_SECOND"), "5"
    FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_ARTIST");
    INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
    SELECT ("ART_DEF_UNIT_PORTUGUESE_BANDEIRANTE"), ("ART_DEF_UNIT_MEMBER_PORTUGUESE_BANDEIRANTE_NATIVESOLDIER"), "7"
    FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_ARTIST");
    INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
    SELECT ("ART_DEF_UNIT_PORTUGUESE_BANDEIRANTE"), ("ART_DEF_UNIT_MEMBER_PORTUGUESE_BANDEIRANTE_FLAGBEARER"), "1"
    FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_ARTIST");

    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_PORTUGUESE_BANDEIRANTE_MAIN"), "EnableActions", "DisableActions", "MoveRadius", "ShortMoveRadius", "ChargeRadius", "AttackRadius", "RangedAttackRadius",
    "tripled", "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_U_FRENCH_MUSKETEER");
    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_PORTUGUESE_BANDEIRANTE_MAIN"), "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_U_FRENCH_MUSKETEER");
    INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
    SELECT ("ART_DEF_UNIT_MEMBER_PORTUGUESE_BANDEIRANTE_MAIN"), "Scale", "ZOffset", "Domain",
    ("u_portuguese_bandeirante_main.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
    FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_U_FRENCH_MUSKETEER");

    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_PORTUGUESE_BANDEIRANTE_SECOND"), "EnableActions", "DisableActions", "MoveRadius", "ShortMoveRadius", "ChargeRadius", "AttackRadius", "RangedAttackRadius",
    "tripled", "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_U_AMERICAN_MINUTEMAN");
    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_PORTUGUESE_BANDEIRANTE_SECOND"), "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_U_AMERICAN_MINUTEMAN");
    INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
    SELECT ("ART_DEF_UNIT_MEMBER_PORTUGUESE_BANDEIRANTE_SECOND"), "Scale", "ZOffset", "Domain",
    ("u_portuguese_bandeirante_second.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
    FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_U_AMERICAN_MINUTEMAN");

    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_PORTUGUESE_BANDEIRANTE_NATIVESOLDIER"), "EnableActions", "DisableActions", "MoveRadius", "ShortMoveRadius", "ChargeRadius", "AttackRadius", "RangedAttackRadius",
    "tripled", "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_MUSKETMAN");
    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_PORTUGUESE_BANDEIRANTE_NATIVESOLDIER"), "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_MUSKETMAN");
    INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
    SELECT ("ART_DEF_UNIT_MEMBER_PORTUGUESE_BANDEIRANTE_NATIVESOLDIER"), "Scale", "ZOffset", "Domain",
    ("u_portuguese_bandeirante_nativesoldier.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
    FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_MUSKETMAN");

    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_PORTUGUESE_BANDEIRANTE_FLAGBEARER"), "EnableActions", "DisableActions", "MoveRadius", "ShortMoveRadius", "ChargeRadius", "AttackRadius", "RangedAttackRadius",
    "tripled", "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_GREATARTIST_EARLY_FLAGBEARER");
    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_PORTUGUESE_BANDEIRANTE_FLAGBEARER"), "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_GREATARTIST_EARLY_FLAGBEARER");
    INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
    SELECT ("ART_DEF_UNIT_MEMBER_PORTUGUESE_BANDEIRANTE_FLAGBEARER"), "Scale", "ZOffset", "Domain",
    ("u_portuguese_bandeirante_flagbearer.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
    FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_GREATARTIST_EARLY_FLAGBEARER");
    ----
     
  11. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,646
    Location:
    France
    Sorry, I can't help with that, hopefully someone else have the answer.

    When adding entries that are not based on part of another unit (IE all columns have new values), you should use a simple:

    Code:
    INSERT INTO tablename (column1, column2, ...) VALUES ('string1', number, ...);
    example:
    Code:
    -- V1
    INSERT INTO ArtDefine_UnitInfoMemberInfos (UnitInfoType, UnitMemberInfoType, NumMembers)
    	VALUES	('ART_DEF_UNIT__WARRIOR_SONGHAI', 'ART_DEF_UNIT_MEMBER_WARRIOR_ZULU_IMPI', 3);
    -- V2
    INSERT INTO ArtDefine_UnitInfoMemberInfos (UnitInfoType, UnitMemberInfoType, NumMembers)
    	VALUES	('ART_DEF_UNIT__WARRIOR_SONGHAI', 'ART_DEF_UNIT_MEMBER_WARRIOR_ZULU_IMPI_V2', 2);
    -- V3
    INSERT INTO ArtDefine_UnitInfoMemberInfos (UnitInfoType, UnitMemberInfoType, NumMembers)
    	VALUES	('ART_DEF_UNIT__WARRIOR_SONGHAI', 'ART_DEF_UNIT_MEMBER_WARRIOR_ZULU_IMPI_V3', 3);
    -- V4
    INSERT INTO ArtDefine_UnitInfoMemberInfos (UnitInfoType, UnitMemberInfoType, NumMembers)
    	VALUES	('ART_DEF_UNIT__WARRIOR_SONGHAI', 'ART_DEF_UNIT_MEMBER_WARRIOR_ZULU_IMPI_V4', 2);
    Also note that the tutorial had sadly a bad SQL syntax about the use of double-quotes, please refer to the now corrected code in post #1 and #6 of the thread (see here for details), they should only be used when SQL reserved keywords are used as table or column name (like the column named "Index" in post 6)

    For your problem itself, the code you use seems to be correct, so try first with an ART_DEFINE_UNIT_MEMBER_* that you know is working in game for all slot.
     
  12. Hypereon

    Hypereon He was a Consul of Rome!

    Joined:
    Jun 19, 2012
    Messages:
    414
    Location:
    Helsinki, Finland
    Thanks!
    So, should I use "INSERT INTO tablename (column1, column2, ...) VALUES ('string1', number, ...);" for doing the base Bandeirante unit, instead of the Great Artist. I will also try the corrected codes in the first posts.

    I'll try these later this day, and 'll post then whether I got them working. :)
     
  13. nokmirt

    nokmirt Emperor

    Joined:
    Feb 14, 2009
    Messages:
    5,087
    Location:
    Iowa USA
    @Gedemon, It's ok I figured out the problem. The solution was obvious, surprised you did not notice what I did wrong. :lol: You cannot add values, to those values already linked to a unit, you' re replacing. Otherwise, it thinks the unit is unique. That is why my Arabian Longsword was set apart and made into a religious unit.

    Ok, if anyone is adding a unit via SQL. Use this corrected code. This will add the "FaithCost", and "RequiresFaithPurchaseEnabled" fields to unit infos. This code is for Gods and Kings, if you do not have GnK, use the SQL code in the 1st post from Gedemon, for CiV vanilla.

    Spoiler :
    Code:
    INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
    	SELECT	("ART_DEF_UNIT_ARABIAN_LONGSWORDSMAN"), "DamageStates", "Formation"
    	FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_LONGSWORDSMAN");
    INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
    	SELECT	("ART_DEF_UNIT_ARABIAN_LONGSWORDSMAN"), ("ART_DEF_UNIT_MEMBER_ARABIAN_LONGSWORDSMAN"), "NumMembers"
    	FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_LONGSWORDSMAN");
    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_ARABIAN_LONGSWORDSMAN"), "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_LONGSWORDSMAN");
    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_ARABIAN_LONGSWORDSMAN"), "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_LONGSWORDSMAN");
    INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
    	SELECT	("ART_DEF_UNIT_MEMBER_ARABIAN_LONGSWORDSMAN"), "Scale", "ZOffset", "Domain", 
    			("Longswordsman_Arabia.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
    	FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_LONGSWORDSMAN");
    INSERT INTO "Units" ('Type', 'Description', 'Civilopedia', 'Strategy', 'Help', 'Requirements', 'Combat', 'RangedCombat', 'Cost', 'FaithCost', 'RequiresFaithPurchaseEnabled', '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', 'SpecialCargo', 'DomainCargo', 'Conscription', 'ExtraMaintenanceCost', 'NoMaintenance', 'Unhappiness', 'UnitArtInfo', 'UnitArtInfoCulturalVariation', 'UnitArtInfoEraVariation', 'ProjectPrereq', 'SpaceshipProject', 'LeaderPromotion', 'LeaderExperience', 'DontShowYields', 'ShowInPedia', 'MoveRate', 'UnitFlagIconOffset', 'PortraitIndex', 'IconAtlas', 'UnitFlagAtlas')
    	SELECT	("UNIT_ARABIAN_LONGSWORDSMAN"), ("Arabian Longswordsman"), "Civilopedia", "Strategy", "Help", "Requirements",
    			"Combat", "RangedCombat", "Cost", "FaithCost", "RequiresFaithPurchaseEnabled", "Moves", "Immobile", "Range", "BaseSightRange", ("UNITCLASS_LONGSWORDSMAN"), "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", "SpecialCargo", "DomainCargo", "Conscription", "ExtraMaintenanceCost", "NoMaintenance", "Unhappiness",
    			("ART_DEF_UNIT_ARABIAN_LONGSWORDSMAN"), "UnitArtInfoCulturalVariation", "UnitArtInfoEraVariation", "ProjectPrereq", "SpaceshipProject", "LeaderPromotion", "LeaderExperience", "DontShowYields", "ShowInPedia", "MoveRate",
    			"UnitFlagIconOffset", "PortraitIndex", "IconAtlas", "UnitFlagAtlas"
    	FROM "Units" WHERE (Type = "UNIT_LONGSWORDSMAN");
    INSERT INTO "Unit_AITypes" ('UnitType', 'UnitAIType')
    	SELECT ("UNIT_ARABIAN_LONGSWORDSMAN"), "UnitAIType"
    	FROM "Unit_AITypes" WHERE (UnitType = "UNIT_LONGSWORDSMAN");
    INSERT INTO "Unit_ClassUpgrades" ('UnitType', 'UnitClassType')
    	SELECT ("UNIT_ARABIAN_LONGSWORDSMAN"), "UnitClassType"
    	FROM "Unit_ClassUpgrades" WHERE (UnitType = "UNIT_LONGSWORDSMAN");
    INSERT INTO "Unit_Flavors" ('UnitType', 'FlavorType', 'Flavor')
    	SELECT ("UNIT_ARABIAN_LONGSWORDSMAN"), "FlavorType", "Flavor"
    	FROM "Unit_Flavors" WHERE (UnitType = "UNIT_LONGSWORDSMAN");
    INSERT INTO "Unit_FreePromotions" ('UnitType', 'PromotionType')
    	SELECT ("UNIT_ARABIAN_LONGSWORDSMAN"), "PromotionType"
    	FROM "Unit_FreePromotions" WHERE (UnitType = "UNIT_LONGSWORDSMAN");
    INSERT INTO "Unit_ResourceQuantityRequirements" ('UnitType', 'ResourceType', 'Cost')
    	SELECT ("UNIT_ARABIAN_LONGSWORDSMAN"), "ResourceType", "Cost"
    	FROM "Unit_ResourceQuantityRequirements" WHERE (UnitType = "UNIT_LONGSWORDSMAN");
    INSERT INTO "Civilization_UnitClassOverrides" ( 'CivilizationType', 'UnitClassType', 'UnitType' )
    	VALUES ( 'CIVILIZATION_ARABIA', 'UNITCLASS_LONGSWORDSMAN', 'UNIT_ARABIAN_LONGSWORDSMAN' );    
     
  14. Hypereon

    Hypereon He was a Consul of Rome!

    Joined:
    Jun 19, 2012
    Messages:
    414
    Location:
    Helsinki, Finland
    OK, now I've done what you suggested, Gedemon.
    :confused:
    Well it is now even worse - a spearman :eek:.
    Yes, I did also try the code with existing working unit members, but it had no effect. I've now written the code completely again with the corrected syntax and haven't managed to find any error from the code, but could you check it too.

    Spoiler :
    INSERT INTO ArtDefine_UnitInfos (Type, DamageStates, Formation)
    VALUES ('ART_DEF_UNIT_PORTUGUESE_BANDEIRANTE', DamageStates, 'HonorableGunpowder')
    -- MAIN
    INSERT INTO ArtDefine_UnitInfoMemberInfos (UnitInfoType, UnitMemberInfoType, NumMembers)
    VALUES ('ART_DEF_UNIT_PORTUGUESE_BANDEIRANTE', 'ART_DEF_UNIT_MEMBER_PORTUGUESE_BANDEIRANTE_MAIN', 1);
    -- SECOND
    INSERT INTO ArtDefine_UnitInfoMemberInfos (UnitInfoType, UnitMemberInfoType, NumMembers)
    VALUES ('ART_DEF_UNIT_PORTUGUESE_BANDEIRANTE', 'ART_DEF_UNIT_MEMBER_PORTUGUESE_BANDEIRANTE_SECOND', 5);
    -- NATIVE
    INSERT INTO ArtDefine_UnitInfoMemberInfos (UnitInfoType, UnitMemberInfoType, NumMembers)
    VALUES ('ART_DEF_UNIT_PORTUGUESE_BANDEIRANTE', 'ART_DEF_UNIT_MEMBER_PORTUGUESE_BANDEIRANTE_NATIVESOLDIER', 7);
    -- FLAG
    INSERT INTO ArtDefine_UnitInfoMemberInfos (UnitInfoType, UnitMemberInfoType, NumMembers)
    VALUES ('ART_DEF_UNIT_PORTUGUESE_BANDEIRANTE', 'ART_DEF_UNIT_MEMBER_PORTUGUESE_BANDEIRANTE_FLAGBEARER', 1);

    -- MAIN
    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_PORTUGUESE_BANDEIRANTE_MAIN'), 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_U_FRENCH_MUSKETEER');
    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_PORTUGUESE_BANDEIRANTE_MAIN'), "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_U_FRENCH_MUSKETEER');
    INSERT INTO ArtDefine_UnitMemberInfos (Type, Scale, ZOffset, Domain, Model, MaterialTypeTag, MaterialTypeSoundOverrideTag)
    SELECT ('ART_DEF_UNIT_MEMBER_PORTUGUESE_BANDEIRANTE_MAIN'), Scale, ZOffset, Domain,
    ('u_portuguese_bandeirante_main.fxsxml'), MaterialTypeTag, MaterialTypeSoundOverrideTag
    FROM ArtDefine_UnitMemberInfos WHERE (Type = 'ART_DEF_UNIT_MEMBER_U_FRENCH_MUSKETEER');

    -- SECOND
    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_PORTUGUESE_BANDEIRANTE_SECOND'), 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_U_AMERICAN_MINUTEMAN');
    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_PORTUGUESE_BANDEIRANTE_SECOND'), "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_U_AMERICAN_MINUTEMAN');
    INSERT INTO ArtDefine_UnitMemberInfos (Type, Scale, ZOffset, Domain, Model, MaterialTypeTag, MaterialTypeSoundOverrideTag)
    SELECT ('ART_DEF_UNIT_MEMBER_PORTUGUESE_BANDEIRANTE_SECOND'), Scale, ZOffset, Domain,
    ('u_portuguese_bandeirante_second.fxsxml'), MaterialTypeTag, MaterialTypeSoundOverrideTag
    FROM ArtDefine_UnitMemberInfos WHERE (Type = 'ART_DEF_UNIT_MEMBER_U_AMERICAN_MINUTEMAN');

    -- NATIVE
    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_PORTUGUESE_BANDEIRANTE_NATIVESOLDIER'), 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_MUSKETMAN');
    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_PORTUGUESE_BANDEIRANTE_NATIVESOLDIER'), "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_MUSKETMAN');
    INSERT INTO ArtDefine_UnitMemberInfos (Type, Scale, ZOffset, Domain, Model, MaterialTypeTag, MaterialTypeSoundOverrideTag)
    SELECT ('ART_DEF_UNIT_MEMBER_PORTUGUESE_BANDEIRANTE_NATIVESOLDIER'), Scale, ZOffset, Domain,
    ('u_portuguese_bandeirante_nativesoldier.fxsxml'), MaterialTypeTag, MaterialTypeSoundOverrideTag
    FROM ArtDefine_UnitMemberInfos WHERE (Type = 'ART_DEF_UNIT_MEMBER_MUSKETMAN');

    -- FLAG BEARER
    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_PORTUGUESE_BANDEIRANTE_FLAGBEARER'), 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_GREATARTIST_EARLY_FLAGBEARER');
    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_PORTUGUESE_BANDEIRANTE_FLAGBEARER'), "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_GREATARTIST_EARLY_FLAGBEARER');
    INSERT INTO ArtDefine_UnitMemberInfos (Type, Scale, ZOffset, Domain, Model, MaterialTypeTag, MaterialTypeSoundOverrideTag)
    SELECT ('ART_DEF_UNIT_MEMBER_PORTUGUESE_BANDEIRANTE_FLAGBEARER'), Scale, ZOffset, Domain,
    ('u_portuguese_bandeirante_flagbearer.fxsxml'), MaterialTypeTag, MaterialTypeSoundOverrideTag
    FROM ArtDefine_UnitMemberInfos WHERE (Type = 'ART_DEF_UNIT_MEMBER_GREATARTIST_EARLY_FLAGBEARER');
    ----


    Thanks for any help in advance.
     
  15. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,646
    Location:
    France
    you missed the ";" at the end of the first INSERT statement

    Edit : and DamageStates have to be defined (when using the "direct" INSERT syntax, you can't refer to a column name from the SELECT as you've not selected anything), replace it by 1

    Code:
    INSERT INTO ArtDefine_UnitInfos (Type, DamageStates, Formation)
    VALUES	('ART_DEF_UNIT_PORTUGUESE_BANDEIRANTE', 1, 'HonorableGunpowder');
     
  16. Hypereon

    Hypereon He was a Consul of Rome!

    Joined:
    Jun 19, 2012
    Messages:
    414
    Location:
    Helsinki, Finland
    Thank you very much! It's now working.

    The thing there that didn't work, that was the Flagbearer member. It seems that it isn't possible to easily combine a civilian member to a military unit. But now it works with just the military units.
     
  17. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,646
    Location:
    France
    strange, I've done that before (Engineer + workers + Infantries)
     
  18. nokmirt

    nokmirt Emperor

    Joined:
    Feb 14, 2009
    Messages:
    5,087
    Location:
    Iowa USA
    How do you merge all units into a single mod? I clicked build solution, which I thought created a mod that encompassed them all. However in game in Mods, I still have to click a folder for each unit. Sorry for being smart earlier. This stuff is not all that easy sometimes.
     
  19. nokmirt

    nokmirt Emperor

    Joined:
    Feb 14, 2009
    Messages:
    5,087
    Location:
    Iowa USA
    When I add my British rifleman units (infact this happens with all UU rifles) to my worldbuilder map, they have a settler icon. Why is that? And does it matter? Is there an easy way to fix it?
     
  20. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,646
    Location:
    France
    I only use the WB to work on blank maps to add city and territory in my scenarios, the rest I handle in Lua (which is why I can't answer your last PM), so I never tried to fix that. I think there is a post or tutorial somewhere about how to set icons for strategic view, I suppose it's the same icons used in WB placement. Maybe someone can point you to that post...
     

Share This Page