I've added a custom resource in one my experiments: UnholyMana. I can get it in the game and show it in the resource bar (and collect it), but I can't seem to get it to pick up from a <Calculate/> element. I've tried setting ValueOwner="Player" and a half dozen other things. Has anyone else had any luck with this one?
EDIT: Clarification on what I'm trying to do
In this specific case, I've added a new Resource to the game: UnholyMana. It's global, not shared, not stored, and visible in the resource strip at the top. I gave my sovereign the ability to provide +1 (per turn, since it's not stored). It displays 1 unit in the resource strip (as expected). The InternalName and "Type" of the resource are both "UnholyMana" (mimicking other resources).
The goal is to allow the UnholyMana resource to provide a damage bonus to specific spells (much like shards). An example for how I expected this to go looks like this:
----- Note: This doesn't actually work. -----
Code: xml
- <GameModifier>
- <ModType>Unit</ModType>
- <Attribute>CurHealth</Attribute>
- <Calculate InternalName="EffectStrength" ValueOwner="Player">
- <Expression><![CDATA[[UnholyMana] * -5.0]]></Expression>
- </Calculate>
- <Calculate InternalName="Value">
- <Expression><![CDATA[[EffectStrength]]]></Expression>
- </Calculate>
- </GameModifier>
----- Note: This doesn't actually work -----Honestly, I thought it would be a slam-dunk, but it doesn't work. I've tried
lots of variations with ValueOwner={Player, PlayerSovereign, CastingUnit, Player_1} and a bunch of other things I saw other places in the XML (even comments). I've tried changing the variable name as well to things like { Resource_UnholyMana, NumShards_UnholyMana, UnitStat_UnholyMana } and more.
It seems like the resource value would be available to you more easily - I've actually done this succesfully with custom
unit stats, but I can't seem to make it work with resources.
Any help would be appreciated,
Gnilbert