Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

Cross sheets attributes

1665491653

Edited 1665491696
Hello everyone,  i'm making a character sheet for a custom game/world. One of the feature is to make the roll difficulty depend on a "stress" value, increased manually by the GM.  I want to make this stress value visible by making a hourglass that fills up itself, depending on this value. I don't know yet how to create API, and i only know to make character sheet for a few months now. So i want to make it myself. To summarize: Is their a way to create an attribute manageable from one sheet, that all others can access to ? 
1665500081
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
There are a few ways to do this. For your use case, the best one would probably be something I did for the Starfinder sheet's Starship tab. This requires a reasonably complex mix of html and javascript: Create an alternate view of your sheet that will display your stress counter. You can put any other party wide information here as well, but the stress counter is what's important for this obviously. Create a text input somewhere in the general sheet display (I'd recommend a settings tab personally). Name the input something like gm_screen_name . This input will be where users can put the name of the character sheet being used as their gm/party screen. Construct your rolls to call the indicated gm screen's stress value when a roll is made to calculate the difficulty at roll time. I'd recommend using Custom Roll Parsing (CRP) for this, but you could rebuild the entire macro for use in a roll button each time the name of the gm screen is changed. CRP is going to be the much easier method though.
1665996310

Edited 1665996393
Thank you ! I had a bit of trouble to figured out how to call another sheet attribute, but i finally did it. I can't decide on how to represent it yet, but it is now used in the difficulty roll !   i did use CRP. I put it here in case someone need it too (might no be optimised, but it work) : < tr >     < td > Nom de la fiche GM: </ td >     < td >< input type = "text" name = "attr_master_sheet" ></ td > </ tr > < tr >     < td > Tension: </ td >     < td >< input type = "text" name = "attr_tension" ></ td > </ tr > [...] function dark_roll_stat(val_stat) {                 //Call when action button is clicked: (val_stat) is the statistic associated with the roll                          getAttrs ([ "master_sheet" ], function ( values ) {         var master_sheet ;         master_sheet = values . master_sheet ;         startRoll ( "&{template:test2} {{name=Jet sous Tension}} {{roll1=[[" + val_stat + "d6]]}} {{Tension= [[@{" + master_sheet + "|tension}]]}}" , ( results ) => {             let result = 0 ;             results . results . roll1 . dice . forEach ( element => {                 result += element >= ( results . results [ "Tension" ]. result );             });             result -= results . results [ "Tension" ]. result ;             finishRoll (                 results . rollId ,                 {                     roll1 : result ,                 }             );     }); }) } ;