Add a new unit in the game (using SQL)

[I haven't tested it, but at least one problem appears to be that] you also need to revise Lua\RedDefinesUnits.lua to allow each civ to build the cavalry.

EDIT:
Add ", CAVALRY" to each civ, e.g.:
Spoiler :
Code:
Lg_Major_Units = {
	[FRANCE] = {
		FR_INFANTRY, FR_LEGION,
		FR_R35, FR_R40, FR_H35, FR_H39,
		FR_S35, FR_B1, FR_ARL_44,
		FR_MB152, FR_D520, FR_POTEZ630,
		FR_LN401, FR_AMIOT350,
		FR_FANTASQUE, FR_GALISSONIERE, FR_SUBMARINE, FR_BATTLESHIP, FR_BATTLESHIP_2,
		ARTILLERY, AA_GUN, AT_GUN, CAVALRY},
	[ENGLAND] = {
		UK_INFANTRY,
		UK_MATILDA_I, UK_CRUISER_II, UK_CRUISER_III, UK_CRUISER_IV, UK_A10_VALENTINE, UK_A15_CRUSADER,
		UK_MATILDA_II, UK_M4_FIREFLY,
		UK_CHURCHILL,
		UK_SPITFIRE, UK_SPITFIRE_V, UK_SPITFIRE_IX, UK_WHIRLWIND, UK_BEAUFIGHTER,
		UK_MOSQUITO, UK_WELLINGTON, UK_HALIFAX, UK_LANCASTER,
		UK_TRIBA, UK_SUBMARINE, UK_DIDO, UK_BATTLESHIP, UK_BATTLESHIP_2,
		ARTILLERY, AA_GUN, AT_GUN, CAVALRY},
 
Could someone please help I am having trouble putting the fantastic Cruiser by Lord Tirian unit into the game and getting the icons to work correctly

Here is my Units SQL:

Spoiler :
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_CRUISER'), ('Cruiser'), Civilopedia, Strategy, Help, Requirements, (40), (45), (250), Moves, Immobile, (2), BaseSightRange, ('UNITCLASS_CRUISER'), Special, Capture, CombatClass, Domain, CivilianAttackPriority, DefaultUnitAI, Food, NoBadGoodies, RivalTerritory, MilitarySupport, MilitaryProduction, Pillage, Found, FoundAbroad, CultureBombRadius, GoldenAgeTurns, IgnoreBuildingDefense, PrereqResources, Mechanized, Suicide, CaptureWhileEmbarked, ('TECH_BIOLOGY'), 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_CRUISER'), UnitArtInfoCulturalVariation, UnitArtInfoEraVariation, ProjectPrereq, SpaceshipProject, LeaderPromotion, LeaderExperience, DontShowYields, ShowInPedia, MoveRate, 0, 0, ('UNIT_CRUISER_FLAG_ART'), ('UNIT_CRUISER_PORTRAIT_ART')
FROM Units WHERE (Type = 'UNIT_FRIGATE');


AND the UNITSART that I believe is needed

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

INSERT INTO ArtDefine_UnitInfoMemberInfos (UnitInfoType,UnitMemberInfoType,NumMembers)
SELECT ('ART_DEF_UNIT_CRUISER'), ('ART_DEF_UNIT_MEMBER_CRUISER'), NumMembers
FROM ArtDefine_UnitInfoMemberInfos WHERE (UnitInfoType = 'ART_DEF_UNIT_FRIGATE');

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_CRUISER'), 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_FRIGATE');

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_CRUISER'), "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_FRIGATE');

INSERT INTO ArtDefine_UnitMemberInfos (Type, Scale, ZOffset, Domain, Model, MaterialTypeTag, MaterialTypeSoundOverrideTag)
SELECT ('ART_DEF_UNIT_MEMBER_CRUISER'), ('0.086'), ZOffset, Domain, ('cruiser.fxsxml'), MaterialTypeTag, MaterialTypeSoundOverrideTag
FROM ArtDefine_UnitMemberInfos WHERE (Type = 'ART_DEF_UNIT_MEMBER_FRIGATE');

INSERT INTO ArtDefine_StrategicView (StrategicViewType, TileType, Asset )
SELECT ('ART_DEF_UNIT_CRUISER'), TileType, ('svcruiser.dds')
FROM ArtDefine_StrategicView WHERE (StrategicViewType = 'ART_DEF_UNIT_FRIGATE');

