A quick question about champions

I've been trying to mod the game so when a particular custom sovereign of a custom faction started the game, a champion would spawn with her, instead of one of the two starting units (I basically took Ascian, made her weaker, spawn as a level 1 and added the sovereign bond ability).I've managed to get the unit to spawn, but it won't spawn properly. It seems to be spawing as a normal unit, instead of as a champion. It won't let me change it's equipment, it won't spawn with equipment, and when I level the unit up I can't choose perks. This is the code I'm using to spawn the unit

 

<GameModifier InternalName="GameModifier 1641">
            <ModType>Map</ModType>
            <Attribute>SummonUnit</Attribute>
            <UnitClass>Champion_Gwenhaur</UnitClass>
            <Value>1.0000</Value>
            <Multiplier>1.0000</Multiplier>
        </GameModifier>

 

and it comes out of the custom sovereign's unit file. I just want to be able to spawn the unit as a champion, not a normal unit, and I can't figure it out. Can anyone  please give me some help? thanks.

2,999 views 2 replies
Reply #1 Top

OK, I've seen the same problem here.  The way I worked around it was to create an item (based on a suggestion made by Parrotmath).  I first used Bacco The Begger as my test subject here.

Create an item.  Here's the code I used:

<GameItemTypes>

        <GameItemType InternalName="Token_Bacco">
            <DisplayName>Bacco's Token</DisplayName>
            <Description>This token will summon Bacco to serve alongside you</Description>
            <GameModifier InternalName="JoinBaccoJoin">
                <ModType>Unit</ModType>
                <Attribute>UnitJoinArmy</Attribute>
                <StrVal>Champion_Bacco</StrVal>
                <StrVal2>Bacco the Beggar</StrVal2>
                <Value>1</Value>
                <UnitClass>Champion</UnitClass>
                <Provides>Summons Bacco</Provides>
            </GameModifier>
            <!--<Type>Accessory</Type>
            <IsAvailableForSovereignCustomization>1</IsAvailableForSovereignCustomization>
            <CustomizationPointCost>1</CustomizationPointCost>-->
            <HeroOnly>1</HeroOnly>
            <IsUsable>1</IsUsable>
            <ArtDef>Token_Wolf_ArtDef</ArtDef>
            <GameItemTypeArtDef InternalName="Token_Wolf_ArtDef">
                <GameItemTypeModelPack InternalName="Token_Wolf_Default">
                    <IconFile>Item_TokenoftheWolf.png</IconFile>
                    <TintR>53</TintR>
                    <TintG>55</TintG>
                    <TintB>182</TintB>
                    <SFX>Equip_MagicRing_01</SFX>
                    <SFX>Equip_MagicRing_02</SFX>
                    <SFX>Equip_MagicRing_03</SFX>
                    <SFX>Equip_MagicRing_04</SFX>
                    <GameItemTypeModel>
                    </GameItemTypeModel>
                </GameItemTypeModelPack>
            </GameItemTypeArtDef>
        </GameItemType>

</GameItemTypes>

Then equip your Sov with this item, in the Sov file. (Change Champion_Bacco to whatever Champion you are trying to recruit)


        <AutoCreateEquipment>Token_Bacco</AutoCreateEquipment>

This will create an item that will allow you to Summon Bacco, having him join your army.

Note the commented out code above. 


            <!--<Type>Accessory</Type>
            <IsAvailableForSovereignCustomization>1</IsAvailableForSovereignCustomization>
            <CustomizationPointCost>1</CustomizationPointCost>-->

I tried including this, so Sovs could pick this token during Sov creation, but what ends up happening is that the game thinks this token is an Accessory, not a one use item, hence you don't get the 'Use Item' prompt.  I'm sharing it here, in case you can think of a different way to get this to show up in Sov creation, so that it will actually work normally, but still be a Sov creation option.  If you are good with just adding in the item via .xml editing, though, you can delete these three lines without worry.

BTW, simply including the 'UnitJoinArmy' gamemodifier code from the above item file in your Sov file won't work.  I've tried a few times...

 

One final note: As of 1.6, AI Sovs WILL use these tokens if they have them.  I had one of my custom Sovs with four different versions of this token (for testing purposes of course), and all four Champions were in that AI's ranks wandering around the map when I came across them, fairly early actually (around turn 8).

This was something I had planned to use for my Lieutenants mod (if I ever get around to it), but it'll be a bit before I get to it if I ever do get around to it...

Reply #2 Top

Thanks! This worked perfectly for me.