Anyone figure out how to create npc's or summon them in game yet?

I have wrestled with this one for a while now and cant ever seem to get it to work. First by changing the faction and allowing them to create the npc through the city, then next I tried to change the summoning spells to allow you to summon an npc.

While I did summon a unit or create a unit it was nothing more than a unit and not an npc hero.

So anyone figure out a work around for this?

5,602 views 9 replies
Reply #1 Top

Yes, I've made a trait that spawns a faithful dog. However, I CANNOT get it to spawn someone as a champion character (which was my origional purpose). Here is the code for my dog (a custom unit).

            <GameModifier InternalName="SummonUnit">
                <ModType>Map</ModType>
                <Attribute>SummonUnit</Attribute>
                <UnitClass>CompanionDog</UnitClass>
                <StrVal>Doggy</StrVal>
            </GameModifier>

The problem appears to be with SummonUnit, we probably need to be using something else and I haven't discovered that code yet.

I'd love it if someone could figure out how to spawn a champion. We could do a lot with that code! Could implement taverns that slowly spawn new champions, could implement an "Engaged" trait where you begin with a spouse, could implement a "Loyal Friend" trait where you spawn with a companion, and you could use spells to "summon" new champions.

Reply #2 Top

Yeah figured out how to do that, but running into the same issue as you. I personally would like to see the ability to create your own heroes like in Sword of Aragon or being able to summon them like in MOM or AOW. Also it sounds cool that you could be able to goto an inn and recruit there or have a hero join you as a quest reward instead of having a bunch of heroes running around on the main map using up my resources.

Reply #3 Top

This summons an npc that counts as a champion (could cast imbue champion on them), but could not marry them (female sovereign, with male champion). Still a work in progress, since it only costs 1 mana.

<SpellDef InternalName="SummonJoffrey">

<DisplayName>Summon Joffrey</DisplayName>

<Description>Summon a Joffrey from a pocket universe to serve with you.</Description>

<Image>FireCrystal_Medallion.png</Image>

<IconFG>Pariden'sReturn.png</IconFG>

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

<SoundFX>Spell_DarkEnchan_0t2</SoundFX>

<ManaCost>1</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="SummonUnit">

<ModType>Unit</ModType>

<Attribute>UnitJoinArmy</Attribute>

<UnitClass>Champion</UnitClass>

<StrVal>Joffrey</StrVal>

</GameModifier>

</SpellDef>

Let me know if you find out more and I will let you know if I find out more  :grin:

 

Edit: Found out how to create a spouse for you as well!!  As you can see it was meant to allow you to marry the summoned champions (internal name), but it works good!

<SpellDef InternalName="MarryChampion">

<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>

For this spell you will need this, save it to [Your Elemental Documents]\Units\Icons\:

Reply #4 Top

Hmmm, still having trouble getting this to work. Not sure what I'm doing wrong either. But excellent progress on figuring this out!

Also, I REALLY like the idea of being able to go into the Inn (or maybe the Pub for lower level heroes) and recruit them. We could probably make it an unlock-able ability (while in the city) or maybe just a purchasable "Deed" to "summon" them.

Reply #5 Top

Unless someone can think of a better way, the best way I can think of to be able to get a champion from a pub/inn would be make a set of spells that maybe only work once, that their target is the pub/inn, and it summons them for a cost of gold or something.

Reply #6 Top

Actually you make a quest where you select what type of npc you want to hire from the inn.

 

Now if I can only allow the city to recruit champions instead of units. The reason behind this is to have units that will actually level up and instead of deleting a unit when its gear becomes obsolete you can just buy more gear and suit it up.

Reply #7 Top

Well for me it was the duration line that was screwing it up for me. Once I got rid of that I was able to summon the hero.

Also anyone know if there is some way to make a limit on the number of leaders you can summon? Perhaps making it use an enchantment slot, but anyone know how many enchantment slots you have?

Reply #8 Top

You guys got them to spawn as champions? How?

I'm trying to implement this (the spawning) as a trait but... it ain't working for me. I think what I'm going to have to do is spawn the character with a special unit or a "quest" building.

Also, I'm trying to avoid making this mod into a spell. Can the spell be something that can only be used once and then disappears? Can it work like an abilities? Are abilities spells?

Reply #9 Top

Unfortunately no its not a single cast spell and there is no way to make it so, that I know of. I personally believe that the -1 duration makes the summon an enchantment which would make it single cast, but the spell wont work with the -1 duration.