Problem with my code

I'm most likely trying something that's impossible again, but I'd like to run it by the more knowledgeable fellows of the forum before giving up on my ideas. The big idea was to make a bloodtype that increases attack by 1 each level and reduces defense by 2. In the current code there's also a line about HP, but that was just for testing purposes.

Code: xml
  1. <AbilityBonus InternalName="Blood_BarbarianAbility">
  2. <AbilityBonusOption InternalName="Blood_Barbarian">
  3. <DisplayName>Barbarian Blood</DisplayName>
  4. <Description>+ 1 HP per level,+ 1 Attack per level, -2 Defense per level</Description>
  5. <Icon>RoundCrest_11.png</Icon>
  6. <GameModifier>
  7. <Type>Unit</Type>
  8. <Attribute>AdjustUnitStat</Attribute>
  9. <StrVal>UnitStat_HitPoints</StrVal>
  10. <Value>1</Value>
  11. <PerLevel>1</PerLevel>
  12. <Provides>+1 HP per level</Provides>
  13. </GameModifier>
  14. <GameModifier>
  15. <Type>Unit</Type>
  16. <Attribute>AdjustUnitStat</Attribute>
  17. <StrVal>UnitStat_Attack_Pierce</StrVal>
  18. <Value>1</Value>
  19. <PerLevel>1</PerLevel>
  20. <Provides>+1 Attack per level</Provides>
  21. </GameModifier>
  22. <GameModifier>
  23. <Type>Unit</Type>
  24. <Attribute>AdjustUnitStat</Attribute>
  25. <StrVal>UnitStat_Defense_Pierce</StrVal>
  26. <Value>-2</Value>
  27. <PerLevel>1</PerLevel>
  28. <Provides>-2 Defense per level</Provides>
  29. </GameModifier>
  30. <AIData AIPersonality="AI_General">
  31. <AIPriority>5</AIPriority>
  32. </AIData>
  33. </AbilityBonusOption>
  34. </AbilityBonus>

 

Problems:

- Attack and Defense are not affected by the bloodtype (no changes either if I use UnitStat_Attack_Boost instead of Pierce)

- HP level bonus is listed as +2 for level 1 units (didn't have the time to check what it lists on further levels yet)

11,153 views 6 replies
Reply #2 Top

I don't see anything that likely wouldn't work.  Other modders, do you have any ideas?

Reply #3 Top

 <Type>Unit</Type>

 

<ModType> not <Type>

Reply #5 Top

Quoting random_thoughts_7, reply 3

 <Type>Unit</Type>

 

<ModType> not <Type>
End of random_thoughts_7's quote

 

Thanks, that fixed it.

 

Good to know I can still make myself feel like a fool for not seeing that.

Reply #6 Top

Don't worry about, I didn't see the error either.  Actually, I have made the same error, once or twice until I recognized it. =)