INSERT INTO (IconTextureAtlases (Atlas, IconSize, Filename, IconsPerRow, IconsPerColumn)
VALUES ('UNIT_CRUISER_FLAG_ART', 32, 'cruiserflag.dds', 1, 1)
VALUES ('UNIT_CRUISER_PORTRAIT_ART',32, 'cruiserportrait.dds', 1, 1);


Everything else is working strategic view graphics animations just I get the settler flag and a blank portrait. PLease help!
 
For Scale, you don't want to enclose the number in quotes.

I'm guessing you forgot to set your svcruiser.dds file to VFS=true [or forgot to include it at all!].

EDIT: Plus, these are the sizes you need for your [portrait] atlases: 45, 64, 80, 128, 256
 
For Scale, you don't want to enclose the number in quotes.

I'm guessing you forgot to set your svcruiser.dds file to VFS=true [or forgot to include it at all!].

I have got the Strategic view to show the icon fine just not the normal world view I get this

Spoiler :
 
Ah, I misunderstood. OK, then see the edit above re:portrait.

[VFS=true for the atlases?]

So its the scale and I have added the other sizes in let me try, All the asset have VFS se to true. The file only came with these .dds files

Spoiler :


So i used the cruiserportrait.dds as the portrait and the cruiserflag.dds as the flag

correct?
 
You'll need to make copies for the various sizes.

Ok thanks I will try that. What about the UNITFLAG??

EDIT - Tried that still got the same problem. What numbers should I have for the UnitFlagOffset and PortraitIndex??
 
Hello, i recently started modding CIV 5. I created a working civ with custom leader and trait, but i have trouble adding a Pz IV tank to be used alongside with the regular tank for my civ. Using SQL i added it to my civ, but i can't build it from my cities and when i try to spawn it using IGE the game crashes:confused:

I am new to and got used to work with XML. So I pretty much have 0 clue where the problem persists.

Any help would be appreciated.

Here is the SQL code for the unit

Spoiler :
INSERT INTO ArtDefine_UnitInfos(Type, DamageStates, Formation)
VALUES ('ART_DEF_UNIT_PZIV_H', 1, 'Vehicle');
INSERT INTO ArtDefine_UnitInfoMemberInfos(UnitInfoType, UnitMemberInfoType, NumMembers)
VALUES ('ART_DEF_UNIT_PZIV_H', 'ART_DEF_UNIT_MEMBER_PZIV_H', 3);
INSERT INTO ArtDefine_UnitMemberInfos(Type, Scale, Model, MaterialTypeTag, MaterialTypeSoundOverrideTag)
VALUES ('ART_DEF_UNIT_MEMBER_PZIV_H', 0.119999997317791, 'PZIV_H.fxsxml', 'METAL', 'METALSM');
INSERT INTO ArtDefine_UnitMemberCombats(UnitMemberType, EnableActions, HasShortRangedAttack, HasStationaryMelee, HasRefaceAfterCombat, ReformBeforeCombat, HasIndependentWeaponFacing)
VALUES ('ART_DEF_UNIT_MEMBER_PZIV_H', 'Idle Attack RunCharge AttackCity Bombard Death BombardDefend Run Fortify CombatReady', 1, 1, 0, 1, 1);
INSERT INTO ArtDefine_UnitMemberCombatWeapons(UnitMemberType, "Index", SubIndex, VisKillStrengthMin, VisKillStrengthMax, HitEffect, WeaponTypeTag, WeaponTypeSoundOverrideTag)
VALUES ('ART_DEF_UNIT_MEMBER_PZIV_H', 0, 0, 25.0, 50.0, 'ART_DEF_VEFFECT_TANK_IMPACT_$(TERRAIN)', 'EXPLOSIVE', 'EXPLOSION6POUND');
INSERT INTO ArtDefine_StrategicView(StrategicViewType, TileType, Asset)
VALUES ('ART_DEF_UNIT_PZIV_H', 'Unit', 'SV_Tank.dds');

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_PZIV_H'), ('Pz IV ausf. H'), Civilopedia, Strategy, Help, Requirements,
Combat, (70), (350), Moves, Immobile, (6), BaseSightRange, ('UNITCLASS_PZIV_H'), 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_PZIV_H'), UnitArtInfoCulturalVariation, UnitArtInfoEraVariation, ProjectPrereq, SpaceshipProject, LeaderPromotion, LeaderExperience, DontShowYields, ShowInPedia, MoveRate,
UnitFlagIconOffset, PortraitIndex, IconAtlas, UnitFlagAtlas
FROM Units WHERE (Type = 'UNIT_TANK');

INSERT INTO Unit_AITypes (UnitType, UnitAIType)
SELECT ('UNIT_PZIV_H'), UnitAIType
FROM Unit_AITypes WHERE (UnitType = 'UNIT_TANK');

INSERT INTO Unit_ClassUpgrades (UnitType, UnitClassType)
SELECT ('UNIT_PZIV_H'), UnitClassType
FROM Unit_ClassUpgrades WHERE (UnitType = 'UNIT_TANK');

INSERT INTO Unit_Flavors (UnitType, FlavorType, Flavor)
SELECT ('UNIT_PZIV_H'), FlavorType, Flavor
FROM Unit_Flavors WHERE (UnitType = 'UNIT_TANK');

INSERT INTO Unit_FreePromotions (UnitType, PromotionType)
SELECT ('UNIT_PZIV_H'), PromotionType
FROM Unit_FreePromotions WHERE (UnitType = 'UNIT_TANK');

INSERT INTO Unit_ResourceQuantityRequirements (UnitType, ResourceType, Cost)
SELECT ('UNIT_PZIV_H'), ResourceType, Cost
FROM Unit_ResourceQuantityRequirements WHERE (UnitType = 'UNIT_TANK');
 
Where do I put my files in? Can't believe you didn't make a screenshot. I am starting to get :mad: now.
 
Hello, i recently started modding CIV 5. I created a working civ with custom leader and trait, but i have trouble adding a Pz IV tank to be used alongside with the regular tank for my civ. Using SQL i added it to my civ, but i can't build it from my cities and when i try to spawn it using IGE the game crashes:confused:

I am new to and got used to work with XML. So I pretty much have 0 clue where the problem persists.

Any help would be appreciated.

Here is the SQL code for the unit

Spoiler :
INSERT INTO ArtDefine_UnitInfos(Type, DamageStates, Formation)
VALUES ('ART_DEF_UNIT_PZIV_H', 1, 'Vehicle');
INSERT INTO ArtDefine_UnitInfoMemberInfos(UnitInfoType, UnitMemberInfoType, NumMembers)
VALUES ('ART_DEF_UNIT_PZIV_H', 'ART_DEF_UNIT_MEMBER_PZIV_H', 3);
INSERT INTO ArtDefine_UnitMemberInfos(Type, Scale, Model, MaterialTypeTag, MaterialTypeSoundOverrideTag)
VALUES ('ART_DEF_UNIT_MEMBER_PZIV_H', 0.119999997317791, 'PZIV_H.fxsxml', 'METAL', 'METALSM');
INSERT INTO ArtDefine_UnitMemberCombats(UnitMemberType, EnableActions, HasShortRangedAttack, HasStationaryMelee, HasRefaceAfterCombat, ReformBeforeCombat, HasIndependentWeaponFacing)
VALUES ('ART_DEF_UNIT_MEMBER_PZIV_H', 'Idle Attack RunCharge AttackCity Bombard Death BombardDefend Run Fortify CombatReady', 1, 1, 0, 1, 1);
INSERT INTO ArtDefine_UnitMemberCombatWeapons(UnitMemberType, "Index", SubIndex, VisKillStrengthMin, VisKillStrengthMax, HitEffect, WeaponTypeTag, WeaponTypeSoundOverrideTag)
VALUES ('ART_DEF_UNIT_MEMBER_PZIV_H', 0, 0, 25.0, 50.0, 'ART_DEF_VEFFECT_TANK_IMPACT_$(TERRAIN)', 'EXPLOSIVE', 'EXPLOSION6POUND');
INSERT INTO ArtDefine_StrategicView(StrategicViewType, TileType, Asset)
VALUES ('ART_DEF_UNIT_PZIV_H', 'Unit', 'SV_Tank.dds');

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_PZIV_H'), ('Pz IV ausf. H'), Civilopedia, Strategy, Help, Requirements,
Combat, (70), (350), Moves, Immobile, (6), BaseSightRange, ('UNITCLASS_PZIV_H'), 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_PZIV_H'), UnitArtInfoCulturalVariation, UnitArtInfoEraVariation, ProjectPrereq, SpaceshipProject, LeaderPromotion, LeaderExperience, DontShowYields, ShowInPedia, MoveRate,
UnitFlagIconOffset, PortraitIndex, IconAtlas, UnitFlagAtlas
FROM Units WHERE (Type = 'UNIT_TANK');

INSERT INTO Unit_AITypes (UnitType, UnitAIType)
SELECT ('UNIT_PZIV_H'), UnitAIType
FROM Unit_AITypes WHERE (UnitType = 'UNIT_TANK');

INSERT INTO Unit_ClassUpgrades (UnitType, UnitClassType)
SELECT ('UNIT_PZIV_H'), UnitClassType
FROM Unit_ClassUpgrades WHERE (UnitType = 'UNIT_TANK');

INSERT INTO Unit_Flavors (UnitType, FlavorType, Flavor)
SELECT ('UNIT_PZIV_H'), FlavorType, Flavor
FROM Unit_Flavors WHERE (UnitType = 'UNIT_TANK');

INSERT INTO Unit_FreePromotions (UnitType, PromotionType)
SELECT ('UNIT_PZIV_H'), PromotionType
FROM Unit_FreePromotions WHERE (UnitType = 'UNIT_TANK');

INSERT INTO Unit_ResourceQuantityRequirements (UnitType, ResourceType, Cost)
SELECT ('UNIT_PZIV_H'), ResourceType, Cost
FROM Unit_ResourceQuantityRequirements WHERE (UnitType = 'UNIT_TANK');

Uhmm... You made a civ,right? I need some help making a Civilization? Can you help me with the coding?
 
@Liamv3: You haven't given anyone any information with which to help you. Post a new thread in the main Creation & Customization subforum, and attach whatever you have so far. There are lots of people that are happy to help, but you have to meet them halfway.

If you've created a new mod in ModBuddy, it doesn't matter where you put the files. You can create folders, but they're there just to keep things organized.

If you don't know what I'm talking about or where to start, skim through Kael's Guide, which though outdated is an excellent primer on modding for CiV. Once you've got a grasp of things, whoward69's new civ thread should prove very helpful.
 
I need The Dawn of Man stuff and animation. I will make a forum..
That Guide got me to a start. I will try to upload my current building
 
Uhmm... You made a civ,right? I need some help making a Civilization? Can you help me with the coding?

Sorry for the late response, I was away for some time. To anweser you question, yes, i did create my own civ. I used Kael's guide (http://kael.civfanatics.net/files/ModdersGuide.pdf) on how to create a custom civ and came across many problems and errors. In order to solve them, I took many different codes from other custom civs to make it work which resulted into a mess, but its working, well, except adding multiple units.
 
Hi everyone
I tried adding promotion to some of my skins and I partially made. Units like swordsman, longswordsman ect. promotion doesnt take effect...
here 1 my sqls':
Spoiler :
UPDATE Units SET UnitArtInfoCulturalVariation = 1 WHERE Type = 'UNIT_GREAT_WAR_INFANTRY';

-- GREECE WW1 Infantry
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
SELECT ("ART_DEF_UNIT_WW1_INFANTRY_GREECE"), "DamageStates", "Formation"
FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_WW1_INFANTRY");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
SELECT ("ART_DEF_UNIT_WW1_INFANTRY_GREECE"), ("ART_DEF_UNIT_MEMBER_WW1_INFANTRY_GREECE"), "NumMembers"
FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_WW1_INFANTRY");
INSERT INTO "ArtDefine_UnitMemberCombats" ('UnitMemberType', 'EnableActions', 'DisableActions', 'MoveRadius', 'ShortMoveRadius', 'ChargeRadius', 'AttackRadius', 'RangedAttackRadius', 'MoveRate', 'ShortMoveRate', 'TurnRateMin', 'TurnRateMax', 'TurnFacingRateMin', 'TurnFacingRateMax', 'RollRateMin', 'RollRateMax', 'PitchRateMin', 'PitchRateMax', 'LOSRadiusScale', 'TargetRadius', 'TargetHeight', 'HasShortRangedAttack', 'HasLongRangedAttack', 'HasLeftRightAttack', 'HasStationaryMelee', 'HasStationaryRangedAttack', 'HasRefaceAfterCombat', 'ReformBeforeCombat', 'HasIndependentWeaponFacing', 'HasOpponentTracking', 'HasCollisionAttack', 'AttackAltitude', 'AltitudeDecelerationDistance', 'OnlyTurnInMovementActions', 'RushAttackFormation')
SELECT ("ART_DEF_UNIT_MEMBER_WW1_INFANTRY_GREECE"), "EnableActions", "DisableActions", "MoveRadius", "ShortMoveRadius", "ChargeRadius", "AttackRadius", "RangedAttackRadius",
"MoveRate", "ShortMoveRate", "TurnRateMin", "TurnRateMax", "TurnFacingRateMin", "TurnFacingRateMax", "RollRateMin", "RollRateMax", "PitchRateMin", "PitchRateMax", "LOSRadiusScale", "TargetRadius", "TargetHeight", "HasShortRangedAttack", "HasLongRangedAttack", "HasLeftRightAttack", "HasStationaryMelee", "HasStationaryRangedAttack", "HasRefaceAfterCombat", "ReformBeforeCombat", "HasIndependentWeaponFacing", "HasOpponentTracking", "HasCollisionAttack", "AttackAltitude", "AltitudeDecelerationDistance", "OnlyTurnInMovementActions", "RushAttackFormation"
FROM "ArtDefine_UnitMemberCombats" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_WW1_INFANTRY");
INSERT INTO "ArtDefine_UnitMemberCombatWeapons" ('UnitMemberType', 'Index', 'SubIndex', 'ID', 'VisKillStrengthMin', 'VisKillStrengthMax', 'ProjectileSpeed', 'ProjectileTurnRateMin', 'ProjectileTurnRateMax', 'HitEffect', 'HitEffectScale', 'HitRadius', 'ProjectileChildEffectScale', 'AreaDamageDelay', 'ContinuousFire', 'WaitForEffectCompletion', 'TargetGround', 'IsDropped', 'WeaponTypeTag', 'WeaponTypeSoundOverrideTag')
SELECT ("ART_DEF_UNIT_MEMBER_WW1_INFANTRY_GREECE"), "Index", "SubIndex", "ID", "VisKillStrengthMin", "VisKillStrengthMax", "ProjectileSpeed", "ProjectileTurnRateMin", "ProjectileTurnRateMax", "HitEffect", "HitEffectScale", "HitRadius", "ProjectileChildEffectScale", "AreaDamageDelay", "ContinuousFire", "WaitForEffectCompletion", "TargetGround", "IsDropped", "WeaponTypeTag", "WeaponTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberCombatWeapons" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_WW1_INFANTRY");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
SELECT ("ART_DEF_UNIT_MEMBER_WW1_INFANTRY_GREECE"), "Scale", "ZOffset", "Domain",
("gregw1.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_WW1_INFANTRY");
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_WW1_INFANTRY_GREECE'), Description, Civilopedia, Strategy, Help, Requirements,
Combat, RangedCombat, Cost, 99, Immobile, Range, BaseSightRange, ('UNITCLASS_ANTI_WW1_INFANTRY'), 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_WW1_INFANTRY'), UnitArtInfoCulturalVariation, UnitArtInfoEraVariation, ProjectPrereq, SpaceshipProject, LeaderPromotion, LeaderExperience, DontShowYields, ShowInPedia, MoveRate,
UnitFlagIconOffset, PortraitIndex, IconAtlas, UnitFlagAtlas
FROM Units WHERE (Type = 'UNIT_GREAT_WAR_INFANTRY');
INSERT INTO Unit_FreePromotions ('UnitType', 'PromotionType')
SELECT ("UNIT_WW1_INFANTRY_GREECE"), ("PROMOTION_BLITZ")
FROM Unit_FreePromotions WHERE (UnitType = 'UNIT_GREAT_WAR_INFANTRY');

any help will be appreciated
thanx
 
@d0minus
Code:
INSERT INTO Unit_FreePromotions ('UnitType', 'PromotionType')
SELECT ("UNIT_WW1_INFANTRY_GREECE"), ("PROMOTION_BLITZ")
FROM Unit_FreePromotions WHERE (UnitType = 'UNIT_GREAT_WAR_INFANTRY');

There's no record with UNIT_GREAT_WAR_INFANTRY value in Unit_FreePromotions table by default, so this query returns nothing. So either you need to have it in your other code elsewhere, or it's simply missing.

If you work with SQL, you may want to download plugin for Firefox - SQLite Manager - to browse through the game's database, check tables and values, and test your queries there for validity. Otherwise it's like taking a blind guess everytime.
 
@d0minus
Code:
INSERT INTO Unit_FreePromotions ('UnitType', 'PromotionType')
SELECT ("UNIT_WW1_INFANTRY_GREECE"), ("PROMOTION_BLITZ")
FROM Unit_FreePromotions WHERE (UnitType = 'UNIT_GREAT_WAR_INFANTRY');

There's no record with UNIT_GREAT_WAR_INFANTRY value in Unit_FreePromotions table by default, so this query returns nothing. So either you need to have it in your other code elsewhere, or it's simply missing.

If you work with SQL, you may want to download plugin for Firefox - SQLite Manager - to browse through the game's database, check tables and values, and test your queries there for validity. Otherwise it's like taking a blind guess everytime.
thanx but u mean I have make another .sql adding values on that table?
Im not sure how... but Im going to check sqlite
 
Not really. Rather you should clearly define what you exactly want to achieve there first ;]

