Napoleonic Line Infantry

j51

Blue Star Cadet
Joined
Oct 22, 2006
Messages
1,754
Location
Ping Island
So, I stupidly hijacked bernie14's ethnic riflemen thread with this issue recently:

I'm trying to replace the riflemen in game with line infantry (it'll be made available with Military Science, and cavalry will require Rifling). Bernie's units are superb for that and Nutty made an awesome general version of them for all civs to use.

Basically the idea is that the riflemen unit only covers 1850-1900, while WWI infanty covers 1900-1930, and WWII infantry covers 1930~1980. The narrow time frame for these changes sucks. 'Musketmen' are basically supposed to cover 450 years! Arquebusiers, wheellock muskets, and flintlock muskets/line infantry all fall under their umbrella. Boooo - no fun! Way to skip the most colourful period of warfare Civ.

So my idea is renaming Musketmen Arquebusiers, reducing their time frame to ~1400~1700 and replacing Riflemen with Line Infantry. Giving them a time frame of ~1700~1850. The space of old minnie ball riflemen is now split between the new Line-Infantry and WWI Infantry. It's not perfect, but I like it more. Anyway. I tried to make a mod, but it's not working. I posted it here: http://forums.civfanatics.com/downloads.php?do=file&id=21376
 
OK, so the first step is to take a look at the log file. These are the lines that pertain to your mod:
Code:
[481083.979] no such column: Type
[481084.026] Database::XMLSerializer (Game Rules1.xml): 'Row' or 'Delete' expected, got 'Where'.

Now, to find the problems referred to, you want to actually look at the database with a SQLite Browser. You can use any one of the following programs:
Then open this file:
Code:
%userprofile%\Documents\My Games\Sid Meier's Civilization 5\cache\Civ5DebugDatabase.db
Note that Civ5CoreDatabase.db is the same database before any mods have been activated.

The second line is your XML file (you might want to rename your files so that's clearer). Looking at the database, you'll see that none of the changes from the XML are getting into the database. That's because before your very first <Update> tag in the XML, you need to specify the table name (in this case, <Units>).

The top line in the log excerpt is (not as obviously) your SQL file. Again, by going to the database, you'll notice it never gets to the BRITLINE units, so you know there's something wrong with FRENCHLINE. Just go through each change, and you'll quickly see that the problem is with ArtDefine_StrategicView (because ART_DEF_UNIT_FRENCHLINE isn't there). Now, looking at your entry, the error CiV is reporting makes sense.

Code:
INSERT INTO ArtDefine_StrategicView (StrategicViewType, TileType, Asset )
	SELECT	('ART_DEF_UNIT_FRENCHLINE'), TileType, Asset
	FROM ArtDefine_StrategicView WHERE ([COLOR=red]Type[/COLOR] = 'ART_DEF_UNIT_MUSKETMAN');
Type should have been StrategicViewType.


