celestian
February 27th, 2017, 02:09
So, I'm trying to add "skills". I have the following fields, base/class_adj/stat_adj/armor_adj/total AND a cycle select. Total has the onUpdate that will collect all those values and set itself to them.
The cycle select will let the player choose from nothing/percentile/str/dex/con/int/wis/char. When it cycles I am trying to set the base based on what they select (if they select str I set the base to the str score/etc). When I set the base value I get the alert of a recursive node event. The change to the base is causing the onUpdate bit for total to run again.
This is the bit that sets it.
nValue = DB.getValue(nodeChar, "abilities." .. sAbility .. ".score", 0);
DB.setValue(nodeSkill, "base_check","number", nValue);
I'm trying to think how to get around this. I want the user to be able to set the base but default it to the stat (if they select a stat with the cycler) and they can change it if they want.
Any suggestions?
edit...update
As a work around for now I've just made the base_check field hidden if they select the ability score types and just fill that in behind using ability score.
The cycle select will let the player choose from nothing/percentile/str/dex/con/int/wis/char. When it cycles I am trying to set the base based on what they select (if they select str I set the base to the str score/etc). When I set the base value I get the alert of a recursive node event. The change to the base is causing the onUpdate bit for total to run again.
This is the bit that sets it.
nValue = DB.getValue(nodeChar, "abilities." .. sAbility .. ".score", 0);
DB.setValue(nodeSkill, "base_check","number", nValue);
I'm trying to think how to get around this. I want the user to be able to set the base but default it to the stat (if they select a stat with the cycler) and they can change it if they want.
Any suggestions?
edit...update
As a work around for now I've just made the base_check field hidden if they select the ability score types and just fill that in behind using ability score.