From your code, I assume that you want to create a special unit for Greece with a free promotion. And this unit is supposed to be based on Great War Infrantry.
The point is that G.W.I. has no any free promotions as it is a generic unit. So in this case you can't use SELECT statement because there is no any data for this query to copy from.

And if you want just to assign for your unit the blitz free promotion then this code is enough here:
Code:
INSERT INTO Unit_FreePromotions (UnitType, PromotionType)
VALUES ('UNIT_WW1_INFANTRY_GREECE', 'PROMOTION_BLITZ');


and btw:
You don't have a cleanest code there, which makes it hard to read, not only for others but for you as well. For instance don't use quotes of any kind for table and column names - it's uneccessary. Don't put single values in brackets, etc.

for instance this:
Code:
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
SELECT ("ART_DEF_UNIT_WW1_INFANTRY_GREECE"), "DamageStates", "Formation"
FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_WW1_INFANTRY");

can be replaced with this:
Code:
INSERT INTO ArtDefine_UnitInfos (Type, DamageStates, Formation)
SELECT 'ART_DEF_UNIT_WW1_INFANTRY_GREECE', DamageStates, Formation
FROM ArtDefine_UnitInfos
WHERE Type = 'ART_DEF_UNIT_WW1_INFANTRY';

If you have longer SQL code it makes it easier to read, where single quotes are only reserved for text values inserted to/retrived from database.
 
