The data below (in my previous post) was from the db after typing /save with a modified character. .. So yes. it should be showing there right? .. and no it isn't.. so something is tweaked. Gotta figure out where to look to untweak it.
Printable View
The data below (in my previous post) was from the db after typing /save with a modified character. .. So yes. it should be showing there right? .. and no it isn't.. so something is tweaked. Gotta figure out where to look to untweak it.
Is your number_cv template based on the same template hierarchy as number_charabilitybonus from the 3.5E ruleset? i.e. does it at some point in the hierarchy link to the CoreRPG number_modifier template? It is this template (number_modifier) that has the code (in number_modifer.lua) that sets and reads the value in the database.
Yep.. number_cv uses number_chartotal which uses number_modifier...
In the onInit() function for number_modifier.lua (the LUA script file for the number_modifier control template) there is code that creates the database entry for the modifier field:
In your case, modifierFieldName will be combatvalues.dcv.bonusmodifier - so this will be created as a child of window.getDatabaseNode(). I'd recommend putting some debug code in the script to see what window.getDatabaseNode() returns - use Debug.console to write the result of window.getDatabaseNode().getNodeName() and see if his is valid and also if adding combatvalues.dcv.bonusmodifier as a child node would make sense.Code:modifierFieldNode = window.getDatabaseNode().createChild(modifierFieldName, "number");
Actually, I think I see the issue. Compare your database structure with that of the example I gave above:
This gives database entries of:Code:<number_charabilitybonus name="strengthbonus" source="abilities.strength.bonus">
<anchored to="strength" />
<target>strength</target>
<modifierfield>abilities.strength.bonusmodifier</modifierfield>
<description textres="char_tooltip_strbonus" />
</number_charabilitybonus>
Notice that both the strength bonus (the field to display as the main bonus field) is strength.bonus and that the modifier field is strength.bonusmodifier - they are built on the same base database entry, strength, which is just a placeholder not a database entry that has a type (number in this case).Code:<strength>
<holder name="Player" owner="true" />
<bonus type="number">2</bonus>
<bonusmodifier type="number">2</bonusmodifier>
<damage type="number">0</damage>
<score type="number">14</score>
</strength>
In your code you use combatvalues.dcv to hold the number and then try to build a child on this to hold the bonus: combatvalues.dcv.bonusmodifier. I don't think the FG database supports this for these type of fields.
Use similar code to the 3.5e example code to have 2 separate values combatvalues.dcv.bonus and combatvalues.dcv.bonusmodifier. Use:
Code:<number_cv name="dcv" source="combatvalues.dcv.bonus">
<anchored>
<to>cvtitle</to>
<position>insidetopleft</position>
<offset>105,20</offset>
</anchored>
<target>dcv</target>
<modifierfield>combatvalues.dcv.bonusmodifier</modifierfield>
<description>
<text>DCV</text>
</description>
</number_cv>
Thanks. That did it. I went the other way and changed them to combatvalues.dcvmod and kept combatvalues.dcv since it was incorporated all over the place in the mechanics and the mods really only come up in a couple of places. It seems to have worked just fine. Thanks again!
I would really love it if this rule set was downloadable. It doesn't have to be perfect.
What version of Champions is this for?
A big set of Champions and Hero System 5th Revised Edition PDFs available for a short time on Bundle of Holding: https://bundleofholding.com/index/preview
If you're not using the same version, sorry for the slightly unrelated spam!
That is in fact exactly the version that I am using as the model for the ruleset.
I'm very glad that you're doing this work with the 5th Revised version. While I like the work the DOJ guys have been doing with the Hero System Rules, I think they sorta lost their way with 6th edition. Plus me and my group are old so we like the older rules, took some convincing to move to 5th haha.