Pet Dragon/Drake and Pet Units

Hi All,

I have a few questions on modding.

I just created a set of Sovereigns and some heroes.  I want one of them to have a pet Dragon.  The others, I wanted to start off with a special hero bodyguard I designed.  How do I designate that?  Do I need to add something to my Sovereign xml file?

Another question is how do I make my custom random npcs show up in my game.  Where do I add them in the C:\My Documents\My Games\Elemental folder?  Do I have to name them in a specific way? 

I really don't want to edit any of the core files.  Would prefer to stick to using the modding folders.

Thanks

11,469 views 24 replies
Reply #2 Top

Regarding the first issue: in the SovereignHistories.xml you find the entry for the Warlord history:

        <AbilityBonusOption InternalName = "History_Warlord">
            <DisplayName>Warlord</DisplayName>
            <Description>Sovereign starts the game with two sentinel units.</Description>
      <Icon>Profession_Warlord.png</Icon>
            <GameModifier InternalName="SummonUnit">
                <ModType>Map</ModType>
                <Attribute>SummonUnit</Attribute>
                <UnitClass>Sentinel</UnitClass>
                <StrVal>Sentinel</StrVal>
            </GameModifier>
            <GameModifier InternalName="SummonUnit">
                <ModType>Map</ModType>
                <Attribute>SummonUnit</Attribute>
                <UnitClass>Sentinel</UnitClass>
                <StrVal>Sentinel</StrVal>
            </GameModifier>
        </AbilityBonusOption>

 

This spawns two Sentinel units for the Sovereign.

Regarding the other issue: I don't know this personally but there is a mod that adds NPC heroes, maybe look into that?

Reply #3 Top

is it possible to spawn more than one sentinel or different type of unit (example... a beast a elemental a dragon...?)?

on SWEAW FC once i modded a similar xml by adding several lines of starships for the death star retinue of excorting ships.... it was possible to add at least 15 or 16 starships of every type in the game (knowing correct input name of course)

Reply #4 Top

Yes it is possible Raruto, just look at the code I just posted. It spawns two sentinels and the code repeats itself (GameModifier /GameModifier) for each of the two Sentinels. So add another copy for three Sentinels or change the UnitClass for another unit.

Reply #6 Top

Yes, you can do this. However, I don't think anybody has discovered how to make them champions yet. I've implemented a dog and a bodyguard as special traits you can select if you are interested: Abilities and Traits Mod.

Reply #7 Top

Can you post a sample code?  I already created a custom champion named Solomon in his own .xml file.  Now I want to make sure this guy always spawns as a member of a specific faction if not a as part of a specific Sovereign.

Thanks

Reply #8 Top

Try using this on the sovereign you want to be a special add-ons:

<GameModifier InternalName="SummonUnit">

<ModType>Unit</ModType>

<Attribute>UnitJoinArmy</Attribute>

<UnitClass>Champion</UnitClass>

<StrVal>[Sovereign Internal Name Goes Here]</StrVal>

</GameModifier>

 

If it does not work, try duplicating the sovereigns and converting to champions (copy a champion and transfer the sovereign stuff over, where possible) that is what I did for some special champion units.

Reply #9 Top

Maybe James would like to shed some light into this. Seems this is the thread: https://forums.elementalgame.com/393019

Could be this:

 

<GameModifier InternalName="SummonUnit">

<ModType>Map</ModType>

<Attribute>SummonUnit</Attribute>

<UnitClass>Champion</UnitClass>

<StrVal>Champion Name</StrVal>

</GameModifier>

Reply #10 Top

Really wished Stardock could help us out on this one.  Atleast let us know if it is possible.

Reply #11 Top

Hi Angelo85,

Tried what you suggested.  Doesn't work.  I think we're just missing something.  Should be fairly simple.

Reply #12 Top

I wish it was just that simple. I've tried almost everything I could think of. Here is an example of the code I've been testing to spawn a spouse for the player (ie. a champion who is marryable):

...