Not really. Rather you should clearly define what you exactly want to achieve there first ;]

From your code, I assume that you want to create a special unit for Greece with a free promotion. And this unit is supposed to be based on Great War Infrantry.
The point is that G.W.I. has no any free promotions as it is a generic unit. So in this case you can't use SELECT statement because there is no any data for this query to copy from.

And if you want just to assign for your unit the blitz free promotion then this code is enough here:
Code:
INSERT INTO Unit_FreePromotions (UnitType, PromotionType)
VALUES ('UNIT_WW1_INFANTRY_GREECE', 'PROMOTION_BLITZ');


and btw:
You don't have a cleanest code there, which makes it hard to read, not only for others but for you as well. For instance don't use quotes of any kind for table and column names - it's uneccessary. Don't put single values in brackets, etc.

for instance this:
Code:
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
SELECT ("ART_DEF_UNIT_WW1_INFANTRY_GREECE"), "DamageStates", "Formation"
FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_WW1_INFANTRY");

can be replaced with this:
Code:
INSERT INTO ArtDefine_UnitInfos (Type, DamageStates, Formation)
SELECT 'ART_DEF_UNIT_WW1_INFANTRY_GREECE', DamageStates, Formation
FROM ArtDefine_UnitInfos
WHERE Type = 'ART_DEF_UNIT_WW1_INFANTRY';

