View Full Version : Add a new unit in the game (using SQL)
Gedemon May 10, 2012, 12:17 PM This tutorial is a step by step to add a new unit in the game, it won't covert the creation of a new unit model, there are other tutorials about that.
It assumes that you know how to create a basic mod, and understand the meaning of "OnModActivated"
It applies for Civilization and G+K post patch .674, since that patch you don't have (and in fact can't) to replace Civ5ArtDefines_UnitMembers.xml and Civ5ArtDefines_Units.xml. The only file related to units which is still not loaded to the Database (and so have to be replaced in a mod using the VFS property) is unitformations.xml. But unless you want to change the default formations, you won't need it.
Note that previous version of the tutorials made a bad use of double-quote in the SQL code, see here (http://forums.civfanatics.com/showthread.php?t=471942) why you shouldn't use them and please refer to the now corrected code.
The exception for using double-quote is when a SQL keyword is used as a table of column name, as it is the case with "Index" column in ArtDefine_UnitMemberCombats table (see code in step 4)
Pre-required : Right click your mod project in the Solution explorer windows, select "properties", go in the "Mod Info" panel, and check the "Reload Unit System" in the "Systems" section.
step 1 : For the tutorial, we're taking the example of the biplan from this danrell's units pack (http://forums.civfanatics.com/showthread.php?t=435156), supposing that we want to add a WW1 era fighter to civ5 vanilla.
Here are the files requested by this unit model:
EarlyFighter_Generic_gloss.dds
EarlyFighter_Generic.gr2
EarlyFighter_Generic.fxsxml
EarlyFighter_Generic.dds
All this files must be copied in your project and have the VFS property set to "true". I'll suggest you to organize your project using folders and subfolders if you have to put many files in it, the VFS will not care for the relative path.
Danrell also provide the blend file and a jpg screenshot, those are not needed in your mod, but the blend is a must for those who want to edit the model itself, go and thanks him again for his work :goodjob:
step 2 : create a new sql file in your project (right click the project name or one of it's subfolder in the Solution Explorer windows, select "Add", "New Item..." and Game Rules (SQL)
Rename it, or keep the original Game Rules1.sql. You don't need to set the VFS to true for that file, but you have to add an UpdateDatabase entry for it.
step 3 : For that right click your mod project in the Solution explorer windows, select "properties", go in the "Action" panel, click "Add...", select "OnModActivated" as event, "UpdateDatabase" as Action, and point File to your newly created SQL file.
As this is a step by step mod, I won't detailed the SQL commands used here, just follow the steps and all will goes well (I hope :D)
An XML tutorial may be more user friendly, but I really found the SQL method more efficient.
step 4 : Now open the sql file and add the following code to it :
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 (Type = 'ART_DEF_UNIT_FIGHTER');
In red the reference for the new unit, in blue the reference of the unit we use as a template for the new one.
This code define the visual effects for the new unit. I use a "template" unit for reference, so I don't have to manually set each entry, but have the SQL code copy them from the "template" unit (here the normal fighter) and only change those that are needed.
Using a template is much faster, but you have to be sure that no other mods will delete the unit you're using as a template. Mods compatibility depend of the loading order and can sometimes be assured using associations, but that's another subject.
You can still use SQL to add new entries without duplicating another unit's entry using this syntax:
INSERT INTO table_name (column1, column2, column3,...)
VALUES (value1, value2, value3,...);
Horem has posted a complete SQL template here (http://forums.civfanatics.com/showthread.php?t=474997).
but you may find it easier to use XML in that case, see the second post (http://forums.civfanatics.com/showpost.php?p=12154830&postcount=2) for an example from whoward69.
step 5 : Below is the code for the new unit statistics, add it after in the sql file :
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');
That code will copy all the entry of the vanilla civ5 fighter in new entry for our new units. In red the changes that are made:
UNIT_BIPLAN is the type of your new unit
Biplan is the in game name
(25) the ranged attack value
(250) the construction cost
(5) the range
ART_DEF_UNIT_BIPLAN refer to the <Type> of step 4
Fell free to tweak other values, thinking of the requested tech for example...
This should be enough for most your new units to work properly, danrell's units may require an extra step
extra step : copy the "Common" folder from danrell's pack in your project folder, and set the VFS property to true for all it's files. Needed especially for his tanks and ships.
edit : finally converted to post-patch .674 method.
Gedemon May 10, 2012, 12:17 PM Example of XML file for ArtDefines and unit stats based on whoward69' Units - Galleon (GK) v.2 (http://www.picknmixmods.com/mods/b002a2f7-945e-4330-af4b-862f8e2dbba9/mod.html)
edit: thanks to him, you can now found XML template for all existing units here (http://forums.civfanatics.com/showthread.php?t=490344).
Art defines:
<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:
<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.
ww2commander May 10, 2012, 03:03 PM This should assist more people to get active in modding.
I remember how painful it was to make my first few units work, but with this guide and Kael's combined we have a good source of info.
nokmirt May 10, 2012, 11:56 PM Thanks a million for this Gedemon. This is going to help new modders a great deal. I have some real good ideas, involving a World War One mod.
This is going to be great! I am going to learn this, it will give me something to do while waiting for GnK. :D
Nutty May 29, 2012, 05:32 PM Apparently this tutorial wasn't quite enough for some, so I zipped up a small ModBuddy project to use as a template, and have attached it here. [EDIT: Removed because it was no longer valid after the changes from pre-G+K patch and later.]
The template copies the stats of a vanilla unit, and makes a new unique "ethnic" unit with new art for a specific Civ. (Vivastpauli requested a Portuguese knight reskin but then disappeared, so this adds the mostly-finished unit to the game and gives it to Greece to replace their knight.)
Note that this template isn't compatible with any other mod that adds units with new art. Remember, the last activated version of the civ5artdefines_* files must include all changes from all such mods.
From a recent thread:
If you can think of any other reasons that'd be great in the meantime, a checklist of 'files needed' and so on might be helpful.
...
Checklist:
You need the 2 civ5artdefines files, the entire contents copied with your additions added (both VFS true).
You'll need the 4 art files (all VFS true):
the gr2 (for a reskin, you would have just copied the vanilla one, renamed it, and revised it with IndieStone Nexus Buddy (http://forums.civfanatics.com/downloads.php?do=file&id=16433) to point to the new dds files)
the fxsxml, also pointing to the new dds files
your edited dds's (diff and sref)
Finally, the XML or SQL file that adds the new unit (VFS false, but set to OnModActivated/ImportDatabase).
I prefer Gedemon's method using SQL rather than XML, because you can easily just copy all the rows from an existing unit and make your changes without worrying about missing anything.
If you aren't making a new unique/ethnic unit, and just want to change the default for everyone, you can skip the XML/SQL file and not worry about adding any new entries to the civ5artdefines. You just edit the civ5artdefines_unitmembers.xml and change the fxsxml reference for, e.g., UNIT_KNIGHT to your new fxsxml. Don't include a path, only "<Granny>knight_camelot.fxsxml</Granny>" (or whatever you called it).
Also note that "Reload Unit System" must be checked on the Mod Info tab of your mod properties.
nokmirt Jul 07, 2012, 06:15 AM So, how do you mod in units post .674 patch? Let me know I want to learn.
Gedemon Jul 07, 2012, 06:46 AM The following is the SQL code that I use to replace step 3 and step 4 now that Civ5ArtDefines_UnitMembers.xml and Civ5ArtDefines_Units.xml are no longer needed to mod in new units (which is a very good thing, but has broken a lot of mods)
You can put that code in the file created in step 5.
The rest of the steps are still valid I think.
INSERT INTO ArtDefine_UnitInfos (Type,DamageStates,Formation)
SELECT ('ART_DEF_UNIT_WW1_FIGHTER_GERMANY'), DamageStates, Formation
FROM ArtDefine_UnitInfos WHERE (Type = 'ART_DEF_UNIT_WW1_FIGHTER');
INSERT INTO ArtDefine_UnitInfoMemberInfos (UnitInfoType,UnitMemberInfoType,NumMembers)
SELECT ('ART_DEF_UNIT_WW1_FIGHTER_GERMANY'), ('ART_DEF_UNIT_MEMBER_WW1_FIGHTER_GERMANY'), NumMembers
FROM ArtDefine_UnitInfoMemberInfos WHERE (UnitInfoType = 'ART_DEF_UNIT_WW1_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_WW1_FIGHTER_GERMANY'), 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_WW1_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_WW1_FIGHTER_GERMANY'), "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_WW1_FIGHTER');
INSERT INTO ArtDefine_UnitMemberInfos (Type, Scale, ZOffset, Domain, Model, MaterialTypeTag, MaterialTypeSoundOverrideTag)
SELECT ('ART_DEF_UNIT_MEMBER_WW1_FIGHTER_GERMANY'), Scale, ZOffset, Domain,
('Fokker_Dr.1.fxsxml'), MaterialTypeTag, MaterialTypeSoundOverrideTag
FROM ArtDefine_UnitMemberInfos WHERE (Type = 'ART_DEF_UNIT_MEMBER_WW1_FIGHTER');
In red the reference for the new unit, in green the reference of the unit we use as a template for the new one.
I'll do a clean update of first post when I have the time for it (which may not be *soon*, but I'll try to prioritize it)
nokmirt Jul 07, 2012, 06:54 AM Don't worry It will take me some time to learn this. I will be patient and do it step by step. Thank you very much for the update, and for your help.
Ok, I am starting with adding a Nieuport 17 mod. Now...
I don't need the Nieuport_17.blend file, or do I? I also changed the no_gloss.dds to Nieuport_17_no_gloss.dds is that the way? Both .dds files need to be used right? So, I do not have to do step 3 or 4? Because the new SQL code takes care of those two steps. I just have to edit the code, correct?
Now when this mod is done it will add the Nieuport 17 to the game, and I can make it just be available to France. Just like I tweaked the longboat UU to be available to Sweden as well as the Danes.
<Civilization_UnitClassOverrides>
<Row>
<CivilizationType>CIVILIZATION_SWEDEN</CivilizationType>
<UnitClassType>UNITCLASS_TRIREME</UnitClassType>
<UnitType>UNIT_VIKING_LONGBOAT</UnitType>
</Row>
</Civilization_UnitClassOverrides>
I will ask you a few more questions later, but I feel I will get the hang of this quite quickly. So far it seems far easier than modding CiIV.
I could also pick apart WHoward's longboat UU mod. I hope he does not mind. Now I can open files in modbuddy properly. I see how he changed the unit stats. I see how the modinfo file is set up. It is a summary. XML is straight forward, just like in CiIV. Let me continue...
So, what I am doing is simply adding the Nierport 17 as a UU for France, as a replacement for the triplane. I figured this kind of project is perfect for getting my feet wet as far as modding goes. The plan is to copy what WHoward did, except I am not going to change unit stats. It will have the same stats as the WWI fighter. Just to learn for the moment.
Ok, SQL folder is in, and code. Changes just need to be made. I do not have to set VFS file to true. check!
Now let's add files to the XML folder.
These two I don't need in the mod file. WHoward does not use them and you said they are not needed for modding in a unit. Civ5ArtDefines_UnitMembers.xml and Civ5ArtDefines_Units.xml so bye bye to them.
I found everything but this.
<Row Tag="TXT_KEY_UNIT_VIKING_LONGBOAT_TEXT">
<Text>Longboats (or Longships) were sea vessels made and used by the Vikings from the Nordic countries for trade, commerce, exploration, and warfare during the Viking Age.[NEWLINE][NEWLINE]The longship is characterized as a graceful, long, narrow, light, wooden boat with a shallow-draft hull designed for speed. The ship's shallow draft allowed navigation in waters only one metre deep and permitted beach landings. Longships were fitted with oars along almost the entire length of the boat itself. Later versions sported a rectangular sail on a single mast which was used to replace or augment the effort of the rowers.</Text>
</Row>
I cannot find any UNIT_TEXT so, I am just going to replace it with my own changes.
<Row Tag="TXT_KEY_UNIT_NIEUPORT17_TEXT">
<Text>The Nieuport 17 was a French biplane fighter aircraft of World War I, manufactured by the Nieuport company. It had outstanding maneuverability, and an excellent rate of climb. Initially, the Nieuport 17 retained the above wing mounted Lewis gun of the Nieuport 11, but in French service this was soon replaced by a synchronised Vickers gun. The Nieuport 17 became obsolescent in 1917, and was replaced by the SPAD S.VII.</Text>
</Row>
That should do, so far so good.
nokmirt Jul 07, 2012, 02:28 PM I cannot find these for triplane. The <IconTextureAtlases> can you send me the path to these. I have to change all of the <Atlas>UNITS_VIKING_LONGBOAT_ICON_ATLAS</Atlas> to NIEUPORT17 correct? So, I have to locate the path to for those dealing with the Triplane <IconTextureAtlases>.
Or will my unit, just by default use the triplane icons? I am :confused: about this.
I am guessing that because my Nieuport 17 is under UNITCLASS_TRIPLANE, then it should use the triplane icons by default. The unit I am adding does not have it's own unique icons. So, am I right in this assumption?
Nutty Jul 07, 2012, 04:49 PM I cannot find these for triplane. The <IconTextureAtlases> can you send me the path to these. I have to change all of the <Atlas>UNITS_VIKING_LONGBOAT_ICON_ATLAS</Atlas> to NIEUPORT17 correct? So, I have to locate the path to for those dealing with the Triplane <IconTextureAtlases>.
See the first spoiler below. However, the way you're going about it, you won't have a proper air unit.
Or will my unit, just by default use the triplane icons?
No, if you don't use SQL (much easier, IMHO--you can just copy most of the entries, and change the ones you need), then you will need to specify everything.
If you still want to use XML, then there's no need to guess about any of this. Just take a look at the pertinent section of the game XML. Everything is there, you just have to piece it together from the various files (or learn to go through the database [Documents\My Games\Sid Meier's Civilization V\cache\Civ5DebugDatabase.db] using SQLite Manager for Firefox, or a similar program).
It is a little confusing here because Firaxis has 2 different names they use internally for "Triplanes" or "WWI Fighters."
* See Assets\DLC\Expansion\Gameplay\XML\Units\CIV5Units_ Expansion.xml (I've bolded <Icon_Atlas> and <PortraitIndex>, which should be the one you were asking about):
<GameData>
<Units>
<Row>
<Class>UNITCLASS_TRIPLANE</Class>
<Type>UNIT_TRIPLANE</Type>
<PrereqTech>TECH_FLIGHT</PrereqTech>
<RangedCombat>35</RangedCombat>
<Cost>325</Cost>
<Moves>2</Moves>
<Special>SPECIALUNIT_FIGHTER</Special>
<Immobile>true</Immobile>
<Range>5</Range>
<AirInterceptRange>5</AirInterceptRange>
<CombatClass>UNITCOMBAT_FIGHTER</CombatClass>
<Domain>DOMAIN_AIR</Domain>
<DefaultUnitAI>UNITAI_DEFENSE_AIR</DefaultUnitAI>
<Description>TXT_KEY_UNIT_TRIPLANE</Description>
<Civilopedia>TXT_KEY_CIV5_TRIPLANE_TEXT</Civilopedia>
<Strategy>TXT_KEY_UNIT_TRIPLANE_STRATEGY</Strategy>
<Help>TXT_KEY_UNIT_HELP_TRIPLANE</Help>
<MilitarySupport>true</MilitarySupport>
<MilitaryProduction>true</MilitaryProduction>
<Mechanized>true</Mechanized>
<ObsoleteTech>TECH_RADAR</ObsoleteTech>
<IgnoreBuildingDefense>true</IgnoreBuildingDefense>
<AdvancedStartCost>30</AdvancedStartCost>
<AirUnitCap>1</AirUnitCap>
<RangedCombatLimit>100</RangedCombatLimit>
<CombatLimit>0</CombatLimit>
<XPValueAttack>3</XPValueAttack>
<XPValueDefense>2</XPValueDefense>
<UnitArtInfo>ART_DEF_UNIT_WW1_FIGHTER</UnitArtInfo>
<UnitFlagAtlas>EXPANSION_UNIT_FLAG_ATLAS</UnitFlagAtlas>
<UnitFlagIconOffset>24</UnitFlagIconOffset>
<IconAtlas>EXPANSION_UNIT_ATLAS_1</IconAtlas>
<PortraitIndex>24</PortraitIndex>
<MoveRate>AIR_REBASE</MoveRate>
</Row>
</Units>
</GameData>
* The Art Defines are in Assets\DLC\Expansion\Units\Civ5ArtDefines_Expansio n_Units.xml [note, though, that they need to be rewritten; tag names are different in the database, so if you have to do it from scratch you'll want to check the database--but I've done this for you below; hopefully I haven't made any mistakes/typos] [EDIT: I apparently made lots, but I've tried to fix them]:
<GameData>
<ArtDefine_UnitInfos>
<Row>
<Type>ART_DEF_UNIT_WW1_FIGHTER</Type>
<DamageStates>1</DamageStates>
<Formation>FighterWing</Formation>
</Row>
</ArtDefine_UnitInfos>
<ArtDefine_UnitInfoMemberInfos>
<Row>
<UnitInfoType>ART_DEF_UNIT_WW1_FIGHTER</UnitInfoType>
<UnitMemberInfoType>ART_DEF_UNIT_MEMBER_WW1_FIGHTER</UnitMemberInfoType>
<NumMembers>3</NumMembers>
</Row>
</ArtDefine_UnitInfoMemberInfos>
</GameData>
...and Assets\DLC\Expansion\Units\Civ5ArtDefines_Expansio n_UnitMembers.xml [same for this one, needed to be rewritten]:
<GameData>
<ArtDefine_UnitMemberInfos>
<Row>
<Type>ART_DEF_UNIT_MEMBER_WW1_FIGHTER</Type>
<Scale>0.09</Scale>
<ZOffset />
<Domain>Air</Domain>
<Model>WW1_Fighter.fxsxml</Model>
<MaterialTypeTag>METAL</MaterialTypeTag>
<MaterialTypeSoundOverrideTag>METALLRG</MaterialTypeSoundOverrideTag>
</Row>
</ArtDefine_UnitMemberInfos>
<ArtDefine_UnitMemberCombats>
<Row>
<UnitMemberType>ART_DEF_UNIT_MEMBER_WW1_FIGHTER</UnitMemberType>
<EnableActions>Idle Attack Bombard Death Run</EnableActions>
<DisableActions />
<AttackRadius>45.0</AttackRadius>
<MoveRate>1.6</MoveRate>
<TurnRateMin>0.25</TurnRateMin>
<TurnRateMax>0.5</TurnRateMax>
<HasRefaceAfterCombat>0</HasRefaceAfterCombat>
<RushAttackFormation />
</Row>
</ArtDefine_UnitMemberCombats>
<ArtDefine_UnitMemberCombatWeapons>
<Row>
<UnitMemberType>ART_DEF_UNIT_MEMBER_WW1_FIGHTER</UnitMemberType>
<Index>0</Index>
<SubIndex>0</SubIndex>
<ID />
<VisKillStrengthMin>10.0</VisKillStrengthMin>
<VisKillStrengthMax>20.0</VisKillStrengthMax>
<ProjectileSpeed>1.3</ProjectileSpeed>
<HitEffect>ART_DEF_VEFFECT_FIGHTER_MACHINE_GUN_HIT_$(TERRAIN)</HitEffect>
<HitRadius>20.0</HitRadius>
<WeaponTypeTag>BULLETHC</WeaponTypeTag>
<WeaponTypeSoundOverrideTag>BULLETHC</WeaponTypeSoundOverrideTag>
</Row>
<Row>
<UnitMemberType>ART_DEF_UNIT_MEMBER_WW1_FIGHTER</UnitMemberType>
<Index>1</Index>
<SubIndex>0</SubIndex>
<ID />
<VisKillStrengthMin>1.0</VisKillStrengthMin>
<VisKillStrengthMax>1.0</VisKillStrengthMax>
<HitEffect>ART_DEF_VEFFECT_FIGHTER_MACHINE_GUN_HIT_$(TERRAIN)</HitEffect>
<HitRadius>30.0</HitRadius>
<WeaponTypeTag>BULLETHC</WeaponTypeTag>
<WeaponTypeSoundOverrideTag>BULLETHC</WeaponTypeSoundOverrideTag>
</Row>
<Row>
<UnitMemberType>ART_DEF_UNIT_MEMBER_WW1_FIGHTER</UnitMemberType>
<Index>1</Index>
<SubIndex>1</SubIndex>
<ID>PROJECTILE</ID>
<VisKillStrengthMin>25.0</VisKillStrengthMin>
<VisKillStrengthMax>50.0</VisKillStrengthMax>
<ProjectileSpeed>1.3</ProjectileSpeed>
<HitEffect />
<TargetGround>1</bTargetGround>
<IsDropped>1</bIsDropped>
<WeaponTypeTag>EXPLOSIVE</WeaponTypeTag>
<WeaponTypeSoundOverrideTag>EXPLOSION200POUND</WeaponTypeSoundOverrideTag>
</Row>
</ArtDefine_UnitMemberCombatWeapons>
</GameData>
...and Assets\DLC\Expansion\StrategicView\Civ5ArtDefines_ SV_Expansion_Units.xml [which doesn't need rewriting, thankfully]:
<GameData>
<ArtDefine_StrategicView>
<Row>
<StrategicViewType>ART_DEF_UNIT_WW1_FIGHTER</StrategicViewType>
<TileType>Unit</TileType>
<Asset>SV_WWI_Triplane.dds</Asset>
</Row>
</ArtDefine_StrategicView>
</GameData>
* The text descriptions are in Assets\DLC\Expansion\Gameplay\XML\Text\en_US\CIV5G ameTextInfos2_Expansion.xml:
<GameData>
<Language_en_US>
<Row Tag="TXT_KEY_UNIT_HELP_TRIPLANE">
<Text>Early Air Unit designed to intercept incoming enemy aircraft.</Text>
</Row>
<Row Tag="TXT_KEY_UNIT_TRIPLANE_STRATEGY">
<Text>The Triplane is an early air unit. It can be based in any city you own or aboard an aircraft carrier. It can move from city to city (or carrier) and can perform "missions" within its range of 5 tiles. Use triplanes to attack enemy aircraft and ground units, to scout enemy positions, and to defend against enemy air attacks. See the rules on Aircraft for more information.</Text>
</Row>
</Language_en_US>
</GameData>
...and Assets\DLC\Expansion\Gameplay\XML\Text\en_US\CIV5G ameTextInfos_Civilopedia_Expansion.xml:
<GameData>
<Language_en_US>
<Row Tag="TXT_KEY_CIV5_TRIPLANE_TEXT">
<Text>Deriving its name from the unique three-tiered wing system utilized in its design, the triplane was used with varying degrees of success during World War I. The most famous triplane of the war, the Fokker Dr.I, was used extensively by the German air force, gaining particular notoriety as the legendary Red Baron's craft of choice. Although engineers developed many variations on the triplane design, advancements in the traditional biplane rendered the triplane obsolete within a decade of its introduction.</Text>
</Row>
</Language_en_US>
</GameData>
Now copy all this mess into your mod, and go through and make your changes. One file or multiple, doesn't matter. You can leave stuff out if you're going to use the references to the original (e.g., I might use the original TXT_KEY_UNIT_HELP_TRIPLANE then leave out the <Row Tag="TXT_KEY_UNIT_HELP_TRIPLANE"> entry).
nokmirt Jul 07, 2012, 10:36 PM Ok, let's do this one step at a time so I don't get confused. This is my Nieuport17.xml code. Is anything missing in this file that needs to be added? I am basically copying how WHoward did it.
<?xml version="1.0" encoding="utf-8"?>
<GameData>
<Units>
<Row>
<Class>UNITCLASS_TRIPLANE</Class>
<Type>UNIT_NIEUPORT17</Type>
<PrereqTech>TECH_FLIGHT</PrereqTech>
<RangedCombat>35</RangedCombat>
<Cost>325</Cost>
<Moves>2</Moves>
<Special>SPECIALUNIT_FIGHTER</Special>
<Immobile>true</Immobile>
<Range>5</Range>
<AirInterceptRange>5</AirInterceptRange>
<CombatClass>UNITCOMBAT_FIGHTER</CombatClass>
<Domain>DOMAIN_AIR</Domain>
<DefaultUnitAI>UNITAI_DEFENSE_AIR</DefaultUnitAI>
<Description>TXT_KEY_UNIT_NIEUPORT17</Description>
<Civilopedia>TXT_KEY_CIV5_NIEUPORT17_TEXT</Civilopedia>
<Strategy>TXT_KEY_UNIT_NIEUPORT17_STRATEGY</Strategy>
<Help>TXT_KEY_UNIT_HELP_NIEUPORT17</Help>
<MilitarySupport>true</MilitarySupport>
<MilitaryProduction>true</MilitaryProduction>
<Mechanized>true</Mechanized>
<ObsoleteTech>TECH_RADAR</ObsoleteTech>
<IgnoreBuildingDefense>true</IgnoreBuildingDefense>
<AdvancedStartCost>30</AdvancedStartCost>
<AirUnitCap>1</AirUnitCap>
<RangedCombatLimit>100</RangedCombatLimit>
<CombatLimit>0</CombatLimit>
<XPValueAttack>3</XPValueAttack>
<XPValueDefense>2</XPValueDefense>
<UnitArtInfo>ART_DEF_UNIT_NIEUPORT17</UnitArtInfo>
<UnitFlagAtlas>EXPANSION_UNIT_FLAG_ATLAS</UnitFlagAtlas>
<UnitFlagIconOffset>24</UnitFlagIconOffset>
<IconAtlas>EXPANSION_UNIT_ATLAS_1</IconAtlas>
<PortraitIndex>24</PortraitIndex>
<MoveRate>AIR_REBASE</MoveRate>
</Row>
</Units>
<Unit_AITypes>
<Row>
<UnitType>UNIT_NIEUPORT17</UnitType>
<UnitAIType>UNITAI_DEFENSE_AIR</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_NIEUPORT17</UnitType>
<UnitAIType>UNITAI_CARRIER_AIR</UnitAIType>
</Row>
</Unit_AITypes>
<Unit_ClassUpgrades>
<Row>
<UnitType>UNIT_NIEUPORT17</UnitType>
<UnitClassType>UNITCLASS_FIGHTER</UnitClassType>
</Row>
</Unit_ClassUpgrades>
<Unit_Flavors>
<Row>
<UnitType>UNIT_NIEUPORT17</UnitType>
<FlavorType>FLAVOR_OFFENSE</FlavorType>
<Flavor>5</Flavor>
</Row>
<Row>
<UnitType>UNIT_NIEUPORT17</UnitType>
<FlavorType>FLAVOR_DEFENSE</FlavorType>
<Flavor>5</Flavor>
</Row>
<Row>
<UnitType>UNIT_NIEUPORT17</UnitType>
<FlavorType>FLAVOR_AIR</FlavorType>
<Flavor>10</Flavor>
</Row>
<Row>
<UnitType>UNIT_NIEUPORT17</UnitType>
<FlavorType>FLAVOR_ANTIAIR</FlavorType>
<Flavor>12</Flavor>
</Row>
</Unit_Flavors>
<Unit_FreePromotions>
<Row>
<UnitType>UNIT_NIEUPORT17</UnitType>
<PromotionType>PROMOTION_INTERCEPTION_III</PromotionType>
</Row>
<Row>
<UnitType>UNIT_NIEUPORT17</UnitType>
<PromotionType>PROMOTION_AIR_SWEEP</PromotionType>
</Row>
<Row>
<UnitType>UNIT_NIEUPORT17</UnitType>
<PromotionType>PROMOTION_AIR_RECON</PromotionType>
</Row>
<Row>
<UnitType>UNIT_NIEUPORT17</UnitType>
<PromotionType>PROMOTION_ANTI_AIR_II</PromotionType>
</Row>
</Unit_FreePromotions>
<Civilization_UnitClassOverrides>
<Row>
<CivilizationType>CIVILIZATION_FRANCE</CivilizationType>
<UnitClassType>UNITCLASS_FIGHTER</UnitClassType>
<UnitType>UNIT_NIEUPORT17</UnitType>
</Row>
</Civilization_UnitClassOverrides>
<Unit_ResourceQuantityRequirements>
<Row>
<UnitType>UNIT_NIEUPORT17</UnitType>
<ResourceType>RESOURCE_OIL</ResourceType>
</Row>
</Unit_ResourceQuantityRequirements>
<Language_en_US>
<Row Tag="TXT_KEY_UNIT_NIEUPORT17">
<Text>Nieuport 17</Text>
</Row>
<Row Tag="TXT_KEY_UNIT_NIEUPORT17_TEXT">
<Text>The Nieuport 17 was a French biplane fighter aircraft of World War I, manufactured by the Nieuport company. It had outstanding maneuverability, and an excellent rate of climb. Initially, the Nieuport 17 retained the above wing mounted Lewis gun of the Nieuport 11, but in French service this was soon replaced by a synchronised Vickers gun. The Nieuport 17 became obsolescent in 1917, and was replaced by the SPAD S.VII.</Text>
</Row>
<Row Tag="TXT_KEY_UNIT_NIEUPORT17_STRATEGY">
<Text>The Triplane is an early air unit. It can be based in any city you own or aboard an aircraft carrier. It can move from city to city (or carrier) and can perform "missions" within its range of 5 tiles. Use triplanes to attack enemy aircraft and ground units, to scout enemy positions, and to defend against enemy air attacks. See the rules on Aircraft for more information.</Text>
</Row>
<Row Tag="TXT_KEY_UNIT_HELP_NIEUPORT17">
<Text>Early Air Unit designed to intercept incoming enemy aircraft.</Text>
</Row>
</Language_en_US>
</GameData>
Nieuport17Art.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 7/7/2012 1:47:03 PM -->
<GameData>
<ArtDefine_UnitInfos>
<Row>
<Type>ART_DEF_UNIT_NIEUPORT17</Type>
<DamageStates>1</DamageStates>
<Formation>FighterWing</Formation>
</Row>
</ArtDefine_UnitInfos>
<ArtDefine_UnitInfoMemberInfos>
<Row>
<UnitMemberArt>
<UnitInfoType>ART_DEF_UNIT_NIEUPORT17</UnitInfoType>
<UnitMemberInfoType>ART_DEF_UNIT_MEMBER_WW1_FIGHTER</UnitMemberInfoType>
<NumMembers>3</NumMembers>
</UnitMemberArt>
</Row>
</ArtDefine_UnitInfoMemberInfos>
<ArtDefine_UnitMemberInfos>
<Row>
<Type>ART_DEF_UNIT_MEMBER_WW1_Fighter</Type>
<Scale>0.09</Scale>
<ZOffset/>
<Domain>Air</Domain>
<Model>
<Granny>Nieuport17.fxsxml</Granny>
<MaterialTypeTag>METAL</MaterialTypeTag>
<MaterialTypeSoundOverrideTag>METALLRG</MaterialTypeSoundOverrideTag>
</Model>
</Row>
</ArtDefine_UnitMemberInfos>
<ArtDefine_UnitMemberCombats>
<Row>
<UnitMemberType>ART_DEF_UNIT_MEMBER_WW1_FIGHTER</UnitMemberType>
<EnableActions>Idle Attack Bombard Death Run</EnableActions>
<DisableActions />
<AttackRadius>45.0</AttackRadius>
<MoveRate>1.6</MoveRate>
<TurnRateMin>0.25</TurnRateMin>
<TurnRateMax>0.5</TurnRateMax>
<HasRefaceAfterCombat>0</HasRefaceAfterCombat>
<RushAttackFormation />
</Row>
</ArtDefine_UnitMemberCombats>
<Usage>Vs_Air</Usage>
<ArtDefine_UnitMemberCombatWeapons>
<Row>
<UnitMemberType>ART_DEF_UNIT_MEMBER_WW1_FIGHTER</UnitMemberType>
<Index>0</Index>
<SubIndex>0</SubIndex>
<ID />
<VisKillStrengthMin>10.0</VisKillStrengthMin>
<VisKillStrengthMax>20.0</VisKillStrengthMax>
<ProjectileSpeed>1.3</ProjectileSpeed>
<HitEffect>ART_DEF_VEFFECT_FIGHTER_MACHINE_GUN_HIT_$(TERRAIN)</HitEffect>
<HitRadius>20.0</HitRadius>
<WeaponTypeTag>BULLETHC</WeaponTypeTag>
<WeaponTypeSoundOverrideTag>BULLETHC</WeaponTypeSoundOverrideTag>
</Row>
<Row>
<UnitMemberType>ART_DEF_UNIT_MEMBER_WW1_FIGHTER</UnitMemberType>
<Index>1</Index>
<SubIndex>0</SubIndex>
<ID />
<Weapon>
<VisKillStrengthMin>1.0</VisKillStrengthMin>
<VisKillStrengthMax>1.0</VisKillStrengthMax>
<HitEffect>ART_DEF_VEFFECT_FIGHTER_MACHINE_GUN_HIT_$(TERRAIN)</HitEffect>
<HitRadius>30.0</HitRadius>
<WeaponTypeTag>BULLETHC</WeaponTypeTag>
<WeaponTypeSoundOverrideTag>BULLETHC</WeaponTypeSoundOverrideTag>
</Weapon>
</Row>
<Row>
<UnitMemberType>ART_DEF_UNIT_MEMBER_WW1_FIGHTER</UnitMemberType>
<Index>1</Index>
<SubIndex>1</SubIndex>
<ID>PROJECTILE</ID>
<VisKillStrengthMin>25.0</VisKillStrengthMin>
<VisKillStrengthMax>50.0</VisKillStrengthMax>
<ProjectileSpeed>1.3</ProjectileSpeed>
<HitEffect />
<TargetGround>1</TargetGround>
<IsDropped>1</IsDropped>
<WeaponTypeTag>EXPLOSIVE</WeaponTypeTag>
<WeaponTypeSoundOverrideTag>EXPLOSION200POUND</WeaponTypeSoundOverrideTag>
</Row>
</ArtDefine_UnitMemberCombatWeapons>
<ArtDefine_StrategicView>
<Row>
<StrategicViewType>ART_DEF_UNIT_NIEUPORT17</StrategicViewType>
<TileType>Unit</TileType>
<Asset>SV_WWI_Triplane.dds</Asset>
</Row>
</ArtDefine_StrategicView>
</GameData>
A couple small xml typos. It's ok it keeps me on my toes.
All of this look ok? According to modbuddy there are no xml errors. SV_WWI_Triplane.dds the unit from Danrell does not have a version of this. And most of the animations will be for WW1_FIGHTER is that ok?
nokmirt Jul 08, 2012, 03:04 AM @Gedemon or Nutty, or anyone else that knows.
I am just going to do the SQL way and see how that goes.
This is what my Nieuport17.sql code looks like, in my mod project. Is this ok? I just changed unit stats to match the triplane. Where it says this in the code, WHERE (UnitType = "UNIT_FIGHTER"), shouldn't I change that to
WHERE (UnitType = "UNIT_TRIPLANE")? And will this be a UU for France or is there more steps to get that done? Let me know.
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
SELECT ("ART_DEF_UNIT_NIEUPORT17_FRANCE"), "DamageStates", "Formation"
FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_WW1_FIGHTER");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
SELECT ("ART_DEF_UNIT_NIEUPORT17_FRANCE"), ("ART_DEF_UNIT_MEMBER_NIEUPORT17_FRANCE"), "NumMembers"
FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_WW1_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_NIEUPORT17_FRANCE"), "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_WW1_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_NIEUPORT17_FRANCE"), "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_WW1_FIGHTER");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
SELECT ("ART_DEF_UNIT_MEMBER_NIEUPORT17_FRANCE"), "Scale", "ZOffset", "Domain",
("Nieuport17.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_WW1_FIGHTER");
-- NIEUPORT17
INSERT INTO "UnitClasses" ('Type', 'Description', 'MaxGlobalInstances', 'MaxTeamInstances', 'MaxPlayerInstances', 'InstanceCostModifier', 'DefaultUnit' )
SELECT ("UNITCLASS_NIEUPORT17"), "Description", "MaxGlobalInstances", "MaxTeamInstances", "MaxPlayerInstances", "InstanceCostModifier", "DefaultUnit"
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', '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_NIEUPORT17"), ("Nieuport 17"), "Civilopedia", "Strategy", "Help", "Requirements",
"Combat", (35), (325), "Moves", "Immobile", (5), "BaseSightRange", ("UNITCLASS_NIEUPORT17"), "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_NIEUPORT17"), "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_NIEUPORT17"), "UnitAIType"
FROM "Unit_AITypes" WHERE (UnitType = "UNIT_FIGHTER");
INSERT INTO "Unit_ClassUpgrades" ('UnitType', 'UnitClassType')
SELECT ("UNIT_NIEUPORT17"), "UnitClassType"
FROM "Unit_ClassUpgrades" WHERE (UnitType = "UNIT_FIGHTER");
INSERT INTO "Unit_Flavors" ('UnitType', 'FlavorType', 'Flavor')
SELECT ("UNIT_NIEUPORT17"), "FlavorType", "Flavor"
FROM "Unit_Flavors" WHERE (UnitType = "UNIT_FIGHTER");
INSERT INTO "Unit_FreePromotions" ('UnitType', 'PromotionType')
SELECT ("UNIT_NIEUPORT17"), "PromotionType"
FROM "Unit_FreePromotions" WHERE (UnitType = "UNIT_FIGHTER");
INSERT INTO "Unit_ResourceQuantityRequirements" ('UnitType', 'ResourceType', 'Cost')
SELECT ("UNIT_NIEUPORT17"), "ResourceType", "Cost"
FROM "Unit_ResourceQuantityRequirements" WHERE (UnitType = "UNIT_FIGHTER");
----
Nutty Jul 08, 2012, 04:07 AM I'm going to respond to the XML question anyway because I botched the job so horribly.
Note, these are SQL rows you're adding with XML, so you're not going to have any nesting within the <Row> tags.
<ArtDefine_UnitInfoMemberInfos>
<Row>
<UnitMemberArt>
<UnitInfoType>ART_DEF_UNIT_NIEUPORT17</UnitInfoType>
<UnitMemberInfoType>ART_DEF_UNIT_MEMBER_WW1_FIGHTER</UnitMemberInfoType>
<NumMembers>3</NumMembers>
</UnitMemberArt>
</Row>
</ArtDefine_UnitInfoMemberInfos>
You don't want a <UnitMemberArt></UnitMemberArt> tag in there.
<ArtDefine_UnitMemberInfos>
<Row>
<Type>ART_DEF_UNIT_MEMBER_WW1_Fighter</Type>
<Scale>0.09</Scale>
<ZOffset/>
<Domain>Air</Domain>
<Model>
<Granny>Nieuport17.fxsxml</Granny>
<MaterialTypeTag>METAL</MaterialTypeTag>
<MaterialTypeSoundOverrideTag>METALLRG</MaterialTypeSoundOverrideTag>
</Model>
</Row>
</ArtDefine_UnitMemberInfos>
You don't want <Granny></Granny> in there either, it should be
<Model>Nieuport17.fxsxml</Model>
<MaterialTypeTag>METAL</MaterialTypeTag>
<Usage>Vs_Air</Usage>
That needs to be deleted.
<Row>
<UnitMemberType>ART_DEF_UNIT_MEMBER_WW1_FIGHTER</UnitMemberType>
<Index>1</Index>
<SubIndex>0</SubIndex>
<ID />
<Weapon>
<VisKillStrengthMin>1.0</VisKillStrengthMin>
<VisKillStrengthMax>1.0</VisKillStrengthMax>
<HitEffect>ART_DEF_VEFFECT_FIGHTER_MACHINE_GUN_HIT_$(TERRAIN)</HitEffect>
<HitRadius>30.0</HitRadius>
<WeaponTypeTag>BULLETHC</WeaponTypeTag>
<WeaponTypeSoundOverrideTag>BULLETHC</WeaponTypeSoundOverrideTag>
</Weapon>
</Row>
There shouldn't be a <Weapon></Weapon> tag.
SV_WWI_Triplane.dds the unit from Danrell does not have a version of this.
That's the vanilla one, which should be fine.
And most of the animations will be for WW1_FIGHTER is that ok?
What do you mean? You shouldn't need to change the fxsxml or the gr2.
Now I'll take a look at the SQL...
Nutty Jul 08, 2012, 04:16 AM Is this ok?
Just glancing at it, it looks fine.
shouldn't I change that to WHERE (UnitType = "UNIT_TRIPLANE")?
Yes.
And will this be a UU for France or is there more steps to get that done?
To make a UU, you need:
INSERT INTO "Civilization_UnitClassOverrides" ( 'CivilizationType', 'UnitClassType', 'UnitType' )
VALUES ( 'CIVILIZATION_FRANCE', 'UNITCLASS_TRIPLANE', 'UNIT_NIEUPORT17' );
nokmirt Jul 08, 2012, 04:18 AM I am doing it the shorter way via SQL. Steps 3 and 4, the xml steps are not needed to add units to a mod anymore.
This is my current SQL code.
Nieuport17.sql
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
SELECT ("ART_DEF_UNIT_NIEUPORT17"), "DamageStates", "Formation"
FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_WW1_FIGHTER");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
SELECT ("ART_DEF_UNIT_NIEUPORT17"), ("ART_DEF_UNIT_MEMBER_NIEUPORT17"), "NumMembers"
FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_WW1_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_NIEUPORT17"), "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_WW1_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_NIEUPORT17"), "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_WW1_FIGHTER");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
SELECT ("ART_DEF_UNIT_MEMBER_NIEUPORT17"), "Scale", "ZOffset", "Domain",
("Nieuport17.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_WW1_FIGHTER");
-- NIEUPORT17
INSERT INTO "UnitClasses" ('Type', 'Description', 'MaxGlobalInstances', 'MaxTeamInstances', 'MaxPlayerInstances', 'InstanceCostModifier', 'DefaultUnit' )
SELECT ("UNITCLASS_NIEUPORT17"), "Description", "MaxGlobalInstances", "MaxTeamInstances", "MaxPlayerInstances", "InstanceCostModifier", "DefaultUnit"
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', '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_NIEUPORT17"), ("Nieuport 17"), "Civilopedia", "Strategy", "Help", "Requirements",
"Combat", (35), (325), "Moves", "Immobile", (5), "BaseSightRange", ("UNITCLASS_NIEUPORT17"), "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_NIEUPORT17"), "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_NIEUPORT17"), "UnitAIType"
FROM "Unit_AITypes" WHERE (UnitType = "UNIT_FIGHTER");
INSERT INTO "Unit_ClassUpgrades" ('UnitType', 'UnitClassType')
SELECT ("UNIT_NIEUPORT17"), "UnitClassType"
FROM "Unit_ClassUpgrades" WHERE (UnitType = "UNIT_FIGHTER");
INSERT INTO "Unit_Flavors" ('UnitType', 'FlavorType', 'Flavor')
SELECT ("UNIT_NIEUPORT17"), "FlavorType", "Flavor"
FROM "Unit_Flavors" WHERE (UnitType = "UNIT_FIGHTER");
INSERT INTO "Unit_FreePromotions" ('UnitType', 'PromotionType')
SELECT ("UNIT_NIEUPORT17"), "PromotionType"
FROM "Unit_FreePromotions" WHERE (UnitType = "UNIT_FIGHTER");
INSERT INTO "Unit_ResourceQuantityRequirements" ('UnitType', 'ResourceType', 'Cost')
SELECT ("UNIT_NIEUPORT17"), "ResourceType", "Cost"
FROM "Unit_ResourceQuantityRequirements" WHERE (UnitType = "UNIT_FIGHTER");
----
Check this and let me know if it is correct. Thanks Nutty
nokmirt Jul 08, 2012, 04:21 AM To make a UU, you need:
INSERT INTO "Civilization_UnitClassOverrides" ( 'CivilizationType', 'UnitClassType', 'UnitType' )
VALUES ( 'CIVILIZATION_FRANCE', 'UNITCLASS_TRIPLANE', 'UNIT_NIEUPORT17' );
This I added in an XML folder.
Nieuport17.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 7/8/2012 5:08:15 AM -->
<Civilization_UnitClassOverrides>
<Row>
<CivilizationType>CIVILIZATION_FRANCE</CivilizationType>
<UnitClassType>UNITCLASS_NIEUPORT17</UnitClassType>
<UnitType>UNIT_NIEUPORT17</UnitType>
</Row>
</Civilization_UnitClassOverrides>
Correct?
Finished SQL.
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
SELECT ("ART_DEF_UNIT_NIEUPORT17"), "DamageStates", "Formation"
FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_WW1_FIGHTER");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
SELECT ("ART_DEF_UNIT_NIEUPORT17"), ("ART_DEF_UNIT_MEMBER_NIEUPORT17"), "NumMembers"
FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_WW1_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_NIEUPORT17"), "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_WW1_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_NIEUPORT17"), "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_WW1_FIGHTER");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
SELECT ("ART_DEF_UNIT_MEMBER_NIEUPORT17"), "Scale", "ZOffset", "Domain",
("Nieuport17.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_WW1_FIGHTER");
-- NIEUPORT17
INSERT INTO "UnitClasses" ('Type', 'Description', 'MaxGlobalInstances', 'MaxTeamInstances', 'MaxPlayerInstances', 'InstanceCostModifier', 'DefaultUnit' )
SELECT ("UNITCLASS_NIEUPORT17"), "Description", "MaxGlobalInstances", "MaxTeamInstances", "MaxPlayerInstances", "InstanceCostModifier", "DefaultUnit"
FROM "UnitClasses" WHERE (Type = "UNITCLASS_TRIPLANE");
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_NIEUPORT17"), ("Nieuport 17"), "Civilopedia", "Strategy", "Help", "Requirements",
"Combat", (35), (325), "Moves", "Immobile", (5), "BaseSightRange", ("UNITCLASS_NIEUPORT17"), "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_NIEUPORT17"), "UnitArtInfoCulturalVariation", "UnitArtInfoEraVariation", "ProjectPrereq", "SpaceshipProject", "LeaderPromotion", "LeaderExperience", "DontShowYields", "ShowInPedia", "MoveRate",
"UnitFlagIconOffset", "PortraitIndex", "IconAtlas", "UnitFlagAtlas"
FROM "Units" WHERE (Type = "UNIT_TRIPLANE");
INSERT INTO "Unit_AITypes" ('UnitType', 'UnitAIType')
SELECT ("UNIT_NIEUPORT17"), "UnitAIType"
FROM "Unit_AITypes" WHERE (UnitType = "UNIT_TRIPLANE");
INSERT INTO "Unit_ClassUpgrades" ('UnitType', 'UnitClassType')
SELECT ("UNIT_NIEUPORT17"), "UnitClassType"
FROM "Unit_ClassUpgrades" WHERE (UnitType = "UNIT_TRIPLANE");
INSERT INTO "Unit_Flavors" ('UnitType', 'FlavorType', 'Flavor')
SELECT ("UNIT_NIEUPORT17"), "FlavorType", "Flavor"
FROM "Unit_Flavors" WHERE (UnitType = "UNIT_TRIPLANE");
INSERT INTO "Unit_FreePromotions" ('UnitType', 'PromotionType')
SELECT ("UNIT_NIEUPORT17"), "PromotionType"
FROM "Unit_FreePromotions" WHERE (UnitType = "UNIT_TRIPLANE");
INSERT INTO "Unit_ResourceQuantityRequirements" ('UnitType', 'ResourceType', 'Cost')
SELECT ("UNIT_NIEUPORT17"), "ResourceType", "Cost"
FROM "Unit_ResourceQuantityRequirements" WHERE (UnitType = "UNIT_TRIPLANE");
----
Nutty Jul 08, 2012, 04:32 AM The XML to make it a UU is fine [though why not leave it in SQL?], but looking at your SQL again, I notice you're making a new unit class. You should just be using UNITCLASS_TRIPLANE.
(i.e., delete the inserts to the UnitClasses and Unit_ClassUpgrades tables)
EDIT: And you still want to change references to UNIT_FIGHTER to UNIT_TRIPLANE.
nokmirt Jul 08, 2012, 04:38 AM Ok like this
-- NIEUPORT17
INSERT INTO "UnitClasses" ('Type', 'Description', 'MaxGlobalInstances', 'MaxTeamInstances', 'MaxPlayerInstances', 'InstanceCostModifier', 'DefaultUnit' )
SELECT ("UNITCLASS_TRIPLANE"), "Description", "MaxGlobalInstances", "MaxTeamInstances", "MaxPlayerInstances", "InstanceCostModifier", "DefaultUnit"
FROM "UnitClasses" WHERE (Type = "UNITCLASS_TRIPLANE");
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_NIEUPORT17"), ("Nieuport 17"), "Civilopedia", "Strategy", "Help", "Requirements",
"Combat", (35), (325), "Moves", "Immobile", (5), "BaseSightRange", ("UNITCLASS_TRIPLANE"), "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_NIEUPORT17"), "UnitArtInfoCulturalVariation", "UnitArtInfoEraVariation", "ProjectPrereq", "SpaceshipProject", "LeaderPromotion", "LeaderExperience", "DontShowYields", "ShowInPedia", "MoveRate",
"UnitFlagIconOffset", "PortraitIndex", "IconAtlas", "UnitFlagAtlas"
FROM "Units" WHERE (Type = "UNIT_TRIPLANE");
INSERT INTO "Unit_AITypes" ('UnitType', 'UnitAIType')
SELECT ("UNIT_NIEUPORT17"), "UnitAIType"
FROM "Unit_AITypes" WHERE (UnitType = "UNIT_TRIPLANE"); etc etc.
Nutty Jul 08, 2012, 04:51 AM Delete the first insert, because you don't want to change that table. (Note that what that would have done is make a duplicate of the UNITCLASS_TRIPLANE row.)
nokmirt Jul 08, 2012, 05:03 AM Ok, finally the SQL is done.
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
SELECT ("ART_DEF_UNIT_NIEUPORT17"), "DamageStates", "Formation"
FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_WW1_FIGHTER");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
SELECT ("ART_DEF_UNIT_NIEUPORT17"), ("ART_DEF_UNIT_MEMBER_NIEUPORT17"), "NumMembers"
FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_WW1_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_NIEUPORT17"), "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_WW1_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_NIEUPORT17"), "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_WW1_FIGHTER");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
SELECT ("ART_DEF_UNIT_MEMBER_NIEUPORT17"), "Scale", "ZOffset", "Domain",
("Nieuport17.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_WW1_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', '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_NIEUPORT17"), ("Nieuport 17"), "Civilopedia", "Strategy", "Help", "Requirements",
"Combat", (35), (325), "Moves", "Immobile", (5), "BaseSightRange", ("UNITCLASS_TRIPLANE"), "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_NIEUPORT17"), "UnitArtInfoCulturalVariation", "UnitArtInfoEraVariation", "ProjectPrereq", "SpaceshipProject", "LeaderPromotion", "LeaderExperience", "DontShowYields", "ShowInPedia", "MoveRate",
"UnitFlagIconOffset", "PortraitIndex", "IconAtlas", "UnitFlagAtlas"
FROM "Units" WHERE (Type = "UNIT_TRIPLANE");
INSERT INTO "Unit_AITypes" ('UnitType', 'UnitAIType')
SELECT ("UNIT_NIEUPORT17"), "UnitAIType"
FROM "Unit_AITypes" WHERE (UnitType = "UNIT_TRIPLANE");
INSERT INTO "Unit_ClassUpgrades" ('UnitType', 'UnitClassType')
SELECT ("UNIT_NIEUPORT17"), "UnitClassType"
FROM "Unit_ClassUpgrades" WHERE (UnitType = "UNIT_TRIPLANE");
INSERT INTO "Unit_Flavors" ('UnitType', 'FlavorType', 'Flavor')
SELECT ("UNIT_NIEUPORT17"), "FlavorType", "Flavor"
FROM "Unit_Flavors" WHERE (UnitType = "UNIT_TRIPLANE");
INSERT INTO "Unit_FreePromotions" ('UnitType', 'PromotionType')
SELECT ("UNIT_NIEUPORT17"), "PromotionType"
FROM "Unit_FreePromotions" WHERE (UnitType = "UNIT_TRIPLANE");
INSERT INTO "Unit_ResourceQuantityRequirements" ('UnitType', 'ResourceType', 'Cost')
SELECT ("UNIT_NIEUPORT17"), "ResourceType", "Cost"
FROM "Unit_ResourceQuantityRequirements" WHERE (UnitType = "UNIT_TRIPLANE");
INSERT INTO "Civilization_UnitClassOverrides" ( 'CivilizationType', 'UnitClassType', 'UnitType' )
VALUES ( 'CIVILIZATION_FRANCE', 'UNITCLASS_TRIPLANE', 'UNIT_NIEUPORT17' );
This is the dreaded thread of code. Doing it until I get it right is the only way I'll learn.
nokmirt Jul 08, 2012, 05:46 AM Something is not right it is stiill a triplane. I tried it in game. The mod showed up in the mod section, just that the plane I built is not a Nieuport 17. It does not list France as having that as a UU in the techtree, which it should.
@Gedemon you said...The following is the SQL code that I use to replace step 3 and step 4 now that Civ5ArtDefines_UnitMembers.xml and Civ5ArtDefines_Units.xml are no longer needed to mod in new units (which is a very good thing, but has broken a lot of mods)
So, I decided not to change the xml, you said steps 3 and 4 are not needed now. So, I added the SQL code yyou listed and adjusted it as you said to do.
Gedemon Jul 08, 2012, 06:11 AM 'IsReligious' column has been removed with pre-G&K patch, your mod should return an error in Database.log if you've activated logging in config.ini.
Remove both reference to that tag in the INSERT INTO "Units" entry, it should be ok then.
Just has an added note about your earlier XML code, when in SQL it refer to "ART_DEF_UNIT_MEMBER_WW1_FIGHTER", it's made to duplicate that entry in a new one for "ART_DEF_UNIT_MEMBER_NIEUPORT17".
In XML you don't have a tag allowing to copy an entry, what you want to do here is a new entry "ART_DEF_UNIT_MEMBER_NIEUPORT17", using the data from "ART_DEF_UNIT_MEMBER_WW1_FIGHTER", but what your code was doing is defining an entry for "ART_DEF_UNIT_MEMBER_WW1_FIGHTER", which would have resulted in an error as this entry already exist.
Here's what you should have written:
<ArtDefine_UnitInfoMemberInfos>
<Row>
<UnitMemberArt>
<UnitInfoType>ART_DEF_UNIT_NIEUPORT17</UnitInfoType>
<UnitMemberInfoType>ART_DEF_UNIT_MEMBER_NIEUPORT17</UnitMemberInfoType>
<NumMembers>3</NumMembers>
</UnitMemberArt>
</Row>
</ArtDefine_UnitInfoMemberInfos>
And after that should have replaced ART_DEF_UNIT_MEMBER_WW1_FIGHTER" with ART_DEF_UNIT_MEMBER_NIEUPORT17
nokmirt Jul 08, 2012, 06:32 AM 'IsReligious' column has been removed with pre-G&K patch, your mod should return an error in Database.log if you've activated logging in config.ini.
Remove both reference to that tag in the INSERT INTO "Units" entry, it should be ok then.
Just has an added note about your earlier XML code, when in SQL it refer to "ART_DEF_UNIT_MEMBER_WW1_FIGHTER", it's made to duplicate that entry in a new one for "ART_DEF_UNIT_MEMBER_NIEUPORT17".
In XML you don't have a tag allowing to copy an entry, what you want to do here is a new entry "ART_DEF_UNIT_MEMBER_NIEUPORT17", using the data from "ART_DEF_UNIT_MEMBER_WW1_FIGHTER", but what your code was doing is defining an entry for "ART_DEF_UNIT_MEMBER_WW1_FIGHTER", which would have resulted in an error as this entry already exist.
Here's what you should have written:
<ArtDefine_UnitInfoMemberInfos>
<Row>
<UnitMemberArt>
<UnitInfoType>ART_DEF_UNIT_NIEUPORT17</UnitInfoType>
<UnitMemberInfoType>ART_DEF_UNIT_MEMBER_NIEUPORT17</UnitMemberInfoType>
<NumMembers>3</NumMembers>
</UnitMemberArt>
</Row>
</ArtDefine_UnitInfoMemberInfos>
And after that should have replaced ART_DEF_UNIT_MEMBER_WW1_FIGHTER" with ART_DEF_UNIT_MEMBER_NIEUPORT17
First off, I thought you said steps 3 and 4 were not needed now, due to the fact that you can add a mod via SQL. Is that right? Also, in my mod project, should I have...
1. ART folder 2. Inside the Art folder, the Nieuport17 folder, and inside that all the dds files etc.?
Then the other thing is he has a no_gloss.dds with no reference to Nieuport17, like the Nieuport17.dds. So do I just leave no_gloss.dds alone? And it is used right? I have set all of these to VFS true.
I have added to my XML folder the Civ5ArtDefines_Expansion_UnitMembers.xml and the Civ5ArtDefines_Expansion_Units.xml files. They are set to VFS true as well. Since we are modding the unit via SQL, I do not have to modify these files? Is that true? But they are required to be set at VFS true correct?
Also, inside danrell's Common folder is the civ5artdefines_viseffects.xml file, this should be set to VFS true too? I have done that just let me know if it is supposed to be.
nokmirt Jul 08, 2012, 06:54 AM The easiest thing would be to send the mod. I'll do a build and send it as it is now.
Perhaps, you can take a quick look to see what things are not correct. Which I am sure they probably are not, because I am becoming more and more confused. :lol:
Here it is.
Gedemon Jul 08, 2012, 07:01 AM Steps 3 and 4 are not needed, but you can use either XML or SQL for the replacing step I've done in SQL only.
That code is a conversion of that part of the SQL code
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
SELECT ("ART_DEF_UNIT_NIEUPORT17"), ("ART_DEF_UNIT_MEMBER_NIEUPORT17"), "NumMembers"
FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_WW1_FIGHTER");
to XML:
<ArtDefine_UnitInfoMemberInfos>
<Row>
<UnitMemberArt>
<UnitInfoType>ART_DEF_UNIT_NIEUPORT17</UnitInfoType>
<UnitMemberInfoType>ART_DEF_UNIT_MEMBER_NIEUPORT17</UnitMemberInfoType>
<NumMembers>3</NumMembers>
</UnitMemberArt>
</Row>
</ArtDefine_UnitInfoMemberInfos>
The advantage of SQL, is that if the number of units in the formation is changed for the WWI fighter (by a patch or myself for whatever reason), it will also apply to all units based on it, while in XML I would have to manually change the <NumMembers> tag's value for all ethnic/unique units replacing the WWI fighter.
The DDS, GR2 and FSXML files can be placed anywhere in your mod project as long as the VFS is set to true for them.
I prefer to use subfolders (Art, SQL, XML, Lua,..) to keep the mod easy to manage, but you could have it working with everything in the base folder, that what I do for very small mods.
For no_gloss.dds, as it may be used by different units, I put it in a separate folder for my mods using many units, with VFS to true, this way it will be available to all units models requiring it. Having it multiple time in your mod should not give issues, it's again a matter of organisation/keeping the mod structure "clean".
But don't rename it, the model's files are referring to it's original name.
nokmirt Jul 08, 2012, 08:15 AM Here is the mod. I looked through every step. When I enable the mod and launch it in the game, playing as France, all that is available is the triplane. What am I missing in the mod project? Or what is wrong, is there code missing or something? Is there something deleted that should be there. It's confusing and i cannot figure out what I did wrong. Please let me know and thank you.
Gedemon Jul 08, 2012, 08:25 AM Here is the mod. I looked through every step. When I enable the mod and launch it in the game, playing as France, all that is available is the triplane. What am I missing in the mod project? Or what is wrong, is there code missing or something? Is there something deleted that should be there. It's confusing and i cannot figure out what I did wrong. Please let me know and thank you.
see :
'IsReligious' column has been removed with pre-G&K patch, your mod should return an error in Database.log if you've activated logging in config.ini.
Remove both reference to that tag in the INSERT INTO "Units" entry, it should be ok then.
and to activate logging, open the config.ini file that's in "\My Documents\My Games\Sid Meier's Civilization 5" folder and change "LoggingEnabled = 0" to "LoggingEnabled = 1"
Database.log can be found in the "\My Documents\My Games\Sid Meier's Civilization 5\Logs" folder.
Also, Civ5ArtDefines_Expansion_UnitMembers.xml and Civ5ArtDefines_Expansion_Units.xml should be removed.
nokmirt Jul 08, 2012, 08:29 AM OK, will do. I have to sleep a bit then, I will do what you say, when I get up. :)
Patum333 Jul 08, 2012, 12:11 PM How to use different IconAtlas in SQL?
I wrote this so far:
INSERT INTO "IconTextureAtlases" ('Atlas', 'IconSize', 'Filename', 'IconsPerRow', 'IconsPerColumn')
SELECT ("UNIT_ATLAS_RIFLEMAN"), (256), ("rifleman256.dds"), (5), (5)
FROM "IconTextureAtlases";
INSERT INTO "IconTextureAtlases" ('Atlas', 'IconSize', 'Filename', 'IconsPerRow', 'IconsPerColumn')
SELECT ("UNIT_ATLAS_RIFLEMAN"), (128), ("rifleman128.dds"), (5), (5)
FROM "IconTextureAtlases";
INSERT INTO "IconTextureAtlases" ('Atlas', 'IconSize', 'Filename', 'IconsPerRow', 'IconsPerColumn')
SELECT ("UNIT_ATLAS_RIFLEMAN"), (80), ("rifleman80.dds"), (5), (5)
FROM "IconTextureAtlases";
INSERT INTO "IconTextureAtlases" ('Atlas', 'IconSize', 'Filename', 'IconsPerRow', 'IconsPerColumn')
SELECT ("UNIT_ATLAS_RIFLEMAN"), (64), ("rifleman64.dds"), (5), (5)
FROM "IconTextureAtlases";
INSERT INTO "IconTextureAtlases" ('Atlas', 'IconSize', 'Filename', 'IconsPerRow', 'IconsPerColumn')
SELECT ("UNIT_ATLAS_RIFLEMAN"), (45), ("rifleman45.dds"), (5), (5)
FROM "IconTextureAtlases";
But I don't know how to fix it with the Cultural Variation type, like here: 'UNIT_RIFLEMAN'?
Could someone help me please?:religion:
nokmirt Jul 08, 2012, 01:44 PM IsReligious has been removed in the SQL file. "LoggingEnabled = 1" Let me try it now. These are gone now too. 'Also, Civ5ArtDefines_Expansion_UnitMembers.xml and Civ5ArtDefines_Expansion_Units.xml should be removed.'
Ok, the unit shows up in game, but I cannot see the planes (unit graphics) when the unit is built in the city. When I try to rebase the plane it locks the game up. None of the art files are showing up. How do we fix that? Other than that evrything else checks out. It shows in the techtree, it is a UU for France etc. Just the unit itself is not showing up.
I think I found problem. Let me check. Indeed, I had to change Nieuport17.fxsxml to Nieuport_17.fxsxml.
SUCCESS! WHAT A PAIN IN THE, well I won't say, but anyway. :lol: Now adding units with SQL, will be tons easier. What's there, 5 files, 4 unit graphic, 1 SQL, that's it.
Gedemon Jul 08, 2012, 02:36 PM How to use different IconAtlas in SQL?
I wrote this so far:
INSERT INTO "IconTextureAtlases" ('Atlas', 'IconSize', 'Filename', 'IconsPerRow', 'IconsPerColumn')
SELECT ("UNIT_ATLAS_RIFLEMAN"), (256), ("rifleman256.dds"), (5), (5)
FROM "IconTextureAtlases";
INSERT INTO "IconTextureAtlases" ('Atlas', 'IconSize', 'Filename', 'IconsPerRow', 'IconsPerColumn')
SELECT ("UNIT_ATLAS_RIFLEMAN"), (128), ("rifleman128.dds"), (5), (5)
FROM "IconTextureAtlases";
INSERT INTO "IconTextureAtlases" ('Atlas', 'IconSize', 'Filename', 'IconsPerRow', 'IconsPerColumn')
SELECT ("UNIT_ATLAS_RIFLEMAN"), (80), ("rifleman80.dds"), (5), (5)
FROM "IconTextureAtlases";
INSERT INTO "IconTextureAtlases" ('Atlas', 'IconSize', 'Filename', 'IconsPerRow', 'IconsPerColumn')
SELECT ("UNIT_ATLAS_RIFLEMAN"), (64), ("rifleman64.dds"), (5), (5)
FROM "IconTextureAtlases";
INSERT INTO "IconTextureAtlases" ('Atlas', 'IconSize', 'Filename', 'IconsPerRow', 'IconsPerColumn')
SELECT ("UNIT_ATLAS_RIFLEMAN"), (45), ("rifleman45.dds"), (5), (5)
FROM "IconTextureAtlases";
But I don't know how to fix it with the Cultural Variation type, like here: 'UNIT_RIFLEMAN'?
Could someone help me please?:religion:
The INSERT INTO ... SELECT ... FROM ... WHERE ... is used to fill rows based on an existing entry in my case.
For you, you just want to make new entries using a different syntax:
INSERT INTO "IconTextureAtlases" ('Atlas', 'IconSize', 'Filename', 'IconsPerRow', 'IconsPerColumn')
VALUES ("UNIT_ATLAS_RIFLEMAN", 45, "rifleman45.dds", 5, 5);
nokmirt Jul 08, 2012, 03:05 PM @Gedemon and Nutty. Thank you for all your help and bearing with me. I also wanted to thank Danrell for his excellent unit graphics.
I have one question, when I added danrell's common folder into my mod it show an error. It said that it was missing the civ5artdefines_viseffects.xsd file or something like that. Anyone know what that means? Anyway, I took it out.
Next I was think of adding one of his subs to a mod, so I'd like to know how to fix this 'common' folder issue. Thanks again.
Gedemon Jul 08, 2012, 03:44 PM when do you get the error exactly ?
nokmirt Jul 08, 2012, 05:40 PM These are 2 warnings in the error list box, in the lower left corner, where it tells you if code has errors in it.
Warning 1 Could not find file 'C:\Users\Administrator\Documents\Firaxis ModBuddy\nieuport17\nieuport17\XML\Common\Civ5ArtD efines_VisEffects.xsd'. C:\Users\Administrator\Documents\Firaxis ModBuddy\nieuport17\nieuport17\XML\Common\civ5artd efines_viseffects.xml 3 105 nieuport17
Warning 2 The schema referenced from this location in your document contains errors. C:\Users\Administrator\Documents\Firaxis ModBuddy\nieuport17\nieuport17\XML\Common\civ5artd efines_viseffects.xml 3 105 nieuport17
It says this too. xsi:noNamespaceSchemaLocation="Civ5ArtDefines_VisEffects.xsd">
Should I put the Common folder in an XML folder, in the mod project. Or, should I just have the Common folder in there by itself?
I wonder, is adding in the French FT-17 tank easy to do as well? It will need danrells specific combat graphics though. Will merging these mods be easy later? And the other thing, what goes into updating them if there is a patch? I think a WWI mod unit pack and scenario, would go together quite nicely. We need one. I feel the devs may make one with one of the upcoming DLCs.
I really don't need the Common folder for this little airplane mod, but I may with later ones. If I mod his ships, subs, or tanks. I took it out for now anyway, it really is not needed for the mod to work.
nokmirt Jul 09, 2012, 01:26 AM The following is the SQL code that I use to replace step 3 and step 4 now that Civ5ArtDefines_UnitMembers.xml and Civ5ArtDefines_Units.xml are no longer needed to mod in new units (which is a very good thing, but has broken a lot of mods)
You can put that code in the file created in step 5.
The rest of the steps are still valid I think.
In red the reference for the new unit, in green the reference of the unit we use as a template for the new one.
I'll do a clean update of first post when I have the time for it (which may not be *soon*, but I'll try to prioritize it)
Does this template work for all unit types? It is not just for WWI planes is it?
It seemed to work. I added an FT17, but it had a ranged attack when I first used the unit. The tank showed up in game really well. I took out the rangedattack value, and will test it later. I also, got the common folder in there correctly. Without that folder and the files within, the tank was shown halfway in the ground. It looked like my dog outside trying to dig a hole. Next I will try a sub. Then I was thinking of making a battle cruiser, whole new class.
nokmirt Jul 09, 2012, 06:42 AM Does this SQL code look correct for a WWI tank unit? This is my second unit I just want to make sure, that I am doing things correctly. Thanks.
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
SELECT ("ART_DEF_UNIT_FT17"), "DamageStates", "Formation"
FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_WW1_TANK");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
SELECT ("ART_DEF_UNIT_FT17"), ("ART_DEF_UNIT_MEMBER_FT17"), "NumMembers"
FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_WW1_TANK");
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_FT17"), "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_WW1_TANK");
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_FT17"), "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_WW1_TANK");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
SELECT ("ART_DEF_UNIT_MEMBER_FT17"), "Scale", "ZOffset", "Domain",
("Renault_FT-17.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_WW1_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', '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_FT17"), ("FT17 Tank"), "Civilopedia", "Strategy", "Help", "Requirements",
"Combat", "RangedCombat", "Cost", "Moves", "Immobile", "Range", "BaseSightRange", ("UNITCLASS_WWI_TANK"), "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_FT17"), "UnitArtInfoCulturalVariation", "UnitArtInfoEraVariation", "ProjectPrereq", "SpaceshipProject", "LeaderPromotion", "LeaderExperience", "DontShowYields", "ShowInPedia", "MoveRate",
"UnitFlagIconOffset", "PortraitIndex", "IconAtlas", "UnitFlagAtlas"
FROM "Units" WHERE (Type = "UNIT_WWI_TANK");
INSERT INTO "Unit_AITypes" ('UnitType', 'UnitAIType')
SELECT ("UNIT_FT17"), "UnitAIType"
FROM "Unit_AITypes" WHERE (UnitType = "UNIT_WWI_TANK");
INSERT INTO "Unit_ClassUpgrades" ('UnitType', 'UnitClassType')
SELECT ("UNIT_FT17"), "UnitClassType"
FROM "Unit_ClassUpgrades" WHERE (UnitType = "UNIT_WWI_TANK");
INSERT INTO "Unit_Flavors" ('UnitType', 'FlavorType', 'Flavor')
SELECT ("UNIT_FT17"), "FlavorType", "Flavor"
FROM "Unit_Flavors" WHERE (UnitType = "UNIT_WWI_TANK");
INSERT INTO "Unit_FreePromotions" ('UnitType', 'PromotionType')
SELECT ("UNIT_FT17"), "PromotionType"
FROM "Unit_FreePromotions" WHERE (UnitType = "UNIT_WWI_TANK");
INSERT INTO "Unit_ResourceQuantityRequirements" ('UnitType', 'ResourceType', 'Cost')
SELECT ("UNIT_FT17"), "ResourceType", "Cost"
FROM "Unit_ResourceQuantityRequirements" WHERE (UnitType = "UNIT_WWI_TANK");
INSERT INTO "Civilization_UnitClassOverrides" ( 'CivilizationType', 'UnitClassType', 'UnitType' )
VALUES ( 'CIVILIZATION_FRANCE', 'UNITCLASS_WWI_TANK', 'UNIT_FT17' );
Gedemon Jul 09, 2012, 10:39 AM seems correct on quick view and sqlite report no error executing the query... something wrong ingame ?
nokmirt Jul 09, 2012, 11:15 AM seems correct on quick view and sqlite report no error executing the query... something wrong ingame ?
No, it works beautiful. This is going to be a lot of fun.
I remember in CiIV, at first we did all the xml changes to add units. Then I started just changing the artdefines. You know for unit ethnic diversity. This made it so much easier to add units. Of course, saying that the XML was still needed to make new unit classes, obviously. Common units were a breeze to add.
<UnitArtStyleTypeInfos>
<UnitArtStyleTypeInfo>
<Type>UNIT_ARTSTYLE_ASIAN</Type>
<StyleUnits>
<StyleUnit>
<UnitType>UNIT_ARCHER</UnitType>
<UnitMeshGroup>
<EarlyArtDefineTag>ART_DEF_UNIT_ARCHER_ASIAN</EarlyArtDefineTag>
<LateArtDefineTag>ART_DEF_UNIT_ARCHER_ASIAN</LateArtDefineTag>
<MiddleArtDefineTag>ART_DEF_UNIT_ARCHER_ASIAN</MiddleArtDefineTag>
</UnitMeshGroup>
</StyleUnit>
<StyleUnit>
<UnitType>UNIT_CARAVEL</UnitType>
<UnitMeshGroup>
<EarlyArtDefineTag>ART_DEF_UNIT_ASIAN_WAR_GALLEY</EarlyArtDefineTag>
<LateArtDefineTag>ART_DEF_UNIT_ASIAN_WAR_GALLEY</LateArtDefineTag>
<MiddleArtDefineTag>ART_DEF_UNIT_ASIAN_WAR_GALLEY</MiddleArtDefineTag>
</UnitMeshGroup>
</StyleUnit>
<StyleUnit>
<UnitType>UNIT_CHARIOT</UnitType>
<UnitMeshGroup>
<EarlyArtDefineTag>ART_DEF_UNIT_CHARIOT_CHINESE</EarlyArtDefineTag>
<LateArtDefineTag>ART_DEF_UNIT_CHARIOT_CHINESE</LateArtDefineTag>
<MiddleArtDefineTag>ART_DEF_UNIT_CHARIOT_CHINESE</MiddleArtDefineTag>
</UnitMeshGroup>
</StyleUnit>
</UnitArtStyleTypeInfo>
</UnitArtStyleTypeInfos>
Basically, we would just change the art defines, based on ethnic region, for individual civilization. I remember it being much easier. All of the rest of the unit xml stayed the same. So, for instance, you have one UNIT_RIFLEMAN in XML, but he can have a hundred different looks. I think my mod at the time had 50 civs if I am not exaggerating, most had a rifle that looked the part for the civ they represented.
My point is that the SQL way of adding units, is about as easy. I like that.
Gedemon Jul 09, 2012, 11:44 AM If your going for ethnic diversity instead of unique units, there is a faster way, used in R.E.D. post patch .674
The settler use something like late Civ4 ethnic modding, with a suffix ("ART_DEF_UNIT__SETTLER_ASIA" for example) used for all civilization having that ArtStyle suffix (Japan, China, etc...)
What I've done in R.E.D. modpack is giving every civ it's own artstyle suffix...
example for China:
UPDATE Civilizations SET ArtStyleSuffix = "_CHINA" WHERE Type = 'CIVILIZATION_CHINA';
... and then set an unit type to use cultural variation like the settler...
example for Composite Bowman:
UPDATE Units SET UnitArtInfoCulturalVariation = 1 WHERE Type = 'UNIT_COMPOSITE_BOWMAN';
... and finally I only need the art code to add an ethnic unit:
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
SELECT ("ART_DEF_UNIT_COMPOSITE_BOWMAN_CHINA"), "DamageStates", "Formation"
FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_COMPOSITE_BOWMAN");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
SELECT ("ART_DEF_UNIT_COMPOSITE_BOWMAN_CHINA"), ("ART_DEF_UNIT_MEMBER_COMPOSITE_BOWMAN_CHINA"), "NumMembers"
FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_COMPOSITE_BOWMAN");
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_COMPOSITE_BOWMAN_CHINA"), "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_COMPOSITE_BOWMAN");
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_COMPOSITE_BOWMAN_CHINA"), "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_COMPOSITE_BOWMAN");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
SELECT ("ART_DEF_UNIT_MEMBER_COMPOSITE_BOWMAN_CHINA"), "Scale", "ZOffset", "Domain",
("Composite_Bowman_China_v2.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_COMPOSITE_BOWMAN");
nokmirt Jul 09, 2012, 12:11 PM This is great! What does this Chinese composite bowman look like? What does it do add elements of the Asian settler art defines, to make the composite bowman look more like an Asian unit?
Patum333 Jul 09, 2012, 12:14 PM The INSERT INTO ... SELECT ... FROM ... WHERE ... is used to fill rows based on an existing entry in my case.
For you, you just want to make new entries using a different syntax:
INSERT INTO "IconTextureAtlases" ('Atlas', 'IconSize', 'Filename', 'IconsPerRow', 'IconsPerColumn')
VALUES ("UNIT_ATLAS_RIFLEMAN", 45, "rifleman45.dds", 5, 5);
Thanks a lot! :thumbsup:
But how to wrote the path (<PortraitIndex> 1 or 2 or 3 or 4... </PortraitIndex>
) for using each unique rifleman icon in the "UNIT_ATLAS_RIFLEMAN"? The <PortraitIndex> is a part of "civ5units".:confused:
Gedemon Jul 09, 2012, 12:57 PM Thanks a lot! :thumbsup:
But how to wrote the path (<PortraitIndex> 1 or 2 or 3 or 4... </PortraitIndex>
) for using each unique rifleman icon in the "UNIT_ATLAS_RIFLEMAN"? The <PortraitIndex> is a part of "civ5units".:confused:
yes, here's another example from my WWII mod :
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_LIGHT_TANK"), ("TXT_KEY_UNIT_LIGHT_TANK"), "Civilopedia", "Strategy", ("TXT_KEY_UNIT_HELP_LIGHT_TANK"), "Requirements",
(40), "RangedCombat", (300), (5), "Immobile", "Range", "BaseSightRange", ("UNITCLASS_LIGHT_TANK"), "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_LIGHT_TANK"), "UnitArtInfoCulturalVariation", "UnitArtInfoEraVariation", "ProjectPrereq", "SpaceshipProject", "LeaderPromotion", "LeaderExperience", "DontShowYields", "ShowInPedia", "MoveRate",
("1"), ("7"), ("WW2_UNIT_ICONS"), ("WW2_UNIT_FLAGS")
FROM "Units" WHERE (Type = "UNIT_TANK");
Here I'm defining a light tank unit, based on the tank unit, but with some value changed (in red).
INSERT INTO "Units" (...) list the column that will be filled, SELECT ... FROM "Units" WHERE (Type = "UNIT_TANK") is getting the tank values for those columns, except the entries in parenthesis like ("UNIT_LIGHT_TANK") which are changed values, and you'll see that the last 4 entries corresponding to the 'UnitFlagIconOffset', 'PortraitIndex', 'IconAtlas', 'UnitFlagAtlas' from the insert statement are ("1"), ("7"), ("WW2_UNIT_ICONS"), ("WW2_UNIT_FLAGS"), which are the new unit icon and flags index/atlases from the mod.
Patum333 Jul 10, 2012, 11:41 AM yes, here's another example from my WWII mod :
Yeah, but this creates a new unit. Look at this: 325779
I tryed to find out a way of using unit-icons with a simple ethnic diversity. I believe it's not possible to use ethnic diversity unit-icons without to change the unit entries.
You still have to use overrides like this,
- <Civilization_UnitClassOverrides>
- <Row>
<CivilizationType>CIVILIZATION_GERMANY</CivilizationType>
<UnitClassType>UNITCLASS_RIFLEMAN</UnitClassType>
<UnitType>UNIT_GERMAN_RIFLEMAN</UnitType>
</Row>
if you want to use your own.:(
Gedemon Jul 10, 2012, 11:51 AM ok, I understand now, but AFAIK ethnic icons can't be used the same way.
nokmirt Jul 10, 2012, 09:22 PM Gedemon can you help me learn how to add a unit icon for my units? One for the Nieuport 17 and one for the FT-17 light tank. I put both units in a French WWI unit pack, but I probably should have icons for them before posting on Steam Workshop. I used to make icons for CiIV, I just don't remember how.
I know these two units are not much, but I can add to the pack as time goes on. I want to do a Napoleonic infantry pack as well.
I think with that I will replace the musketman with a standard or generic musket infantry. Or, I could add a unit class. Then I will add UUs to the major powers, France, Prussia, Russia, Austria, and whatever other UUs they have made. Oh Great Britain and America, has some nice ones made for them. I have studied the Napoleonic wars most of my life. I certainly should make a scenario for that. First though, I want to learn more about modding things properly.
Karantaner Jul 11, 2012, 04:31 PM I have a silly question, but I cannot figure out the solution. I'm using in my mod for Austria-Hungaria a Hussar unit which has an fscale size of 1.5 - and not like the Cavlary of 0.12 I cannot figure it out how to use the required size for the Hussar in the new system with the sql file. The system always uses the size of the Cavalry and the Hussar is then sooo tiny, you cannot see it. Where can I put the correct fscale size of 1.5 in the sql file????
Here is my sql file
----Hussar------------------------------------------------------------------
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
SELECT ("ART_DEF_UNIT_HUSSAR"), "DamageStates", "Formation"
FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_CAVALRY");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
SELECT ("ART_DEF_UNIT_HUSSAR"), ("ART_DEF_UNIT_MEMBER_HUSSAR"), 5
FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_CAVALRY");
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_HUSSAR"), "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_CAVALRY");
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_HUSSAR"), "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_CAVALRY");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
SELECT ("ART_DEF_UNIT_MEMBER_HUSSAR"), "Scale", "ZOffset", "Domain",
("Hussar_idle.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_CAVALRY");
Nutty Jul 11, 2012, 04:59 PM Where can I put the correct fscale size of 1.5 in the sql file????
Here you go:
UPDATE ArtDefine_UnitMemberInfos SET Scale = 1.5 WHERE Type = 'ART_DEF_UNIT_MEMBER_HUSSAR';
Karantaner Jul 12, 2012, 12:05 AM Here you go:
UPDATE ArtDefine_UnitMemberInfos SET Scale = 1.5 WHERE Type = 'ART_DEF_UNIT_MEMBER_HUSSAR';
great!!! thanks a lot - you saved me!!!
nokmirt Jul 12, 2012, 03:29 AM <Row>
<Type>PROMOTION_FIRE_SUPPORT</Type>
<Description>TXT_KEY_PROMOTION_FIRE_SUPPORT</Description>
<Help>TXT_KEY_PROMOTION_FIRE_SUPPORT</Help>
<Sound>AS2D_IF_LEVELUP</Sound>
<CityAttack>33</CityAttack>
<PortraitIndex>59</PortraitIndex>
<IconAtlas>PROMOTION_ATLAS</IconAtlas>
<PediaType>PEDIA_ATTRIBUTES</PediaType>
<PediaEntry>TXT_KEY_PROMOTION_FIRE_SUPPORT</PediaEntry>
</Row>
If I wanted to update this promotion in SQL. To change the <CityAttack>33</CityAttack> to <CityAttack>10</CityAttack>, what would the update code be?
I want to reduce this for my dreadnought. It seems a bit overpowered in game anyway, it makes it way too easy to take a coastal city.
nokmirt Jul 12, 2012, 06:07 AM Also, is Battleship the proper template for danrells generic Dreadnought unit. Here is the code. I want this unit to be available to all civs. Is there anty code I am missing here?
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
SELECT ("ART_DEF_UNIT_DREADNOUGHT"), "DamageStates", "Formation"
FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_BATTLESHIP");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
SELECT ("ART_DEF_UNIT_DREADNOUGHT"), ("ART_DEF_UNIT_MEMBER_DREADNOUGHT"), "NumMembers"
FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_BATTLESHIP");
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_DREADNOUGHT"), "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_BATTLESHIP");
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_DREADNOUGHT"), "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_BATTLESHIP");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
SELECT ("ART_DEF_UNIT_MEMBER_DREADNOUGHT"), "Scale", "ZOffset", "Domain",
("Dreadnought_Generic.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_BATTLESHIP");
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_DREADNOUGHT"), ("Dreadnought"), "Civilopedia", "Strategy", "Help", "Requirements",
"Combat", "RangedCombat", "Cost", "Moves", "Immobile", "Range", "BaseSightRange", ("UNITCLASS_BATTLESHIP"), "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_DREADNOUGHT"), "UnitArtInfoCulturalVariation", "UnitArtInfoEraVariation", "ProjectPrereq", "SpaceshipProject", "LeaderPromotion", "LeaderExperience", "DontShowYields", "ShowInPedia", "MoveRate",
"UnitFlagIconOffset", "PortraitIndex", "IconAtlas", "UnitFlagAtlas"
FROM "Units" WHERE (Type = "UNIT_BATTLESHIP");
INSERT INTO "Unit_AITypes" ('UnitType', 'UnitAIType')
SELECT ("UNIT_DREADNOUGHT"), "UnitAIType"
FROM "Unit_AITypes" WHERE (UnitType = "UNIT_BATTLESHIP");
INSERT INTO "Unit_ClassUpgrades" ('UnitType', 'UnitClassType')
SELECT ("UNIT_DREADNOUGHT"), "UnitClassType"
FROM "Unit_ClassUpgrades" WHERE (UnitType = "UNIT_BATTLESHIP");
INSERT INTO "Unit_Flavors" ('UnitType', 'FlavorType', 'Flavor')
SELECT ("UNIT_DREADNOUGHT"), "FlavorType", "Flavor"
FROM "Unit_Flavors" WHERE (UnitType = "UNIT_BATTLESHIP");
INSERT INTO "Unit_FreePromotions" ('UnitType', 'PromotionType')
SELECT ("UNIT_DREADNOUGHT"), "PromotionType"
FROM "Unit_FreePromotions" WHERE (UnitType = "UNIT_BATTLESHIP");
INSERT INTO "Unit_ResourceQuantityRequirements" ('UnitType', 'ResourceType', 'Cost')
SELECT ("UNIT_DREADNOUGHT"), "ResourceType", "Cost"
FROM "Unit_ResourceQuantityRequirements" WHERE (UnitType = "UNIT_BATTLESHIP");
I tried to add code it did not work. Both units are displayed in the civilopedia in game, but the battleship is the only unit in the techtree.
INSERT INTO "UnitClasses" ('Type', 'Description', 'MaxGlobalInstances', 'MaxTeamInstances', 'MaxPlayerInstances', 'InstanceCostModifier', 'DefaultUnit' )
SELECT ("UNITCLASS_DREADNOUGHT"), "Description", "MaxGlobalInstances", "MaxTeamInstances", "MaxPlayerInstances", "InstanceCostModifier", "DefaultUnit"
FROM "UnitClasses" WHERE (Type = "UNITCLASS_BATTLESHIP");
What I need to do is replace the Unitclass Battleship, with Unitclass Dreadnought. Is there a way to do this?
Gedemon Jul 12, 2012, 12:24 PM You need the INSERT INTO UnitClasses ... code, yes, and also change the unitclass entry (in red) in the INSERT INTO Units ... statement, like that:
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_DREADNOUGHT"), ("Dreadnought"), "Civilopedia", "Strategy", "Help", "Requirements",
"Combat", "RangedCombat", "Cost", "Moves", "Immobile", "Range", "BaseSightRange", ("UNITCLASS_DREADNOUGHT"), "Special", "Capture", "CombatClass", "Domain", "CivilianAttackPriority", "DefaultUnitAI", "Food", "NoBadGoodies", "RivalTerritory", "MilitarySupport", "MilitaryProduction", "Pillage", "Found", "FoundAbroad", "CultureBombRadius", "GoldenAgeTurns", "IgnoreBuildingDefense", "PrereqResources", "Mechanized", "Suicide", "CaptureWhileEmbarked", ("TECH_REPLACEABLE_PARTS"), "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_DREADNOUGHT"), "UnitArtInfoCulturalVariation", "UnitArtInfoEraVariation", "ProjectPrereq", "SpaceshipProject", "LeaderPromotion", "LeaderExperience", "DontShowYields", "ShowInPedia", "MoveRate",
"UnitFlagIconOffset", "PortraitIndex", "IconAtlas", "UnitFlagAtlas"
FROM "Units" WHERE (Type = "UNIT_BATTLESHIP");
And if you want to change the requested tech, I've put it in Replaceable part as an example (in green).
nokmirt Jul 12, 2012, 02:10 PM You need the INSERT INTO UnitClasses ... code, yes, and also change the unitclass entry (in red) in the INSERT INTO Units ... statement, like that:
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_DREADNOUGHT"), ("Dreadnought"), "Civilopedia", "Strategy", "Help", "Requirements",
"Combat", "RangedCombat", "Cost", "Moves", "Immobile", "Range", "BaseSightRange", ("UNITCLASS_DREADNOUGHT"), "Special", "Capture", "CombatClass", "Domain", "CivilianAttackPriority", "DefaultUnitAI", "Food", "NoBadGoodies", "RivalTerritory", "MilitarySupport", "MilitaryProduction", "Pillage", "Found", "FoundAbroad", "CultureBombRadius", "GoldenAgeTurns", "IgnoreBuildingDefense", "PrereqResources", "Mechanized", "Suicide", "CaptureWhileEmbarked", ("TECH_REPLACEABLE_PARTS"), "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_DREADNOUGHT"), "UnitArtInfoCulturalVariation", "UnitArtInfoEraVariation", "ProjectPrereq", "SpaceshipProject", "LeaderPromotion", "LeaderExperience", "DontShowYields", "ShowInPedia", "MoveRate",
"UnitFlagIconOffset", "PortraitIndex", "IconAtlas", "UnitFlagAtlas"
FROM "Units" WHERE (Type = "UNIT_BATTLESHIP");
And if you want to change the requested tech, I've put it in Replaceable part as an example (in green).
Thank you Gedemon, but there is still something strange going on. The Battleship still shows up in the techtree, and is the unit available for construction in the city build panel. The Dreadnought shows up in the units civilopedia, as an unlocked unit for the replaceable parts tech, but does not show up in the techtree, like Great War Infantry does. I must be crazy or there is some small overlooked mistake someplace. The SQL code checks out as far as typo mistakes.
We need to completely override the battleship unit from tech electronics, which is where I want the dreadnought unit to be, for the end in 1918 mod.
Gedemon Jul 12, 2012, 03:14 PM Change replaceable parts with electronics for the dreadnought and change electronic to future tech for the battleship, the second one will be coded like that:
UPDATE Units SET PrereqTech = 'TECH_FUTURE_TECH' WHERE Type = 'UNIT_BATTLESHIP';
Still, I don't know why it does not appears in the tech tree with your change... I haven't modded that part of the game yet, so maybe there's something else to do.
nokmirt Jul 12, 2012, 03:27 PM Change replaceable parts with electronics for the dreadnought and change electronic to future tech for the battleship, the second one will be coded like that:
UPDATE Units SET PrereqTech = 'TECH_FUTURE_TECH' WHERE Type = 'UNIT_BATTLESHIP';
Still, I don't know why it does not appears in the tech tree with your change... I haven't modded that part of the game yet, so maybe there's something else to do.
Ok the unit works if it I use the INSERT INTO "Civilization_UnitClassOverrides" ( 'CivilizationType', 'UnitClassType', 'UnitType' )
VALUES ( 'CIVILIZATION_FRANCE', 'UNITCLASS_BATTLESHIP', 'UNIT_DREADNOUGHT' );
I just can't make it a unit all civs can use. Of course, I could use the code for every single civ in the game. :lol: Am I that ambitious though? NO! :lol:
I'll try your suggestion though. Thanks, I really appreciate your help.
xxhe Jul 20, 2012, 04:21 PM Hello Gedemon:
1) In post .674 patch and G&K, the original steps 3,4 are still valid or is totally invalid? You said "not needed" and I'm not quite sure if I understand it right: I think we can still use the original way, it's just not as efficient as what you showed in post #6.
2) For the step 7, can I replace the ("Biplan") with "TXT_KEY_BIPLANE_DESC" to make my mod multi-language compatible?
Thank you!
xxhe
Gedemon Jul 21, 2012, 03:08 AM 1/ You can't use steps 3 and 4 anymore, the new system doesn't allow the complete replacement of the artdefines XML for units.
2/ Yes, you can replace it with a text key, same for the "help" column in unit or "description" in unitclass. Remember the () for column you're replacing with new value:
("TXT_KEY_BIPLANE_DESC")
Rob (R8XFT) Jul 21, 2012, 01:42 PM I appreciate the work that's been put in here, but to be honest, I'm still puzzled. I sincerely hope you'll get an opportunity to re-write the first post soon and feel that once I've worked out how to get one unit in-game, the rest will be quite easy.
Nutty Jul 21, 2012, 02:36 PM ...once I've worked out how to get one unit in-game, the rest will be quite easy.
The confusion comes from the fact that there are various concepts that can be covered by "adding a unit." What kind of unit do you want to add?
Are you going to use unit art from the vanilla game (or even one of the scenarios) or are you adding custom models and/or textures? Is this a new kind of unit for all civs to build, or a unique unit for specific civ(s)? Or are you just creating ethnic versions of units that are straight copies of a vanilla unit for specific civ(s)?
Rob (R8XFT) Jul 21, 2012, 02:50 PM The confusion comes from the fact that there are various concepts that can be covered by "adding a unit." What kind of unit do you want to add?
Are you going to use unit art from the vanilla game (or even one of the scenarios) or are you adding custom models and/or textures? Is this a new kind of unit for all civs to build, or a unique unit for specific civ(s)? Or are you just creating ethnic versions of units that are straight copies of a vanilla unit for specific civ(s)?
My mod contains several units, all of which work; however, for example, the unique unit for Mycenae is a spearman who has a different icon to the regular spearman and a different flag icon, but the actual unit graphics are the same as the regular spearman. I therefore would like to use one of Dandrell's units to make it so it's different.
xxhe Jul 22, 2012, 04:38 PM 1/ You can't use steps 3 and 4 anymore, the new system doesn't allow the complete replacement of the artdefines XML for units.
2/ Yes, you can replace it with a text key, same for the "help" column in unit or "description" in unitclass. Remember the () for column you're replacing with new value:
("TXT_KEY_BIPLANE_DESC")
Thank you Gedemon:goodjob:
One more question: Is there any XML way to do step 3&4 in G&K expansion? I prefer using XML since it reads easier. Anyway, I can try to use SQL if it's required.
xxhe
Gedemon Jul 22, 2012, 04:45 PM One more question: Is there any XML way to do step 3&4 in G&K expansion?
yes, the Tiny Death Robots (v 1) mod is available on the steam workshop as an example for adding new units in XML.
Rob (R8XFT) Jul 23, 2012, 12:00 AM I'm still struggling here, so would appreciate any help. I tried looking at the Tiny Death Robots mod and mimicking it for my mod, but to no avail.
I have the Gods+Kings expansion pack and all the DLCs; I'm making a new version of the Anno Domini mod. I would like to use Dandrell's units (and others) as both flavour units and unique units (the unique units being the more important of the two for me at the moment).
There are no problems with the coding to get a unit into the game; let's use the Maccabee (Hebrew slinger) as an example. I have a Maccabee that has the correct icon for the civilopedia/tech tree, the correct civilopedia text entry and it does the things I'd expect a Maccabee to do, such has have a "retreat after attack" promotion. However, as I don't know how to import new animations, we have a Maccabee that uses the Incan slinger graphics in-game. Whenever I've tried to import the graphics the Nefliqus did, I get a bunch of spearmen!
Please can anyone help?
Androrc the Orc Jul 23, 2012, 11:20 AM I'm still struggling here, so would appreciate any help. I tried looking at the Tiny Death Robots mod and mimicking it for my mod, but to no avail.
I have the Gods+Kings expansion pack and all the DLCs; I'm making a new version of the Anno Domini mod. I would like to use Dandrell's units (and others) as both flavour units and unique units (the unique units being the more important of the two for me at the moment).
There are no problems with the coding to get a unit into the game; let's use the Maccabee (Hebrew slinger) as an example. I have a Maccabee that has the correct icon for the civilopedia/tech tree, the correct civilopedia text entry and it does the things I'd expect a Maccabee to do, such has have a "retreat after attack" promotion. However, as I don't know how to import new animations, we have a Maccabee that uses the Incan slinger graphics in-game. Whenever I've tried to import the graphics the Nefliqus did, I get a bunch of spearmen!
Please can anyone help?
Did you activate "Reload Unit System" in your mod's properties?
Anyhow, here is an example of a .sql file that adds new unit art (based on the method developed by Gedemon):
-- Archer
---------------
-- ROME --------------------------------------------------------------------------------------------------------------
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
SELECT ("ART_DEF_UNIT_ARCHER_ROME"), "DamageStates", ("Archer")
FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_ARCHER");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
VALUES ("ART_DEF_UNIT_ARCHER_ROME", "ART_DEF_UNIT_MEMBER_ARCHER_ROME", "12");
INSERT INTO "ArtDefine_UnitMemberCombats" ('UnitMemberType', 'EnableActions', 'DisableActions', 'MoveRadius', 'ShortMoveRadius', 'ChargeRadius', 'AttackRadius', 'RangedAttackRadius', 'MoveRate', 'ShortMoveRate', 'TurnRateMin', 'TurnRateMax', 'TurnFacingRateMin', 'TurnFacingRateMax', 'RollRateMin', 'RollRateMax', 'PitchRateMin', 'PitchRateMax', 'LOSRadiusScale', 'TargetRadius', 'TargetHeight', 'HasShortRangedAttack', 'HasLongRangedAttack', 'HasLeftRightAttack', 'HasStationaryMelee', 'HasStationaryRangedAttack', 'HasRefaceAfterCombat', 'ReformBeforeCombat', 'HasIndependentWeaponFacing', 'HasOpponentTracking', 'HasCollisionAttack', 'AttackAltitude', 'AltitudeDecelerationDistance', 'OnlyTurnInMovementActions', 'RushAttackFormation')
SELECT ("ART_DEF_UNIT_MEMBER_ARCHER_ROME"), "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_ARCHER");
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_ARCHER_ROME"), "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_ARCHER");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
SELECT ("ART_DEF_UNIT_MEMBER_ARCHER_ROME"), "Scale", "ZOffset", "Domain",
("Archer_Rome.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_ARCHER");
-------------------------------------------------------------------------------------------------------------------------
This one in particular adds danrell's Roman archer.
Rob (R8XFT) Jul 23, 2012, 11:45 AM Thanks Androrc. I've not enabled the "Reload Unit System" before - it's not something I realised I needed to do! (However, I just tried that, excitedly "rebuilding" the mod via modbuddy, only to find that I still have a band of spearmen where the slinger should be. Ah well...)
So...to enter the code you've kindly done for the Roman Archer, I take it I simply creat a new .sql file, give it a name like "units.sql" and simply copy and paste what you've done below (as well as including the Roman archer graphics in a file somewhere in the mod, all files with "Import into VFS" set to "true)??
Once that works, I take it the next step is for me to change references to "Roman Archer" to be A.N.Other unit I want to bring into the game and also change the references to "Archer" to be whatever the base type of unit is in the game?
Androrc the Orc Jul 24, 2012, 10:41 AM Thanks Androrc. I've not enabled the "Reload Unit System" before - it's not something I realised I needed to do! (However, I just tried that, excitedly "rebuilding" the mod via modbuddy, only to find that I still have a band of spearmen where the slinger should be. Ah well...)
So...to enter the code you've kindly done for the Roman Archer, I take it I simply creat a new .sql file, give it a name like "units.sql" and simply copy and paste what you've done below (as well as including the Roman archer graphics in a file somewhere in the mod, all files with "Import into VFS" set to "true)??
I set the Import into VFS to false for the .SQL file and then add it through UpdateDatabase as with .XML files.
Once that works, I take it the next step is for me to change references to "Roman Archer" to be A.N.Other unit I want to bring into the game and also change the references to "Archer" to be whatever the base type of unit is in the game?
Exactly. You also need to change the .fxsxml reference to the desired .fxsxml (just a note: .fxsxml files need to be set to VSF = true, and the same goes for the .dds and .gr2 files, naturally).
Rob (R8XFT) Jul 24, 2012, 01:35 PM Thanks again, Androrc, you've been a big help. I've now worked out (thanks to the code you put up above) how to get Dandrell's units into the game; I'm having limited success with Nefliqus' slinger though, as I can't seem to get the sizing right or the boulder sound for the stone that's thrown. However, I'm happy experimenting for now!
Androrc the Orc Jul 24, 2012, 02:05 PM Thanks again, Androrc, you've been a big help. I've now worked out (thanks to the code you put up above) how to get Dandrell's units into the game; I'm having limited success with Nefliqus' slinger though, as I can't seem to get the sizing right or the boulder sound for the stone that's thrown. However, I'm happy experimenting for now!
Great! :D
JJimmyJ Jul 24, 2012, 02:27 PM Hello
I'm after some help if possible. I'm really struggling to get a Unique Unit to show in my game. It's a unit that was created way back (I'm new to Civ), so it used the old civ5artdefines_unitmembers.xml and civ5artdefines_units.xml. It also contained different art for different members in the formation.
I've stripped out 3 of the 4 fxsxml's so I'm left with 1. Same with the granny files. I've checked them in granny viewer and the models show and the assets are all in the mod. All icons, text, buildings etc show correctly.
I've written some SQL based on all the suggestions in this thread, but every time the unit shows a spearmen.
Can someone please check it out for me? I'm tearing out what little hair is left on my head.
Thanks :)
Androrc the Orc Jul 24, 2012, 05:48 PM One thing I see is that you based your highlander on "ART_DEF_UNIT_WARRIOR". But there's no such art define. The correct form is "ART_DEF_UNIT__WARRIOR" (irritating I know, but AFAIK only settlers, warriors and workers have that extra "_").
JJimmyJ Jul 25, 2012, 10:44 AM One thing I see is that you based your highlander on "ART_DEF_UNIT_WARRIOR". But there's no such art define. The correct form is "ART_DEF_UNIT__WARRIOR" (irritating I know, but AFAIK only settlers, warriors and workers have that extra "_").
Thanks for looking Androrc.
I've finally had a chance to check and I've altered the ART_DEF_UNIT_WARRIOR to ART_DEF_UNIT__WARRIOR.
However, now when I try to make the unit, the game crashes.
I'm now looking at removing the custom animations and replacing them with the warrior animations. It's a long shot...
I really like the model that has been used for this mod and can't seem to find one that would fit well that I could reskin myself.
Androrc the Orc Jul 25, 2012, 12:19 PM Another thing: you should definitely delete the civ5artdefines_unitmembers.xml and civ5artdefines_units.xml files from your project, since replacing them doesn't work anymore (and may even be what is causing your crash). The art define update through "Scot Rules1.sql" should be enough.
JJimmyJ Jul 25, 2012, 01:50 PM Thanks again Androrc. I removed the 2 files, and found one more part where I'd put the extra _ in the wrong part.
Progress - The unit is now visible, however, I seem to have rather a lot of them. Looks like 24 of them!! I must have doubled up on the formation count somewhere.
I'm so close to actually being able to play a game :)
JFD Jul 26, 2012, 05:38 AM Is there a solution to one's custom skin's turning custom units into Spearmen? I've failed to solve it myself.
JJimmyJ Jul 26, 2012, 06:38 AM Is there a solution to one's custom skin's turning custom units into Spearmen? I've failed to solve it myself.
Hi JFD.
I have finally been successful after having the same issue as you. Is it purely an issue with the skin and all other elements are correct? Mine was as simple as a missing underscore in my sql (thanks to Androrc for spotting it). Are art files all named correctly and vfs set to true?
You will get it working. If it's any comfort it took me over a week :-)
JFD Jul 26, 2012, 09:42 AM Hi JFD.
I have finally been successful after having the same issue as you. Is it purely an issue with the skin and all other elements are correct? Mine was as simple as a missing underscore in my sql (thanks to Androrc for spotting it). Are art files all named correctly and vfs set to true?
You will get it working. If it's any comfort it took me over a week :-)
Yeah, everything else is correct - the mod is currently up on the Steam Workshop (http://steamcommunity.com/sharedfiles/filedetails/?id=80377476), but it's using the Landsknecht as the Swiss Guard atm. The reskins just aren't showing up. I've tried copying over other mods with custom arts to test it, but even there I fail to get anything other than Spearmen. I guess I'm just going to have to be meticulous about it until I can get it working.
Rob (R8XFT) Jul 27, 2012, 12:34 PM I'm still having problems :(. The Roman archer was transported across, no problems. Then, I tried to do the Macabee (which is what I called my Hebrew slinger, rightly or wrongly). This is the code I used; I'd added the bit to sizing, as the original unit was extremely tiny. It didn't seem to make any difference whether the template to copy into was an archer or an Incan slinger, the result was the same. However, no matter what I put in for the size, the unit is larger than it was, but dwarfed by the other units - the size remaining the same whatever the value in my code for it. I would also like to make the sound that of a boulder as at the moment, it's a rifle shot (as the "missile" is a bullet). I tried to change that, but got a massive arrow coming out of the sky due to the unit being drastically increased in size!
Here's the code I used:
-- Slinger
---------------
-- MACCABEE --------------------------------------------------------------------------------------------------------------
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
SELECT ("ART_DEF_UNIT_HEBREW_SLINGER"), "DamageStates", ("Archer")
FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_U_INCAN_SLINGER");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
VALUES ("ART_DEF_UNIT_HEBREW_SLINGER", "ART_DEF_UNIT_MEMBER_HEBREW_SLINGER", "12");
INSERT INTO "ArtDefine_UnitMemberCombats" ('UnitMemberType', 'EnableActions', 'DisableActions', 'MoveRadius', 'ShortMoveRadius', 'ChargeRadius', 'AttackRadius', 'RangedAttackRadius', 'MoveRate', 'ShortMoveRate', 'TurnRateMin', 'TurnRateMax', 'TurnFacingRateMin', 'TurnFacingRateMax', 'RollRateMin', 'RollRateMax', 'PitchRateMin', 'PitchRateMax', 'LOSRadiusScale', 'TargetRadius', 'TargetHeight', 'HasShortRangedAttack', 'HasLongRangedAttack', 'HasLeftRightAttack', 'HasStationaryMelee', 'HasStationaryRangedAttack', 'HasRefaceAfterCombat', 'ReformBeforeCombat', 'HasIndependentWeaponFacing', 'HasOpponentTracking', 'HasCollisionAttack', 'AttackAltitude', 'AltitudeDecelerationDistance', 'OnlyTurnInMovementActions', 'RushAttackFormation')
SELECT ("ART_DEF_UNIT_MEMBER_HEBREW_SLINGER"), "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_INCAN_SLINGER");
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_HEBREW_SLINGER"), "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_INCAN_SLINGER");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
SELECT ("ART_DEF_UNIT_MEMBER_HEBREW_SLINGER"), "ZOffset", "Domain",
("hebrew_slinger.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_U_INCAN_SLINGER");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Scale")
VALUES (2);
Also, I tried to get one of Danrell's Greek spearmen in the game, but get the generic spearmen that indicate wrong coding - whether I use the spearman or Greek phalanx as a template. Here's the code for that:
-- Spearman
---------------
-- MYCENAE --------------------------------------------------------------------------------------------------------------
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
SELECT ("ART_DEF_UNIT_HEQETAI"), "DamageStates", ("Phalanx")
FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_U_GREEK_HOPLITE");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
VALUES ("ART_DEF_UNIT_HEQETAI", "ART_DEF_UNIT_MEMBER_HEQETAI", "12");
INSERT INTO "ArtDefine_UnitMemberCombats" ('UnitMemberType', 'EnableActions', 'DisableActions', 'MoveRadius', 'ShortMoveRadius', 'ChargeRadius', 'AttackRadius', 'RangedAttackRadius', 'MoveRate', 'ShortMoveRate', 'TurnRateMin', 'TurnRateMax', 'TurnFacingRateMin', 'TurnFacingRateMax', 'RollRateMin', 'RollRateMax', 'PitchRateMin', 'PitchRateMax', 'LOSRadiusScale', 'TargetRadius', 'TargetHeight', 'HasShortRangedAttack', 'HasLongRangedAttack', 'HasLeftRightAttack', 'HasStationaryMelee', 'HasStationaryRangedAttack', 'HasRefaceAfterCombat', 'ReformBeforeCombat', 'HasIndependentWeaponFacing', 'HasOpponentTracking', 'HasCollisionAttack', 'AttackAltitude', 'AltitudeDecelerationDistance', 'OnlyTurnInMovementActions', 'RushAttackFormation')
SELECT ("ART_DEF_UNIT_MEMBER_HEQETAI"), "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_GREEK_HOPLITE");
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_HEQETAI"), "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_GREEK_HOPLITE");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
SELECT ("ART_DEF_UNIT_MEMBER_HEQETAI"), "Scale", "ZOffset", "Domain",
("Spearman_Greece.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_U_GREEK_HOPLITE");
-------------------------------------------------------------------------------------------------------------------------
Can anyone point me in the right direction? I should add that this is my first go at sql.
JJimmyJ Jul 27, 2012, 01:04 PM Hi Rob,
A bit of a longshot, but I found the 'NumMembers' code produced 36 members when I had it set to 12 in my original code. I reduced this to '4' which then gave the correct number of members (seemed to multiply by 3). Maybe this is conflicting with the unit size as it's trying to produce too many members?
Rob (R8XFT) Jul 27, 2012, 01:50 PM Hi Rob,
A bit of a longshot, but I found the 'NumMembers' code produced 36 members when I had it set to 12 in my original code. I reduced this to '4' which then gave the correct number of members (seemed to multiply by 3). Maybe this is conflicting with the unit size as it's trying to produce too many members?
Thanks for the suggestion and I tried it. Sadly, though, the result is the same.
Nutty Jul 27, 2012, 02:20 PM Rob/JJimmyJ,
The problem is this:
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
SELECT ("ART_DEF_UNIT_HIGHLANDER1"), ("ART_DEF_UNIT_MEMBER_HIGHLANDER1"), "12"
FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_WARRIOR");
If you take a look at the SQL table in question, you'll notice there are 3 models that comprise ART_DEF_UNIT__WARRIOR. With SELECT, you're duplicating all 3 of those rows, but at the same time you're replacing all of the contents of that row (so you don't need a SELECT). Since you don't need to refer to the vanilla warrior, just replace all of the above with:
INSERT INTO ArtDefine_UnitInfoMemberInfos VALUES ('ART_DEF_UNIT_HIGHLANDER1','ART_DEF_UNIT_MEMBER_H IGHLANDER1',"12");
EDIT:
You could also use all 4 of the Highlander models available with a hybrid unit, and instead:
INSERT INTO ArtDefine_UnitInfoMemberInfos VALUES ('ART_DEF_UNIT_HIGHLANDER1','ART_DEF_UNIT_MEMBER_H IGHLANDER1',"3");
INSERT INTO ArtDefine_UnitInfoMemberInfos VALUES ('ART_DEF_UNIT_HIGHLANDER1','ART_DEF_UNIT_MEMBER_H IGHLANDER2',"3");
INSERT INTO ArtDefine_UnitInfoMemberInfos VALUES ('ART_DEF_UNIT_HIGHLANDER1','ART_DEF_UNIT_MEMBER_H IGHLANDER3',"3");
INSERT INTO ArtDefine_UnitInfoMemberInfos VALUES ('ART_DEF_UNIT_HIGHLANDER1','ART_DEF_UNIT_MEMBER_H IGHLANDER4',"3");
and make the appropriate changes to ArtDefine_UnitMemberInfos also:
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
SELECT ("ART_DEF_UNIT_MEMBER_HIGHLANDER1"), "1.4", "ZOffset", "Domain",
("Highlander1.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_WARRIOR");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
SELECT ("ART_DEF_UNIT_MEMBER_HIGHLANDER2"), "1.4", "ZOffset", "Domain",
("Highlander2.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_WARRIOR");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
SELECT ("ART_DEF_UNIT_MEMBER_HIGHLANDER3"), "1.4", "ZOffset", "Domain",
("Highlander3.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_WARRIOR");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
SELECT ("ART_DEF_UNIT_MEMBER_HIGHLANDER4"), "1.4", "ZOffset", "Domain",
("Highlander4.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_WARRIOR");
EDIT #2: Fixed a couple of typos.
Nutty Jul 27, 2012, 02:50 PM Rob,
Maccabee Scale: I don't know what's going on with the last statements there.
EDIT: Try:
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
SELECT ("ART_DEF_UNIT_MEMBER_HEBREW_SLINGER"), "1.5", "ZOffset", "Domain",
("hebrew_slinger.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_U_INCAN_SLINGER");
[FYI, Nefliqus uses 1.5 scale in his original artdefines.]
Maccabee Sound: Did you try changing WeaponTypeSoundOverrideTag to BOULDER (with WeaponTypeTag set to BULLET)?
Greek Spearmen: I'm not sure... Are you sure you're importing the 4 files into VFS?
Rob (R8XFT) Jul 27, 2012, 03:06 PM Thanks for the help Nutty. I'm trying the Maccabee now and will report back. The files are all imported into VFS and I did try changing the sound to boulder without success, but I'll give it another try once I've sorted the scaling out.
Rob (R8XFT) Jul 27, 2012, 03:37 PM The size now works, so thanks Nutty ;)!!
Still having probs with the slinger's sound and the Heqetai; will experiment further tomorrow.
Nutty Jul 27, 2012, 03:39 PM 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?
Rob (R8XFT) Jul 28, 2012, 02:49 AM 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?
I have indeed. In the units.xml, I've used the tag:
<UnitArtInfo>ART_DEF_UNIT_HEQETAI</UnitArtInfo>
JFD Jul 28, 2012, 04:14 AM Having successfully implemented a unique skin for a unit, I was wondering now how to make said unit use the sounds of its replacement: the Marine.
JJimmyJ Jul 28, 2012, 06:16 AM 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
Nutty Jul 28, 2012, 02:52 PM Having successfully implemented a unique skin for a unit, I was wondering now how to make said unit use the sounds of its replacement: the Marine.
You want the UnitGameplay2DScripts table: Set "UnitType" to your unit, "SelectionSound" to AS2D_SELECT_INFANTRY, and "FirstSelectionSound" to AS2D_BIRTH_INFANTRY.
JFD Jul 28, 2012, 04:26 PM You want the UnitGameplay2DScripts table: Set "UnitType" to your unit, "SelectionSound" to AS2D_SELECT_INFANTRY, and "FirstSelectionSound" to AS2D_BIRTH_INFANTRY.
Thanks very much.
Rob (R8XFT) Jul 29, 2012, 12:36 AM 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).
nokmirt Aug 31, 2012, 09:50 PM 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.
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", "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.
Hypereon Sep 01, 2012, 03:19 AM 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:
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_NATIVES OLDIER"), "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_FLAGBEA RER"), "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_NATIVES OLDIER"), "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_NATIVES OLDIER"), "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_NATIVES OLDIER"), "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_FLAGBEA RER"), "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_FLAGBEA RER"), "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_FLAGBEA RER"), "Scale", "ZOffset", "Domain",
("u_portuguese_bandeirante_flagbearer.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_GREATARTIST_EARLY_FLAGBEARER");
----
Gedemon Sep 01, 2012, 04:35 AM 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.
Sorry, I can't help with that, hopefully someone else have the answer.
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?
When adding entries that are not based on part of another unit (IE all columns have new values), you should use a simple:
INSERT INTO tablename (column1, column2, ...) VALUES ('string1', number, ...);
example:
-- 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 (http://forums.civfanatics.com/showpost.php?p=11486041&postcount=1) and #6 (http://forums.civfanatics.com/showpost.php?p=11641592&postcount=6) of the thread (see here (http://forums.civfanatics.com/showthread.php?t=471942) 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.
Hypereon Sep 01, 2012, 05:21 AM 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. :)
nokmirt Sep 01, 2012, 06:23 AM @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.
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' );
Hypereon Sep 01, 2012, 09:38 AM 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.
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_NATIVE SOLDIER', 7);
-- FLAG
INSERT INTO ArtDefine_UnitInfoMemberInfos (UnitInfoType, UnitMemberInfoType, NumMembers)
VALUES ('ART_DEF_UNIT_PORTUGUESE_BANDEIRANTE', 'ART_DEF_UNIT_MEMBER_PORTUGUESE_BANDEIRANTE_FLAGBE ARER', 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_SECON D'), 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_SECON D'), "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_SECON D'), 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_NATIV ESOLDIER'), 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_NATIV ESOLDIER'), "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_NATIV ESOLDIER'), 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_FLAGB EARER'), 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_FLAGB EARER'), "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_FLAGB EARER'), 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.
Gedemon Sep 01, 2012, 12:31 PM 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
INSERT INTO ArtDefine_UnitInfos (Type, DamageStates, Formation)
VALUES ('ART_DEF_UNIT_PORTUGUESE_BANDEIRANTE', 1, 'HonorableGunpowder');
Hypereon Sep 02, 2012, 04:15 AM you missed the ";" at the end of the first INSERT statement
Edit : and DamageStates have to be defined (when not 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
INSERT INTO ArtDefine_UnitInfos (Type, DamageStates, Formation)
VALUES ('ART_DEF_UNIT_PORTUGUESE_BANDEIRANTE', 1, 'HonorableGunpowder');
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.
Gedemon Sep 02, 2012, 05:30 AM strange, I've done that before (Engineer + workers + Infantries)
nokmirt Sep 02, 2012, 03:46 PM 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.
nokmirt Oct 14, 2012, 02:39 AM 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?
Gedemon Oct 14, 2012, 03:30 AM 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...
nokmirt Oct 14, 2012, 04:42 AM 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...
If someone else knows, I can always fix that problem later. Thanks for posting though, I really appreciate how helpful you've been.
Gedemon, do we have a quick questions about modding thread? Instead of making a whole thread about this.
I'll post the question here and can cut/paste it later, if needs be.
In my scenario, I add several UUs to the civs. At the moment I am working on my map in worldbuilder, placing infrastucture and units. I noticed that my British rifleman units show a settler icon on the map. Is there a way to fix this problem? They should be tagged somehow to a rifleman icon. Thanks for any help.
Ekmek Oct 16, 2012, 12:32 AM If someone else knows, I can always fix that problem later. Thanks for posting though, I really appreciate how helpful you've been.
Gedemon, do we have a quick questions about modding thread? Instead of making a whole thread about this.
I'll post the question here and can cut/paste it later, if needs be.
In my scenario, I add several UUs to the civs. At the moment I am working on my map in worldbuilder, placing infrastucture and units. I noticed that my British rifleman units show a settler icon on the map. Is there a way to fix this problem? They should be tagged somehow to a rifleman icon. Thanks for any help.
is it using the settler icon inthe fxsml file?
nokmirt Oct 16, 2012, 02:18 AM is it using the settler icon inthe fxsml file?
Ah that is interesting. It could be. I'll look into it.
Nutty Oct 16, 2012, 02:28 PM No, the icon settings aren't stored in the .fxsxml. It's in your SQL or XML files.
The Unit Portraits and Unit Icons for the regular map view are defined in the last 4 columns of the Units table. For the default Rifleman icon, you want "UnitFlagIconOffset" to be set to 47 (and "UnitFlagAtlas" should be 'UNIT_FLAG_ATLAS').
For Strategic View, the unit icons are defined in the ArtDefine_StrategicView table. For the default Rifleman icon, you want the "Asset" column to be set to 'SV_Rifleman.dds'
nokmirt Oct 16, 2012, 04:19 PM No, the icon settings aren't stored in the .fxsxml. It's in your SQL or XML files.
The Unit Portraits and Unit Icons for the regular map view are defined in the last 4 columns of the Units table. For the default Rifleman icon, you want "UnitFlagIconOffset" to be set to 47 (and "UnitFlagAtlas" should be 'UNIT_FLAG_ATLAS').
For Strategic View, the unit icons are defined in the ArtDefine_StrategicView table. For the default Rifleman icon, you want the "Asset" column to be set to 'SV_Rifleman.dds'
I got the strategic view straightened out, but not Worldbuilder. No big deal as long as SV has icons that works for me.
Nutty Oct 16, 2012, 04:28 PM I wonder where WB picks up the icon then, if not in one of those 2 places.
nokmirt Oct 16, 2012, 06:56 PM I wonder where WB picks up the icon then, if not in one of those 2 places. Probably where you said, but SV is enough for me. I know some people prefer to play that way.
rf900 Dec 09, 2012, 05:14 AM I am hitting a wall :wallbash:
Added a new slave unit based on the worker, all updates in SQL work fine, I can even add the unit to the game via the LUA tuner, and it works as intended.
But I cannot produce the unit inside the city, it does not appear in the list. Any ideas?
INSERT INTO UnitClasses (Type, Description, MaxGlobalInstances, MaxTeamInstances, MaxPlayerInstances, InstanceCostModifier, DefaultUnit )
SELECT ('UNITCLASS_FASTWORKER'), ('Slave'), MaxGlobalInstances, MaxTeamInstances, MaxPlayerInstances, InstanceCostModifier, ('UNIT_ENGINEER')
FROM UnitClasses WHERE (Type = 'UNITCLASS_WORKER');
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_FASTWORKER'), ('Slave'), Civilopedia, Strategy, Help, Requirements,
Combat, RangedCombat, (250), Moves, Immobile, Range, BaseSightRange, ('UNITCLASS_FASTWORKER'), Special, ('UNITCLASS_FASTWORKER'), CombatClass, Domain, CivilianAttackPriority, ('UNITAI_ENGINEER'), Food, NoBadGoodies, RivalTerritory, MilitarySupport, MilitaryProduction, Pillage, Found, FoundAbroad, CultureBombRadius, GoldenAgeTurns, IgnoreBuildingDefense, PrereqResources, Mechanized, Suicide, CaptureWhileEmbarked, PrereqTech, ObsoleteTech, GoodyHutUpgradeUnitClass, HurryCostModifier, AdvancedStartCost, MinAreaSize, AirUnitCap, NukeDamageLevel, (0), NumFreeTechs, RushBuilding, (50), (5), BaseGold, NumGoldPerEra, SpreadReligion, CombatLimit, RangeAttackOnlyInDomain, RangeAttackIgnoreLOS, RangedCombatLimit, XPValueAttack, XPValueDefense, SpecialCargo, DomainCargo, Conscription, ExtraMaintenanceCost, NoMaintenance, Unhappiness,
('ART_DEF_UNIT_ENGINEER'), UnitArtInfoCulturalVariation, UnitArtInfoEraVariation, ProjectPrereq, SpaceshipProject, LeaderPromotion, LeaderExperience, DontShowYields, ShowInPedia, MoveRate,
UnitFlagIconOffset, PortraitIndex, IconAtlas, UnitFlagAtlas
FROM Units WHERE (Type = 'UNIT_WORKER');
INSERT INTO Unit_AITypes (UnitType, UnitAIType)
SELECT ('UNIT_FASTWORKER'), UnitAIType
FROM Unit_AITypes WHERE (UnitAIType = 'UNITAI_ENGINEER');
INSERT INTO Unit_Flavors (UnitType, FlavorType, Flavor)
SELECT ('UNIT_FASTWORKER'), FlavorType, Flavor
FROM Unit_Flavors WHERE (UnitType = 'UNIT_ENGINEER');
Gedemon Dec 09, 2012, 05:50 AM can't see what's wrong here.
did you change something for the original worker unit ?
rf900 Dec 09, 2012, 07:53 AM No change to the original worker. I have added to test the PrereqTech Agriculture to the slave, the info appears correctly in the Civipedia, but there is no icon for the Slave in the tech tree (maybe the icon does not exist for the worker).
I am going to try and copy another unit, maybe the worker has something special to it.
Edit: Arrgg... Added another warrior and same thing happens, I even tested the sql part separately from the LUA and DLL just in case there was something wrong there. Going to download a unit mod from someone to see what is going on.
Well finally did it with XML and it works, try and find the differences :$
<?xml version="1.0" encoding="utf-8"?>
<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Ed Beach (Firaxis Games) -->
<GameData>
<Units>
<Row>
<Class>UNITCLASS_FASTWORKER</Class>
<Type>UNIT_FASTWORKER</Type>
<Cost>200</Cost>
<Moves>2</Moves>
<Capture>UNITCLASS_FASTWORKER</Capture>
<CivilianAttackPriority>CIVILIAN_ATTACK_PRIORITY_LOW</CivilianAttackPriority>
<Domain>DOMAIN_LAND</Domain>
<DefaultUnitAI>UNITAI_ENGINEER</DefaultUnitAI>
<Description>Slave</Description>
<Civilopedia>TXT_KEY_CIV5_ANTIQUITY_WORKER_TEXT</Civilopedia>
<Strategy>TXT_KEY_UNIT_WORKER_STRATEGY</Strategy>
<Help>TXT_KEY_UNIT_HELP_WORKER</Help>
<AdvancedStartCost>20</AdvancedStartCost>
<WorkRate>100</WorkRate>
<BaseHurry>50</BaseHurry>
<HurryMultiplier>5</HurryMultiplier>
<CombatLimit>0</CombatLimit>
<UnitArtInfo>ART_DEF_UNIT__WORKER</UnitArtInfo>
<UnitArtInfoEraVariation>true</UnitArtInfoEraVariation>
<UnitFlagIconOffset>1</UnitFlagIconOffset>
<PortraitIndex>1</PortraitIndex>
<IconAtlas>UNIT_ATLAS_1</IconAtlas>
</Row>
</Units>
<Unit_AITypes>
<Row>
<UnitType>UNIT_FASTWORKER</UnitType>
<UnitAIType>UNITAI_ENGINEER</UnitAIType>
</Row>
</Unit_AITypes>
<Unit_Flavors>
<Row>
<UnitType>UNIT_FASTWORKER</UnitType>
<FlavorType>FLAVOR_PRODUCTION</FlavorType>
<Flavor>1</Flavor>
</Row>
</Unit_Flavors>
<UnitClasses>
<Row>
<Type>UNITCLASS_FASTWORKER</Type>
<Description>TXT_KEY_UNIT_WORKER</Description>
<DefaultUnit>UNIT_FASTWORKER</DefaultUnit>
</Row>
</UnitClasses>
</GameData>
Lord Olleus Dec 26, 2012, 12:30 PM I am utterly confused, and just wasted 4 hours of my life. I've added a unit in XML which uses the horseman ART_DEFINE and all worked well. Decided to add a new graphic model for the unit that I found on the website.
Firstly, I tried to add the xml by copying the relevant parts of Civ5ArtDefines_Units.xml Civ5ArtDefines_UnitMembers.xml into an XML file in modbuddy and changing the ART_DEFINE names and the granny. That didn't work. I then found this tutorial and saw that to add the xml you used a very long winded version, why is that?
Anyway, I tried to use the SQL method you used here, but it doesn't work, I just get a spearman. The code is:
<!-- skirmish cavalry based on horseman -->
INSERT INTO ArtDefine_UnitInfos (Type,DamageStates,Formation)
SELECT ('ART_DEF_UNIT_SKIRMISH_CAVALRY'), DamageStates, Formation
FROM ArtDefine_UnitInfos WHERE (Type = 'ART_DEF_UNIT_HORSEMAN');
INSERT INTO ArtDefine_UnitInfoMemberInfos (UnitInfoType,UnitMemberInfoType,NumMembers)
SELECT ('ART_DEF_UNIT_SKIRMISH_CAVALRY'), ('ART_DEF_UNIT_MEMBER_SKIRMISH_CAVALRY'), NumMembers
FROM ArtDefine_UnitInfoMemberInfos WHERE (UnitInfoType = 'ART_DEF_UNIT_HORSEMAN');
INSERT INTO ArtDefine_UnitMemberCombats (UnitMemberType, EnableActions, DisableActions, MoveRadius, ShortMoveRadius, ChargeRadius, AttackRadius, RangedAttackRadius, MoveRate, ShortMoveRate, TurnRateMin, TurnRateMax, TurnFacingRateMin, TurnFacingRateMax, RollRateMin, RollRateMax, PitchRateMin, PitchRateMax, LOSRadiusScale, TargetRadius, TargetHeight, HasShortRangedAttack, HasLongRangedAttack, HasLeftRightAttack, HasStationaryMelee, HasStationaryRangedAttack, HasRefaceAfterCombat, ReformBeforeCombat, HasIndependentWeaponFacing, HasOpponentTracking, HasCollisionAttack, AttackAltitude, AltitudeDecelerationDistance, OnlyTurnInMovementActions, RushAttackFormation)
SELECT ('ART_DEF_UNIT_MEMBER_SKIRMISH_CAVALRY'), EnableActions, DisableActions, MoveRadius, ShortMoveRadius, ChargeRadius, AttackRadius, RangedAttackRadius,
MoveRate, ShortMoveRate, TurnRateMin, TurnRateMax, TurnFacingRateMin, TurnFacingRateMax, RollRateMin, RollRateMax, PitchRateMin, PitchRateMax, LOSRadiusScale, TargetRadius, TargetHeight, HasShortRangedAttack, HasLongRangedAttack, HasLeftRightAttack, HasStationaryMelee, HasStationaryRangedAttack, HasRefaceAfterCombat, ReformBeforeCombat, HasIndependentWeaponFacing, HasOpponentTracking, HasCollisionAttack, AttackAltitude, AltitudeDecelerationDistance, OnlyTurnInMovementActions, RushAttackFormation
FROM ArtDefine_UnitMemberCombats WHERE (UnitMemberType = 'ART_DEF_UNIT_MEMBER_HORSEMAN');
INSERT INTO ArtDefine_UnitMemberCombatWeapons (UnitMemberType, "Index", SubIndex, ID, VisKillStrengthMin, VisKillStrengthMax, ProjectileSpeed, ProjectileTurnRateMin, ProjectileTurnRateMax, HitEffect, HitEffectScale, HitRadius, ProjectileChildEffectScale, AreaDamageDelay, ContinuousFire, WaitForEffectCompletion, TargetGround, IsDropped, WeaponTypeTag, WeaponTypeSoundOverrideTag)
SELECT ('ART_DEF_UNIT_MEMBER_SKIRMISH_CAVALRY'), "Index", SubIndex, ID, VisKillStrengthMin, VisKillStrengthMax, ProjectileSpeed, ProjectileTurnRateMin, ProjectileTurnRateMax, HitEffect, HitEffectScale, HitRadius, ProjectileChildEffectScale, AreaDamageDelay, ContinuousFire, WaitForEffectCompletion, TargetGround, IsDropped, WeaponTypeTag, WeaponTypeSoundOverrideTag
FROM ArtDefine_UnitMemberCombatWeapons WHERE (UnitMemberType = 'ART_DEF_UNIT_MEMBER_HORSEMAN');
INSERT INTO ArtDefine_UnitMemberInfos (Type, Scale, ZOffset, Domain, Model, MaterialTypeTag, MaterialTypeSoundOverrideTag)
SELECT ('ART_DEF_UNIT_MEMBER_SKIRMISH_CAVALRY'), Scale, ZOffset, Domain,
('Horseman_England.fxsxml'), MaterialTypeTag, MaterialTypeSoundOverrideTag
FROM ArtDefine_UnitMemberInfos WHERE (Type = 'ART_DEF_UNIT_MEMBER_HORSEMAN');
Any clues? The xml part which creates the new unit stats works fine.
Nutty Dec 26, 2012, 01:31 PM Your intial questions have already been answered in this thread: In short, the civ5artdefines method doesn't work anymore after the pre-G+K patch. You can't just copy the "relevant" parts from the civ5artdefines because they're not relevant to the SQL database, which is what you're changing whether you use XML or SQL. The XML version is "long-winded" because there's a lot of things to add, where the SQL version makes a copy of an existing unit, so you don't need to create all the entries from scratch. [EDIT: That post, assuming you're talking about #9 (http://forums.civfanatics.com/showpost.php?p=11643019&postcount=9), was also showing how to piece together where all the parts of an existing unit can be found as a basis of comparison].
Make sure you are loading the SQL with OnModActivated/UpdateDatabase in the mod properties, and that Add to VFS=true in the file properties for the 4 unit files (the .fxsxml, the .gr2, and the sref/diff .dds's).
Your SQL looks OK at first glance, but you might check the database.log (assuming you've enabled logging).
Lord Olleus Dec 26, 2012, 01:58 PM Thanks for the answer, sort of clears it up in my mind.
Found the bug, it was in the sql code, not anywhere else. Points to anyone who can spot it; rather subtle yet obvious at the same time.
The comment at the top uses XML code, not sql code which would just be -- [comment]
Nutty Dec 26, 2012, 02:12 PM D'oh! I've done that one before.
cool3a2 Dec 30, 2012, 03:18 AM I am currently trying to add a unit as well. Actually, it should be a rather easy example as I'd like to add the austrian hussar as hungarian huszár to my Hungary mod. I know I could just refer to the artdefines of the austrian hussar, but I'd like to have the mod compatible with vanilla civ5. Also, I hope that someday someone will mod me a huszár art, that resembles the traditional hungarian huszár better (see unit request thread), so this is some kind of preparation.
Now, I am not following this tutorial exactly as I can't read out the austrian hussars data as it won't be there for users of vanilla civ5. Also, I'd like to do as much as possible with xml, only the parts that would make my mod non-modular. This ways, all the unit infos are done in xml, while I do the artdefines via SQL. The unit is there in the civilopedia and I can add it via Fire Tuner, but the 3d art is not a hussar, but some tipe of spearman (I don't really play civ5, so I can't say which unit exactly it is). When I started to add the hussar, I did it via xml (non-modular) with the exact same result, so I guess that this issue is not caused by the sql. Also, I couldn't find any error in the logs.
My sql file, reduced to a minimum of attributes inserted according to the xmls of the austrian hussar:
INSERT INTO ArtDefine_UnitMemberCombats (
UnitMemberType, HasShortRangedAttack, HasStationaryMelee,
ReformBeforeCombat
)
VALUES (
( 'ART_DEF_UNIT_MEMBER_U_HUNGARIAN_HUSZAR' ),
( 'ART_DEF_TEMPLATE_MOUNTED_SINGLE' ),
1,
1,
1
);
INSERT INTO ArtDefine_UnitMemberCombatWeapons (
UnitMemberType, WeaponTypeTag, WeaponTypeSoundOverrideTag
)
VALUES (
( 'ART_DEF_UNIT_MEMBER_U_HUNGARIAN_HUSZAR' ),
( 'BULLET' ),
( 'BULLET' )
);
INSERT INTO ArtDefine_UnitMemberInfos (
Type, Scale, Granny, MaterialTypeTag, MaterialTypeSoundOverrideTag
)
VALUES (
( 'ART_DEF_UNIT_MEMBER_U_HUNGARIAN_HUSZAR' ),
0.12,
( 'u_austrian_hussar.fxsxml' ),
( 'CLOTH' ),
( 'FLESH' )
);
INSERT INTO ArtDefine_UnitInfos (
Type, DamageStates, Formation
) VALUES (
( 'ART_DEF_UNIT_U_HUNGARIAN_HUSZAR' ),
1,
( 'DefaultCavalry' )
);
INSERT INTO ArtDefine_UnitInfoMemberInfos (
UnitInfoType,UnitMemberInfoType,NumMembers
)
VALUES (
( 'ART_DEF_UNIT_U_HUNGARIAN_HUSZAR' ),
( 'ART_DEF_UNIT_MEMBER_U_HUNGARIAN_HUSZAR' ),
5
);
The civ5units_Hungary file which corresponds to the austrian hussars entry:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 29.11.2012 14:39:48 -->
<GameData>
<!-- TODO: Insert table creation example here. -->
<!-- TODO: Insert table data example here.-->
<!-- Enter your Game Data here. -->
<Units>
<Row>
<Class>UNITCLASS_CAVALRY</Class>
<Type>UNIT_HUNGARIAN_HUSZAR</Type>
<PrereqTech>TECH_MILITARY_SCIENCE</PrereqTech>
<Combat>34</Combat>
<Cost>225</Cost>
<Moves>5</Moves>
<CombatClass>UNITCOMBAT_MOUNTED</CombatClass>
<Domain>DOMAIN_LAND</Domain>
<DefaultUnitAI>UNITAI_FAST_ATTACK</DefaultUnitAI>
<Description>TXT_KEY_UNIT_HUNGARIAN_HUSZAR</Description>
<Civilopedia>TXT_KEY_CIV5_HUNGARIAN_HUSZAR_TEXT</Civilopedia>
<Strategy>TXT_KEY_UNIT_HUNGARIAN_HUSZAR_STRATEGY</Strategy>
<Help>TXT_KEY_UNIT_HELP_HUNGARIAN_HUSZAR</Help>
<MilitarySupport>true</MilitarySupport>
<MilitaryProduction>true</MilitaryProduction>
<Pillage>true</Pillage>
<ObsoleteTech>TECH_COMBUSTION</ObsoleteTech>
<IgnoreBuildingDefense>true</IgnoreBuildingDefense>
<GoodyHutUpgradeUnitClass>UNITCLASS_WWI_TANK</GoodyHutUpgradeUnitClass>
<AdvancedStartCost>30</AdvancedStartCost>
<XPValueAttack>3</XPValueAttack>
<XPValueDefense>3</XPValueDefense>
<UnitArtInfo>ART_DEF_UNIT_U_HUNGARIAN_HUSZAR</UnitArtInfo>
<UnitFlagAtlas>EXPANSION_UNIT_FLAG_ATLAS</UnitFlagAtlas>
<UnitFlagIconOffset>8</UnitFlagIconOffset>
<IconAtlas>EXPANSION_UNIT_ATLAS_1</IconAtlas>
<PortraitIndex>8</PortraitIndex>
<MoveRate>QUADRUPED</MoveRate>
</Row>
</Units>
<Unit_AITypes>
<Row>
<UnitType>UNIT_HUNGARIAN_HUSZAR</UnitType>
<UnitAIType>UNITAI_DEFENSE</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_HUNGARIAN_HUSZAR</UnitType>
<UnitAIType>UNITAI_FAST_ATTACK</UnitAIType>
</Row>
</Unit_AITypes>
<Unit_ClassUpgrades>
<Row>
<UnitType>UNIT_HUNGARIAN_HUSZAR</UnitType>
<UnitClassType>UNITCLASS_WWI_TANK</UnitClassType>
</Row>
</Unit_ClassUpgrades>
<Unit_Flavors>
<Row>
<UnitType>UNIT_HUNGARIAN_HUSZAR</UnitType>
<FlavorType>FLAVOR_OFFENSE</FlavorType>
<Flavor>20</Flavor>
</Row>
<Row>
<UnitType>UNIT_HUNGARIAN_HUSZAR</UnitType>
<FlavorType>FLAVOR_DEFENSE</FlavorType>
<Flavor>12</Flavor>
</Row>
<Row>
<UnitType>UNIT_HUNGARIAN_HUSZAR</UnitType>
<FlavorType>FLAVOR_MOBILE</FlavorType>
<Flavor>14</Flavor>
</Row>
</Unit_Flavors>
<Unit_FreePromotions>
<Row>
<UnitType>UNIT_HUNGARIAN_HUSZAR</UnitType>
<PromotionType>PROMOTION_NO_DEFENSIVE_BONUSES</PromotionType>
</Row>
<Row>
<UnitType>UNIT_HUNGARIAN_HUSZAR</UnitType>
<PromotionType>PROMOTION_CAN_MOVE_AFTER_ATTACKING</PromotionType>
</Row>
<Row>
<UnitType>UNIT_HUNGARIAN_HUSZAR</UnitType>
<PromotionType>PROMOTION_CITY_PENALTY</PromotionType>
</Row>
<Row>
<UnitType>UNIT_HUNGARIAN_HUSZAR</UnitType>
<PromotionType>PROMOTION_EXTRA_SIGHT_I</PromotionType>
</Row>
<Row>
<UnitType>UNIT_HUNGARIAN_HUSZAR</UnitType>
<PromotionType>PROMOTION_FLANK_ATTACK_BONUS</PromotionType>
</Row>
</Unit_FreePromotions>
<Unit_ResourceQuantityRequirements>
<Row>
<UnitType>UNIT_HUNGARIAN_HUSZAR</UnitType>
<ResourceType>RESOURCE_HORSE</ResourceType>
</Row>
</Unit_ResourceQuantityRequirements>
</GameData>
I tried to use the austrian hussars fxsxml as well as using an altered version of that with renamed animation files and textures - no difference. Also, I set the VFS property to true for any artfile and the database is set to be updated with the sql on mod activation.
Besides of the said issue, I have a couple of questions. Might be noob questions since I just started to mod civ5:
1. There is no column called Defaults for the Combat table, however, there is the following line in the unitmembers.xml:
<Defaults>ART_DEF_TEMPLATE_MOUNTED_SINGLE</Defaults>
What does it do and how could I simulate it via sql?
2. Currently, I am reusing the button of the austrian hussar. For temporary use, I'd like to get the button separated to deliver it with my mod as vanilla civ5 won't have the button. I found the atlas files, but it seems chaotic. I suppose it is encrypted. Is that right or is there some way to get the button separated?
3. Is it possible to add unique unit art without adding a unique unit? There is cool modern unit art by Danrell, but I don't want to add another unique unit for each of them. -> found it a few pages back in this thread
4. If I got things right, you encapsulate strings in brackets in the sql file. Is that required or optional`Never seen this style before although I've studied computer sciences.
5. In terms of sql dialect, what type of sql database is used by civ5? Without being familiar with MySQL, I'd suppose this is one as it would be free to use. -> SQLite
cool3a2 Dec 30, 2012, 09:53 AM Okay, I figured out how to fix my main issue. There was a message in the logs indicating the problem, but as it looked harmless and did not refer to my file, I did not notice it. The reason was, that although I had removed the column name for the Defaults value (ArtDefine_UnitMemberCombats), but left the value to be inserted there. Thus, I tried to insert 5 values into 4 columns which was roughly the error message in the log. Also, I did not provide the Index and SubIndex Columns (ArtDefine_UnitMemberCombatWeapons), which I now do using "Index" and "SubIndex". Finally, I changed the order of the statements a bit, not sure if that plays a role, but I could imagine that.
2 of the 5 additional questions are also answered for me, now, yet I'd still be curious to now about the others. And I'd like to add that although I was able to find the databases and look them up according to the Modders Guide, I noticed that there are no entries about the data coming with my mod or even Gods and Kings. For example, there are units and also unique units, but there is no hussar, not even the austrian. Couldn't find the Hun units either, actually not even the Civs are there. On the other side, the db files partially seem to get a fresh change date. Are there more files elsewhere for G&K or am I doing something wrong?
trystero49 Dec 30, 2012, 10:39 AM There are separate folders for DLC files. For example, Vanilla xml files are in Assets/Gameplay/XML, DLC files for Vanilla are in Assets/DLC/DLC01 (or 02, 03, etc). Base .xml files for G&K are in Assets/DLC/Expansion/Gameplay/XML, and updated DLC files for G&K can be found in Assets/DLC/Expansion/DLC/DLC01 (or 02, 03, etc).
In other words, you might as well just look at the db debug file and save yourself the trouble of searching through all the folders trying to find what you want, unless you are looking to copy large amounts of the files, or you are looking for something that hasn't loaded in your db file (for example, you want to find information on a scenario).
cool3a2 Dec 30, 2012, 01:10 PM Ah... I see it's the Civ5DebugDatabase.db file and the screen to view the db tables has more than just one page. Thanks for pointing me in the right direction!
Nutty Dec 30, 2012, 04:46 PM @cool3a2:
I'm not sure what your point is in using XML over SQL for some things and not others; either way, you're making changes to a SQL database. I would find it easier to use SQL to make a copy of a vanilla cavalry unit as a starting point (since you don't want to assume Austria is present).
If you're trying to maintain compatibility with G+K and vanilla, realize that the columns differ in the Units table.
1. There is no column called Defaults for the Combat table, however, there is the following line in the unitmembers.xml: <Defaults>ART_DEF_TEMPLATE_MOUNTED_SINGLE</Defaults>
What does it do and how could I simulate it via sql?
2. Currently, I am reusing the button of the austrian hussar. For temporary use, I'd like to get the button separated to deliver it with my mod as vanilla civ5 won't have the button. I found the atlas files, but it seems chaotic. I suppose it is encrypted. Is that right or is there some way to get the button separated?
...
4. If I got things right, you encapsulate strings in brackets in the sql file. Is that required or optional`Never seen this style before although I've studied computer sciences.
...
1. AFAIK, you can't take advantage of those templates, but for Firaxis they provide default entries for unit types so all entries don't need to be redefined for every unit. Obviously, you're going to have a problem using the files that you posted because you're missing all of the entries that such a template would have provided. As above, I would suggest you copy a vanilla unit (using a INSERT INTO... SELECT) as a starting point and only make the necessary changes.
2. Use DDS unpacker (http://forums.civfanatics.com/showthread.php?t=389316). It will convert the files (filename.dds and filename-index.dds) to PNG, which can be modified and exported back to a single DDS file for use in your mod.
3.
4. It's not required, it just makes it easier to tell which entries are being changed (i.e., where it's not just the name of the column). EDIT: See Gedemon's post #121 below.
5.
cool3a2 Dec 31, 2012, 03:08 AM I'm not sure what your point is in using XML over SQL for some things and not others; either way, you're making changes to a SQL database. I would find it easier to use SQL to make a copy of a vanilla cavalry unit as a starting point (since you don't want to assume Austria is present).
I don't see the point either, but it seems to me that I'm somewhat forced to. I don't think that sql is a that clever solution. It's not a problem for me as I am used to work with sql in business live. But for starters, sql will be harder. To use sql, you'll need to have a clue about the tables being used internally and you have to write a lot syntactic suggar. This ways, I did as much as possible with xml, to keep things as easy as possible for others. Yet I was forced to use sql to have the artdefines modular (at least, the tutorial here sounds like those artdefines files are still not modular, which is also supported by the modders guide).
If you're trying to maintain compatibility with G+K and vanilla, realize that the columns differ in the Units table.
Hmmm... I was hoping that this would not be the case. Well, maybe I create two separate versions of the mod as I suppose there is no chance to tell the game "use this file if you are vanilla civ5 or this if you are G&K"... I see another possible advantage of xml here as looking them up and comparing them is easier then checking the tables, I'd say, at lost for most people.
1. AFAIK, you can't take advantage of those templates, but for Firaxis they provide default entries for unit types so all entries don't need to be redefined for every unit. Obviously, you're going to have a problem using the files that you posted because you're missing all of the entries that such a template would have provided. As above, I would suggest you copy a vanilla unit (using a INSERT INTO... SELECT) as a starting point and only make the necessary changes.
Which is a downside of the sql approach. Well, I figured that out myself meanwhile and looked up the table for the austrian hussar to see which values are set. I'm now setting these values manually as I don't consider the solution of reusing an existing unit that good as you really rely on it. Consider a scenario mod where the cavalry has been removed (maybe even via a new artdefine xml). Don't get me wrong: I don't want to critize you guys for suggesting it here, it may suit a lot of cases. Still, I don't want to restrict myself on this.
2. Use DDS unpacker. It will convert the files (filename.dds and filename-index.dds) to PNG, which can be modified and exported back to a single DDS file for use in your mod.
Okay, thank you!
4. It's not required, it just makes it easier to tell which entries are being changed (i.e., where it's not just the name of the column).
Okay.
Gedemon Dec 31, 2012, 09:37 AM I've finally taken the time to update the first post to the post-patch .674 method. :D
XML can be used to update the tables of course, but then you can't use a template unit for reference.
The bracket syntax is required for the code using a template like
INSERT INTO table_name (column1, column2, column3,...)
SELECT ('newValue'), value2, value3,...
FROM table_name WHERE (column1= 'templateName');
it's not needed for "manual" entries like
INSERT INTO table_name (column1, column2, column3,...)
VALUES (value1, value2, value3,...);
cool3a2 Jan 01, 2013, 03:06 AM I know that xml can be used, but will the artdefines files be modular? According to the modders guide, they can't be made modular. Well, the modders guide may be obsolete. Although it is helpful, it should be made clear if it contains information that are incorrect now...
As of sql vs. xml, I don't see the big advantage. If you prefer to use sql, it is of course your decision. But practically, using the sql approach makes you rely on another unit. Even if the artdefines files should be modular now, it would likely be possible to delete entries from there as well. As said before, if there is a mod that removes your template unit, your mod won't work anymore as the select will fail or deliver an empty result (null). And as I said before, sql will be harder for absolute beginners to mod as the internal tables are harder to look up and understand (not to mention sql itself). With xml, however, you can simply copy defines from a different unit (there's your template) and likely even reuse the templates that Firaxis provided with the Defaults entry (even another template you could reuse). Also, you'll have to write less code as most of the xml will be copied, only a few values will be altered. In contrast to that, one will have to write a lot of sql to mod in a unit that should not reuse another unit to not rely on it. And the sql will be 'error-friendly', just consider one accidently swaps two columns. So, my opinion is, that xml would be the better and cleaner solution and I'd switch to it if the artdefines should be modular now. Also, if they should be now, I'd be happy if you could describe both ways as alternative approaches, mentioning their pros and cons.
Having checked the austrian hussar and whether there are entries in its xmls that have been introduced with G&K, there does not some to be any new entry. The only two differences are that the flanking promotion wasn't there before G&K and the cavalry was upgraded to tank, not wwi_tank. So, if there are differences between the db tables (which I didn't check), they are handled by some code, which would be another advantage of xml. On the other side, the hussar might be a special case if it does not use any of the new entries.
EDIT: and thanks for explaining the brackets. I'll remove them then.
Gedemon Jan 01, 2013, 07:37 AM I know that xml can be used, but will the artdefines files be modular? According to the modders guide, they can't be made modular. Well, the modders guide may be obsolete. Although it is helpful, it should be made clear if it contains information that are incorrect now...
Thanks, I've edited the first post here to reflect the change from patch .674 : the artdefine files are now "modular" (read: they are loaded in the database) and you can't override the 2 original files anymore.
Adding new entries is done using the SQL or XML syntax used to modify tables.
As of sql vs. xml, I don't see the big advantage. If you prefer to use sql, it is of course your decision. But practically, using the sql approach makes you rely on another unit. Even if the artdefines files should be modular now, it would likely be possible to delete entries from there as well. As said before, if there is a mod that removes your template unit, your mod won't work anymore as the select will fail or deliver an empty result (null). And as I said before, sql will be harder for absolute beginners to mod as the internal tables are harder to look up and understand (not to mention sql itself). With xml, however, you can simply copy defines from a different unit (there's your template) and likely even reuse the templates that Firaxis provided with the Defaults entry (even another template you could reuse). Also, you'll have to write less code as most of the xml will be copied, only a few values will be altered. In contrast to that, one will have to write a lot of sql to mod in a unit that should not reuse another unit to not rely on it. And the sql will be 'error-friendly', just consider one accidently swaps two columns. So, my opinion is, that xml would be the better and cleaner solution and I'd switch to it if the artdefines should be modular now. Also, if they should be now, I'd be happy if you could describe both ways as alternative approaches, mentioning their pros and cons.
Right for some points, I have also edited the first post to add a warning about the use of template in case the unit we copy data from is deleted by another mod.
I disagree on the "less code" and "cleaner" parts.
About "less code" the point of the template being to copy all the values, and, when fully optimized like in R.E.D. Modpack (http://forums.civfanatics.com/showthread.php?t=383375) it saves a lot of time when you deal with a lot of units. For that mod, I just need one line of code to add a new unit. Yes, a single line.
About cleaner, it's also about optimization and formatting, see here (http://forums.civfanatics.com/showthread.php?t=437370).
About easier, that's true I suppose, especially when coming from Civ4 modding, once the concept of updating the database using the XML file instead of replacing (or adding code to) another one is grasped. Note that it's slightly different from modular loading (IIRC modular XML from civ4).
Having checked the austrian hussar and whether there are entries in its xmls that have been introduced with G&K, there does not some to be any new entry. The only two differences are that the flanking promotion wasn't there before G&K and the cavalry was upgraded to tank, not wwi_tank. So, if there are differences between the db tables (which I didn't check), they are handled by some code, which would be another advantage of xml. On the other side, the hussar might be a special case if it does not use any of the new entries.
EDIT: and thanks for explaining the brackets. I'll remove them then.
The new entries are in CIV5Units_Expansion.xml (search in assets\DLC\Expansion folder)
edit:
And the art defines files are in \Assets\DLC\Expansion\Units folder.
Note that DLC' XML files (and G+K) are not loaded the same way as mod's XML files. They are loaded during the game initialization, before the main menu is visible, and using a truly modular method I suppose.
cool3a2 Jan 01, 2013, 09:11 AM Thanks, I've edited the first post here to reflect the change from patch .674 : the artdefine files are now "modular" (read: they are loaded in the database) and you can't override the 2 original files anymore.
Thanks, then I'll switch back to xml.
As of pros and cons, I suppose it is a matter of what the modder wants to do and of course, of personal taste. I am working on a mod adding a single civ that should be as compatible as possible as it is likely to be combined with others. Thus, relying on other units should be limited. Having said this, adding the huszár via sql felt rather unhandy. R.E.D. is a modpack used for larger mods where people know what they do anyways and that introduces some kind of standard that makes sure that certain units are there. In this case, I can imagine that sql might be handier. Well, at least the two approaches don't seem to be incompatible per-se, so everyone can use what he prefers.
As of the changes regarding the entries introduced with G&K, I was refering to Nuttys post. I know where to find the files, I meant that I couldn't find so much differences between the old and the new xmls structures. Promotions and units, as well as some other definitions are missing, yet I didn't spot any structural differences, at least as far as it touchs my mod.
However, I have problems like the hussar should upgrade to tank for vanilla civ5, but to wwi_tank for G&K. I was able to solve this certain issue by using a short sql script to dynamically correct the upgrade definitions, but it's rather ugly. It would be cool if the version / DLC used could be determined somehow via sql to make a few manual corrections. Unfortunately, I could not find any table providing the necessary information. Also, some kind of script lanugae wourd be required. Kaels modders Guide suggests that loops can be used in the sql files, but they produced errors for me. I suppose something got mixed up with the lua part of the tutorial. So, I guess I have to create to separate mods for vanilla and G&K.
Gedemon Jan 01, 2013, 10:37 AM Well, at least the two approaches don't seem to be incompatible per-se, so everyone can use what he prefers.
exactly.
As of the changes regarding the entries introduced with G&K, I was refering to Nuttys post. I know where to find the files, I meant that I couldn't find so much differences between the old and the new xmls structures. Promotions and units, as well as some other definitions are missing, yet I didn't spot any structural differences, at least as far as it touchs my mod.
it's because of this:
Note that DLC' XML files (and G+K) are not loaded the same way as mod's XML files. They are loaded during the game initialization, before the main menu is visible, and using a truly modular method I suppose.
More precisely, for unit stats the XML syntax is the same to what you'll use to add a new unit, but for artdefine they use a parser that is not the one used for mods.
example, in Civ5ArtDefines_Expansion_Units.xml you have entry like that:
<UnitArtInfos>
<!-- UNIT_GREAT_ADMIRAL ************************************************ -->
<UnitArtInfo>
<Type>ART_DEF_UNIT_GREAT_ADMIRAL</Type>
<Formation>DefaultCavalry</Formation>
<DamageStates>1</DamageStates>
<UnitMemberArt>
<MemberType>ART_DEF_UNIT_MEMBER_GREAT_ADMIRAL</MemberType>
<MemberCount>1</MemberCount>
</UnitMemberArt>
</UnitArtInfo>
[...]
</UnitArtInfos>
But this code used in a mod will fail.
First it doesn't tell the parser to update a table by starting with
<GameData>
<TableName>
<Row>
And if you add the correct code note that the table a mod must update is not UnitArtInfos or UnitArtInfo but ArtDefine_UnitInfo and then that there is no Type column in that table, but UnitInfoType, there is no Formation column in that table (it's in another one), UnitMemberArt is unknown for the database, and the 2 sub-tags MemberType and MemberCount are respectively UnitMemberInfoType and NumMembers in the DB...
cool3a2 Jan 01, 2013, 12:08 PM Yeah, just figured that out myself... It seems like not even the templates work exactly like one would expect. I looked up the template the austrian hussar uses, which uses another template, which then again uses a template. If I merge all the attributes from all three templates, the EnableActions column will differ from what the austrian hussar actually has in the db. Also, the templates contain a DeathRotationAmount, which is nowhere in the db, it seems. Well, if a db could be maintained that contains all the artdefines in a clean - e.g. translated - form, things would be easier via xml, I believe. Requiring beginners to translate the templates and the column and table names will be over the top for much of them. This ways, your method gains some attraction although I still prefer it the xml way as it is independent and will be a bit easier to read if modmodded. Hell, they truely didn't make it really beginner friendly.
Nutty Jan 02, 2013, 04:02 PM Hell, they truely didn't make it really beginner friendly.
It's not really that hard; I think it's only hard for those coming from Civ4 modding. The trick is to completely ignore the game's XML files, and just look at the database itself with a db viewer (e.g., SQLite Manager for Firefox (https://addons.mozilla.org/en-us/firefox/addon/sqlite-manager/) or SQLite Administrator (http://sqliteadmin.orbmu2k.de/) or SQLite Browser (http://sqlitebrowser.sourceforge.net/) or SQLiteSpy (http://www.yunqa.de/delphi/doku.php/products/sqlitespy/index)).
From there you can use either SQL or XML to make changes.
bouncymischa Jan 03, 2013, 09:01 AM Yeeesh... as a total newbie to Civ modding, I've finally gotten to the point where I want to try to start adding some of the unique unit art people have developed to make UU's for some of my new civilizations and mods... but the hurdle looks intimidatingly high. D:
So far I've been using XML to make my UUs and the like, and I've been able to port over units that other people have used in their mods and get them working (finally! It took me forever to figure out which files need VFS set to true and such...), but the next step of adding new art defines to my own units is rather confusing. Since my current plans do rely on existing units (typically tanks and infantry) I should be able to use the SQL method for that, and just rely on my XML code to refer to those artdefines...?
I think I'll need to reread Gedemon's post to figure out which parts I need to add to set up the artdefines, and which parts I don't (since I'm using XML for the unit statistics and such)...
Gedemon Jan 03, 2013, 09:15 AM in the updated OP, step 4 is for the art defines, step 5 is for the stats.
if you already have the stats working in XML, skip step 5, just make sure you've set the <UnitArtInfo> tag of your unit's XML definition to point to the art define type you're using in step 4 (ART_DEF_UNIT_BIPLAN in the OP example).
bouncymischa Jan 03, 2013, 09:31 AM Ahhh, I see! I wasn't sure how dependent it was on having part 5 in SQL. Thinking about it, though, some of the units I ported over did do the same thing -- stats in XML with the artdefines in SQL -- so it does make sense that it'd work that way.
Now I just need to figure out which units some models use as a base -- I want to try adding new units using the British Whippet and the Railroad Artillery models, but I'm not sure if they're based on Tanks or one of the other units...
Thanks for the help, Gedemon!
Pazyryk Jan 03, 2013, 10:31 AM @Gedemon,
You can do the Step 4 SQL in a more elegant way without listing all the column names that you aren't changing anyway. Here's how I did it for my new Druid unit, which is based on the barb euro alpha (the guy with the deer horns) model:
INSERT INTO ArtDefine_UnitInfos (Type, DamageStates, Formation)
SELECT 'ART_DEF_UNIT_EA_DRUID', 1, '' ;
INSERT INTO ArtDefine_UnitInfoMemberInfos (UnitInfoType, UnitMemberInfoType, NumMembers)
SELECT 'ART_DEF_UNIT_EA_DRUID', 'ART_DEF_UNIT_MEMBER_EA_DRUID', 1 ;
CREATE TABLE ArtDefine_UnitMemberInfos_Temp AS SELECT * FROM ArtDefine_UnitMemberInfos WHERE Type IN ('ART_DEF_UNIT_MEMBER_BARBARIAN_EURO_ALPHA'); --add any other members in the parentheses separated by commas
UPDATE ArtDefine_UnitMemberInfos_Temp SET Type = 'ART_DEF_UNIT_MEMBER_EA_DRUID', Scale = 0.25, Model = 'your_new_model.fxsxml' WHERE Type = 'ART_DEF_UNIT_MEMBER_BARBARIAN_EURO_ALPHA';
--update additional members here
INSERT INTO ArtDefine_UnitMemberInfos SELECT * FROM ArtDefine_UnitMemberInfos_Temp;
DROP TABLE ArtDefine_UnitMemberInfos_Temp;
CREATE TABLE ArtDefine_UnitMemberCombats_Temp AS SELECT * FROM ArtDefine_UnitMemberCombats WHERE UnitMemberType IN ('ART_DEF_UNIT_MEMBER_BARBARIAN_EURO_ALPHA');
UPDATE ArtDefine_UnitMemberCombats_Temp SET UnitMemberType = 'ART_DEF_UNIT_MEMBER_EA_DRUID' WHERE UnitMemberType = 'ART_DEF_UNIT_MEMBER_BARBARIAN_EURO_ALPHA';
INSERT INTO ArtDefine_UnitMemberCombats SELECT * FROM ArtDefine_UnitMemberCombats_Temp;
DROP TABLE ArtDefine_UnitMemberCombats_Temp;
CREATE TABLE ArtDefine_UnitMemberCombatWeapons_Temp AS SELECT * FROM ArtDefine_UnitMemberCombatWeapons WHERE UnitMemberType IN ('ART_DEF_UNIT_MEMBER_BARBARIAN_EURO_ALPHA');
UPDATE ArtDefine_UnitMemberCombatWeapons_Temp SET UnitMemberType = 'ART_DEF_UNIT_MEMBER_EA_DRUID' WHERE UnitMemberType = 'ART_DEF_UNIT_MEMBER_BARBARIAN_EURO_ALPHA';
INSERT INTO ArtDefine_UnitMemberCombatWeapons SELECT * FROM ArtDefine_UnitMemberCombatWeapons_Temp;
DROP TABLE ArtDefine_UnitMemberCombatWeapons_Temp;
I was using existing unit art in the above code, but the blue text shows where the model would be updated. The first line of each of the last three sections creates a temp table with the exact structure of the base table (without enumerating columns yourself). Perhaps it's unlikely, but if Firaxis ever changes a column name or adds a column with some essential data (say in the next expansion) then you would need to update your columns if you list them. This method will not need an update.
One thing I'm not sure is correct is my use of an empty string for Formation. I did that because a lot of these appear to be blank but not NULL in the existing database (and it worked for my single unit graphic here).
Nutty Jan 03, 2013, 02:29 PM ...creates a temp table with the exact structure of the base table (without enumerating columns yourself).
Hm. Something similar should probably be the method for the Units table as well, to allow compatibility with both vanilla and G+K (assuming G+K specific columns aren't required for the unit in question).
Gedemon Jan 03, 2013, 04:27 PM More elegant, yes, but more difficult to grasp for a beginner maybe :think:
I like it anyway, I'll add a second post with your method when I got some time :D
And if someone has a XML template for the ArtDefines, I'll add it to the thread too.
Nutty Jan 03, 2013, 06:10 PM And if someone has a XML template for the ArtDefines, I'll add it to the thread too.
From whoward69's "Units - Galleon (GK) (v 2)":
<?xml version="1.0" encoding="utf-8"?>
<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 while I'm at it...
<?xml version="1.0" encoding="utf-8"?>
<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>
<Update>
<Where Class="UNITCLASS_FRIGATE"/>
<Set ObsoleteTech="TECH_STEAM_POWER"/>
</Update>
<Update>
<Where Type="UNIT_IRONCLAD"/>
<Set>
<CombatClass>UNITCOMBAT_NAVALRANGED</CombatClass>
<Cost>300</Cost>
<Combat>45</Combat>
<RangedCombat>50</RangedCombat>
<Range>2</Range>
<ObsoleteTech>TECH_ELECTRONICS</ObsoleteTech>
</Set>
</Update>
</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>
<Delete UnitType="UNIT_IRONCLAD" UnitAIType="UNITAI_ATTACK_SEA"/>
<Row>
<UnitType>UNIT_IRONCLAD</UnitType>
<UnitAIType>UNITAI_ASSAULT_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>
<Row>
<UnitType>UNIT_IRONCLAD</UnitType>
<PromotionType>PROMOTION_ONLY_DEFENSIVE</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>
<Update>
<Where UnitType="UNIT_FRIGATE"/>
<Set UnitClassType="UNITCLASS_IRONCLAD"/>
</Update>
<Update>
<Where UnitType="UNIT_ENGLISH_SHIPOFTHELINE"/>
<Set UnitClassType="UNITCLASS_IRONCLAD"/>
</Update>
<Update>
<Where UnitType="UNIT_IRONCLAD"/>
<Set UnitClassType="UNITCLASS_BATTLESHIP"/>
</Update>
</Unit_ClassUpgrades>
<Unit_ResourceQuantityRequirements>
<Row>
<UnitType>UNIT_GALLEON</UnitType>
<ResourceType>RESOURCE_IRON</ResourceType>
</Row>
<Row>
<UnitType>UNIT_DESTROYER</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>
<Update>
<Where Tag="TXT_KEY_UNIT_HELP_CARAVEL"/>
<Set Text="Fast Medieval exploration Unit with a large sight radius."/>
</Update>
<Update>
<Where Tag="TXT_KEY_UNIT_IRONCLAD_STRATEGY"/>
<Set>
<Text>Ironclads are the first steam-powered warships available. Fighting as a naval ranged unit, they are harder to kill than any sailing vessel, and their Combat strength is higher. Use them primarily for in-shore defense and to assault cities.</Text>
</Set>
</Update>
<Update>
<Where Tag="TXT_KEY_UNIT_HELP_IRONCLAD"/>
<Set>
<Text>A very powerful naval ranged unit, the Ironclad pays for its strength by being slower in ocean tiles.</Text>
</Set>
</Update>
</Language_en_US>
</GameData>
<?xml version="1.0" encoding="utf-8"?>
<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>
bouncymischa Jan 03, 2013, 06:19 PM Hrm.... so, not sure if I should ask some more specific questions here or not!
So I've been looking over the art files from the Tiny Death Robots mod, which has the same entries as Gedemon's SQL file but in XML format. However, I can't really copy over the appropriate information for a Tank since the data in the Civ 5 artdefines is all arranged differently. (I think one of the earlier posts discussed this, saying that Civ V goes and rearranges the artdefines data while its loading the game...) Still, it's helping me figure out some of the data I want to change in the SQL, such as the number of members in the unit.
The big question currently on my mind, though, is what happens if I change the attack data? I'm currently trying to add the Railroad Artillery to my game, which is apparently designed to use the Tank data. That's fine, I can just use the SQL code to copy of the data... however, I designed my Railroad Artillery as an artillery unit, giving it a ranged attack. Units like Artillery and the Anti-Tank Gun have "<HasLongRangedAttack>1</HasLongRangedAttack>", but the Tank doesn't. Is the code going to break if I try to make an artillery attack with my Railroad Artillery if it doesn't have the HasLongRangedAttack tag? If I add the tag, is the model going to break if I try to make a ranged attack with it? Or does it really matter, since the Anti-Tank Gun is a melee unit, and still has the tag...?
whoward69 Jan 04, 2013, 04:26 AM From whoward69's "Units - Galleon (GK) (v 2)"
Beat me to it :)
fuzzy_bunnies Jan 13, 2013, 11:11 PM I'm trying to follow along here and having a hard time... I'm adding about 10 new units into a stand-alone mod. I have all the abilities, tech requirements, stats etc all set in XML but when using another existing unit's <UnitArtInfo> line in civ5units, the unit doesn't show up. If I create a unitartinfo entry in xml, then the unit shows up but everything looks like spearmen.
I would really prefer to use XML if at all possible. I don't have a TON of units to add in but XML makes a lot more sense to me.
So with the current patch and G&K, after creating the unitinfo files and the unitclass, can I create a new unitartinfo file with just my addition or no? Or can I not do it with XML? Alternately, is there an XML version of this tutorial thats up to date?
Nutty Jan 14, 2013, 06:29 PM @fuzzy_bunnies: See the first spoiler in post #134.
fuzzy_bunnies Jan 17, 2013, 09:01 AM Thanks, I'll take a closer look though that seems to imply you need new info in all of those tables but I'm not sure thats the case?
Second question: I understand its possible to mix units via unitartinfos but does anyone know if you can assign normally non-combat models that way? For example, I want to make some civilian militia, I want to use the worker model and the combat animations... is that possible? OR mix some riflemen and some workers etc.
I'm trying to figure out if that's one of the reasons for the spearmen? Or possibly cause the custom units file to not load at all? Currently I'm trying to track down something thats causing none of my units to load by eliminating entries. I've narrowed it down to a couple that seem to break the mod.
Gedemon Jan 17, 2013, 09:31 AM I think that you can't use combat animation on a civilian models without exporting/editing the .gr2 file, but you can mix civilian and military models in the same unit.
Edit: I've added Whoward69' Galleon XML code to the second post, thanks !
Pazyryk Jan 17, 2013, 10:29 AM 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.)
fuzzy_bunnies Jan 20, 2013, 07:04 PM 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:
<!-- ********************************************** -->
<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!
whoward69 Jan 21, 2013, 03:49 AM I can post the whole thing if needed:
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)
CoDazle Apr 27, 2013, 03:21 PM 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.
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');
whoward69 Apr 27, 2013, 03:30 PM 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
Zaelon May 01, 2013, 03:12 PM 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
Zaelon May 03, 2013, 11:48 AM 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 !
|
|