Member
Join Date: Oct 2012
Posts: 37
|
Yeah, I don't have any code for this, as nothing I've done has worked so I keep deleting it.
Code:
<!-- Calculate the Damage Modifier trait as appropriate --> <eval value="1" phase="Traits" priority="4000"> <after name="Calc trtFinal"/><![CDATA[ var dammod as number dammod = #trait[attrStr] + #trait[attrSiz] field[trtDisplay].text = round( dammod / 5, 0, 1) ]]></eval> </thing> Last edited by Kevlyn; February 25th, 2013 at 07:05 AM. |
#21 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
Quote:
|
|
#22 |
Member
Join Date: Oct 2012
Posts: 37
|
No, if trtDisplay is being updated it is not visible on the screen. All that's being displayed is the derived traits table, and the damage modifier is reading 0. With this code in place trtBonus.value is still 0.
|
#23 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
Look at the value of the fields via the floating info windows and see if the field does get updated or not. Or put in debug statements to test that it gets to those lines of code?
Hmm. Is this an eval on trtBonus? If so, you are telling it not to evaluate until after trtFinal is done. The <after name="Calc trtFinal"> line is what is doing that. |
#24 |
Member
Join Date: Oct 2012
Posts: 37
|
Here's the whole derived attribute
Code:
<!-- Damage Modifier Trait --> <thing id="trDamMod" name="Damage Modifier" compset="Trait" isunique="yes" description="The bonus amount of damage a character inflicts when they physically strike or apply force."> <fieldval field="trtAbbrev" value="Dam"/> <fieldval field="trtDisplay" value="+0"/> <tag group="explicit" tag="2"/> <tag group="User" tag="Combat"/> <tag group="DashTacCon" tag="Combat"/> <tag group="DashTacCon" tag="Traits"/> <!-- Calculate the Damage Modifier trait as appropriate --> <eval value="1" phase="Traits" priority="4000"> <after name="Calc trtFinal"/><![CDATA[ var dammod as number dammod = #trait[attrStr] + #trait[attrSiz] field[trtDisplay].text = "-" & round( dammod / 5, 0, 1) & "d8" ]]></eval> </thing> |
#25 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
aha. Maybe.
I think it's timing again. On your trait component, when do you calculate Display? Is it after this and it sets it to the blank? |
#26 |
Member
Join Date: Oct 2012
Posts: 37
|
I stopped try to calculate the derived trait, so the only thing that it's racing against here is trtBonus.value which is being displayed instead.
|
#27 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Code:
<!-- Calculate the Damage Modifier trait as appropriate --> <eval value="1" phase="Traits" priority="4000"> <after name="Calc trtFinal"/><![CDATA[ var dammod as number dammod = #trait[attrStr] + #trait[attrSiz] field[trtDisplay].text = "-" & round( dammod / 5, 0, 1) & "d8" ]]></eval> </thing> Code:
<!-- Calculate the Damage Modifier trait as appropriate --> <eval value="1" phase="Traits" priority="4000"> <after name="Calc trtFinal"/><![CDATA[ var dammod as number dammod = #trait[attrStr] + #trait[attrSiz] dammod = round( dammod / 5, 0, 1) field[trtDisplay].text = "-" & dammod & "d8" ]]></eval> </thing> |
#28 |
Member
Join Date: Oct 2012
Posts: 37
|
Alright, trtDisplay is updated via the info panel. But the tab_basics is still displaying the derived trait as Damage Modifier: 0
|
#29 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
I'll need to see the code for the portal that's displaying that 0.
|
#30 |
|
|