Unique Unit, different upgrade path

Aldollin

Chieftain
Joined
Mar 7, 2017
Messages
87
Is it possible to have a unique unit that replaces a normal unit and changing the units that upgrade INTO that unit?

the normal way in UnitUpgrades throws a UNIQUE constrained failed, because there will be 2 upgrades for one unit

special case:
i want to make a civ unique replacement for the knight that is a light cavalry instead of heavy
so naturaly i would like to have the horseman upgrade into that unit, and the chariot not upgrade into that unit
but that does seem to conflict with the "replacing a unit" part

is my only solution to create the new unit seperatly and not make it a replacement?
 
Since your unit is light cavarly it can only be upgraded from light cavarly and can only upgrade into light cavarly the same way as vanilla units with such shift (Saka, Hetairoi).
Check base game data to see how they arehandled. Notice they have not unit that upgrade INTO them.
Code:
    <UnitUpgrades>
        <Row Unit="UNIT_MACEDONIAN_HYPASPIST" UpgradeUnit="UNIT_MUSKETMAN"/>
        <Row Unit="UNIT_MACEDONIAN_HETAIROI" UpgradeUnit="UNIT_KNIGHT"/>
        <Row Unit="UNIT_PERSIAN_IMMORTAL" UpgradeUnit="UNIT_MUSKETMAN"/>
    </UnitUpgrades>
    <UnitReplaces>
        <Row CivUniqueUnitType="UNIT_MACEDONIAN_HYPASPIST" ReplacesUnitType="UNIT_SWORDSMAN"/>
        <Row CivUniqueUnitType="UNIT_MACEDONIAN_HETAIROI" ReplacesUnitType="UNIT_HORSEMAN"/>
        <Row CivUniqueUnitType="UNIT_PERSIAN_IMMORTAL" ReplacesUnitType="UNIT_SWORDSMAN"/>
    </UnitReplaces>
All players use the same database so it is not possible to change upgrade patch for only one of them.
Only way I see it can be done (with database edit) is to disallow your civ to create horseman and in its place put "new" (unique but the same) horseman which does upgrade into your knight.
Don't know though how to prevent chariot upgrade. And why, by the way? Did you tried it? Does the game engine accepts it? What happens to chariot upgrades and upgrade path during promotion?
==================================
I see why you might not want chariot to upgrade into your knight. In civV mongolian UU had ranged upgrade tree and preserved it though upgraded to (light?) cavarly. Thus it ended up with multiple useless promotions. But just out of curiosity I would like to know what actually happens in civ6.
 
i just tested it, if the unit gets a promotion as a heavy cavalry unit(chariot) and then gets upgraded into light cavalry it keeps the heavy cav promotion
so it now has one promotion from the old tree, the promotion works
and if it gets another levelup you pick from the light cavalry tree as if it was your first level
 
Back
Top Bottom