EDIT: Also note you can test SQL using most (all?) of the tools linked above. For example, in SQLite Manager for Firefox, go to the Execute SQL tab and paste your entire SQL file into the Enter SQL box, and it will immediately pinpoint the error. Note that it will actually make changes to the database when you do so. [Also note the game won't actually notice any "modding" done this way.] So, if you want to test your entire file again, you'll want to make a backup of your database first, or you could just make a copy of Civ5CoreDatabase.db.
 
FWIW... as far as the design of the mod itself, I was thinking about some suggestions.

You could make the fusilier line infantry a whole new class, and leave the riflemen in, but change them to adopt their historical use as early special forces and sniper units. Taking into consideration the need for special training to combat the minie rifle's slow reload speed, they should be expensive and/or weaker on defense with a penalty vs. cities. Maybe give them ignore terrain.

Another thought I had would be to make them ranged snipers with 1 tile range. I imagine they might upgrade to gatling gun, but crossbowmen would still have to upgrade straight to gatling gun.
 
So my idea is renaming Musketmen Arquebusiers, reducing their time frame to ~1400~1700 and replacing Riflemen with Line Infantry. Giving them a time frame of ~1700~1850. The space of old minnie ball riflemen is now split between the new Line-Infantry and WWI Infantry.
I've made my own personal mod that does exact that, but also with Cavalry, mainly because I hate how Cossacks, Hussars and Caroleans become available only when in the industrial era. Generals in cars don't really fit well in a Cossack charge :rolleyes:
 
Wow. Those are all really good suggestions. I still haven't got around to fixing it yet, but I'll tell you the outcome when I do!
 
Now, looking at your entry, the error CiV is reporting makes sense.

Code:
INSERT INTO ArtDefine_StrategicView (StrategicViewType, TileType, Asset )
	SELECT	('ART_DEF_UNIT_FRENCHLINE'), TileType, Asset
	FROM ArtDefine_StrategicView WHERE ([COLOR=red]Type[/COLOR] = 'ART_DEF_UNIT_MUSKETMAN');
Type should have been StrategicViewType.

Wait, where does 'StrategicViewType' go? I don't get it. I used the code from Gedemon's guide.

Edit: Oh wait, I get it. Does that mean there's an error in Gedemon's guide?
 
It worked! The units look glorious! Thank you! :goodjob::D

Also: is it possible for a unit to not have a civilopedia entry? Because right now there are 6 entries for riflemen.
 
Does that mean there's an error in Gedemon's guide?
If it was an error in Gedemon's guide, you should let him know.

is it possible for a unit to not have a civilopedia entry?
You could set the ShowInPedia tag in the Units table to 0.

But you're still going to run into other UI issues if you're using the unique unit technique to display ethnic rifleman skins...

If the civ has a UB or a UI instead of a second UU, the Dawn of Man screen, Choose your Civ screen, and the Civilopedia will show your ethnic unit instead (the game shows units, then buildings, then improvements, until 2 are shown). You can "fix" the Dawn of Man screen by mod, but not the other 2 places without replacing installation files.

Alternatively, you could go the route discussed recently in this thread.
 
If it was an error in Gedemon's guide, you should let him know.
It was, bad copy/pasting on my side, and now it's corrected. Strange that it wasn't reported before, it should have give an error in the database.log
 
Alternatively, you could go the route discussed recently in this thread.

I've been looking at the ethnic units mod to figure out how to do this. I can see the sql that adds the civ-specific styles, and the sql that adds the unit art. What I can't find is how to tie the unit art to a specific civ style. Where is the sql that assigns unit art to specific civ art styles?
 
In the SQL\Units folder, there's a SQL file for each type of unit. The format is copied from an earlier version of R.E.D. Modpack, so the use of quotation marks isn't proper syntactically, but hey, it works.

Note that the recent patches added some new columns to the ArtDefine_UnitInfos and ArtDefine_UnitMemberCombats tables, but I believe the SQL should still work as written.

Example from Ethnic Units (v 21)\SQL\Units\Musketman.sql:
Spoiler :
Code:
-- AMERICAN musketman
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
	SELECT	("ART_DEF_UNIT_MUSKETMAN_AMERICA"), "DamageStates", "Formation"
	FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_MUSKETMAN");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
	SELECT	("ART_DEF_UNIT_MUSKETMAN_AMERICA"), ("ART_DEF_UNIT_MEMBER_MUSKETMAN_AMERICA"), "NumMembers"
	FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_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_MUSKETMAN_AMERICA"), "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_MUSKETMAN_AMERICA"), "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_MUSKETMAN_AMERICA"), "Scale", "ZOffset", "Domain", 
			("continental_inf.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
	FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_MUSKETMAN");
 
No, that's a comment.

Sorry, I get where the question is now... You're confused because the game is adding the suffix automatically.

If UnitArtInfoCulturalVariation (Units table) is active for a given unit, then the game will automatically look for the ArtStyleSuffix (Civilizations table) after the unit's art define type name, e.g., ART_DEF_UNIT_MUSKETMAN becomes ART_DEF_UNIT_MUSKETMAN_EURO. However, remember that we changed the ArtStyle suffix in the Civilizations table to make them unique for each Civ (e.g., we changed EURO to AMERICA), therefore the unit the game looks for is now ART_DEF_UNIT_MUSKETMAN_AMERICA.
 
It worked! Now it's ready just in time for BNW! Thanks Nutty, thanks Gedemon, thanks Bernie, thanks everyone!

PS: Also Nutty, thanks for explaining how it worked. I like knowing those things and appreciate it!
 
Back
Top Bottom