<GameModifier InternalName="SummonNPC">
                <ModType>Map</ModType>
                <Attribute>SummonUnit</Attribute>
                <UnitClass>TestSpouse</UnitClass>
                <StrVal>Fiancee</StrVal>
            </GameModifier>
            <!-- WHAT PROBABLY WOULD WORK: Place a "Quest" building (like the Naturalist trait) near the player where they get ring or unit joins. -->
            <!-- Doesnt work -->
            <GameModifier>
                <ModType>GiveItem</ModType>
                <Attribute>Lifesap</Attribute>
            </GameModifier>
            <GameModifier>
                <ModType>GiveItem</ModType>
                <Attribute>staff</Attribute>
            </GameModifier>
            <GameModifier>
                <ModType>GiveItem</ModType>
                <Equipment>Dagger</Equipment>
            </GameModifier>
            <GameModifier InternalName="SummonChampion">
                <ModType>Map</ModType>
                <Attribute>SummonChampion</Attribute>
                <UnitClass>TestSpouse</UnitClass>
                <StrVal>Champ</StrVal>
            </GameModifier>
            <GameModifier InternalName="SummonHero">
                <ModType>Map</ModType>
                <Attribute>SummonHero</Attribute>
                <UnitClass>TestSpouse</UnitClass>
                <StrVal>Hero</StrVal>
            </GameModifier>
            <GameModifier InternalName="SummonUnit">
                <ModType>Map</ModType>
                <Attribute>SummonUnit</Attribute>
                <UnitClass>CompanionDog</UnitClass>
                <StrVal>Doggy</StrVal>
            </GameModifier>
            <GameModifier>
                <ModType>ProduceResource</ModType>
                <Attribute>Gold</Attribute>
                <Calculate InternalName = "Value" ValueOwner="PlayerSovereign">
                    <Expression><![CDATA[[UnitStat_Intelligence]+[UnitStat_Charisma]]]></Expression>
                </Calculate>
                <PerTurn>1</PerTurn>
                <Duration>-1</Duration>
            <GameModifier>
                <Target>Player</Target>
                <ModType>ProduceResource</ModType>
                <Attribute>Gold</Attribute>
                <Calculate InternalName = "Value" ValueOwner="PlayerSovereign">
                    <Expression><![CDATA[[UnitStat_Intelligence]+[UnitStat_Charisma]]]></Expression>
                </Calculate>
                <PerTurn>1</PerTurn>
                <Duration>-1</Duration>
            </GameModifier>
            <GameModifier>
                <Target>Player</Target>
                <ModType>ProduceResource</ModType>
                <Attribute>Gold</Attribute>
                <Calculate InternalName = "Value" ValueOwner="Unit">
                    <Expression><![CDATA[[UnitStat_Intelligence]+[UnitStat_Charisma]]]></Expression>
                </Calculate>
                <PerTurn>1</PerTurn>
                <Duration>-1</Duration>
            </GameModifier>
            <GameModifier>
                <Target>Player</Target>
                <ModType>ProduceResource</ModType>
                <Attribute>Gold</Attribute>
                <Calculate InternalName = "Value" ValueOwner="CastingUnit">
                    <Expression><![CDATA[[UnitStat_Intelligence]+[UnitStat_Charisma]]]></Expression>
                </Calculate>
                <PerTurn>1</PerTurn>
                <Duration>-1</Duration>
            </GameModifier>
            <GameModifier>
                <Target>Player</Target>
                <ModType>Resource</ModType>
                <Attribute>Gold</Attribute>
                <Calculate InternalName = "Value" ValueOwner="PlayerSovereign">
                    <Expression><![CDATA[[UnitStat_Intelligence]+[UnitStat_Charisma]]]></Expression>
                </Calculate>
                <PerTurn>1</PerTurn>
                <Duration>-1</Duration>
            </GameModifier>
            <GameModifier>
                <Target>Player</Target>
                <ModType>Resource</ModType>
                <Attribute>Gold</Attribute>
                <Calculate InternalName = "Value" ValueOwner="CastingUnit">
                    <Expression><![CDATA[[UnitStat_Intelligence]+[UnitStat_Charisma]]]></Expression>
                </Calculate>
                <PerTurn>1</PerTurn>
                <Duration>-1</Duration>
            </GameModifier>
            <GameModifier>
                <Target>Unit</Target>
                <ModType>Resource</ModType>
                <Attribute>Gold</Attribute>
                <Calculate InternalName = "Value" ValueOwner="PlayerSovereign">
                    <Expression><![CDATA[[UnitStat_Intelligence]+[UnitStat_Charisma]]]></Expression>
                </Calculate>
                <PerTurn>1</PerTurn>
                <Duration>-1</Duration>
            </GameModifier>
            <GameModifier>
                <Target>Unit</Target>
                <ModType>Resource</ModType>
                <Attribute>Gold</Attribute>
                <Calculate InternalName = "Value" ValueOwner="Unit">
                    <Expression><![CDATA[[UnitStat_Intelligence]+[UnitStat_Charisma]]]></Expression>
                </Calculate>
                <PerTurn>1</PerTurn>
                <Duration>-1</Duration>
            </GameModifier>
            <GameModifier>
                <Target>Unit</Target>
                <ModType>Resource</ModType>
                <Attribute>Gold</Attribute>
                <Calculate InternalName = "Value" ValueOwner="CastingUnit">
                    <Expression><![CDATA[[UnitStat_Intelligence]+[UnitStat_Charisma]]]></Expression>
                </Calculate>
                <PerTurn>1</PerTurn>
                <Duration>-1</Duration>
            </GameModifier>
            <GameModifier>
                <Target>Player</Target>
                <ModType>Resource</ModType>
                <Attribute>Gold</Attribute>
                <Calculate InternalName = "Value" ValueOwner="Player">
                    <Expression><![CDATA[[UnitStat_Intelligence]+[UnitStat_Charisma]]]></Expression>
                </Calculate>
                <PerTurn>1</PerTurn>
                <Duration>-1</Duration>
            </GameModifier>
            <GameModifier>
                <ModType>Unit</ModType>
                <Attribute>AdjustUnitStat</Attribute>
                <StrVal>Experience</StrVal>
                <Value>5.0</Value>
                <PerTurn>1</PerTurn>
                <Duration>-1</Duration>
            </GameModifier>
            <GameModifier>
                <ModType>Unit</ModType>
                <Attribute>UnlockAction</Attribute>
                <StrVal>MarriageProposal</StrVal>
            </GameModifier>
            <GameModifier>
                <ModType>Unit</ModType>
                <Attribute>UnlockSpell</Attribute>
                <StrVal>MarriageProposal</StrVal>
            </GameModifier>
            <GameModifier>
                <ModType>Unit</ModType>
                <Attribute>UnlockSpell</Attribute>
                <StrVal>MarriageChampion</StrVal>
            </GameModifier>
        </AbilityBonusOption>

