Apologies for the /braindump here....just been thinking about some things i'd like to do with my 5e sheet when i find the time and thought i'd better get some of it out of my head while i remember it :) There are lots of character sheets being produced and some of these have normal versions and versions that support/use API features like the power cards script for macros or even more complicated ones doing all sorts of stuff. It would be useful, and probably prevent a lot of duplication of effort, if there was some way sheet authors could maintain a single sheet that provided all the API powered goodies providing the correct API scripts were available to it when the campaign is loaded, but gracefully degraded to a non-API powered version were it not to find the scripts it needed for all the bells and whistles. The most useful example of this would be for macro output either using the power card script, or falling back to a default no API version of it's output if the script/API is not available. In my head this would work by sheet authors having some way of defining a set of scripts the sheet has baked in support for that is referenced and checked when the campaign is loaded....and then, for the power card example anyway, the sheet either uses the API enabled roll macros, or the default non API ones...perhaps defined something like this in the sheet and processed as part of the initial check on the load of the campaign : <button type="roll" name="roll_Example_Roll" value="/em attempts a TEST attack\n\n [[1d20 + @{modifiers}]]" pcardapi_value="!power --ddn| --emote|@{selected|token_name} attempts a TEST roll --name|Test Roll --attack|1d20+@{modifier}"> A simple example of an addition to the json file for the sheet containing an example to replace one attribute with another if a certain script is available might be - {
"APISUPPORT": {
"replace": [
{
"scriptname": "Power Cards",
"replace": "value",
"replacewith": "pcardapi_value",
"intag": "button"
}
]
}
}
So in this example on a campaign load if there was a script available named "Power Cards" then every button tag would have it's "value" attribute replaced with the content from the "pcardapi_value" attribute....if the script didnt exist, or either of the replace or replace with attributes didnt exist then nothing happens and the sheet works just fine with the default, non-api campaigns. Is this a better option (or at least the start of a possible solution) to prevent the need for multiple versions of the same sheet being produced (API enhanced,simple without api enahncements, API enhanced using different scripts, etc...)?