Stv
June 4th, 2020, 08:57
OK time to show my ignorance again.
I have the following code in a quick test setup just to set a test database value and tie it to some buttons
function onInit()
newnode=DB.createChild("testnode","test","number")
Debug.console("newnode",newnode)
DB.setValue(newnode,"","number",2)
end
Then in my xml file I have
<buttongroup_counter name="legrescounter" source="testnode.test">
<anchored to="legres_label" position="righthigh" offset="40,0" />
<values>
<maximum>8</maximum>
<current>4</current>
</values>
</buttongroup_counter>
Which I was hoping would give me a working set of butons to play around with, which it does to a degree.
The buttons display in the combattracker where I have set them, they have the correct number of buttons, and are filled in upto number 4.
But when I 1st press the buttons, nothing happens, when they are pressed for the second time the following error is produced :
Script Error: [string "common/scripts/buttongroup_counter.lua"]:128: attempt to compare nil with number
I'm obviously doing something incorrectly, what do I need to add/change to get this to work ?
Cheers, Steve.
I have the following code in a quick test setup just to set a test database value and tie it to some buttons
function onInit()
newnode=DB.createChild("testnode","test","number")
Debug.console("newnode",newnode)
DB.setValue(newnode,"","number",2)
end
Then in my xml file I have
<buttongroup_counter name="legrescounter" source="testnode.test">
<anchored to="legres_label" position="righthigh" offset="40,0" />
<values>
<maximum>8</maximum>
<current>4</current>
</values>
</buttongroup_counter>
Which I was hoping would give me a working set of butons to play around with, which it does to a degree.
The buttons display in the combattracker where I have set them, they have the correct number of buttons, and are filled in upto number 4.
But when I 1st press the buttons, nothing happens, when they are pressed for the second time the following error is produced :
Script Error: [string "common/scripts/buttongroup_counter.lua"]:128: attempt to compare nil with number
I'm obviously doing something incorrectly, what do I need to add/change to get this to work ?
Cheers, Steve.