Help with mod to let a monster join you after defeat

I am trying to make a mod that lets a monster join you after it has been defeated (just like you get gold, or an item, but in this case the monster joins your army).

I have made the following mod file, but it is not working properly. The problem is that this mod results in a game where at the start I am able to train a peasant, a pioneer, and an undefined unit without picture.

What am I doing wrong? This mod is supposed to build on the existing "GiantBlackWidow", but it appears to add a new monster instead...

 

Code: xml
  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <UnitTypes>
  3.  <DataChecksum NoParse="1">
  4.   <Ignore>DisplayName,Quote,ModelPath,ModelScale,AnimationPack,MovingSfx</Ignore>
  5.   <Translate>DisplayName,Quote</Translate>
  6.  </DataChecksum>
  7.     <UnitType InternalName="GiantBlackWidow">
  8.         <Title>Spider Join</Title>
  9.         <Liklihood>100</Liklihood>
  10.         <ModType>CharmTarget</ModType>
  11.     </UnitType>
  12. </UnitTypes>

 

2,612 views 1 replies
Reply #1 Top

First, I think you have to overwrite the entire unit (not just the stuff you want to add, copy the whole unit's xml to your mod file, then add what you want).

Second, I don't think charm monster will work because it will be dead at that point. But, you can have the same monster type join the army (although I havent tested it out)

Third, you forgot the treasure tag (looking at the core XMLs arent very helpful sometimes)

 

<Treasure>
<Title>Spider Join</Title>
<Liklihood>1</Liklihood>
<GameModifier>
<ModType>Unit</ModType>
<Attribute>UnitJoinArmy</Attribute>
<StrVal>GiantBlackWidow</StrVal>
<UnitClasS>GiantBlackWidow</UnitClasS>
</GameModifier>
</Treasure>