Free Starting Promotions (Help)

Riker13

King
Joined
Nov 9, 2001
Messages
859
Location
UK
In Civ V, this is what was needed to give your unit a free starting promotion:
<Unit_FreePromotions>
<Row>
<UnitType>UNIT_RANGER</UnitType>
<PromotionType>PROMOTION_SCOUTING_1</PromotionType>
</Row>
</Unit_FreePromotions>

What does it in Civ 6? please.

Regards
Riker13:crazyeye:
 
You want to update the InitialLevel value to 2. That will grant the unit a free promotion. In SQL, for Scout and Ranger, it's written as:

UPDATE Units SET InitialLevel = 2 WHERE UnitType = 'UNIT_SCOUT' OR UnitType = 'UNIT_RANGER';
 
The code I posted was copy+pasted from my own code. It's SQL so it needs to be in an SQL file. Can you upload your mod so I can take a look?
 
Yep its in an SQL file, I will go back and check my work just in case there are other issues stopping it, if not I will upload it for you.
 
Yes my Database logfile has some issues:
[3097026.776] [Localization]: Validating Foreign Key Constraints...
[3097026.777] [Localization]: Passed Validation.
[3097026.783] [Configuration]: Validating Foreign Key Constraints...
[3097026.783] [Configuration]: Passed Validation.
[3097038.566] [FullTextSearch]: Initializing FullTextSearch
[3097039.321] [Gameplay]: Validating Foreign Key Constraints...
[3097039.332] [Gameplay]: Passed Validation.
[3097039.963] [Configuration]: Validating Foreign Key Constraints...
[3097039.964] [Configuration]: Passed Validation.
[3097103.643] [FullTextSearch]: FTS - Creating Context
[3097107.214] [FullTextSearch]: FTS - Creating Context
[3097109.095] [Configuration]: Validating Foreign Key Constraints...
[3097109.096] [Configuration]: Passed Validation.
[3097112.174] [Configuration]: Validating Foreign Key Constraints...
[3097112.174] [Configuration]: Passed Validation.
[3097136.859] [Gameplay] ERROR: table UnitAbilityModifiers has no column named Type
[3097136.859] [Gameplay]: In Query - insert into UnitAbilityModifiers('Type', 'Kind') values (?, ?);
[3097136.859] [Gameplay]: In XMLSerializer while updating table UnitAbilityModifiers from file Atlantia_Units.xml.
[3097136.862] [Localization] ERROR: UNIQUE constraint failed: LocalizedText.Language, LocalizedText.Tag
[3097136.862] [Localization]: While executing - 'insert into LocalizedText('Tag', 'Language', 'Text') values (?, ?, ?);'
[3097136.862] [Localization]: In XMLSerializer while inserting row into table insert into LocalizedText('Tag', 'Language', 'Text') with values (LOC_CIVILIZATION_ATLANTIA_NAME, en_US, Atlantia, ).
[3097136.862] [Localization]: In XMLSerializer while updating table LocalizedText from file Atlantia_Text.xml.
[3097136.862] [Localization] ERROR: UNIQUE constraint failed: LocalizedText.Language, LocalizedText.Tag
[3097136.895] [Gameplay]: Validating Foreign Key Constraints...
[3097136.917] [Gameplay]: Passed Validation.
[3097143.182] [FullTextSearch]: FTS - Creating Context
[3097143.361] [FullTextSearch]: FTS - Creating Context
[3097143.854] [FullTextSearch]: FTS - Creating Context
[3097301.188] [FullTextSearch]: FullTextSearch - Shutting down
 
UnitAbilityModifiers tables are "UnitAbilityType" and "ModifierId". I don't know whats going on with your text issue, I'd have to look at it.
 
he is repeating a LOC_SOMETHING name that already exists. Repeating something that already exists is always the cause of a UNIQUE constraint failed error. Nearly every table in civ6 has a primary column or a combination of primary columns each of which must have unique data or unique combinations of data to all others within the same table. Tag and Language must be a unique combination within table <LocalizedText> for each new Row added to the table.
 
Cleared all errors and it now works, many thanks to ITcore and LeeS :)

Quick question, is there a way of giving a certain Promotion to a unit when it comes out the gate, save you having to click on Promotions. Example my Archer unit has the GARRISON_PROMOTION without me having to do anything?

Refer you to the top of this post, thats how it was in CiV.
 
The Mont St. Michel wonder gives the Martyr promotion to all Apostle units, so I'd start there as far as looking for the proper code to do this (away from my PC atm or I'd give a more detailed answer).
 
Is the syntex to this ok?

UPDATE Units SET InitialLevel = 2 WHERE UnitType = 'UNIT_ATLANTIAN_ARCHER' ;

Getting,
[Gameplay] ERROR: near "UPDATE": syntax error
[3341955.443]

Warning: UpdateDatabase - Error Loading SQL

UPDATE: Its ok now, used SQLite Spy and it did report a syntex error (Gobledegook before UPDATE), must have been a copy and paste issue.
 
Last edited:
Back
Top Bottom