Roll expression issue with Sandbox 5.0

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.

1 Like

Thanks for such a detailed report. I tried to replicate but I think I’d need to understand how Sandbox works and create these cItem and property things.
I’d say the first thing to check to compare between your local environment and the one on the Forge is the version of Foundry VTT and the version of the system. Can you confirm that they are the same in both cases ?
If it is, then one possibility is if the system itself had a bug in the latest release and their download URL points to the development branch of their repository (which I just confirmed, they do that), so on your local install, you’re not on version 0.5.0 but you’re on the development version which has the bug fixed.

Thank you for your reply. I did think about the issue you brought up with differences between system versions, but as I said in my original post, I’d uninstalled and re-downloaded the system both offline and on forge to make sure they were the same. Additionally, Foundry was updated to 0.7.7 both on forge and offline. The roll expression still works fine offline but not on forge.

If you want help with setting up the parameters I’m working with, I can create a test world with the necessary components put together in sandbox 5.0 and foundry 0.7.7 and upload a zip of that world to dropbox or something.

Okay, there may actually be problems on my end. Will update again when I’m sure what’s going on.

Alright, turns out I made an error while trying to build a world offline to send, but apparently this led to a bug being caught and fixed in a patreon update to sandbox. My roll works right on forge now!

1 Like