Hey guys, getting back to attempting to work on some stuff again. Sorry for the long break in communications, but the holiday season has been pretty crazy for us too :(
Anyway, I think I have a few more questions:
We've made a "sum" field for our group to sum up the total of each damage type:
<group layout="horizontal">
<header>Normal Attacks</header>
<data source="impact damage"><format>{{Icon|Proc|Impact}} {{{impact damage|}}}</format></data>
<data source="puncture damage"><format>{{Icon|Proc|Puncture}} {{{puncture damage|}}}</format></data>
<data source="slash damage"><format>{{Icon|Proc|Slash}} {{{slash damage|}}}</format></data>
<data source="elemental damage"><format>{{Icon|Proc| {{{elemental damage type|}}} }} {{{elemental damage|}}}</format></data>
<data source="total damage">
<default>{{#if: {{{impact damage|}}}{{{puncture damage|}}}{{{slash damage|}}}{{{elemental damage|}}} | '''Σ''' {{#expr: {{{impact damage|0}}} + {{{puncture damage|0}}} + {{{slash damage|0}}} + {{{elemental damage|0}}}}}|}}</default>
</data>
</group>
So, if {{{impact damage|}}}, {{{puncture damage|}}}, or {{{slash damage|}}} are passed an empty value when transcluded:
{{WeaponU17
| physical damage = 24 //can be empty
| impact damage = //is empty and works fine
| puncture damage = word // will break the expression, but will trigger the field to activate
}}
the field functions as intended (the value is just omitted from both the expression equation and the data field itself). In fact, the entire group will hide if all 3 are passed empty values, as would be expected.
However, the {{{elemental damage|}}} fields will throw an error "Expression error: Missing operand for +." for the expression if it is empty, like so:
| elemental damage type = //will break the icon template call if empty, but not effect the template otherwise
| elemental damage = //if empty, will throw an error. If value is passed, will work as intended
I would expect it to use the default value of 0 when not passed a value; instead we currently have to comment out the field on the trunsclusion page to prevent it from receiving the null value.
Is there a better way to do this whole process? Is there a solution to the current problem (other than commenting out the field unless explicitly being used (which looks kind of ugly on the pages being edited by users (not everybody knows what is (even I only learned it recently :3 ) ) ) )
Again, here are the pages being worked on:
P.S.: Please post a message on my wall if you reply, I'm still not getting notification from this thread even though I am following it (maybe we should start a new thread?)