Pre-defined starting non-sovereign champion

I've made a custom sovereign, custom faction, and custom champion (non-sovereign).  I'd like to always start a game with both the sovereign and the champion.

I've tried a few approaches:

1. Add the SummonUnit GameModifier in the sovereign file.

However, the resulting champion becomes a summoned creature or trained unit.  I.E. no equipment, no level-up traits, etc.

2. Use the UnitJoinArmy GameModifier.

This simply doesn't work: I've tried adding it in the sovereign's file, the faction file, and even as an ability.  Also tried enclosing it in <Treasure>.

3. Give both the faction and the champion the same allegiance "Neutral".

Well, the theory is that startup champions always spawn next to sovereigns of the same allegiance.  But of course I couldn't actually define a 3rd non-Kingdom and non-Empire allegiance.  So the result of this attempt is simply no champion spawned next to sovereign.

4. The last resort is to make pre-defined map with pre-defined champion+sovereign spawn points.  But this is not what I intended...

 

Anyway, does anyone know how this could be done?

I might try making a quest that auto-triggers at gamestart...  Not sure if this would work, though.

3,946 views 9 replies
Reply #1 Top

I would recommend that you simply create a spell to summon that particular champion. The spell would only be unlocked based on the factors you decide. Making it sovereign only and giving it -1 Cooldown ensures it can only be cast once.

Reply #2 Top

But if I use the SummonUnit GameModifier for the spell effect, the champion would end up like a summoned creature: no equipment, no level up traits, etc.

Reply #3 Top

    <GameModifier InternalName="Reward2">
      <ModType>Unit</ModType>
      <Attribute>UnitJoinArmy</Attribute>
      <StrVal>championinternalnamehere</StrVal>
      <UnitClass>Champion</UnitClass>
      <Value>5</Value>
    </GameModifier>

this should work from a spell

Reply #4 Top

Thanks, that worked.

Still I'd appreciate a more streamlined alternative.

Is there documentation on which GameModifier is valid for which context?

Reply #5 Top

No documentation.

Reply #6 Top

Quoting Heavenfall, reply 3
    <GameModifier InternalName="Reward2">
      <ModType>Unit</ModType>
      <Attribute>UnitJoinArmy</Attribute>
      <StrVal>championinternalnamehere</StrVal>
      <UnitClass>Champion</UnitClass>
      <Value>5</Value>
    </GameModifier>

this should work from a spell
End of Heavenfall's quote

 

Will the AI reliably use this if you put it into CoreUnits? I'm hoping Value tells the AI how important it is to cast? Or that UnitJoinArmy is coded to be used immediately?

Reply #7 Top

Value is summoned unit's level. Those things you mention are set up in the spell containing that modifier.

Reply #8 Top

Can I hijack the thread?

 

If I put:

 

        <PossibleAITrait>Expansionist</PossibleAITrait>
        <PossibleAITrait>Civilized</PossibleAITrait>
        <PossibleAITrait>Builder</PossibleAITrait>

 

towards the end of a custom sov xml file in my games/mods/units will the AI use those traits? Would changing UserDesigned help any problems?

Reply #9 Top

By the way, for the lurkers and passer-bys, put it at the end of CoreSpells, tested on custom sovs only, note that if you do a custom sov that has a blood that matches their allegiance (ie amarian with kingdom, krax with empire, etc) your custom sov will get whatever you set the stock sovs to:

 

    <SpellDef InternalName="SummonSovChamp1">
        <DisplayName>Summon Champion</DisplayName>
        <Description>Summon a Champion.</Description>
        <Image>M_WargFamiliar_Card.png</Image>
        <IconFG>T_SummonFamiliar_Icon.png</IconFG>
        <IconColor>222,32,224</IconColor>
        <CanStack>0</CanStack>
        <SpellBookSortCategory>Summon</SpellBookSortCategory>
        <SpellBookSortSubCategory>Summon</SpellBookSortSubCategory>
        <SpellType>Strategic</SpellType>
        <SpellClass>Defensive</SpellClass>
        <SpellSubClass>Summon</SpellSubClass>
        <SpellTargetType>Self</SpellTargetType>
        <CasterMustBeSov>1</CasterMustBeSov>
        <AutoUnlock>1</AutoUnlock>
        <Range>0</Range>
        <Cooldown>-1</Cooldown>
        <Prereq>
            <Type>Allegiance</Type>
            <Attribute>SOV_ALL_HERE</Attribute>
        </Prereq>
        <Prereq>
            <Type>Gender</Type>
            <Attribute>SOV_GEN_HERE</Attribute>
        </Prereq>
        <Prereq>
            <Type>AbilityBonusOption</Type>
            <Attribute>SOV_BLD_HERE(Blood_Amarian etc)</Attribute>
        </Prereq>        
        <SpellResourceCost>
            <Resource>Mana</Resource>
            <Amount>1</Amount>
        </SpellResourceCost>
        <GameModifier>
            <ModType>Unit</ModType>
            <!--<Attribute>SummonUnit</Attribute>-->
            <Attribute>UnitJoinArmy</Attribute>
            <StrVal>CHAMP_INT_NAME</StrVal>
            <UnitClass>Champion</UnitClass>
            <Value>5</Value>
        </GameModifier>
        <AIData AIPersonality="AI_General">
            <AIPriority>0</AIPriority>
        </AIData>
        <HitSoundFX>Spell_SummonFamiliar_01</HitSoundFX>
        <SpellDefEffect>
            <EffectName>S_SummonEarthElemental_Particle</EffectName>
            <LocalPosition>0,0,0</LocalPosition>
            <EffectScale>0.5</EffectScale>
            <EffectDelay>0</EffectDelay>
            <SnapToTerrain>1</SnapToTerrain>
        </SpellDefEffect>
    </SpellDef>