[Help] Can someone look this over

Alright I am looking at modifying some base game values and statistics and I am trying to make sure I am starting off right.  Just looking for someone to check out my code to see if it appears to look right.  I am using some legacy commands that are left over from E:WoM that have not been removed from the system.

Code: xml
  1. <UnitStatType InternalName="UnitStat_Intelligence_Mod">
  2. <DisplayName>Intelligence</DisplayName>
  3. <DisplayNameShort>INT</DisplayNameShort>
  4. <Description>Increases the experience a unit earns, its ability to resist spells and lowers the chance its spells will be resisted.</Description>
  5. <Icon>Stat_Intelligence_Icon.png</Icon>
  6. <Hidden>0</Hidden>
  7. <BaseSovereignAttribute>1</BaseSovereignAttribute>
  8. <DefaultValue>10.0</DefaultValue>
  9. <UnitStatGrouping>AbilityStat</UnitStatGrouping>
  10. <UnitStatGrouping>UnitDetailsAttribute</UnitStatGrouping>
  11. </UnitStatType>

To be used with the following,

Code: xml
  1. <AbilityBonus InternalName="StatsAbility">
  2. <AbilityBonusOption InternalName="Stats">
  3. <DisplayName>Stats</DisplayName>
  4. <Icon>Ability_Spirit_Icon</Icon>
  5. <GameModifier>
  6. <ModType>Unit</ModType>
  7. <Attribute>AdjustUnitStat</Attribute>
  8. <StrVal>UnitStat_SpellDamage</StrVal>
  9. <Duration>-1</Duration>
  10. <Calculate InternalName="IntToBeUsed" ValueOwner="CastingUnit">
  11. <Expression><![CDATA[[UnitStat_Intelligence]-10]]></Expression>
  12. </Calculate>
  13. <Calculate InternalName="IntBonus">
  14. <Expression><![CDATA[[IntToBeUsed]/2]]></Expression>
  15. </Calculate>
  16. <Calculate InternalName="Value">
  17. <Expression><![CDATA[[IntBonus]]]></Expression>
  18. </Calculate>
  19. </GameModifier>
  20. <HideWhenUpgraded>0</HideWhenUpgraded>
  21. <Type>Aggressive</Type>
  22. <AIData AIPersonality="AI_General">
  23. <AIPriority>5</AIPriority>
  24. </AIData>
  25. </AbilityBonusOption>
  26. </AbilityBonus>

The idea is to add this ability to each race and possibly some monster units.  IT will entail a new base stat system not using the current stat modifiers that Stardock has set within the Elemental Defs.  This is for a mod eventually but this is not simple project this is basically rebuilding some of the game mechanics from the ground up in a slightly different fashion.  I will attempt to keep the main gameplay in tact but I am going a different way.  Anywho can someone look this over before I dive to deep only to find that this doesn't work.

8,759 views 15 replies
Reply #1 Top

Anyone have a chance to look this over yet?

Reply #2 Top

my understanding isn't deep enough to know if you can calculate that or not. I do know you can change the values in the coredefs, but i don't know if you can outright override the current system because the old system will be continually reloaded over it.

 

what is this for?

 

  1. <Duration>-1</Duration>
Reply #3 Top

I used the modifier off a spell definition from E:WoM, poaching old code thats not used but still in the system.  I am not sure if that tag needs to be there or not.

Reply #4 Top

Alright I boiled my code down to this but it still doesn't work in game any guesses why?

Code: xml
  1. &lt;GameModifier&gt;
  2. &lt;ModType&gt;Unit&lt;/ModType&gt;
  3. &lt;Attribute&gt;AdjustUnitStat&lt;/Attribute&gt;
  4. &lt;StrVal&gt;UnitStat_WeightCapacity&lt;/StrVal&gt;
  5. &lt;Calculate InternalName="Value" ValueOwner="OwnerUnit"&gt;
  6. &lt;Expression&gt;&lt;![CDATA[[UnitStat_Strength_Mod]*3]]&gt;&lt;/Expression&gt;
  7. &lt;/Calculate&gt;
  8. &lt;/GameModifier&gt;

Reply #5 Top

Abilitybonusoptions are not updated every turn, meaning you can't put any calculates in them. Automatically updating Calculate can only be used in spelldefs and certain improvements

Reply #6 Top

Argh, so basically this is not possible without creating a persistent buff that simulates the same thing.  Thanks for the info Heavenfall.

Reply #7 Top

Just had a thought about this, can I add a buff spell to say something that all units use, say like the units heads?

Reply #8 Top

You can add battleautocastspells to items, but they get cast twice for some reason. And obviously the stats would not be displayed or applied out of combat.

Reply #9 Top

Alright then this is shelved like many other things for the moment until it can be hopefully addressed later.

Reply #10 Top

¯\_(ツ)_/¯

 

Reply #11 Top

You can add battleautocastspells to items, but they get cast twice for some reason

Oh geez, I though it was just me.  I have an item that does this and spent hours trying to figure out what i'd done wrong that was making it autocast twice.  Oh well, there it is... it just does!

:S

Reply #12 Top

 

¯\_(ツ)_/¯

Reply #13 Top

Dude I love the crazy shrug.  I have never seen that one before.

Reply #14 Top

Quoting abob101, reply 11



You can add battleautocastspells to items, but they get cast twice for some reason




Oh geez, I though it was just me.  I have an item that does this and spent hours trying to figure out what i'd done wrong that was making it autocast twice.  Oh well, there it is... it just does!

 

And what about Pariden's Noble Legacy auto cast spell? Does it also gets casted twice? Maybe using this faction skill as base halmal could achieve his purpose.

Reply #15 Top

That is using the battleautocast and will not work for a strategic spell buff that is supposed to work at all times.  Effectively this is a problem for either using a strategic buff that will be applied to all or being able to use calculate within abilitybonusoptions.