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 .
×
Create a free account
This post has been closed. You can still view previous posts, but you can't post any new replies.

[Script] PowerCards 3 (Thread 3)

I am trying to make a stealth roll power card with the list function. However when I use the macro below it doesn't use the stealth bonus, instead it outputs the formula for it (dexterity_mod+stealth_proficiency+stealth_flat) and simply gives me the D20 roll. I am using the OGL 5e setup, with a token that is connected to it's relative character sheet. What am I doing wrong? !power {{ --whisper|gm --format|gen --name|Stealth Check --target_list|@{target|1st|token_id} | @{target|2nd|token_id} | @{target|3rd|token_id} | @{target|4th|token_id} | @{target|5th|token_id} --%%token_name%%#?{Number of targets|1}|[[1d20+%%stealth_bonus%%]] }}
1475108424

Edited 1475109631
Silvyre
Forum Champion
It doesn't look like you can use autocalculated Attributes with target info charms. Looks like you'd have to use something like: !power {{ --whisper|gm --format|gen --name|Stealth Check --target_list|@{target|1st|token_id} | @{target|2nd|token_id} | @{target|3rd|token_id} | @{target|4th|token_id} | @{target|5th|token_id} --%%token_name%%#?{Number of targets|1}| [[ 1d20 + floor((%%dexterity%%-10)/2) [Dex] + ((ceil((%%level%%)/1e10) + ceil((%%level%%)/4)) * %%stealth_type%%) [Prof] + %%stealth_flat%% [Bonuses] ]] }}
Hi,  I want to thank everyone who has contributed to this thread.  Through your discussions and examples, I've been able to cobble together some nice power cards for my group, even though I'm pretty trash at writing scripts.  I've come across a problem that I haven't been able to find a solution for.  I'm trying to make a script to roll  a skill check pulling data from the Pathfinder character sheet. I believe the issue is with spaces in the skill names.  I'd like to keep the spaces since I think it looks better, but it messes with the conditionals.  Here is an example of the script: !power {{ --charid|@{selected|character_id} --name|?{Skill Check|Diplomacy|Disable Device} --leftsub|@{selected|token_name} --?? ?{Skill Check|Diplomacy|Disable Device} == Diplomacy ?? !DpmyChk|**Results** ~R [[1d20 + @{selected|Diplomacy} ]] ~R --?? ?{Skill Check|Diplomacy|Disable Device} == Disable Device ?? !DsDvChk|**Results** ~R [[1d20 + @{selected|Disable-Device} ]] ~R }}  Diplomacy works exactly like I'd expect, but Disable Device never meets the conditional.  It puts up the header of the card correctly, but doesn't print the results.  I'm thinking that this is because of the space. Is there any way to make the conditional ignore that space between "Disable" and "Device"?  I've tried using the HTML character entity reference, and that didn't work.  I suspect that I'm just going to have to live with an underscore in the card name, but I thought I'd ask to see if I'm just missing something. 
1475178006
Silvyre
Forum Champion
Chris L. said: Is there any way to make the conditional ignore that space between "Disable" and "Device"?  I've tried using the HTML character entity reference, and that didn't work. You could try using variant spaces , or HTML entities thereof.
If you weren't using the skill name for the name of the card... you could have done ?{Skill|Diplomacy, 1|Disable Device, 2} etc.
1475189615

Edited 1475189838
Hi Drew C. , You could try a modification I did to allow the use of autocalculated attributes of DnD 4e sheet. The code of PowerCards should be changed as following: 1. Add a new function (to treat attributes with references to other attributes): function getAttrRefValues(char_id, attribute) {     var n_ref = 0;     var attr = attribute;     if (/.*@{.*/.test(attribute)) {         n_ref = attribute.match(/@{/g).length;     }     if (n_ref > 0) { //there are references to attributes         for  (var i = 0; i < n_ref; i++) {             attr = attr.replace(/@{(.*?)}/, function(e) {                 var attr_ref = e.replace(/@{/, '').replace(/}/, '');                 attr_ref = getAttrByName(char_id, attr_ref);                 return getAttrRefValues(char_id, attr_ref);             });         }     }     return attr; }; 2. On the function getTargetInfo, modify the default case of its "switch (charm)": default:     attr = getAttrByName(Character.id, charm);     attr = getAttrRefValues(Character.id, attr); Then, on the game, make sure your target charm is part of an inline roll. Your example "[[1d20+%%stealth_bonus%%]]" is already part of one, but I had to add 0d0 and brackets where some of my target charms are, like "[[ 0d0 + %%ac%% [AC] ]]". Hope it helps.
Thanks for the help. I wasn't able to figure out any syntax that would make the variant space idea work. I ended up just pulling the line out of the title, and doing like HB suggested.
I am *not* a proficient coder, by any stretch of the imagination, but I like to dabble from time-to-time, especially on Roll20. This is a script that I wrote using the Mythic Fate chart as a guide: !power {{ --name | Fate Roll --leftsub | Chaos @{Mythic|Chaos} --corners | 8 --Question: | "?{Question}" --Base Odds: | [[ [$Odds]  d0 + ?{Odds|50/50, [[50]], Impossible, [[5]]|No way, [[15]]|Very unlikely, [[25]]|Unlikely,[[35]]|Somewhat likely, [[65]]|Likely, [[75]]|Very likely, [[85]]|Near sure thing, [[90]]|A sure thing, [[90]]|Has to be, [[95]]} ]] --Probability | [[ [$Probability] d0 + ?{Odds} - ((5-@{Mythic|Chaos}) * 5) ]] --Definite Yes | [[ [$DefiniteYes] d0 + (?{Odds} - ((5-@{Mythic|Chaos}) * 5))/5 ]] --Definite No | [[ [$DefiniteNo] d0 + 101 - ((100 - ?{Odds} - ((5-@{Mythic|Chaos}) * 5)) /5) ]] --Fate | [[ [$Fate] 1d100 ]] --?? $Fate <= $DefiniteYes ?? Answer: | Definite Yes --?? $Fate > $DefiniteYes AND $Fate <= $Probability ?? Answer: | Yes --?? $Fate > $Probability AND $Fate < $DefiniteNo ?? Answer: | No --?? $Fate >= $DefiniteNo ?? Answer: | Definite No --?? $Fate == 11 OR $Fate == 22 OR $Fate == 33 OR $Fate == 44 OR $Fate == 55 OR $Fate == 66 OR $Fate == 77 OR $Fate == 88 OR $Fate == 99 ?? Scene Interrupt: | **Roll for Event!** }} This is what the Mythic Fate chart looks like: The script is functional, but it has several limitations that I would like to correct: (1) Right now the script "shows its work" - setting out the threshholds for Definite Yes and Definite No. I need those lines to create the variables that I use in conditionals later in the code. When I try to "hide" these, using the $, it ends up ignoring the variables later on in the script. I realize I could resolve this by eliminating the lines and substituting the formulas on those lines in the conditionals, but I am wondering if there is any other way to get this done without revealing the lines on the thresholds. (2) I would like to show the qualitative description, rather than the number on the output for the base "Odds". (3) I am not replicating the effect of the Chaos Rank correctly, opting instead for a simple linear relationship, moving left to right in the column. This is a rough approximation that I'm happy to live with, but if I could fix it to match the table, i would be even happier with it. Unfortunately, I'm not mathematically sophisticated enough to understand what is happening as you move from the center to right and left on this table. (4) I would *love* for the question to show up in an emote - so that you see a character token, the character's name, and then the words "asks:" followed by the question. I see examples of what this is supposed to look like on the main OP for this thread, but I can't seem to replicate it. I suspect it has to do with changes in Roll20 since that design was implemented in PowerCards, but - again - I don't claim to be a coding genius. Any help on any of these issues would be appreciated.
1475358345

Edited 1475358468
Silvyre
Forum Champion
Answering out of order: 4. Use --emote in conjunction with --tokenid|@{selected|token_id} 1. The --hroll tag was created for this reason. 2. One possibility is adding inline labels to the your 'odds'. e.g.  ?{Odds|50/50, [[...]] [50/50] | etc.} 3. This is possible, but requires some data entry. I'll demonstrate: Base odds for 'Impossible': [[ -20 + {@{Mystic|Chaos} + d0}>2 * 20 + {@{Mystic|Chaos} + d0}>4 * 5 + {@{Mystic|Chaos} + d0}>6 * 5 + {@{Mystic|Chaos} + d0}>7 * 5 + {@{Mystic|Chaos} + d0}>8 * 10 + {@{Mystic|Chaos} + d0}>9 * 25 ]] If @{Mystic|Chaos} ≥ 2, then {@{Mystic|Chaos} + d0}>2 resolves to equal 1. Otherwise, it resolves to equal 0. In order to nest that large inline roll within a Roll Query, you'll need to replace the closing curly braces with their HTML entity } as outlined in Advanced Usage for Roll Queries . Of course, please let me know if you have any questions.
@Sylvyre - thanks so much for the help. I managed to get the emote working correctly, and am going to look at some other things soon... In the meantime, I am having trouble getting the --hroll tag to work properly. Its not (that I can see) documented in the OP for this thread, so I'm just guessing about how it works. Here is what I'm doing  --hroll | [[ [$Probability] d0 + ?{Odds} - ((5-@{Mythic|Chaos}) * 5) ]] The line does not show up once I add this. However, $Probability is then ignored (treated as zero, I assume) in future conditionals. Am I doing something wrong?
1475361386

Edited 1475361415
Silvyre
Forum Champion
GM Matt said: [[ [$RollID] d0 + Numbers ]] There's apparently some weirdness going on with Roll IDs used like that. I instead recommend using Roll IDs like this: [[ [$RollID] Numbers + 0d0 ]]
Silvyre said: GM Matt said: [[ [$RollID] d0 + Numbers ]] There's apparently some weirdness going on with Roll IDs used like that. I instead recommend using Roll IDs like this: [[ [$RollID] Numbers + 0d0 ]] Probably because he used d0 instead of 0d0.
Thanks for all the help, Silvyre and Sky. I tried... --hroll | [[ [$DefiniteYes] ?{Odds}/5 + 0d0 ]] Unfortunately, I am having the same issue. $DefiniteYes seems to be treated as a zero in subsequent conditionals. In the meantime, this continues to work correctly, although it displays: --Definite Yes | [[ [$DefiniteYes] ?{Odds}/5 + 0d0 ]]
1475430548
Silvyre
Forum Champion
GM Matt said: Thanks for all the help, Silvyre and Sky. I tried... --hroll | [[ [$DefiniteYes] ?{Odds}/5 + 0d0 ]] Unfortunately, I am having the same issue. $DefiniteYes seems to be treated as a zero in subsequent conditionals. Strange. Mind posting the whole macro that you're testing?
1475432638

Edited 1475432820
GM Matt
Sheet Author
Here is my current working version: !power {{ --tokenid|@{selected|token_id} --emote| @{selected|token_name} asks: "?{Question}" --name | Fate Roll --leftsub | Chaos @{Mythic|Chaos} --corners | 8 --Base Odds: | [[ [$Odds]  ?{Odds|50/50, [[50]] | Impossible, [[5]]|No way, [[15]]|Very unlikely, [[25]]|Unlikely,[[35]]|Somewhat likely, [[65]]|Likely, [[75]]|Very likely, [[85]]|Near sure thing, [[90]]|A sure thing, [[90]]|Has to be, [[95]]} + 0d0 ]] --Probability:| [[ [$Probability] ?{Odds} - ((5-@{Mythic|Chaos}) * 5) + 0d0 ]] --Definite Yes:| [[ [$DefiniteYes] (?{Odds} - ((5-@{Mythic|Chaos}) * 5))/5 + 0d0 ]] --Definite No: | [[ [$DefiniteNo] 101 - ((100 - ?{Odds} - ((5-@{Mythic|Chaos}) * 5)) /5) + 0d0 ]] --Fate | [[ [$Fate] 1d100 ]] --?? $Fate <= $DefiniteYes ?? Answer: | Definite Yes --?? $Fate > $DefiniteYes AND $Fate <= $Probability ?? Answer: | Yes --?? $Fate > $Probability AND $Fate < $DefiniteNo ?? Answer: | No --?? $Fate >= $DefiniteNo ?? Answer: | Definite No --?? $Fate == 11 OR $Fate == 22 OR $Fate == 33 OR $Fate == 44 OR $Fate == 55 OR $Fate == 66 OR $Fate == 77 OR $Fate == 88 OR $Fate == 99 ?? Scene Interrupt: | **Roll for Event!** }} I would prefer to not display the tags Probability, Definite Yes, and Definite No. After a little more work, I've discovered that the macro continues to work if I substitute: --hroll| [[ [$Probability] ?{Odds} - ((5-@{Mythic|Chaos}) * 5) + 0d0 ]] The same is true if I use the --hroll tag on the "Base Odds" line (which, for now, I want to leave as is - but see below). But if I try to substitute either of these: --Definite Yes:| [[ [$DefiniteYes] (?{Odds} - ((5-@{Mythic|Chaos}) * 5))/5 + 0d0 ]] --Definite No: | [[ [$DefiniteNo] 101 - ((100 - ?{Odds} - ((5-@{Mythic|Chaos}) * 5)) /5) + 0d0 ]] ...none of the conditionals trigger. My assumption is that I am getting zeros for $DefiniteYes and $DefiniteNo. But I don't really know what is happening. Just FYI - my goal on "Base Odds" is eventually to display the qualitative descriptions that are used in the prompts. Can't seem to get it working with inline descriptions as Silvyre suggested, but for now I'm less concerned about that than the above issue.
1475434229
Silvyre
Forum Champion
Try this out: !power {{ --tokenid|@{selected|token_id} --emote| @{selected|token_name} asks: "?{Question}" --name | Fate Roll --leftsub | Chaos @{Mythic|Chaos} --corners | 8 --Base Odds:|?{Odds|50/50, 50 [50/50]|Impossible, 5 [Impossible]|No way, 15 [No way]|Very unlikely, 25 [Very unlikely]|Unlikely, 35 [Unlikely]|Somewhat likely, 65 [Somewhat likely]|Likely, 75 [Likely]|Very likely, 85 [Very likely]|Near sure thing, 90 [Near sure thing]|A sure thing, 90 [A sure thing]|Has to be, 95 [Has to be]} --hroll| [[ [$Odds] ?{Odds} + 0d0 ]] [[ [$Probability] ?{Odds} - ((5-@{Mythic|Chaos}) * 5) + 0d0 ]] [[ [$DefiniteYes] (?{Odds} - ((5-@{Mythic|Chaos}) * 5))/5 + 0d0 ]] [[ [$DefiniteNo] 101 - ((100 - ?{Odds} - ((5-@{Mythic|Chaos}) * 5)) /5) + 0d0 ]] --Fate|[[ [$Fate] 1d100 ]] --?? $Fate <= $DefiniteYes ?? Answer:|Definite Yes --?? $Fate > $DefiniteYes AND $Fate <= $Probability ?? Answer:|Yes --?? $Fate > $Probability AND $Fate < $DefiniteNo ?? Answer:|No --?? $Fate >= $DefiniteNo ?? Answer:|Definite No --?? $Fate % 11 ?? Scene Interrupt:|**Roll for Event!** }}
1475434729

Edited 1475434748
GM Matt
Sheet Author
Works! Thanks so much, Silvyre! So.... is the secret having a single --hroll tag?
1475435820
Silvyre
Forum Champion
That's the secret!
Is it possible to add line breaks in the descriptions of PowerCard Status List? I tried a few ways, but it seems to only print exactly what is there. Reason is I wanted to make the descrptions a bulleted list instead of a paragraph. 
1475486132
Ziechael
Forum Champion
Sheet Author
API Scripter
^^ adds a line break to a tags content :)
GM Matt said: Works! Thanks so much, Silvyre! So.... is the secret having a single --hroll tag? Ah yes, you cannot have two of the same tag. They overwrite each other since I suck at writing javascript.
Ziechael, I tried that and it just does this: Also showing another attempt with <br>. 
1475552278
Silvyre
Forum Champion
Shot(s) in the dark: try with \r\n or 
Seems that no matter what is placed there, it will be printed. 
I'll poke around in it sometime tomorrow evening.
That would be most appreciated SkyCaptainXIII.
October 4th, 2016 ~ 4:00 am eastern Version: 3.2.21 Link: gist.github.com/Sky-Captain-13/452330a3d926b32da49c Minor Update: Moved when status icons and info are added into the powercard to support usage of powercard formatting options like ^^ for line breaks. This means you can use all the bold, underline, links and more in the PowerCards Status List handout if you're using that to store your status information like this... dazed|half-haze|You grant combat advantage. ^^ You can take either a **standard action**, a **move action**, or a **minor action** on your turn (you can also take free actions). You can't take immediate actions or opportunity actions. You can't flank an enemy.
1475625856

Edited 1475628195
DM
Pro
Bravo good sir. Works like a charm. Thank you.  Edit: How it looks now. Still adjusting the format a little, but its getting there. Thanks again (I know the damage does dazed and its showing blinded. Its just a test card). 
No problem. It was literally a three second fix once I took a moment to look at the script. I just moved one line to the beginning of a section instead of the end. :D  I spent more time writing the post update in the thread than I did working in the API.
SkyCaptainXIII said: No problem. It was literally a three second fix once I took a moment to look at the script. I just moved one line to the beginning of a section instead of the end. :D  I spent more time writing the post update in the thread than I did working in the API. Amazing. You scriptors weave words and punctuation into such magical things. 
1475632158

Edited 1475639910
DM
Pro
Have a question that is hard to put into words, but I'll try. When choosing a font inside the API, where does it look to determine how a font functions? Example: I want to change the subtitlefont. The default is set to Helvetica. I want to change it to a different font. My question is, when I change it to a different font, can it be any font I have installed on my computer (for me to see it) or does it need to be from a list of fonts that are known to roll20?&nbsp; Like I choose a font named "D&D 4e icons" (found&nbsp; here ). I have this font installed on my computer. Will it show me that font in the subtitle as I have it installed on my computer, or does it not matter what I have installed, it matters what is known to roll20? I think the answer is it does not matter what I have installed, as it does not show me the font I expected to see. Thought I would ask though.&nbsp; Edit: I was asking as I wanted to enter symbols. The Arron is so helpful, he suggested how to do this a year ago.&nbsp; <a href="https://app.roll20.net/forum/post/1905190/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/1905190/slug%7D</a> and it works great for the power cards.&nbsp;
You can use any font on your computer, but if players don't have that font installed, it will default back to Arial ot something.
1475640057

Edited 1475683168
DM
Pro
SkyCaptainXIII said: You can use any font on your computer, but if players don't have that font installed, it will default back to Arial ot something. Okay. I figured they would need to. Ill work on it on my end. Thanks.&nbsp; Edit: Oh wow, it works.&nbsp; Okay, one more thing and I'll leave you alone for a while. I see on the front page that I can alter the font in broad strokes (I can change the main body, the title, and subtitle). Is there a way to do a more surgical strike to do something like this? Or would it be easier to just edit a font to include the symbols I want (take hevetica and change out the normal Shift + Number characters (like "! & @") and change them to to the dice) and call the font something else (like hevetica_altered) and ensure that all players have this new font installed? Edit Edit: Here's how it looks merging fonts. I merged my symbol set with Arial in this example: I have to adjust some items on the font side to make it a bit bigger and darker, but the idea is solid. It's easy to do with free software and everyone can see it (as long as they install the font you created before hand). A little more tinkering and it will be perfect.&nbsp;
Been going around in circles with&nbsp; !power {{ &nbsp; --format|atwill &nbsp; --target_list|@{target| |token_id} &nbsp; --name|Trick Shot &nbsp; --leftsub|Save: [[ [$Save|NH|TXT] 0d1 + @{pb} + @{dexterity_mod} + 8 ]] &nbsp; --rightsub|Type: [[ [$Type|NH|TXT] 0d1 + ?{Shot Target|Arm, 1|Head, 2|Leg, 3|Torso, 4|Wing, 5} ]] &nbsp; --?? $Type.total == 1 ?? Shot: *1|Arm Shot &nbsp; --?? $Type.total == 1 ?? Save: *1|[^Save.total] vs. [[ [NH] 1d20 + {0, @{target| |npcd_str_save}, @{target| |strength_mod}}kh1 ]] (@{target| |token_name}) &nbsp; --?? $Type.total == 1 ?? !Effect *1|On a successful hit, target takes normal damage and must make a Strength saving throw or drops one held item of the Gunslinger's choice. &nbsp; --?? $Type.total == 2 ?? Shot: *2|Head Shot &nbsp; --?? $Type.total == 2 ?? Save: *2|[^Save.total] vs. [[ [NH] 1d20 + {0, @{target| |npcd_con_save}}, @{target| |constitution_mod}}}kh1 ]] (@{target| |token_name}) &nbsp; --?? $Type.total == 2 ?? !Effect *2|On a successful hit, target takes normal damage and must make a Constitution saving throw or have disadvantage on attacks for 1 round. &nbsp; --?? $Type.total == 3 ?? Shot: *3|Leg Shot &nbsp; --?? $Type.total == 3 ?? Save: *3|[^Save.total] vs. [[ [NH] 1d20 + {0, @{target| |npcd_str_save}, @{target| |strength_mod}}kh1 ]] (@{target| |token_name}) &nbsp; --?? $Type.total == 3 ?? !Effect *3|On a successful hit, target takes normal damage and must make a Strength saving throw or get knocked prone. &nbsp; --?? $Type.total == 4 ?? Shot: *4|Torso Shot &nbsp; --?? $Type.total == 4 ?? Save: *4|No Save &nbsp; --?? $Type.total == 4 ?? !Effect *4|On a successful hit, target takes normal damage and is pushed up to 10 feet away from you. &nbsp; --?? $Type.total == 5 ?? Shot: *5|Wing Shot &nbsp; --?? $Type.total == 5 ?? Save: *5|[^Save.total] vs. [[ [NH] 1d20 + {0, @{target| |npcd_con_save}, @{target| |constitution_mod}}kh1 ]] (@{target| |token_name}) &nbsp; --?? $Type.total == 5 ?? !Effect *5|On a successful hit, target takes normal damage and must make a Constitution saving throw or plummet 20 feet. }} No matter how I adjust the conditionals, the failing conditions are getting printed out as normal text before the power card appears.&nbsp; Any ideas? Using the most recent version.
Aquaricat said: Been going around in circles with&nbsp; - snip - Using the most recent version. It's this line in your macro: --?? $Type.total == 2 ?? Save: *2|[^Save.total] vs. [[ [NH] 1d20 + {0, @{target| |npcd_con_save}}, @{target| |constitution_mod}}}kh1 ]] (@{target| |token_name}) You have an extra curly brace after the npcd_con_save.
Augh.&nbsp; Damn typo demoness won't leave me alone.&nbsp; I must have scanned over that half a dozen times.&nbsp; Thanks.
1479450350
Tetsuo
Forum Champion
If it doesn't already exist, how hard would it be to implement the /emas command the same way that /em has been used for --emote?
1479837294

Edited 1479838373
Can someone lend a hand? I've been trying to simulate this table from Dungeon Crawl Classics but its proving to be difficult.&nbsp; Warrior Table: This is what I have so far: !power {{ --tokenid|@{selected|token_id}&nbsp; --emote|@{selected|character_name} Attacks! --format|default --name|Level [[ [$L|TXT] @{selected|Level} + 0d1]] --leftsub|Action --rightsub|Attack -- ?? $L.total == 1 ?? Attack|[[ 1d3 + 1d20]]&nbsp; -- ?? $L.total == 2 ?? Attack|[[ 1d4 + 1d20 ]] -- ?? $L.total == 3 ?? Attack|[[ 1d5 + 1d20 ]] -- ?? $L.total == 4 ?? Attack|[[ 1d6 + 1d20 ]] -- ?? $L.total == 5 ?? Attack|[[ 1d7 + 1d20 + 1d14 ]] -- ?? $L.total == 6 ?? Attack|[[ 1d8 + 1d20 + 16]] -- ?? $L.total == 7 ?? Attack|[[ 1d10 + 1 + 1d20 ]] -- ?? $L.total == 8 ?? Attack|[[ 1d10 + 2 + 1d20 ]] -- ?? $L.total == 9 ?? Attack|[[ 1d10 + 3 + 1d20 ]] -- ?? $L.total == 10 ?? Attack|[[ 1d10 + 4 + 1d20 ]] }} That gives me the right value for the attack but I haven't been able to figure out a way to use two variables in an elsif statement to tell me if the d20 rolled a one and to do something if it did. Like: -- ?? $L.total == 1 ?? Attack|[[ [[ 1d3 ]] + [[ [$D] 1d20]] ]] -- ?? $D &gt;= 19 AND $L.total == 1 ?? Critical Success!|[[ [TXT] 1t[critSuccess1] -- ?? $D &lt; 1 AND $L.total &lt;= 2 ?? Critical Fumble!|[[ [TXT] 1t[critFumble3] ]]&nbsp; -- ?? $D &lt; 1 AND $L.total &gt; 2 AND $L.total &lt;= 4 ?? Critical Fumble|[[ [TXT] 1t[critFumble4] ]] -- ?? $D &lt; 1 AND $L.total &gt;= 5 ?? Critical Fumble|[[ [TXT] 1t[critFumble5] ]] Or if there is any other way of turning the above table into a power cards macro.&nbsp;
1479847495

Edited 1479850592
Silvyre
Forum Champion
Grognard said: Here's how I'd prefer to handle this: !power {{ --tokenid|@{selected|token_id} --emote|@{selected|character_name} Attacks! --format|default --name|Warrior Level @{selected|Level} --leftsub|Action --rightsub|Attack --Attack|[[ [$Atk] 1d20cs&gt;[[19 - {@{selected|Level},0}&gt;5 - {@{selected|Level},0}&gt;9]] + [[{@{selected|Level},0}=5 + {@{selected|Level},0}=10]]d14cs0cf0 + [[{@{selected|Level},0}=6]]d16cs0cf0 + [[{@{selected|Level},0}&gt;7]]d20cs0cf0 + [$Deed] 1d[[{@{selected|Level} + {@{selected|Level},0}&gt;7, 10 + 0d0&gt;0}kl1 + ]]cs0cf0 + [[{@{selected|Level},0}&gt;7 * (@{selected|Level} - 6)]] ]] --?? $Atk.base &gt;= [[ 19 - {@{selected|Level},0}&gt;5 - {@{selected|Level},0}&gt;9 ]] ?? Critical Success!|[[ [TXT] 1t[critSuccess[[3 + {@{selected|Level},0}&gt;3 + {@{selected|Level},0}&gt;5 + 0]]]] ]] --?? $Atk.base == 1 ?? Critical Fumble!|[[ [TXT] 1t[critFumble[[3 + {@{selected|Level},0}&gt;3 + {@{selected|Level},0}&gt;5 + 0]]]] ]] }} {@{selected|Level},0}&gt;5 resolves to equal 1 if and only if @{selected|Level} ≥ 5. Otherwise, it resolves to equal 0. This macro assumes the existence of 6 Rollable Tables named critSuccess3, critSuccess4, critSuccess5, critFumble3, critFumble4 and critFumble5 (corresponding to the Crit Die/Table column).
Thanks Silvyre. I tried the macro you posted and nothing happens. I don't get errors in chat or in the api sandbox. Hmmm.&nbsp;
1479851301

Edited 1479851321
Silvyre
Forum Champion
What is @{selected|Level} for you? Also, do you have all of the Rollable Tables? This macro assumes the existence of 6 Rollable Tables named critSuccess3, critSuccess4, critSuccess5, critFumble3, critFumble4 and critFumble5 (corresponding to the Crit Die/Table column).
1479852483

Edited 1479852741
What is @{selected|Level} for you? One. My bad, I added the tables. The only thing left is that I'm not sure how to make the tables such that you roll a d12 at level 1 on table 3, 1d14 at level 2 on table 3, 1d16 at level 3 on table 4, 1d20 at level 4 on table 4 and so on. &nbsp; Edit: I could add the table to the script but not sure how to incorporate the awesome macro you provided. As per a post you helped me out with before I started putting the table in the macro itself.&nbsp; Example: !power {{ --tokenid|@{selected|token_id}&nbsp; --emote|@{selected|character_name} Rolls on the Disapproval Table... --format|default --name|Cleric Disapproval Roll --Disapproval Result:|~R[[ [$TST] ?{Disapproval |1, 1d4|2, 2d4|3, 3d4|4, 4d4|5, 5d4|6, 6d4|7, 7d4|8, 8d4|9, 9d4|10, 10d4|11, 11d4|12, 12d4|13, 13d4|14, 14d4|15, 15d4} + @{selected|LCK} ]]~R -- ?? $TST.total &lt; 1 ?? |~~~Your deity decides to forgive you... this time! -- ?? $TST.total == 1 ?? |~~~The cleric must atone for his sins. He must do nothing but utter chants and intonations for the next 10 minutes, starting as soon as he is able (i.e., if he is in combat, he can wait until the danger is over). -- ?? $TST.total == 2 ?? |~~~The cleric must pray for forgiveness immediately. He must spend at least one hour in prayer, beginning as soon as he is able (i.e., if he is in combat, he can wait until the danger is over). Failure to finish the full hour of prayers within the next 120 minutes is looked upon unfavorably; he incurs a -1 penalty to all spell checks until he completes the full hour. -- ?? $TST.total == 3 ?? |~~~The cleric must increase his god’s power by recruiting a new follower. If he does not convert one new follower to his deity’s worship by the next sunrise, he takes a -1 penalty to all checks on the following day. This penalty resets after 24 hours. -- ?? $TST.total == 4 ?? |~~~The cleric immediately incurs an additional -1 penalty to all spell checks that lasts until the next day. -- ?? $TST.total == 5 ?? |~~~The cleric must undergo the test of humility. For the remainder of the day, he must defer to all other characters and creatures as if they were his superiors. Failure (at the discretion of the judge) means he immediately loses all spellcasting ability (including healing and laying on hands) for the remainder of the day. -- ?? $TST.total == 6 ?? |~~~The cleric incurs an immediate -1 penalty to all attempts to lay on hands until he goes on a quest to heal the crippled. This quest is of his own design, but generally speaking must result in significant aid to the crippled, blind, lamed, sickly, etc. Once the quest is completed, the deity revokes the penalty. While the penalty remains, it applies to all attempts to lay on hands, even if the “normal” disapproval range has been reduced back to a natural 1. -- ?? $TST.total == 7 ?? |~~~The cleric must endure a test of faith. He gains an illness that costs him 1 point each of Strength, Agility, and Stamina. The ability score loss heals at the normal rate of 1 point per day. The cleric may not use magic to heal the loss. If the cleric endures the test to the satisfaction of the deity, he retains his magical abilities. If not (judge’s discretion), his disapproval range immediately increases by another point. -- ?? $TST.total == 8 ?? |~~~The cleric immediately incurs a -4 penalty to spell checks on the specific spell that resulted in disapproval (including laying on hands and turning unholy, if those were the acts that produced disapproval). This lasts until the next day. -- ?? $TST.total == 9 ?? |~~~The cleric immediately incurs an additional -2 penalty to all spell checks that lasts until the next day. -- ?? $TST.total == 10 ?? |~~~The cleric loses access to one randomly determined level 1 spell. This spell cannot be cast until the next day. -- ?? $TST.total == 11 ?? |~~~The cleric is ordered by his deity to meditate on his faith and come to a better understanding of what he has done to earn disapproval. The cleric incurs an immediate and permanent -2 penalty to all spell checks. The only way to lift this penalty is for the cleric to meditate. For every full day of meditation, the cleric can make a DC 15 Will save. Success means the spell check penalties are removed. -- ?? $TST.total == 12 ?? |~~~The cleric is temporarily disowned by his deity. For the rest of the day, the character cannot accumulate XP and may not gain class levels as a cleric. After the time period expires, the character begins to accumulate XP again as normal but does not accrue “back pay” (so to speak) for XP missed while he was disowned. -- ?? $TST.total == 13 ?? |~~~The cleric loses access to two randomly determined level 1 spells. These spells cannot be cast until the next day. -- ?? $TST.total == 14 ?? |~~~The cleric’s deity wishes to test whether the cleric is a man of the faith or a man of the &nbsp;flesh. Calculate the cleric’s total net worth in gold pieces. The cleric immediately incurs a permanent -4 penalty to all spell checks. The only way to remove this penalty is for the cleric to sacrifice his material possessions. For every 10% of his net worth sacrificed to the deity, one point of penalty is removed. Or, in other words, sacrificing 40% of what he owns will return the cleric to a normal spell check penalty. A sacrifice can be destruction, consecration, donation, transformation into a temple or statue, etc. -- ?? $TST.total == 15 ?? |~~~The deity is not forgiving on this day. When the cleric rests for the night, he does not “reset” his disapproval range at the next morning – it carries over from this day to the next. The disapproval ranged resets as normal on the following day. -- ?? $TST.total == 16 ?? |~~~Cleric is temporarily barred from using his lay on hands ability. The deity will not grant healing powers for the next [[ 1d4 ]] days. After that time, the cleric regains the use of his healing abilities. -- ?? $TST.total == 17 ?? |~~~The cleric loses access to [[ 1d4+1 ]] spells, randomly determined from all the character knows. These spells cannot be cast for the next 24 hours. -- ?? $TST.total == 18 ?? |~~~Cleric is temporarily unable to turn unholy creatures. The cleric regains the ability after [[ 1d4 ]] days. -- ?? $TST.total == 19 ?? |~~~The cleric is stained with the mark of the unfaithful. This physical mark appears like a brand, tattoo, or birthmark, with the symbol determined by the cleric’s faith. The symbol is automatically visible to all worshippers of the cleric’s faith, even through clothing, but may be invisible to others. To all who see and comment on the mark, the cleric must explain his sin and describe what he is doing as penance. If he continues to sustain his faith for a week while retaining the mark, it disappears. -- ?? $TST.total &gt;= 20 ?? |~~~The cleric’s ability to lay on hands is restricted. The ability works only once per day per creature healed – no single character can be healed more than once per day. After 24 hours, the ability’s use reverts to normal. }} How would you do it?
I am pretty sure I am just missing something because I am a total scrub when it comes to this but... I want to build a text block that uses character attribute data from the D&D 4E character sheet built into Roll 20 for example I want to be able to use this.... !power {{ --emote|, Your strike puts your opponent off guard, allowing your allies to better exploit the enemy's openings --format|atwill --name|Intuitive Strike --leftsub|At-Will --rightsub|Standard Action --Melee| Weapon ^^**Target** One Creature --Keywords|Martial, Weapon --Attack| [[1d20 + 4 [Strength Mod] + 3 [Rapier Prof.]]] vs Will --Hit|[[1d8]]] Pierlashing Damage. Until the start of your next turn, the next ally who attacks the target and has combat advantage against it gains a +2 power bonus to the attack roll. }} so I want to be able to call attributes that will fill in the blanks so I do not have to touch this again.. for example where it actually says "1d20 + 4 [Strength Mod] " I want to be able to just put in the attribute place holder instead to call the reference so it looks something like&nbsp; 1d20 + {{Strength Mod}} is this possible?
1479858713

Edited 1479864014
Silvyre
Forum Champion
Grognard said: What is @{selected|Level} for you? One Hopefully, you meant 1 ! (Sorry for pedantry...) Grognard said: I'm not sure how to make the tables such that you roll a d12 at level 1 on table 3, 1d14 at level 2 on table 3, 1d16 at level 3 on table 4, 1d20 at level 4 on table 4 and so on. After actually reading the relevant rules, here's my revised suggestion: !power {{ --tokenid|@{selected|token_id} --emote|@{selected|character_name} Attacks! --format|default --name|Warrior Level @{selected|Level} --leftsub|Action --rightsub|Attack --Attack|[[ [$Atk] 1d20cs&gt;[[19 - {@{selected|Level},0}&gt;5 - {@{selected|Level},0}&gt;9]] + [[{@{selected|Level},0}&gt;5]]d[[14 + 2 * {@{selected|Level},0}&gt;6 + 4 * {@{selected|Level},0}&gt;7]]cs0cf0 + [[{@{selected|Level},0}&gt;10]]d14cs0cf0 + [$Deed] 1d[[{@{selected|Level} + {@{selected|Level},0}&gt;7, 10 + 0d0&gt;0}kl1 + ]]cs0cf0 + [[{@{selected|Level},0}&gt;7 * (@{selected|Level} - 6)]] ]] --?? $Atk.base &gt;= [[ 19 - {@{selected|Level},0}&gt;5 - {@{selected|Level},0}&gt;9 ]] ?? Critical Success!|Rolled [[ [ $Crit ] [[1 + {@{selected|Level},0}&gt;8]]d[[12 + 2 * {@{selected|Level},0}&gt;2 + 2 * {@{selected|Level},0}&gt;3 + 4 * {@{selected|Level},0}&gt;4 + 4 * {@{selected|Level},0}&gt;5 + 6 * {@{selected|Level},0}&gt;6 - 10 * {@{selected|Level},0}&gt;8]] + @{selected|LCK} ]] on Crit Table [[ [TXT| $Table ] [[3 + {@{selected|Level},0}&gt;3 + {@{selected|Level},0}&gt;5]] + 0d0 ]]! --?? $Atk.base == 1 ?? Critical Fumble!|Rolled [[ 1d8 - @{selected|LCK} ]] or [[ 1d12 - @{selected|LCK} ]] or [[ 1d16 - @{selected|LCK} ]] on the Fumble Table! --$|Many, many lines of crit table conditionals could go here... }} (Assumes LCK is added to crit table rolls and subtracted from fumble table rolls.) I know this is currently a step backwards in terms of automation, but further automation would require the integration of 3 or 4 sizeable tables into the macro (dozens of conditionals). If that's the route you'd like to go, I'd be happy to push you in the right direction.
1479860745
Silvyre
Forum Champion
Ryan T. said: 1d20 + {{Strength Mod}} This section of the Roll20 Wiki documents how to call Attributes. The Attribute in question ( according to the sheet's Wiki page ) is named strength-mod
Hopefully, you meant 1 ! (Sorry for pedantry...) Yep I know this is currently a step backwards in terms of automation, but further automation would require the integration of 3 or 4 sizeable tables into the macro (dozens of conditionals). If that's the route you'd like to go, I'd be happy to push you in the right direction. Ha, I love DCC but sometimes all the table rolls are a huge pain. It's the reason I'm trying to automate as much as possible since I don't want to do a dozen physical table lookups every combat round. Please, push me in the giant macro direction.&nbsp;
1479866208

Edited 1479866399
Silvyre
Forum Champion
To get you started with the crit tables: !power {{ --tokenid|@{selected|token_id} --emote|@{selected|character_name} Attacks! --format|default --name|Warrior Level @{selected|Level} --leftsub|Action --rightsub|Attack --Attack|[[ [$Atk] 1d20cs&gt;[[19 - {@{selected|Level},0}&gt;5 - {@{selected|Level},0}&gt;9]] + [[{@{selected|Level},0}&gt;5]]d[[14 + 2 * {@{selected|Level},0}&gt;6 + 4 * {@{selected|Level},0}&gt;7]]cs0cf0 + [[{@{selected|Level},0}&gt;10]]d14cs0cf0 + [$Deed] 1d[[{@{selected|Level} + {@{selected|Level},0}&gt;7, 10 + 0d0&gt;0}kl1 + ]]cs0cf0 + [[{@{selected|Level},0}&gt;7 * (@{selected|Level} - 6)]] ]] --hroll|[[ [ $cs ] [[19 - {@{selected|Level},0}&gt;5 - {@{selected|Level},0}&gt;9]] + 0d0 ]] --?? $Atk.base &gt;= $cs ?? Critical Success!|Rolled [[ [ $Crit ] [[1 + {@{selected|Level},0}&gt;8]]d[[12 + 2 * {@{selected|Level},0}&gt;2 + 2 * {@{selected|Level},0}&gt;3 + 4 * {@{selected|Level},0}&gt;4 + 4 * {@{selected|Level},0}&gt;5 + 6 * {@{selected|Level},0}&gt;6 - 10 * {@{selected|Level},0}&gt;8]] + @{selected|LCK} ]] on Crit Table [[ [TXT| $Table ] [[3 + {@{selected|Level},0}&gt;3 + {@{selected|Level},0}&gt;5]] + 0d0 ]]! --?? $Atk.base == 1 ?? Critical Fumble!|Rolled [[ 1d8 - @{selected|LCK} ]] or [[ 1d12 - @{selected|LCK} ]] or [[ 1d16 - @{selected|LCK} ]] on the Fumble Table! --?? $Atk.base &gt;= $cs AND $Table == 3 AND $Crit &lt;= 0 ?? Crit Table Result:|Battle rage makes friend and foe indistinguishable. Foe is hit for +[[ 1d12 ]] damage, and the ally nearest him is also hit by a rebounding blow for [[ 1d4 ]] damage.** --?? $Atk.base &gt;= $cs AND $Table == 3 AND $Crit == 1 ?? Crit Table Result:|etc. }}
To get you started with the crit tables: Thanks! I'll let you know how my slide into madness goes :D
1479866836
Silvyre
Forum Champion
Please do! Then we can get started on fumbles!
This section of the Roll20 Wiki documents how to call Attributes. The Attribute in question ( according to the sheet's Wiki page ) is named strength-mod Thank you very much, I ended up using the sheet wiki page which lead me to&nbsp; <a href="https://wiki.roll20.net/DnD4e_Character_Sheet" rel="nofollow">https://wiki.roll20.net/DnD4e_Character_Sheet</a> , this has every hidden attribute which is making life so much easier for me. &nbsp;thank you for your assistance, I just gotta learn how to add the condition icons and see if these rolls can automatically influence attribute bar data like hp. &nbsp;I read it a bit on the home page but I'm going to tackle it and see what I can do.&nbsp;