Rolled out version 0.21.
NPC dice rolls are now private. Also, overhauled how critical crits are handled. (A nasty bug lurking in there.)
I just discovered your utility yesterday, and I am quite impressed! It is exactly what I need/want to start using maptool for my campaign, since I do all character management with HeroLab.
However, I was encountering that stack overflow every time a crit was rolled. I was going to post the bug to this thread when I saw you had updated it already, so I grabbed 0.21, and that issue is gone!
Anyway, I had wondered why everyone was processing stat blocks instead of reading the XML directly, to the point where I was about to dust off my old programming skills and see if they still worked. But there is no need now. Thank you for taking the time to work on this, and share with the rest of us!
I do, unfortunately, have two other issues to report. They would only be noticeable under certain circumstances (my crazy players cause all kinds of problems).
Create a character in HeroLab that dual wields, and give them the same weapon type
in each hand. Purchase two short swords, for instance, check one for 1st, the other 2nd. HeroLabs reports everything properly, and the XML reports them separately as well, but only one button is created on the token macro. Not surprisingly, only one corresponding weapon is created in the WeaponJSON.
In the XML, there is a property in the <weapon> tag called "equipped" that can have values of 'mainhand', 'offhand', or 'bothhands'. Perhaps append something to the weapon name to keep them separate? "Short sword (main)" "Short sword (off)" for instance?
[EDIT: I see the weaponJSON already tracks the "equipped" property, it is apparently just not expecting two weapons of the same name, and it overwrites. It is only showing the offhand, which is listed 2nd in the XML ]
Also, I noticed that the "Sword, Bastard" is coming through only "Sword" in the weaponJSON, and the macro. Perhaps the comma?