End of quote

I've also been trying to get money to generate based on your charisma and intelligence, experience gain, and a marriage spell... no luck with any of it. I've tried almost everything but I do have one idea for how to implement it. You could make you character spawn with a specific quest within their radius that would spawn a hero or a spouse or whatever you want. It'd be more work then I'd like to do but might be possible.

Reply #13 Top

How does Janusk spawn?  I can't seem to find him anywhere in the code.  He seems to spawn next to the sovereign.

Reply #14 Top

I believe his spawning is dependent on the "Janusk Advice" option. No idea where the code is though. If we could find that we could be in business!

Reply #15 Top

If anyone at Stardock is reading this.  Can you point us to the right direction on where to find Janusk?

Reply #16 Top

This will litterally spawn a spouse for you (and sometimes, :typo:  :puke:   ):

<SpellDef InternalName="SpawnSpouse">

<DisplayName>Summon Spouse</DisplayName>

<Description>Summon a spouse.</Description>

<Image>FireCrystal_Medallion.png</Image>

<IconFG>MarriageSpell.png</IconFG>

<IconColor>88,78,32</IconColor>

<SoundFX>Spell_DarkEnchan_0t2</SoundFX>

<ManaCost>0</ManaCost>

<Range>1</Range>

<SpellLevel>1</SpellLevel>

<SpellType>Strategic</SpellType>

<SpellClass>Defensive</SpellClass>

<SpellTargetType>Self</SpellTargetType>

<SpellDefEffect>

<EffectName>SummonLife</EffectName>

<LocalPosition>0,0,0</LocalPosition>

<EffectScale>0.3</EffectScale>

<EffectDelay>0.0</EffectDelay>

<SnapToTerrain>1</SnapToTerrain>

</SpellDefEffect>

<GameModifier InternalName="MarriageProposal">

<ModType>Player</ModType>

<Attribute>MarriageProposal</Attribute>

<AffectedUnits>Male</AffectedUnits>

<StrVal>Would you like a Wife?</StrVal>

</GameModifier>

<GameModifier InternalName="MarriageProposal">

<ModType>Player</ModType>

<Attribute>MarriageProposal</Attribute>

<AffectedUnits>Female</AffectedUnits>

<StrVal>Would you like a Husband?</StrVal>

</GameModifier>

</SpellDef>

 

Reply #17 Top

Nice, I'm going to have to try and implement that code.

Reply #18 Top

Let me know if it works

Reply #19 Top

Sythvipers already posted how to solve this in the other thread

<GameModifier InternalName="SummonUnit">

<ModType>Unit</ModType>

<Attribute>UnitJoinArmy</Attribute>

<UnitClass>Champion</UnitClass>

<StrVal>NameGoesHere</StrVal>

</GameModifier>

Reply #20 Top

Tried it, didn't work.  Where are you suppose to put that code?  Which xml file?

Reply #21 Top

A spell or an item. I don't recal if it worked putting it as a starting ability, but you might want to try it.

Reply #22 Top

Quoting Heavenfall, reply 19
Sythvipers already posted how to solve this in the other thread

<GameModifier InternalName="SummonUnit">

<ModType>Unit</ModType>

<Attribute>UnitJoinArmy</Attribute>

<UnitClass>Champion</UnitClass>

<StrVal>NameGoesHere</StrVal>

</GameModifier>
End of Heavenfall's quote

 

Unfortuatnely heroes you summon that way cannot be married. Anyone know how to solve that?

Reply #23 Top

add gender?

Reply #24 Top
August 29, 2010 1:44:18 PM

Yes, you can do this. However, I don't think anybody has discovered how to make them champions yet. I've implemented a dog and a bodyguard as special traits you can select if you are interested: Abilities and Traits Mod.

 

Is this now adapted to ver 1.09  ?   Says 1.08 in desc... thanks