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. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,664
    Location:
    France
    Example of XML file for ArtDefines and unit stats based on whoward69' Units - Galleon (GK) v.2

    edit: thanks to him, you can now found XML template for all existing units here.

    Art defines:

    Code:
    <GameData>
    	<ArtDefine_UnitInfos>
    		<Row>
    		<Type>ART_DEF_UNIT_MOD_GALLEON</Type>
    		<DamageStates>1</DamageStates>
    		<Formation>TwoBigGuns</Formation>
    		</Row>
    	</ArtDefine_UnitInfos>
    
    	<ArtDefine_UnitInfoMemberInfos>
    		<Row>
    			<UnitInfoType>ART_DEF_UNIT_MOD_GALLEON</UnitInfoType>
    			<UnitMemberInfoType>ART_DEF_UNIT_MEMBER_MOD_GALLEON</UnitMemberInfoType>
    			<NumMembers>1</NumMembers>
    		</Row>
    	</ArtDefine_UnitInfoMemberInfos>
    
    	<ArtDefine_UnitMemberInfos>
    		<Row>
    			<Type>ART_DEF_UNIT_MEMBER_MOD_GALLEON</Type>
    			<Scale>0.14</Scale>
    			<Domain>Sea</Domain>
    			<Model>Assets/Units/Galleon/Galleon.fxsxml</Model>
    			<MaterialTypeTag>WOOD</MaterialTypeTag>
    			<MaterialTypeSoundOverrideTag>WOODLRG</MaterialTypeSoundOverrideTag>
    		</Row>
    	</ArtDefine_UnitMemberInfos>
    
    	<ArtDefine_UnitMemberCombats>
    		<Row>
    			<UnitMemberType>ART_DEF_UNIT_MEMBER_MOD_GALLEON</UnitMemberType>
    			<EnableActions>Idle Attack RunCharge AttackCity Bombard Death BombardDefend Run Fortify CombatReady AttackSurfaceToAir</EnableActions>
    			<DisableActions></DisableActions>
    			<HasShortRangedAttack>1</HasShortRangedAttack>
    			<HasLeftRightAttack>1</HasLeftRightAttack>
    			<HasRefaceAfterCombat>0</HasRefaceAfterCombat>
    			<HasIndependentWeaponFacing>1</HasIndependentWeaponFacing>
    		</Row>
    	</ArtDefine_UnitMemberCombats>
    
    	<ArtDefine_UnitMemberCombatWeapons>
    		<Row>
    			<UnitMemberType>ART_DEF_UNIT_MEMBER_MOD_GALLEON</UnitMemberType>
    			<Index>0</Index>
    			<SubIndex>0</SubIndex>
    			<VisKillStrengthMin>10</VisKillStrengthMin>
    			<VisKillStrengthMax>20</VisKillStrengthMax>
    			<HitEffect>ART_DEF_VEFFECT_CANNON_IMPACT_$(TERRAIN)</HitEffect>
    			<WeaponTypeTag>EXPLOSIVE</WeaponTypeTag>
    			<WeaponTypeSoundOverrideTag>EXPLOSION6POUND</WeaponTypeSoundOverrideTag>
    		</Row>
    	</ArtDefine_UnitMemberCombatWeapons>
    
    	<ArtDefine_StrategicView>
    		<Row>
    			<StrategicViewType>ART_DEF_UNIT_MOD_GALLEON</StrategicViewType>
    			<TileType>Unit</TileType>
    			<Asset>SV_ModGalleon.dds</Asset>
    		</Row>
    	</ArtDefine_StrategicView>
    </GameData>
    And unit statistics:

    Code:
    <GameData>
    	<UnitClasses>
    		<Row>
    			<Type>UNITCLASS_GALLEON</Type>
    			<Description>TXT_KEY_UNIT_GALLEON</Description>
    			<DefaultUnit>UNIT_GALLEON</DefaultUnit>
    		</Row>
    	</UnitClasses>
    
    	<Units>
    		<Row>
    			<Class>UNITCLASS_GALLEON</Class>
    			<Type>UNIT_GALLEON</Type>
    			<PrereqTech>TECH_STEAM_POWER</PrereqTech>
    			<Combat>40</Combat>
    			<Cost>250</Cost>
    			<Moves>4</Moves>
    			<HurryCostModifier>20</HurryCostModifier>
    			<CombatClass>UNITCOMBAT_NAVALMELEE</CombatClass>
    			<Domain>DOMAIN_SEA</Domain>
    			<DefaultUnitAI>UNITAI_ATTACK_SEA</DefaultUnitAI>
    			<Description>TXT_KEY_UNIT_GALLEON</Description>
    			<Civilopedia>TXT_KEY_UNIT_GALLEON_TEXT</Civilopedia>
    			<Strategy>TXT_KEY_UNIT_GALLEON_STRATEGY</Strategy>
    			<Help>TXT_KEY_UNIT_GALLEON_HELP</Help>
    			<MilitarySupport>true</MilitarySupport>
    			<MilitaryProduction>true</MilitaryProduction>
    			<Pillage>true</Pillage>
    			<Mechanized>true</Mechanized>
    			<ObsoleteTech>TECH_COMBUSTION</ObsoleteTech>
    			<AdvancedStartCost>50</AdvancedStartCost>
    			<MinAreaSize>20</MinAreaSize>
    			<XPValueAttack>3</XPValueAttack>
    			<XPValueDefense>3</XPValueDefense>
    			<UnitArtInfo>ART_DEF_UNIT_MOD_GALLEON</UnitArtInfo>
    			<UnitFlagAtlas>UNITS_GALLEON_FLAG_ATLAS</UnitFlagAtlas>
    			<UnitFlagIconOffset>0</UnitFlagIconOffset>
    			<IconAtlas>UNITS_GALLEON_ICON_ATLAS</IconAtlas>
    			<PortraitIndex>0</PortraitIndex>
    			<MoveRate>BOAT</MoveRate>
    		</Row>
    	</Units>
    
    	<Unit_AITypes>
    		<Row>
    			<UnitType>UNIT_GALLEON</UnitType>
    			<UnitAIType>UNITAI_ATTACK_SEA</UnitAIType>
    		</Row>
    		<Row>
    			<UnitType>UNIT_GALLEON</UnitType>
    			<UnitAIType>UNITAI_RESERVE_SEA</UnitAIType>
    		</Row>
    		<Row>
    			<UnitType>UNIT_GALLEON</UnitType>
    			<UnitAIType>UNITAI_ESCORT_SEA</UnitAIType>
    		</Row>
    		<Row>
    			<UnitType>UNIT_GALLEON</UnitType>
    			<UnitAIType>UNITAI_EXPLORE_SEA</UnitAIType>
    		</Row>
    	</Unit_AITypes>
    
    	<Unit_Flavors>
    		<Row>
    			<UnitType>UNIT_GALLEON</UnitType>
    			<FlavorType>FLAVOR_NAVAL</FlavorType>
    			<Flavor>5</Flavor>
    		</Row>
    		<Row>
    			<UnitType>UNIT_GALLEON</UnitType>
    			<FlavorType>FLAVOR_NAVAL_RECON</FlavorType>
    			<Flavor>6</Flavor>
    		</Row>
    	</Unit_Flavors>
    
    	<Unit_FreePromotions>
    		<Row>
    			<UnitType>UNIT_GALLEON</UnitType>
    			<PromotionType>PROMOTION_EXTRA_SIGHT_I</PromotionType>
    		</Row>
    	</Unit_FreePromotions>
    
    	<Unit_ClassUpgrades>
    		<Row>
    			<UnitType>UNIT_GALLEON</UnitType>
    			<UnitClassType>UNITCLASS_DESTROYER</UnitClassType>
    		</Row>
    
    		<Update>
    			<Where UnitType="UNIT_CARAVEL"/>
    			<Set UnitClassType="UNITCLASS_GALLEON"/>
    		</Update>
    		<Update>
    		  <Where UnitType="UNIT_KOREAN_TURTLE_SHIP"/>
    		  <Set UnitClassType="UNITCLASS_GALLEON"/>
    		</Update>
    	</Unit_ClassUpgrades>
    
    	<Unit_ResourceQuantityRequirements>
    		<Row>
    			<UnitType>UNIT_GALLEON</UnitType>
    			<ResourceType>RESOURCE_IRON</ResourceType>
    		</Row>
    	</Unit_ResourceQuantityRequirements>
      
    	<Language_en_US>
    		<Row Tag="TXT_KEY_UNIT_GALLEON">
    			<Text>Galleon</Text>
    		</Row>
    		<Row Tag="TXT_KEY_UNIT_GALLEON_HELP">
    			<Text>Fast Renaissance exploration Unit with a large sight radius.</Text>
    		</Row>
    		<Row Tag="TXT_KEY_UNIT_GALLEON_STRATEGY">
    			<Text>The Galleon is a major upgrade to a civilization's naval power. A Ranged unit, it is stronger and faster than a Caravel, and it can enter Deep Ocean hexes. The Galleon has a large sight radius, making it the eyes and ears of the mid-game navy.</Text>
    		</Row>
    		<Row Tag="TXT_KEY_UNIT_GALLEON_TEXT">
    			<Text>The gallen was a mid-size, seagoing vessel used in the 17th century to exploit the world, being an upgrade of the earlier Caravel.</Text>
    		</Row>
    	</Language_en_US>
    </GameData>
    
    <GameData>
      <IconTextureAtlases>
        <Row>
    		<Atlas>UNITS_GALLEON_ICON_ATLAS</Atlas>
    		<IconSize>256</IconSize>
    		<Filename>ART/Galleon256.dds</Filename>
    		<IconsPerRow>8</IconsPerRow>
    		<IconsPerColumn>6</IconsPerColumn>
        </Row>
        <Row>
    		<Atlas>UNITS_GALLEON_ICON_ATLAS</Atlas>
    		<IconSize>128</IconSize>
    		<Filename>ART/Galleon128.dds</Filename>
    		<IconsPerRow>8</IconsPerRow>
    		<IconsPerColumn>6</IconsPerColumn>
        </Row>
        <Row>
    		<Atlas>UNITS_GALLEON_ICON_ATLAS</Atlas>
    		<IconSize>80</IconSize>
    		<Filename>ART/Galleon80.dds</Filename>
    		<IconsPerRow>8</IconsPerRow>
    		<IconsPerColumn>6</IconsPerColumn>
        </Row>
        <Row>
    		<Atlas>UNITS_GALLEON_ICON_ATLAS</Atlas>
    		<IconSize>64</IconSize>
    		<Filename>ART/Galleon64.dds</Filename>
    		<IconsPerRow>8</IconsPerRow>
    		<IconsPerColumn>6</IconsPerColumn>
        </Row>
        <Row>
    		<Atlas>UNITS_GALLEON_ICON_ATLAS</Atlas>
    		<IconSize>45</IconSize>
    		<Filename>ART/Galleon45.dds</Filename>
    		<IconsPerRow>8</IconsPerRow>
    		<IconsPerColumn>6</IconsPerColumn>
        </Row>
    
        <Row>
    		<Atlas>UNITS_GALLEON_FLAG_ATLAS</Atlas>
    		<IconSize>32</IconSize>
    		<Filename>ART/GalleonFlag.dds</Filename>
    		<IconsPerRow>1</IconsPerRow>
    		<IconsPerColumn>1</IconsPerColumn>
        </Row>
      </IconTextureAtlases>
    </GameData>
    
    Note that whoward69's galleon use specific icons and texts that are defined here while the BIPLAN unit from my SQL example re-use the fighter icons and texts.
     
  2. Pazyryk

    Pazyryk Deity

    Joined:
    Jun 13, 2008
    Messages:
    3,584
    If you mix civilian and military members in the same unit, add the military member first. If the civilian is added first, it will sort of "glide up" to the enemy unit during attack. If second, then it will stand its ground through the whole attack animation. (At least this is what I found in one case.)
     
  3. fuzzy_bunnies

    fuzzy_bunnies Prince

    Joined:
    May 28, 2004
    Messages:
    325
    OK I'm still having trouble. I redid everything based on the galleon sample, I just realized that G&K changed the way the XML files are formatted... but it still doesn't work. Can someone take a look at this and let me know what I'm missing? For now I'm trying to get them to work using existing units and existing icons so I didn't modify the icons xml or the memberinfo/combats/weapons tables. Sample selection below, I can post the whole thing if needed:

    Spoiler :

    <!-- ********************************************** -->


    <ArtDefine_UnitInfos>
    <Row>
    <Type>ART_DEF_UNIT_ZOMBIE_HORDE</Type>
    <DamageStates>1</DamageStates>
    <Formation>Barbarian</Formation>
    </Row>
    </ArtDefine_UnitInfos>

    <ArtDefine_UnitInfoMemberInfos>
    <Row>
    <UnitInfoType>ART_DEF_UNIT_ZOMBIE_HORDE</UnitInfoType>
    <UnitMemberInfoType>ART_DEF_UNIT_MEMBER_BARBARIAN_EURO_ALPHA</UnitMemberInfoType>
    <NumMembers>15</NumMembers>
    </Row>
    </ArtDefine_UnitInfoMemberInfos>

    <ArtDefine_StrategicView>
    <Row>
    <StrategicViewType>ART_DEF_UNIT_ZOMBIE_HORDE</StrategicViewType>
    <TileType>Unit</TileType>
    <Asset>SV_AntiAircraftGun.dds</Asset>
    </Row>
    </ArtDefine_StrategicView>


    <!-- ********************************************** -->


    <ArtDefine_UnitInfos>
    <Row>
    <Type>ART_DEF_UNIT_CIVILIAN_MILITIA</Type>
    <DamageStates>1</DamageStates>
    <Formation>WARRIOR</Formation>
    </Row>
    </ArtDefine_UnitInfos>

    <ArtDefine_UnitInfoMemberInfos>
    <Row>
    <UnitInfoType>ART_DEF_UNIT_CIVILIAN_MILITIA</UnitInfoType>
    <UnitMemberInfoType>ART_DEF_UNIT_MEMBER_WARRIOR_V2</UnitMemberInfoType>
    <NumMembers>3</NumMembers>
    </Row>
    </ArtDefine_UnitInfoMemberInfos>

    <ArtDefine_StrategicView>
    <Row>
    <StrategicViewType>ART_DEF_UNIT_CIVILIAN_MILITIA</StrategicViewType>
    <TileType>Unit</TileType>
    <Asset>SV_AntiAircraftGun.dds</Asset>
    </Row>
    </ArtDefine_StrategicView>

    <!-- ********************************************** -->


    <ArtDefine_UnitInfos>
    <Row>
    <Type>ART_DEF_UNIT_SURVIVALIST</Type>
    <DamageStates>1</DamageStates>
    <Formation>UnFormed</Formation>
    </Row>
    </ArtDefine_UnitInfos>

    <ArtDefine_UnitInfoMemberInfos>
    <Row>
    <UnitInfoType>ART_DEF_UNIT_SURVIVALIST</UnitInfoType>
    <UnitMemberInfoType>ART_DEF_UNIT_MEMBER_INFANTRY</UnitMemberInfoType>
    <NumMembers>2</NumMembers>
    </Row>
    </ArtDefine_UnitInfoMemberInfos>

    <ArtDefine_StrategicView>
    <Row>
    <StrategicViewType>ART_DEF_UNIT_SURVIVALIST</StrategicViewType>
    <TileType>Unit</TileType>
    <Asset>SV_AntiAircraftGun.dds</Asset>
    </Row>
    </ArtDefine_StrategicView>

    <!-- ********************************************** -->


    <ArtDefine_UnitInfos>
    <Row>
    <Type>ART_DEF_UNIT_RANGER</Type>
    <DamageStates>1</DamageStates>
    <Formation>UnFormed</Formation>
    </Row>
    </ArtDefine_UnitInfos>

    <ArtDefine_UnitInfoMemberInfos>
    <Row>
    <UnitInfoType>ART_DEF_UNIT_RANGER</UnitInfoType>
    <UnitMemberInfoType>ART_DEF_UNIT_MEMBER_INFANTRY</UnitMemberInfoType>
    <NumMembers>1</NumMembers>
    </Row>
    <Row>
    <UnitInfoType>ART_DEF_UNIT_RANGER</UnitInfoType>
    <UnitMemberInfoType>ART_DEF_UNIT_MEMBER_WORKER_EURO_LATE</UnitMemberInfoType>
    <NumMembers>2</NumMembers>
    </Row>
    </ArtDefine_UnitInfoMemberInfos>

    <ArtDefine_StrategicView>
    <Row>
    <StrategicViewType>ART_DEF_UNIT_RANGER</StrategicViewType>
    <TileType>Unit</TileType>
    <Asset>SV_AntiAircraftGun.dds</Asset>
    </Row>
    </ArtDefine_StrategicView>

    <!-- ********************************************** -->


    Thanks in advance for any assistance!
     
  4. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,350
    Location:
    Near Portsmouth, UK
    Probably best to start a new thread in the general forum (more people will see it there) and attach the zipped built mod (not the ModBuddy project but the built mod - should be in C:\Users\{username}\Documents\My Games\Sid Meier's Civilization 5\Mods) and any relevant info from the database.log file (you DO have logging enabled and are actually checking the log files)
     
  5. CoDazle

    CoDazle Chieftain

    Joined:
    Jan 31, 2013
    Messages:
    6
    Location:
    Chicago, IL
    So I have been following this thread and trying to figure out how to make a Unit based off of the Greek Hoplite just using a single unit that is a tad larger. But like many others, I am plagued by the spearman unit appearing with every attempt I have tried. I have attempted XML and SQL methods. Working on a mod that adds Champion Units to the game, I have the concept down, but would really like single unit graphics for my champion units

    I have attached what I have so far. If anyone has any pointers let me know.

    Spoiler :
    INSERT INTO ArtDefine_UnitInfos (Type,DamageStates,Formation)
    SELECT ('ART_DEF_UNIT_CHAMPION_SPEARMAN'), DamageStates, Formation
    FROM ArtDefine_UnitInfos WHERE (Type = 'ART_DEF_UNIT_U_GREEK_HOPLITE');

    INSERT INTO ArtDefine_UnitInfoMemberInfos (UnitInfoType,UnitMemberInfoType,NumMembers)
    SELECT ('ART_DEF_UNIT_CHAMPION_SPEARMAN'), ('ART_DEF_UNIT_MEMBER_CHAMPION_SPEARMAN'), (1)
    FROM ArtDefine_UnitInfoMemberInfos WHERE (UnitInfoType = 'ART_DEF_UNIT_U_GREEK_HOPLITE');

    INSERT INTO ArtDefine_UnitMemberCombats (UnitMemberType, EnableActions, ShortMoveRadius, ShortMoveRate, TargetHeight, HasRefaceAfterCombat, ReformBeforeCombat)
    SELECT ('ART_DEF_UNIT_MEMBER_CHAMPION_SPEARMAN'), UnitMemberType, EnableActions, ShortMoveRadius, ShortMoveRate, TargetHeight, HasRefaceAfterCombat, ReformBeforeCombat
    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_CHAMPION_SPEARMAN'), UnitMemberType, "Index", SubIndex, WeaponTypeTag, WeaponTypeSoundOverrideTag
    FROM ArtDefine_UnitMemberCombatWeapons WHERE (UnitMemberType = 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE');

    INSERT INTO ArtDefine_UnitMemberCombatWeapons (UnitMemberType, "Index", SubIndex, VisKillStrengthMin, VisKillStrengthMax, WeaponTypeTag, MissTargetSlopRadius)
    SELECT ('ART_DEF_UNIT_MEMBER_CHAMPION_SPEARMAN'), UnitMemberType, "Index", SubIndex, VisKillStrengthMin, VisKillStrengthMax, WeaponTypeTag, MissTargetSlopRadius
    FROM ArtDefine_UnitMemberCombatWeapons WHERE (UnitMemberType = 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE');

    INSERT INTO ArtDefine_UnitMemberInfos (Type, Scale, Model, MaterialTypeTag, MaterialTypeSoundOverrideTag)
    SELECT ('ART_DEF_UNIT_MEMBER_CHAMPION_SPEARMAN'), Type, (.20), Model, MaterialTypeTag, MaterialTypeSoundOverrideTag
    FROM ArtDefine_UnitMemberInfos WHERE (Type = 'ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE');

    INSERT INTO ArtDefine_StrategicView (StrategicViewType, TileType, Asset )
    SELECT ('ART_DEF_UNIT_CHAMPION_SPEARMAN'), TileType, Asset
    FROM ArtDefine_StrategicView WHERE (Type = 'ART_DEF_UNIT_U_GREEK_HOPLITE');
     
  6. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,350
    Location:
    Near Portsmouth, UK
    Stmts 3 thru 6 give the error "N+1 values for N columns" and the last stmt complains about no such column Type

    So, step 1 would be to enable logging. Step 2, to check and double check your typing
     
  7. Zaelon

    Zaelon Warlord

    Joined:
    Nov 1, 2010
    Messages:
    103
    Hello fellow modders :)

    I've been trying to follow your tutorial, along with some other resources you point at in this thread, but I haven't been too successful so far.
    As I'm no 3D artist I used existing models from a working mod (Faerun from G&K) so the gr2, dds and all should be ok.
    I followed your examples to make the sql and could get over the spearman bug. The units seem to display just fine when idle, they can move with animations (even though their movement range seems weird), and they can use ranged attack but with no animation - the ranged animation seems to work when triggered through firetuner though.
    But the worst of all is that they respawn in the city they were made in every new turn !
    I found nothing relevant in the logs and I didn't seem to find much more typing keywords in google.
    So I was wondering if you guys had been through something like this and, if so, if you knew how to fix it !

    Thanking you in advance for your time,
    Cheers,
    Chris
     
  8. Zaelon

    Zaelon Warlord

    Joined:
    Nov 1, 2010
    Messages:
    103
    Okay, I figured it out.
    It has nothing to do with the new models actually. Turns out I had also a wrong "domain" set for them !
     
  9. LakeTroll

    LakeTroll Chieftain

    Joined:
    Feb 21, 2009
    Messages:
    23
    Complete newbie questions I know but here goes. How do I copy the art files into my mod? What is VFS and how do I work with it? None of the intro tutorials I've read including Kael's seem to mention this stuff. If anyone could point me to a source of information on these subjects I would be very grateful.
     
  10. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,664
    Location:
    France
    Yes, Kael' guide was made before the introduction of the vitual file system. See the modiki (link is in the top menu), and specifically here for the VFS.
     
  11. Immk

    Immk Chieftain

    Joined:
    Sep 22, 2012
    Messages:
    13
    Location:
    Europe - Spain
    I cant get the models to work, i only see a spearman.

    This is the code of my sql.

    Spoiler :
    INSERT INTO ArtDefine_UnitInfos (Type,DamageStates,Formation)
    SELECT ('ART_DEF_UNIT_BIPLAN'), DamageStates, Formation
    FROM ArtDefine_UnitInfos WHERE (Type = 'ART_DEF_UNIT_FIGHTER');

    INSERT INTO ArtDefine_UnitInfoMemberInfos (UnitInfoType,UnitMemberInfoType,NumMembers)
    SELECT ('ART_DEF_UNIT_BIPLAN'), ('ART_DEF_UNIT_MEMBER_BIPLAN'), NumMembers
    FROM ArtDefine_UnitInfoMemberInfos WHERE (UnitInfoType = 'ART_DEF_UNIT_FIGHTER');

    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_BIPLAN'), 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_FIGHTER');

    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_BIPLAN'), "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_FIGHTER');

    INSERT INTO ArtDefine_UnitMemberInfos (Type, Scale, ZOffset, Domain, Model, MaterialTypeTag, MaterialTypeSoundOverrideTag)
    SELECT ('ART_DEF_UNIT_MEMBER_BIPLAN'), Scale, ZOffset, Domain, ('EarlyFighter_Generic.fxsxml'), MaterialTypeTag, MaterialTypeSoundOverrideTag
    FROM ArtDefine_UnitMemberInfos WHERE (Type = 'ART_DEF_UNIT_MEMBER_FIGHTER');

    INSERT INTO ArtDefine_StrategicView (StrategicViewType, TileType, Asset )
    SELECT ('ART_DEF_UNIT_BIPLAN'), TileType, Asset
    FROM ArtDefine_StrategicView WHERE (StrategicViewType = 'ART_DEF_UNIT_FIGHTER');

    --La mierda se separa aqui--

    INSERT INTO UnitClasses (Type, Description, MaxGlobalInstances, MaxTeamInstances, MaxPlayerInstances, InstanceCostModifier, DefaultUnit )
    SELECT ('UNITCLASS_BIPLAN'), Description, MaxGlobalInstances, MaxTeamInstances, MaxPlayerInstances, InstanceCostModifier, ('UNIT_BIPLAN')
    FROM UnitClasses WHERE (Type = 'UNITCLASS_FIGHTER');

    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, SpecialCargo, DomainCargo, Conscription, ExtraMaintenanceCost, NoMaintenance, Unhappiness, UnitArtInfo, UnitArtInfoCulturalVariation, UnitArtInfoEraVariation, ProjectPrereq, SpaceshipProject, LeaderPromotion, LeaderExperience, DontShowYields, ShowInPedia, MoveRate, UnitFlagIconOffset, PortraitIndex, IconAtlas, UnitFlagAtlas)
    SELECT ('UNIT_BIPLAN'), ('Biplan'), Civilopedia, Strategy, Help, Requirements,
    Combat, (25), (250), Moves, Immobile, (5), BaseSightRange, ('UNITCLASS_BIPLAN'), 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_BIPLAN'), UnitArtInfoCulturalVariation, UnitArtInfoEraVariation, ProjectPrereq, SpaceshipProject, LeaderPromotion, LeaderExperience, DontShowYields, ShowInPedia, MoveRate,
    UnitFlagIconOffset, PortraitIndex, IconAtlas, UnitFlagAtlas
    FROM Units WHERE (Type = 'UNIT_FIGHTER');

    INSERT INTO Unit_AITypes (UnitType, UnitAIType)
    SELECT ('UNIT_BIPLAN'), UnitAIType
    FROM Unit_AITypes WHERE (UnitType = 'UNIT_FIGHTER');

    INSERT INTO Unit_ClassUpgrades (UnitType, UnitClassType)
    SELECT ('UNIT_BIPLAN'), UnitClassType
    FROM Unit_ClassUpgrades WHERE (UnitType = 'UNIT_FIGHTER');

    INSERT INTO Unit_Flavors (UnitType, FlavorType, Flavor)
    SELECT ('UNIT_BIPLAN'), FlavorType, Flavor
    FROM Unit_Flavors WHERE (UnitType = 'UNIT_FIGHTER');

    INSERT INTO Unit_FreePromotions (UnitType, PromotionType)
    SELECT ('UNIT_BIPLAN'), PromotionType
    FROM Unit_FreePromotions WHERE (UnitType = 'UNIT_FIGHTER');

    INSERT INTO Unit_ResourceQuantityRequirements (UnitType, ResourceType, Cost)
    SELECT ('UNIT_BIPLAN'), ResourceType, Cost
    FROM Unit_ResourceQuantityRequirements WHERE (UnitType = 'UNIT_FIGHTER');


    This is a screen of how my project looks

    Spoiler :


    Sorry for my bad english. Also sorry if my too bad at modding im really newbie at it. :lol:
     
  12. Nutty

    Nutty Deity

    Joined:
    Mar 9, 2011
    Messages:
    3,161
    Gender:
    Male
    Location:
    Orange County, California, U.S.A.
    Immk,
    There don't seem to be any problems with your SQL. Are you sure all 4 of the unit art files are VFS=true and you have Reload Unit System activated?

    Can you attach the built mod? While you're at it, you can make sure you have logging enabled, then after you have started a new game with your mod activated, post the contents of your database.log.
     
  13. Immk

    Immk Chieftain

    Joined:
    Sep 22, 2012
    Messages:
    13
    Location:
    Europe - Spain
    -- Nervermind --

    What happened is that i forgot to check the box of Reload Unit System on the mod properties. :lol:

    Thank you for the help.
     
  14. Nutty

    Nutty Deity

    Joined:
    Mar 9, 2011
    Messages:
    3,161
    Gender:
    Male
    Location:
    Orange County, California, U.S.A.
    No, that error comes from someone sloppy at Firaxis for the base game. The errors from your mod are:
    Code:
    [964.320] Invalid Reference on Units.Description - "Biplan" does not exist in Language_en_US
    [964.413] Invalid Reference on UnitPromotions.PediaEntry - "TXT_KEY_PROMOTION_WITHDRAW_BEFORE_MELEE" does not exist in Language_en_US
    [964.444] Invalid Reference on UnitPromotions.Help - "TXT_KEY_PROMOTION_WITHDRAW_BEFORE_MELEE_HELP" does not exist in Language_en_US
    [964.491] Invalid Reference on UnitPromotions.Description - "TXT_KEY_PROMOTION_WITHDRAW_BEFORE_MELEE" does not exist in Language_en_US
    [964.491] Failed Validation.
    But I don't think that would cause spearman to display for your unit. Please post the built mod.
     
  15. AngelsFallFirst

    AngelsFallFirst Chieftain

    Joined:
    Jul 22, 2013
    Messages:
    4
    Hi, Im totally new to modding< just started a project in which i want to add a A9 Cruiser MKI tank ingame.

    This may sound stupid, but what do i need to make the mod apper in the MODS section in the game. The game doesnt see my mod. or did i miss anything.

    Here's the code:

    Spoiler :
    Code:
    -- Insert SQL Rules Here 
    
    -- A9 Cruiser Mk I
    INSERT INTO ArtDefine_UnitInfos(Type, DamageStates, Formation)
    	SELECT ('ART_DEF_UNIT_A9_CRUISER_MK_I'), DamageStates, Formation
    	FROM ArtDefine_UnitInfos WHERE (Type = 'ART_DEF_UNIT_TANK');
    	VALUES ('ART_DEF_UNIT_A9_CRUISER_MK_I', 1, 'Vehicle');
    
    INSERT INTO ArtDefine_UnitInfoMemberInfos(UnitInfoType, UnitMemberInfoType, NumMembers)
    	SELECT	('ART_DEF_UNIT_A9_CRUISER_MK_I'), ('ART_DEF_UNIT_MEMBER_A9_CRUISER_MK_I'), NumMembers
    	FROM ArtDefine_UnitInfoMemberInfos WHERE (UnitInfoType = 'ART_DEF_UNIT_TANK');
    	VALUES ('ART_DEF_UNIT_A9_CRUISER_MK_I', 'ART_DEF_UNIT_MEMBER_TANK', 3);
    
    INSERT INTO ArtDefine_UnitMemberInfos(Type, Scale, Model, MaterialTypeTag, MaterialTypeSoundOverrideTag)
    	SELECT	('ART_DEF_UNIT_MEMBER_A9_CRUISER_MK_I'), Scale, ZOffset, Domain, ('A9_Cruiser_MK_I.fxsxml'), MaterialTypeTag, MaterialTypeSoundOverrideTag
    	FROM ArtDefine_UnitMemberInfos WHERE (Type = 'ART_DEF_UNIT_MEMBER_TANK');
    	VALUES ('ART_DEF_UNIT_MEMBER_A9_CRUISER_MK_I', 0.10999999940395355, 'Assets/Units/Tank/Tank.fxsxml', 'METAL', 'METALSM');
    
    INSERT INTO ArtDefine_UnitMemberCombats(UnitMemberType, EnableActions, HasShortRangedAttack, HasStationaryMelee, HasRefaceAfterCombat, ReformBeforeCombat, HasIndependentWeaponFacing)
    	SELECT	('ART_DEF_UNIT_MEMBER_A9_CRUISER_MK_I'), 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_TANK');
    	VALUES ('ART_DEF_UNIT_MEMBER_A9_CRUISER_MK_I', 'Idle Attack RunCharge AttackCity Bombard Death BombardDefend Run Fortify CombatReady', 1, 1, 0, 1, 1);
    
    INSERT INTO ArtDefine_UnitMemberCombatWeapons(UnitMemberType, "Index", SubIndex, VisKillStrengthMin, VisKillStrengthMax, HitEffect, WeaponTypeTag, WeaponTypeSoundOverrideTag)
    	SELECT ('ART_DEF_UNIT_MEMBER_A9_CRUISER_MK_I'), "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_TANK');
    	VALUES ('ART_DEF_UNIT_MEMBER_A9_CRUISER_MK_I', 0, 0, 25.0, 50.0, 'ART_DEF_VEFFECT_TANK_IMPACT_$(TERRAIN)', 'EXPLOSIVE', 'EXPLOSION6POUND');
    
    INSERT INTO ArtDefine_StrategicView(StrategicViewType, TileType, Asset)
    	SELECT	('ART_DEF_UNIT_A9_CRUISER_MK_I'), TileType, Asset
    	FROM ArtDefine_StrategicView WHERE (StrategicViewType = 'ART_DEF_UNIT_TANK');
    	VALUES ('ART_DEF_UNIT_A9_CRUISER_MK_I', 'Unit', 'A9_Cruiser_MK_I.dds');
    
    
    
    
    
    INSERT INTO UnitClasses (Type, Description, MaxGlobalInstances, MaxTeamInstances, MaxPlayerInstances, InstanceCostModifier, DefaultUnit )
    	SELECT ('UNITCLASS_A9_CRUISER_MK_I'), Description, MaxGlobalInstances, MaxTeamInstances, MaxPlayerInstances, InstanceCostModifier, ('UNIT_A9_CRUISER_MK_I')
    	FROM UnitClasses WHERE (Type = 'UNITCLASS_TANK');
    
    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, IsReligious, 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_A9_CRUISER_MK_I'), ('A9 Cruiser MKI'), ('TXT_KEY_UNIT_A9_CRUISER_MKI'),  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, IsReligious, CombatLimit, RangeAttackOnlyInDomain, RangeAttackIgnoreLOS, RangedCombatLimit, XPValueAttack, XPValueDefense, SpecialCargo, DomainCargo, Conscription, ExtraMaintenanceCost, NoMaintenance, Unhappiness,
    			('ART_DEF_UNIT_A9_CRUISER_MK_I'), UnitArtInfoCulturalVariation, UnitArtInfoEraVariation, ProjectPrereq, SpaceshipProject, LeaderPromotion, LeaderExperience, DontShowYields, ShowInPedia, MoveRate, ("1"), PortraitIndex, IconAtlas
    	FROM Units WHERE (Type = 'UNIT_TANK');
    
    INSERT INTO Language_en_US ( Tag, Text )
    	VALUES ( 'TXT_KEY_UNIT_A9_CRUISER_MKI', 'A9 Cruiser MKI' );
    
    INSERT INTO Unit_AITypes (UnitType, UnitAIType)
    	SELECT ('UNIT_A9_CRUISER_MK_I'), UnitAIType
    	FROM Unit_AITypes WHERE (UnitType = 'UNIT_TANK');
    
    INSERT INTO Unit_ClassUpgrades (UnitType, UnitClassType)
    	SELECT ('UNIT_A9_CRUISER_MK_I'), UnitClassType
    	FROM Unit_ClassUpgrades WHERE (UnitType = 'UNIT_TANK');
    
    INSERT INTO Unit_Flavors (UnitType, FlavorType, Flavor)
    	SELECT ('UNIT_A9_CRUISER_MK_I'), FlavorType, Flavor
    	FROM Unit_Flavors WHERE (UnitType = 'UNIT_TANK');
    
    INSERT INTO Unit_FreePromotions (UnitType, PromotionType)
    	SELECT ('UNIT_A9_CRUISER_MKI'), PromotionType
    	FROM Unit_FreePromotions WHERE (UnitType = 'UNIT_TANK');
    
    INSERT INTO Unit_ResourceQuantityRequirements (UnitType, ResourceType, Cost)
    	SELECT ('UNIT_A9_CRUISER_MKI'), ResourceType, Cost
    	FROM Unit_ResourceQuantityRequirements WHERE (UnitType = 'UNIT_TANK');
     
  16. Nutty

    Nutty Deity

    Joined:
    Mar 9, 2011
    Messages:
    3,161
    Gender:
    Male
    Location:
    Orange County, California, U.S.A.
    Did you Build it in ModBuddy?

    Your SQLite syntax isn't right. You either use a SELECT (to make a copy of an existing row with some changes) or a VALUES (insert a brand new line and specify all the values), but you're trying to do both at once.
     
  17. AngelsFallFirst

    AngelsFallFirst Chieftain

    Joined:
    Jul 22, 2013
    Messages:
    4
    yes I did build it in SQL, hmmm I,ll remove VALUES then and see what happens
     
  18. AngelsFallFirst

    AngelsFallFirst Chieftain

    Joined:
    Jul 22, 2013
    Messages:
    4
    Ok, the code looks like this now, the game sees the mod, but i cant build the new unit. its still the vanilla TANK and no signs of the new unit... what could be the problem?

    I want it to be available only for england, well in this case. Not to replace the vanilla tank, but as alternative tank in the building list.


    code:

    Spoiler :
    Code:
    -- Insert SQL Rules Here 
    
    INSERT INTO ArtDefine_UnitInfos(Type, DamageStates, Formation)
    	SELECT ('ART_DEF_UNIT_A9_CRUISER_MK_I'), DamageStates, Formation
    	FROM ArtDefine_UnitInfos WHERE (Type = 'ART_DEF_UNIT_TANK');
    
    INSERT INTO ArtDefine_UnitInfoMemberInfos(UnitInfoType, UnitMemberInfoType, NumMembers)
    	SELECT	('ART_DEF_UNIT_A9_CRUISER_MK_I'), ('ART_DEF_UNIT_MEMBER_A9_CRUISER_MK_I'), NumMembers
    	FROM ArtDefine_UnitInfoMemberInfos WHERE (UnitInfoType = 'ART_DEF_UNIT_TANK');
    
    INSERT INTO ArtDefine_UnitMemberInfos(Type, Scale, Model, MaterialTypeTag, MaterialTypeSoundOverrideTag)
    	SELECT	('ART_DEF_UNIT_MEMBER_A9_CRUISER_MK_I'), Scale, ZOffset, Domain, ('A9_Cruiser_MK_I.fxsxml'), MaterialTypeTag, MaterialTypeSoundOverrideTag
    	FROM ArtDefine_UnitMemberInfos WHERE (Type = 'ART_DEF_UNIT_MEMBER_TANK');
    
    INSERT INTO ArtDefine_UnitMemberCombats(UnitMemberType, EnableActions, HasShortRangedAttack, HasStationaryMelee, HasRefaceAfterCombat, ReformBeforeCombat, HasIndependentWeaponFacing)
    	SELECT	('ART_DEF_UNIT_MEMBER_A9_CRUISER_MK_I'), 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_TANK');
    
    INSERT INTO ArtDefine_UnitMemberCombatWeapons(UnitMemberType, "Index", SubIndex, VisKillStrengthMin, VisKillStrengthMax, HitEffect, WeaponTypeTag, WeaponTypeSoundOverrideTag)
    	SELECT ('ART_DEF_UNIT_MEMBER_A9_CRUISER_MK_I'), "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_TANK');
    
    INSERT INTO ArtDefine_StrategicView(StrategicViewType, TileType, Asset)
    	SELECT	('ART_DEF_UNIT_A9_CRUISER_MK_I'), TileType, Asset
    	FROM ArtDefine_StrategicView WHERE (StrategicViewType = 'ART_DEF_UNIT_TANK');
    
    
    -- A9 Cruiser Mk I
    
    INSERT INTO UnitClasses (Type, Description, MaxGlobalInstances, MaxTeamInstances, MaxPlayerInstances, InstanceCostModifier, DefaultUnit )
    	SELECT ('UNITCLASS_A9_CRUISER_MK_I'), Description, MaxGlobalInstances, MaxTeamInstances, MaxPlayerInstances, InstanceCostModifier, ('UNIT_A9_CRUISER_MKI')
    	FROM UnitClasses WHERE (Type = 'UNITCLASS_TANK');
    
    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, IsReligious, 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_A9_CRUISER_MK_I'), ('A9 Cruiser MKI'),  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, IsReligious, CombatLimit, RangeAttackOnlyInDomain, RangeAttackIgnoreLOS, RangedCombatLimit, XPValueAttack, XPValueDefense, SpecialCargo, DomainCargo, Conscription, ExtraMaintenanceCost, NoMaintenance, Unhappiness,
    			('ART_DEF_UNIT_A9_CRUISER_MK_I'), UnitArtInfoCulturalVariation, UnitArtInfoEraVariation, ProjectPrereq, SpaceshipProject, LeaderPromotion, LeaderExperience, DontShowYields, ShowInPedia, MoveRate, ("1"), PortraitIndex, IconAtlas
    	FROM Units WHERE (Type = 'UNIT_TANK');
    
    INSERT INTO Unit_AITypes (UnitType, UnitAIType)
    	SELECT ('UNIT_A9_CRUISER_MK_I'), UnitAIType
    	FROM Unit_AITypes WHERE (UnitType = 'UNIT_TANK');
    
    INSERT INTO Unit_ClassUpgrades (UnitType, UnitClassType)
    	SELECT ('UNIT_A9_CRUISER_MK_I'), UnitClassType
    	FROM Unit_ClassUpgrades WHERE (UnitType = 'UNIT_TANK');
    
    INSERT INTO Unit_Flavors (UnitType, FlavorType, Flavor)
    	SELECT ('UNIT_A9_CRUISER_MK_I'), FlavorType, Flavor
    	FROM Unit_Flavors WHERE (UnitType = 'UNIT_TANK');
    
    INSERT INTO Unit_FreePromotions (UnitType, PromotionType)
    	SELECT ('UNIT_A9_CRUISER_MK_I'), PromotionType
    	FROM Unit_FreePromotions WHERE (UnitType = 'UNIT_TANK');
    
    INSERT INTO Unit_ResourceQuantityRequirements (UnitType, ResourceType, Cost)
    	SELECT ('UNIT_A9_CRUISER_MK_I'), ResourceType, Cost
    	FROM Unit_ResourceQuantityRequirements WHERE (UnitType = 'UNIT_TANK');
     
  19. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,664
    Location:
    France
    what's in the database.log ?
     
  20. AngelsFallFirst

    AngelsFallFirst Chieftain

    Joined:
    Jul 22, 2013
    Messages:
    4
    <?xml version="1.0" encoding="utf-8"?>
    <Mod id="bdc97a4c-4425-4104-a37a-7f1d7218af69" version="1">
    <Properties>
    <Name>A9 Cruiser MKI</Name>
    <Stability>Alpha</Stability>
    <Teaser>A9 Cruiser MKI Tank</Teaser>
    <Description>Experimental Mod</Description>
    <Authors>Ophidian</Authors>
    <HideSetupGame>0</HideSetupGame>
    <AffectsSavedGames>1</AffectsSavedGames>
    <MinCompatibleSaveVersion>0</MinCompatibleSaveVersion>
    <SupportsSinglePlayer>1</SupportsSinglePlayer>
    <SupportsMultiplayer>1</SupportsMultiplayer>
    <SupportsMac>1</SupportsMac>
    <ReloadLandmarkSystem>0</ReloadLandmarkSystem>
    <ReloadStrategicViewSystem>0</ReloadStrategicViewSystem>
    <ReloadUnitSystem>1</ReloadUnitSystem>
    </Properties>
    <Dependencies />
    <References />
    <Blocks />
    <Files>
    <File md5="B6303B4AA2BEBC0AC32A64660ED8E55F" import="0">SQL/Values.sql</File>
    <File md5="539828CF96AAD114F91101A93C873B58" import="0">SQL/NewUnits.sql</File>
    <File md5="34C07015AC8580ED079C71C397675229" import="1">UK/Army/A9_Cruiser_MK_I/A9_Cruiser_MK_I.dds</File>
    <File md5="3F01AC32C18D45E5B3FAED951E6B678F" import="1">UK/Army/A9_Cruiser_MK_I/A9_Cruiser_MK_I.fxsxml</File>
    <File md5="22EAE9AE4509E8A261AD316CBCCB1EA7" import="1">UK/Army/A9_Cruiser_MK_I/A9_Cruiser_MK_I.gr2</File>
    <File md5="AC41C06BA721315512F26433220FEDF7" import="1">UK/Army/A9_Cruiser_MK_I/no_gloss.dds</File>
    <File md5="39D65B3F27C06B95E2F6FA28F1E19BF6" import="0">XML/UnitText.xml</File>
    </Files>
    <Actions>
    <OnModActivated>
    <UpdateDatabase>NewUnits.sql</UpdateDatabase>
    <UpdateDatabase>Values.sql</UpdateDatabase>
    </OnModActivated>
    </Actions>
    </Mod>
     

Share This Page