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 .
×
🍵 What is a cleric’s favorite hot drink? Divini-tea. 🍵
Create a free account

Referencing previously calculated properties within a template call

I've been reading the documentation and the only thing I can find is the Order of Operations for inline-rolls.  I'm pretty sure what i'm after can't be done, but I thought i'd confirm it anyways (i've already tried a few macros and it's not been possible, but my syntax may be wrong). Example button roll: <button type="roll" Value="&{template:blah} {{attackroll=[[1d100]]}} {{otherproperty1=[[ attackroll + 10]]}} {{otherproperty2= [[ attackroll / 10 ]]" /> So essentially, I create a field/property named 'attackroll' and then I reference it in other fields/properties within the same roll.  At the moment, with the complex ruleset of WFRP 4e with crits and impales and SLS the template ends up being a complete nightmare to write/modify. If you could chain these references it could alleviate a lot of headaches by calculating all the properties before the template gets rendered. If someone put me out of my misery that would be great :) Thanks
1579740756

Edited 1579740952
vÍnce
Pro
Sheet Author
You can't re-use a roll within, or between, macros. ;-( An api script(pro level subscription) like powercards has a feature that can reference a roll and perform additional calculations.  You might be able to make your attack roll, then use a query to ask what the attack roll was in order to use that result in other calculations.  I think this would require two buttons/rolls though  <button type="roll" name="roll_attack" value="&{template:blah} {{attackroll=[[1d100]]}}  /> <button type="roll" name="roll_attack_details" value ="&{template:blah} {{attackroll_details= ?{attack rolled|0} }} {{otherproperty1=[[  ?{attack rolled|0}  + 10]]}} {{otherproperty2= [[  ?{attack rolled|0}  / 10 ]]" /> Not sure if you can roll 2 macros with one button (never tried that)...
Thanks Vince, I suspected this may be the case. My mate has the Pro subscription and he's the one mainly editing the Sheet i'm just helping him out. I don't suppose you have a link to where I might read about the 'powercards' feature that you mentioned? Cheers
1579768122

Edited 1579768159
vÍnce
Pro
Sheet Author
Pete L. said: Thanks Vince, I suspected this may be the case. My mate has the Pro subscription and he's the one mainly editing the Sheet i'm just helping him out. I don't suppose you have a link to where I might read about the 'powercards' feature that you mentioned? Cheers Here you go; [Script] PowerCards 3 (Thread 6) and here: <a href="https://wiki.roll20.net/Script:PowerCards" rel="nofollow">https://wiki.roll20.net/Script:PowerCards</a>
Great, thanks