knizia.fan wrote:b44 made some incompatible changes that will require tweaks to these macros. I'm holding off a rewrite until some other changes I'm making get applied to MapTool.
For now, the big problem is probably the roll.count change. If you go through the macros and replace every instance of
roll.count
with
(roll.count+1)
then it should be ok.
I hadn't realized that I didn't raise a couple of rollcount values one higher on the edit weapon macro. Made the correction and changed the value "p" to "r". It works now.
<!-- Build the list of weapon names. --> [h: WpnList = ""] [h, c(9,""): WpnList = WpnList + getStrProp(eval("Weapon" + (roll.count+1)), "Name") + ","]
<!-- Ask the user to select one of the weapons. --> [h: fail = input("WpnNum | " + WpnList + " | Select weapon to edit | LIST")] [h: abort(fail)]
<!-- Obtain the property string for the selected weapon. --> [h: WpnNum = WpnNum + 1] [h: WpnName = "Weapon" + WpnNum] [h: WpnProps = eval(WpnName)]
<!-- Error checking -- make sure the property string has been set up already. --> [h: NumProps = countStrProp(eval(WpnName))] [h: abort(NumProps)]
<!-- Put up a dialog with all the properties in the property string. -- Note that the new property string is automatically assigned back to the -- token property that holds the weapon's property string. --> [h: fail = input("blah | " + WpnNum + " | Weapon number | LABEL", WpnName + " | " + WpnProps + " | Weapon properties | PROPS | setvars=true")] [h: abort(fail)]
<!-- Print the new values to the chat window for verification. --> New properties for weapon #{WpnNum}: <table border=0> [h: NumProps = countStrProp(eval(WpnName))] [h,r,c(NumProps,""): "<tr><td style='padding:0px 5px'><b>" + indexKeyStrProp(WpnProps,roll.count) + "</b></td><td>" + eval(indexKeyStrProp(WpnProps,roll.count)) + "</td></tr>" ] </table>
Thanks to you all!