A roll expression I used just fine in a local, offline install of FoundryVTT in a world using the Sandbox 5.0 System is not working at all on Forge. I’ve tested it by turning off all modules in the original world file I uploaded to Forge, by creating a new world and re-creating all the necessary parameters by hand, and by uninstalling and reinstalling the system itself, both on Forge and offline. I can only conclude it’s an issue on Forge’s end, somehow.
In short, Sandbox allows users to create their own character sheets from scratch, by creating various parameters and defining where they go on a sheet. One of the most important tools in Sandbox is “cItems”, which combine multiple user-created attributes in discreet groupings to allow for the creation of traits, abilities, and other such character-altering effects.
I created some properties to use in cItems that call for a die roll. One property, which I named “dicestatus”, was a drop-down list with the options NORM,ADV,DIS
. The other, which I named “diceroll”, was a label which I toggled to be rollable, which turns it into a button that can be clicked on in a cItem to roll a given formula. The formula I used, which to reiterate still works perfectly fine offline, is:
if[#{dicestatus}:NORM,1d6,ELSE if[#{dicestatus}:ADV,2d6kh1,ELSE if[#{dicestatus}:DIS,2d6kl1,1]]]
When dicestatus is set to NORM, it rolls 1d6, 2d6kh1 if set to ADV, and 2d6kl1 if set to DIS. But, only ADV and DIS work when I try this on Forge. the console returns this error if I attempt to roll it while dicestatus is set to NORM.
Uncaught (in promise) SyntaxError: Unexpected token ']'
at new Function (<anonymous>)
at Roll._safeEval (foundry.js:8041)
at Roll.evaluate (foundry.js:7663)
at Roll.roll (foundry.js:7692)
at gActor.rollSheetDice (a-entity.js:1898)
at async gActorSheet._onRollCheck (gactorsheet.js:454)
To reiterate one last time, this exact roll expression works without issue in an offline instance of foundryvtt.
I understand if this is all a bit too specific to one system to be bothered with, but some help or feedback about this issue would be much appreciated.