If you have longer SQL code it makes it easier to read, where single quotes are only reserved for text values inserted to/retrived from database.

thanx 4 teaching pal, much appreciate it. 1 last question what is happening with unique units r they locked or something, although included on table?
 
Hi everyone!

How replace original workers (workers_euro) with that Andean worker? Suffix _EURO already in unit name. :confused:

Code:
-- AZTEC WORKER
UPDATE Civilizations SET ArtStyleSuffix = "_AZTEC" WHERE Type = 'CIVILIZATION_AZTEC';
UPDATE Units SET UnitArtInfoCulturalVariation = 1 WHERE Type = 'UNIT__WORKER';
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
	SELECT	("ART_DEF_UNIT_WORKER_AZTEC"), "DamageStates", "Formation"
	FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT__WORKER");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
	SELECT	("ART_DEF_UNIT_WORKER_AZTEC"), ("ART_DEF_UNIT_MEMBER_WORKER_AZTEC"), "NumMembers"
	FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT__WORKER");
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_WORKER_AZTEC"), "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_WORKER");
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_WORKER_AZTEC"), "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_WORKER");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
	SELECT	("ART_DEF_UNIT_MEMBER_WORKER_AZTEC"), "Scale", "ZOffset", "Domain", 
			("worker_andes.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
	FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_WORKER");

Following code does nothing.
 
Top Bottom