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)

1444322426

Edited 1444322441
DK Heinrich said: Calhanol said:  I wish I could space them closer or make it smaller overall or use multiple colours to dictate titles ect.. Try them without the ~C (center) -- for me it got rid of the extra padding between each (space closer together), and I liked the tighter look better than the centered look. Its also why I moved my 'remaining castings' to the front of the spell instead of behind it -- it kept the natural left format consistent.  Tried but because they are literally different section tabs, not just the same tab but with "^^" on it, so they remain spaced the same. I know I could do it but it would become overally complex that it'd not be worth it.
Peter Bergholtz said: I have noticed that I can't use Powercards III together with the Mapdiscovery script. Anyone else ran into this? Sorry for not seeing this post before. Can you link to the Map Discovery script and post the error you get when trying to run them both? Thanks.
I'd like some help developing a powercard for my paladin that helps me keep track of my lay hands healing remaining and it would be great to have a powercard that replenishes it after a long rest.
1445432733

Edited 1445432851
DK Heinrich
Marketplace Creator
Sheet Author
Best way to do it IMO is to combine !ammo and !powercards - I am using a version of !ammo that Grey modified (removed most of the auto responses when you do things so chat stays cleaner). 1st set an attribute as LayOnHands # (current) | # (max)  [to start current and max are probably the same] !ammo @{selected|token_id} LayOnHands -?{Amount|0} !power {{ --charid|@{character_id} --emote|//@{selected|token_name} touches you in that special way…// --format|at-will --name|Lay on Hands --hroll|[[ [$LOH] @{selected|LayOnHands} + 0d0 ]]  --?? $LOH.total == 0 ?? !Error1|~C**Error**~C  --?? $LOH.total == 0 ?? !Error2|~CYou have already touched all the people you can touch today~C --?? $LOH.total > 0 ?? @{target|T1|token_name}|heals [[ ?{Amount} + 0d0]] damage --?? $LOH.total > 0 ?? Healing Remaining| [[ @{selected|LayOnHands} - ?{Amount}]]  }} Resting would be something like this !ammo @{selected|token_id} LayOnHands [[@{selected|LayOnHands|Max} - @{selected|LayOnHands}]] !power {{ --charid|@{character_id} --emote|//@{selected|token_name} benefits from a rest…// --format|at-will --name|REST --~C **@{selected|token_name}** regains the following ~C --!Spell *1| **Lay On Hands** resets to [[@{selected|LayOnHands|Max}]] }} This is just basic formatting, but out put looks like this (using 10 as my max Lay On Hands). Hope these help!
1445432996

Edited 1445437331
DK Heinrich
Marketplace Creator
Sheet Author
Looks like this if you go over your max... so you can just do the math OR add conditionals to the !powercard to give additional error messages if you choose a ?{amount} greater than current LayOnHands. maybe add (untested) --?? $LOH.total < ?{Amount} ?? !Error3|~CYou cannot heal for that amount, you only have [[ @{selected|LayOnHands} + 0d0 ]] available until after you rest~C Oh, and to see how much you have before you use it, just use the main macro and enter 0 (default) for the Amount query. 
Works fantastic, Thank you! I have now made 3 more powercards.
Rob said: Works fantastic, Thank you! I have now made 3 more powercards. Hope they help you manage your campaign better. :)
1445518597
DK Heinrich
Marketplace Creator
Sheet Author
Rob said: Works fantastic, Thank you! I have now made 3 more powercards. Your welcome, every once in a while my limited knowledge comes in handy.
Ziechael said: Zowie Slot Machine (big payout, can be reduced to a 1d6/reel variation easily enough) !power {{ --emote|@{selected|token_name} tries their luck on the big slot machine. --name|Zowie Slot Machine --Wager|[[?{How Much?|5} + 0d0]]gp --!stuff|You pull the big handle and stand back as the clockwork ticks away inside. ^^ Eventually the reels stop, one by one: --Result|[[ [$r1] 1d8 ]] | [[ [$r2] 1d8 ]] | [[ [$r3] 1d8 ]] --?? $r1 == 6 AND $r2 == 6 AND $r3 == 1 ?? !win1|**Ding Ding Ding** ^^ You win [[?{How Much?}*2]]gp --?? $r1 == 6 AND $r2 == 1 AND $r3 == 6 ?? !win1a|**Ding Ding Ding** ^^ You win [[?{How Much?}*2]]gp --?? $r1 == 1 AND $r2 == 6 AND $r3 == 6 ?? !win1b|**Ding Ding Ding** ^^ You win [[?{How Much?}*2]]gp --?? $r1 == 6 AND $r2 == 6 AND $r3 == 2 ?? !win2|**Ding Ding Ding** ^^ You win [[?{How Much?}*4]]gp --?? $r1 == 6 AND $r2 == 2 AND $r3 == 6 ?? !win2a|**Ding Ding Ding** ^^ You win [[?{How Much?}*4]]gp --?? $r1 == 2 AND $r2 == 6 AND $r3 == 6 ?? !win2b|**Ding Ding Ding** ^^ You win [[?{How Much?}*4]]gp --?? $r1 == 6 AND $r2 == 6 AND $r3 == 3 ?? !win3|**Ding Ding Ding** ^^ You win [[?{How Much?}*6]]gp --?? $r1 == 6 AND $r2 == 3 AND $r3 == 6 ?? !win3a|**Ding Ding Ding** ^^ You win [[?{How Much?}*6]]gp --?? $r1 == 3 AND $r2 == 6 AND $r3 == 6 ?? !win3b|**Ding Ding Ding** ^^ You win [[?{How Much?}*6]]gp --?? $r1 == 6 AND $r2 == 6 AND $r3 == 4 ?? !win4|**Ding Ding Ding** ^^ You win [[?{How Much?}*8]]gp --?? $r1 == 6 AND $r2 == 4 AND $r3 == 6 ?? !win4a|**Ding Ding Ding** ^^ You win [[?{How Much?}*8]]gp --?? $r1 == 4 AND $r2 == 6 AND $r3 == 6 ?? !win4b|**Ding Ding Ding** ^^ You win [[?{How Much?}*8]]gp --?? $r1 == 6 AND $r2 == 6 AND $r3 == 5 ?? !win5|**Ding Ding Ding** ^^ You win [[?{How Much?}*10]]gp --?? $r1 == 6 AND $r2 == 5 AND $r3 == 6 ?? !win5a|**Ding Ding Ding** ^^ You win [[?{How Much?}*10]]gp --?? $r1 == 5 AND $r2 == 6 AND $r3 == 6 ?? !win5b|**Ding Ding Ding** ^^ You win [[?{How Much?}*10]]gp --?? $r1 == 6 AND $r2 == 6 AND $r3 == 7 ?? !win6|**Ding Ding Ding** ^^ You win [[?{How Much?}*12]]gp --?? $r1 == 6 AND $r2 == 7 AND $r3 == 6 ?? !win6a|**Ding Ding Ding** ^^ You win [[?{How Much?}*12]]gp --?? $r1 == 7 AND $r2 == 6 AND $r3 == 6 ?? !win6b|**Ding Ding Ding** ^^ You win [[?{How Much?}*12]]gp --?? $r1 == 6 AND $r2 == 6 AND $r3 == 8 ?? !win7|**Ding Ding Ding** ^^ You win [[?{How Much?}*15]]gp --?? $r1 == 6 AND $r2 == 8 AND $r3 == 6 ?? !win7a|**Ding Ding Ding** ^^ You win [[?{How Much?}*15]]gp --?? $r1 == 8 AND $r2 == 6 AND $r3 == 6 ?? !win7b|**Ding Ding Ding** ^^ You win [[?{How Much?}*15]]gp --?? $r1 == 1 AND $r2 == 1 AND $r3 == 1 ?? !win8|**Ding Ding Ding** ^^ You win [[?{How Much?}*8]]gp --?? $r1 == 2 AND $r2 == 2 AND $r3 == 2 ?? !win9|**Ding Ding Ding** ^^ You win [[?{How Much?}*12]]gp --?? $r1 == 3 AND $r2 == 3 AND $r3 == 3 ?? !win10|**Ding Ding Ding** ^^ You win [[?{How Much?}*14]]gp --?? $r1 == 4 AND $r2 == 4 AND $r3 == 4 ?? !win11|**Ding Ding Ding** ^^ You win [[?{How Much?}*16]]gp --?? $r1 == 5 AND $r2 == 5 AND $r3 == 5 ?? !win12|**Ding Ding Ding** ^^ You win [[?{How Much?}*20]]gp --?? $r1 == 6 AND $r2 == 6 AND $r3 == 6 ?? !win13|**Ding Ding Ding** ^^ You win [[?{How Much?}*24]]gp --?? $r1 == 7 AND $r2 == 7 AND $r3 == 7 ?? !win14|**JACKPOT** ^^ You win [[?{How Much?}*50]]gp --?? $r1 == 8 AND $r2 == 8 AND $r3 == 8 ?? !win15|**ZOWIE!!!** ^^ You win [[?{How Much?}*100]]gp }} When I tried to use this script, all that came up in the chat was "#Zowie Slot Machine". Do you know why that is? What can I fix in the code to make it work?
OK, just so I can get my head around the Power Cards. Can someone post a basic code for an attack Power Card for 5e w/API buttons for say a short sword, long sword, and light crossbow with the finished product as well. That way I can kind of see what goes where and how it all pieces together. Unfortunately I'm more of a visual learner, than reading and saying "OK, this goes here and you have to add these tags to this, etc...and this is the outcome." If someone could do that, that would be awesome, then I can actually see where everything is, and hopefully be able to create my own. Also, do you need to use Character sheets, i.e. 5th Edition Character Sheet, or can you use the built in Character Sheets that are pre-loaded on the game itself?
1445578295

Edited 1445579691
OK guys, I think I have it mostly figured out, but... I'm having this problem and don't know how to fix it. Here's the code I'm using: Here's the output: And here are the abilities that it says it can't find: Can any of you guys help me out please? EDIT: Oh, and I've tried switching out HTML entities, I've tried rewriting the code, I've tried copy-and-paste from the title box of the abilities. Nothing seems to work. EDIT 2: OK, I've figured out why the buttons didn't show, but now it's still saying that it can't find the abilities, and the one ability that it does find the button won't work. EDIT 3: OK, I tried Silvyre's attempt at fixing it: Silvyre said: !power {{ --whisper|self --$See:| <a href="https://app.roll20.net/forum/permalink/2378264/" rel="nofollow">https://app.roll20.net/forum/permalink/2378264/</a> --orowbg|#F5DEB3 --erowbg|#FFFFF0 --name|B-R8’s Spell Book --leftsub|♦ --!Arcane Armor:|[**Arcane Armor**](! %{B-R8|04-Arcane-Armor}) --!Evade:|[**Evade**](! %{B-R8|06-Evade}) --!Magic Dart:|[**Magic Dart**](! %{B-R8|07-Magic-Dart}) --!Magic Lock:|[**Magic Lock**](! %{B-R8|05-Magic-Lock}) --!Sense Magic:|[**Sense Magic**](! %{B-R8|03-Sense-Magic}) --!Secure Site:|[**Secure Site**](! %{B-R8|02-Secure-Site}) --!Unerring Darts:|[**Unerring Darts**](! %{B-R8|08-Unerring-Darts}) }} Now, all the buttons are there but they are not working and it's giving me an error: "No ability was found for %{Cairo|Command} (GM):Cairo|Command" This is the error I get for all the buttons, with the names changed of course.
1445604184

Edited 1445604594
DK Heinrich
Marketplace Creator
Sheet Author
you might be missing the carriage return - (see below with html entities) - you need a 13 (carriage return) and a 37 (percent sign) as html entities for each call to a character macro.&nbsp; !power {{ --orowbg|#F5DEB3 --erowbg|#FFFFF0 --name|**Spells Available** --leftsub|**Power: 1**&nbsp; --whisper|self --!Blank1|~~~ --!Rank0|~C**Rank 0 Spells**~C --!Blank2|~~~ --!Spells0|[[ @{HELMUT|Celerity} + 0d0 ]] [**Celerity**](!&amp;#13;&amp;#37;{HELMUT|Celerity})&nbsp;^^ [[ @{HELMUT|MinorHealing} + 0d0 ]] [**Minor Healing**](!&amp;#13;&amp;#37;{HELMUT|Minor-Healing}) &nbsp; --!Blank3|~~~ --!Rank1|~C**Rank 1 Spells**~C --!Blank4|~~~ --!Spells1|[[ @{HELMUT|MightyAttack} + 0d0 ]] [**Mighty Attack**](!&amp;#13;&amp;#37;{HELMUT|Might-Attack})&nbsp; }}
1445604665
DK Heinrich
Marketplace Creator
Sheet Author
and, damn, I wish the need for html entities would be cured - if for no other reason than not having to struggle with editing posts with them in it... lol
DK Heinrich said: you might be missing the carriage return - (see below with html entities) - you need a 13 (carriage return) and a 37 (percent sign) as html entities for each call to a character macro.&nbsp; Not missing the carriage return or percent. As stated in EDIT 3, I tried Silvyre's fix with the carriage return. That's what fixed the buttons showing up but they still won't link to the Abilities. I just looked over all the lines in the code and all of them have the &#13; and &#37; in them.
1445627063
DK Heinrich
Marketplace Creator
Sheet Author
ok, so if the buttons all output correctly but dont call the macro you are looking for. Sorry I mis understood where your error might be.&nbsp; looks like your marco titles are correct from what you have posted, so that leaves the character name - I assume its correct and is its full name? and the token is assigned to that character and represents it and all that good stuff?&nbsp; I also assume all the macro's work when you use them without the api button (use them from the list or have 'token action' checked and use it from there.
1445628881

Edited 1445634434
DK Heinrich said: ok, so if the buttons all output correctly but dont call the macro you are looking for. Sorry I mis understood where your error might be.&nbsp; looks like your marco titles are correct from what you have posted, so that leaves the character name - I assume its correct and is its full name? and the token is assigned to that character and represents it and all that good stuff?&nbsp; I also assume all the macro's work when you use them without the api button (use them from the list or have 'token action' checked and use it from there. Yes, everything is correct. Yes, the macros work without calling them from the API buttons. I will try something with the name in a little bit. EDIT: &nbsp;OK, I got everything working. It was the name. For some reason when you just use the buttons in a regular macro it works fine with a shortened name, but not in this script. Everything is working correctly and all is right with the world yet again.
DK Heinrich said: and, damn, I wish the need for html entities would be cured - if for no other reason than not having to struggle with editing posts with them in it... lol I will try adding something to the formatter and do the replacement in PowerCards and test it...maybe Sunday. It might get around the need to use html entities and instead a separate method. Like maybe #Button Name#($MacroName) and I will do the replacements in PowerCards to turn it into [Button Name](!%{MacroName}) or something. Hopefully that will work.
1445649751
Silvyre
Forum Champion
HoneyBadger said: DK Heinrich said: and, damn, I wish the need for html entities would be cured - if for no other reason than not having to struggle with editing posts with them in it... lol I will try adding something to the formatter and do the replacement in PowerCards and test it...maybe Sunday. It might get around the need to use html entities and instead a separate method. Like maybe #Button Name#($MacroName) and I will do the replacements in PowerCards to turn it into [Button Name](!%{MacroName}) or something. Hopefully that will work. Awesome! I'd been hoping that we'd get button support. :)
I am using the following power card for a longsword attack 2 handed. When I roll with advantage and both of dice results would add up to 20 (example the dice rolled an 11 and 9). And the targets AC is 21 or higher i get a result of miss and in addition it produces the critical hit response as well. !power {{ --charid|@{character_id} --emote|//@{selected|token_name} attacks @{target|token_name} with his longsword.// --format|baros --name|Longsword --leftsub|Melee Attack --rightsub|Reach 5 ft. --title|[[ [$AtkType] ?{Attack Std (0), Dis (1), or Adv(2)|0} + 0d0 ]] --?? $AtkType == 0 ?? Attack:|[[ [$AtkStd] [nh] 1d20 + @{Strength_Mod} + @{PB} + ?{Misc. Attack Modifier|3} [Misc. Mod] ]] vs @{target|Bar2} AC --?? $AtkType == 1 ?? Attack:|[[ [$AtkDis] [nh] {2d20}KL1 + @{Strength_Mod} + @{PB} + ?{Misc. Attack Modifier|3} [Misc. Mod] ]] vs @{target|Bar2} AC --?? $AtkType == 2 ?? Attack:|[[ [$AtkAdv] [nh] {2d20}KH1 + @{Strength_Mod} + @{PB} + ?{Misc. Attack Modifier|3} [Misc. Mod] ]] vs @{target|Bar2} AC --?? $AtkType == 0 AND $AtkStd.base == 20 ?? Critical Hit:|[[ [nh] 2d10 + @{Strength_Mod} ]] slashing damage --?? $AtkType == 0 AND $AtkStd.base &lt;&gt; 1 AND $AtkStd.total &gt;= @{target|Bar2} AND $AtkStd.base &lt;&gt; 20 ?? Hit:|[[ [nh] 1d10 + @{Strength_Mod} ]] slashing damage. --?? $AtkType == 0 AND $AtkStd.base &lt;&gt; 1 AND $AtkStd.total &lt; @{target|Bar2} ?? Miss:|Strength Through Discipline, Order Through Strength, Peace Through Order. --?? $AtkType == 1 AND $AtkDis.base == 20 ?? Critical Hit:|[[ [nh] 2d10 + @{Strength_Mod} ]] slashing damage --?? $AtkType == 1 AND $AtkDis.base &lt;&gt; 1 AND $AtkDis.total &gt;= @{target|Bar2} AND $AtkDis.base &lt;&gt; 20 ?? Hit:|[[ [nh] 1d10 + @{Strength_Mod} ]] slashing damage --?? $AtkType == 1 AND $AtkDis.base &lt;&gt; 1 AND $AtkDis.total &lt; @{target|Bar2} ?? Miss:|By the Iron Codex, I will defeat thee! --?? $AtkType == 2 AND $AtkAdv.base == 20 ?? Critical Hit:|[[ [nh] 2d10 + @{Strength_Mod} ]] slashing damage --?? $AtkType == 2 AND $AtkAdv.base &lt;&gt; 1 AND $AtkAdv.total &gt;= @{target|Bar2} AND $AtkStd.base &lt;&gt; 20 ?? Hit:|[[ [nh] 1d10 + @{Strength_Mod} ]] slashing damage. --?? $AtkType == 2 AND $AtkAdv.base &lt;&gt; 1 AND $AtkAdv.total &lt; @{target|Bar2} ?? Miss:|**Bane's** black mailed fist! }}
1445666126

Edited 1445668515
I see a few things that are bad. First, when you have two tags in a roll, you can't have them in two separate tags. This: [$AtkAdv] [nh] {2d20}KH1 Must become this: [$AtkAdv|nh] {2d20}KH1 Otherwise, it's getting confused looking for something that isn't there. Next, you also have it checking&nbsp;$AtkStd.base &lt;&gt; 20, when it should be checking&nbsp;$AtkAdv.base &lt;&gt; 20. Turn it into something like this: !power {{ --charid|@{character_id} --emote|//@{selected|token_name} attacks @{target|token_name} with his longsword.// --format|baros --name|Longsword --leftsub|Melee Attack --rightsub|Reach 5 ft. --title|[[ [$AtkType] ?{Attack|Std,0|Dis,1|Adv,2} + 0d0 ]] --?? $AtkType == 0 ?? Attack:|[[ [$AtkStd|nh] 1d20 + @{Strength_Mod} + @{PB} + ?{Misc. Attack Modifier|3} [Misc. Mod] ]] vs @{target|Bar2} AC --?? $AtkType == 1 ?? Attack:|[[ [$AtkDis|nh] {2d20}KL1 + @{Strength_Mod} + @{PB} + ?{Misc. Attack Modifier|3} [Misc. Mod] ]] vs @{target|Bar2} AC --?? $AtkType == 2 ?? Attack:|[[ [$AtkAdv|nh] {2d20}KH1 + @{Strength_Mod} + @{PB} + ?{Misc. Attack Modifier|3} [Misc. Mod] ]] vs @{target|Bar2} AC --?? $AtkType == 0 AND $AtkStd.base == 20 ?? Critical Hit:|[[ [nh] 2d10 + @{Strength_Mod} ]] slashing damage --?? $AtkType == 0 AND $AtkStd.base &lt;&gt; 1 AND $AtkStd.total &gt;= @{target|Bar2} AND $AtkStd.base &lt;&gt; 20 ?? Hit:|[[ [nh] 1d10 + @{Strength_Mod} ]] slashing damage. --?? $AtkType == 0 AND $AtkStd.base &lt;&gt; 1 AND $AtkStd.total &lt; @{target|Bar2} ?? Miss:|Strength Through Discipline, Order Through Strength, Peace Through Order. --?? $AtkType == 1 AND $AtkDis.base == 20 ?? Critical Hit:|[[ [nh] 2d10 + @{Strength_Mod} ]] slashing damage --?? $AtkType == 1 AND $AtkDis.base &lt;&gt; 1 AND $AtkDis.total &gt;= @{target|Bar2} AND $AtkDis.base &lt;&gt; 20 ?? Hit:|[[ [nh] 1d10 + @{Strength_Mod} ]] slashing damage --?? $AtkType == 1 AND $AtkDis.base &lt;&gt; 1 AND $AtkDis.total &lt; @{target|Bar2} ?? Miss:|By the Iron Codex, I will defeat thee! --?? $AtkType == 2 AND $AtkAdv.base == 20 ?? Critical Hit:|[[ [nh] 2d10 + @{Strength_Mod} ]] slashing damage --?? $AtkType == 2 AND $AtkAdv.base &lt;&gt; 1 AND $AtkAdv.total &gt;= @{target|Bar2} AND $AtkAdv.base &lt;&gt; 20 ?? Hit:|[[ [nh] 1d10 + @{Strength_Mod} ]] slashing damage. --?? $AtkType == 2 AND $AtkAdv.base &lt;&gt; 1 AND $AtkAdv.total &lt; @{target|Bar2} ?? Miss:|**Bane's** black mailed fist! } Granted, I turned your popup window that asks about Advantage, etc., into a dropdown instead of a number value being entered, but this should work a lot better for you. To give you an idea of how powerful this setup can be... This is the macro I use for my Druid: !power {{&nbsp; @{format}&nbsp; --charid|@{character_id}&nbsp; --emote|~L @{character_name} puts aside his healing and spell casting for a moment to bathe in the blood of his enemies.&nbsp; --name|@{selected|meleeweaponname1} Attack&nbsp; --leftsub|Attack Action&nbsp; --rightsub|Melee&nbsp; --hroll|[[ [$Adv] ?{Advantage?|No,0|Advantage,1|Disadvantage,2} +0d0 ]] --?? $Adv == 1 ?? !Advantage|~C **$$#006600|Advantage$$** ~~~ ~C --?? $Adv == 2 ?? !Disadvantage|~C **$$#990000|Disadvantage$$** ~~~ ~C --Main Hand Attack:|@{selected|token_name} slices through the air with his //@{selected|meleeweaponname1}//.&nbsp; --Target:|$$#ff0000|**@{target|Target 1|token_name}**$$ --?? $Adv == 0 ?? ^1Attack *1:|~R [[ [$AtkStd] 1d20+ [[@{selected|meleetohit1} [Melee Bonus] ]] ]] ~R --?? $Adv == 0 AND $AtkStd.total &lt; @{target|Target 1|bar3} AND $AtkStd.base == 1 ?? !Miss *1:|Like a dumbass, you missed horribly: ^^^^ $$#ff0000|**[[ 1t[Critical-Miss] [txt] ]]**$$ --?? $Adv == 0 AND $AtkStd.total &lt; @{target|Target 1|bar3} AND $AtkStd.base &lt;&gt; 1 ?? !Miss *1:|~C $$#ff0000|**Missed.**$$ ~C --?? $Adv == 0 AND $AtkStd.total &gt;= @{target|Target 1|bar3} ?? ^1Damage *1:|~R[[@{selected|meleedmg1}+ [[@{meleedmgbonus1}]] ]]~R --?? $Adv == 0 AND $AtkStd.total &gt;= @{target|Target 1|bar3} ?? ^1Damage Type *1:|@{selected|meleedmgtype1} --?? $Adv == 0 AND $AtkStd.base == 20 ?? ^2Crit *1:|~R[[@{selected|meleedmg1}]]~R --?? $Adv == 1 ?? ^1Attack *1:|~R [[ [$AtkAdv] {2d20}KH1 + [[@{selected|meleetohit1} [Melee Bonus] ]] ]] ~R --?? $Adv == 1 AND $AtkAdv.total &lt; @{target|Target 1|bar3} AND $AtkAdv.base == 1 ?? !Miss *1:|Like a dumbass, you missed horribly: ^^^^ $$#ff0000|**[[ 1t[Critical-Miss] [txt] ]]**$$ --?? $Adv == 1 AND $AtkAdv.total &lt; @{target|Target 1|bar3} AND $AtkAdv.base &lt;&gt; 1 ?? !Miss *1:|~C $$#ff0000|**Missed.**$$ ~C --?? $Adv == 1 AND $AtkAdv.total &gt;= @{target|Target 1|bar3} ?? ^1Damage *1:|~R[[@{selected|meleedmg1}+ [[@{meleedmgbonus1}]] ]]~R --?? $Adv == 1 AND $AtkAdv.total &gt;= @{target|Target 1|bar3} ?? ^1Damage Type *1:|@{selected|meleedmgtype1} --?? $Adv == 1 AND $AtkAdv.base == 20 ?? ^2Crit *1:|~R[[@{selected|meleedmg1}]]~R --?? $Adv == 2 ?? ^1Attack *1:|~R [[ [$AtkDis] {2d20}KL1 + [[@{selected|meleetohit1} [Melee Bonus] ]] ]] ~R&nbsp; --?? $Adv == 2 AND $AtkDis.total &lt; @{target|Target 1|bar3} $AtkDis.base == 1 ?? !Miss *1:|Like a dumbass, you missed horribly: ^^^^ $$#ff0000|**[[ 1t[Critical-Miss] [txt] ]]**$$ --?? $Adv == 2 AND $AtkDis.total &lt; @{target|Target 1|bar3} AND $AtkDis.base &lt;&gt; 1 ?? !Miss *1:|~C $$#ff0000|**Missed.**$$ ~C --?? $Adv == 2 AND $AtkDis.total &gt;= @{target|Target 1|bar3} ?? ^1Damage *1:|~R[[@{selected|meleedmg1}+ [[@{meleedmgbonus1}]] ]]~R --?? $Adv == 2 AND $AtkDis.total &gt;= @{target|Target 1|bar3} ?? ^1Damage Type *1:|@{selected|meleedmgtype1} --?? $Adv == 2 AND $AtkDis.base == 20 ?? ^2Crit *1:|~R[[@{selected|meleedmg1}]]~R }} And with a bit more work, you can make some pretty long ones. I have one I made for my dad that is 182 lines long, and&nbsp;one for my mother that is 118 lines for her Paladin asking her about smites and such, and pulling data from other macros to insert into various places as necessary. Of course, I removed a return of the AC to keep monster AC's secret from the players...
1445670337

Edited 1445670360
Thank you Sean that fixed it. Your macro is bit beyond me at the moment, however I have book marked this page to refer to when I get a few more runs on the board. Cheers, Rob
You can actually greatly simplify macro's like that by altering the advantage/disadvantage drop down attack roll to the following. This method means you only have to compare one roll id instead of each roll and whether the attack has advantage or not and such. [[ [$AtkRoll] ?{Attack|Standard, 1d20|w/Advantage, 2d20KH1|w/Disadavantage, 2d20KL1} + 0 [Modifiers] ]] vs AC
Silvyre said: Awesome! I'd been hoping that we'd get button support. :) I can't promise it will work though, lol. Just will try it out.
I can't remember why, but there was some reason I couldn't do it that way... Maybe my brain is shutting down on me soon, but there was a reason I couldn't.
HoneyBadger said: Silvyre said: Awesome! I'd been hoping that we'd get button support. :) I can't promise it will work though, lol. Just will try it out. Sadly... it does not work. It turns into this:
1445702860

Edited 1445703411
Silvyre
Forum Champion
Hmm, yeah. API Command Buttons and line breaks don't play nice. Plus, normally, a ton of characters have to be replaced with entities to avoid parsing (but it seems like you're looking to fix that?) Slightly related: do you think it might be possible to make it such that a whisper tag isn't needed to output buttons and Markdown images/links?
The other thing is, for whatever reason, PowerCards with buttons must &nbsp;be whispered to someone. You can never send it to general chat, or else it shows up as you see there.
1445717709
DK Heinrich
Marketplace Creator
Sheet Author
EDIT: &nbsp;OK, I got everything working. It was the name. For some reason when you just use the buttons in a regular macro it works fine with a shortened name, but not in this script. Everything is working correctly and all is right with the world yet again. Cool, glad I could help.
1445718826

Edited 1445719035
Silvyre said: Hmm, yeah. API Command Buttons and line breaks don't play nice. Plus, normally, a ton of characters have to be replaced with entities to avoid parsing (but it seems like you're looking to fix that?) Slightly related: do you think it might be possible to make it such that a whisper tag isn't needed to output buttons and Markdown images/links? Ah. I will try it as one line. Edit: Nope, a single line didn't work either... but I think I know how to make linkable powers work. Testing now.
1445719971

Edited 1445721070
Okay... I think there's a way to do this and even style the buttons, BUT... it's going to take a lot of time I don't have right now to make it work... because inline rolls and colon's break the buttons, so I'm gonna have to figure out a way to get the data from the linked macro into powercards in a way that won't break the link/button. This will create an API Command Button with a black border that will create a powercard as normal. Adding a colon after Attack or doing an inline roll [[1d20]] breaks it. Edit: Just had an idea that should be easy, but I won't be able to get to it right away. What I am going to do is make a new button method instead of [Button Name](!api command) that will tell the PowerCards script to go get the data from the specified macro and then run it through the PowerCard.Process and do the card that way. NOT FINAL Example: [Claw](!power --button|Troll|Claw) will trigger PowerCards to go get the text from the Troll|Claw macro and parse that for the powercard when clicked. That should avoid all the issues with inline rolls and other problematic characters. I will also be able to add a variable for GM's to style the buttons to their specifications instead of the bright ass pink button. &lt;a style='border: 1px solid #000;' href='!power --name|Claw --Attack|[!1d20!]'&gt;Claw&lt;/a&gt;
1445721925
Silvyre
Forum Champion
Yeah, API Command Buttons are kind of tenuous like that. One will usually have to replace each of ? @ % [[ ]] * ) ` to prevent Roll20/Markdown parsing (with : and " thrown in to prevent HTML intepretation). To prevent PowerCards' parsing, I add -- // _ ~ ^ $ }} to the list. Regex Find/Replace: (\Q?\E)|(\Q@\E)|(\Q%\E)|(\Q[[\E)|(\Q]]\E)|(\Q*\E)|(\Q)\E)|(\Q--\E)|(\Q//\E)|(\Q~\E)|(\Q^\E)|(\Q}\E)|(\Q$\E)|(\r\n)|(\Q`\E)|(\Q_\E)|(\Q:\E)|(\Q"\E) (?1&amp;#63;)(?2&amp;#64;)(?3&amp;#37;)(?4&amp;#91;[)(?5]&amp;#93;)(?6&amp;#42;)(?7&amp;#41;)(?8&amp;#45;-)(?9&amp;#47;/)(?10&amp;#126;)(?11&amp;#94;)(?12&amp;#125;)(?13&amp;#36;)(?14 )(?15&amp;#96;)(?16&amp;#95;)(?17&amp;#58;)(?18&amp;#34;)
1445722487

Edited 1445722684
This won't require any of that. Example of what a powercard spellbook might look like... once I figure out how I want to do the powercard specific api command buttons. I finally realized I can just tell powercards to go get the text from the macro instead of letting Roll20 do that via chat. !power {{ --name|Spellbook --!text1|~C Cantrips ~C --!c1|[Ray of Frost]($Mage|Ray-of-Frost) --!c2|[Mage Hand]($Mage|Mage-Hand) }}
Hrm... an issue. It won't trigger any queries. &gt;_&lt;
Can someone please explain how to make an inline roll highlight green for a crit roll on a 19 or 20. I have a barbarian NPC &nbsp;who gets crits on a 19, and it's so tiring having to always check the inline roll to see if he rolled a 19 or not. And sometimes my players get lucky because I forget to check it. I saw something about $Atk and Atk.base or .total, and thought that might be the way but I can't seem to make it work.
[[1d20cs&gt;19]]
Well that was simple enough. What is the $Atk/Atk.base/Atk.total for and how would I use that? Also, is anyone else getting this problem: Here is the character I'm working on right now. This is what comes up for the output in chat. This happens no matter what macro button I select, and no matter which character I use. Does anyone know what's going on here?!?!?
Also, is there any way to use the players color for the power cards?
To your last: yes. In the PowerCards script, change &nbsp; &nbsp; var USE_PLAYER_COLOR = false; // Set to true to override all color formatting to &nbsp; &nbsp; var USE_PLAYER_COLOR = true; // Set to true to override all color formatting To the question about $Atk/Atk.base/Atk.total and how to use them: --^1Attack *1:|~R [[ [$AtkStd] 1d20+ [[@{selected|meleetohit1} [Melee Bonus] ]] ]] ~R In this instance (and there are things above I edited out, like Advantage choice), the roll is set to happen and be named $AtkStd. That leads us to this: --?? $AtkStd.total &lt; @{target|Target 1|bar3} AND $AtkStd.base == 1 ?? !Miss *1:|Like a dumbass, you missed horribly: ^^^^ $$#ff0000|**[[ 1t[Critical-Miss] [txt] ]]**$$ Here, we are told that if the total &nbsp;amount rolled in $AtkStd roll is less than the AC and &nbsp;that the actual die roll was a 1, then to execute the line of code following the second set of question marks. The next line is: --?? $AtkStd.total &lt; @{target|Target 1|bar3} AND $AtkStd.base &lt;&gt; 1 AND $AtkStd.base &lt;&gt; 20 ?? !Miss *1:|~C $$#ff0000|**Missed.**$$ ~C Here, if the total is less than the AC and &nbsp;the actual die roll is not 1 and&nbsp; the actual die roll is a 20 (since a 20 is an automatic hit), execute that line. Next: --?? $AtkStd.total &gt;= @{target|Target 1|bar3} OR $AtkStd.base == 20 ?? ^1Damage *1:|~R[[@{selected|meleedmg1}+ [[@{meleedmgbonus1}]] ]]~R Now, if the total is greater than or equal to the AC or &nbsp;the actual die roll is a 20, execute that line. Next: --?? $AtkStd.total &gt;= @{target|Target 1|bar3} OR $AtkStd.base == 20 ?? ^1Damage Type *1:|@{selected|meleedmgtype1} I run the damage type on another line, and is exactly the same as the one above. Finally: --?? $AtkStd.base == 20 ?? ^2Crit *1:|~R[[@{selected|meleedmg1}]]~R Here, if the actual die roll is exactly 20, the line executes.&nbsp;Since this is an attack roll, I don't care about whether it meets or exceeds the AC, since a 20 is an automatic hit anyhow. Basically: .base refers to the actual die roll, and .total is the total roll after all applicable modifiers have been added or subtracted. On your issue with what's happening in your output chat... I'm not sure offhand, since we don't see what the macros actually have written in them.
SeanOG said: To your last: yes. In the PowerCards script, change &nbsp; &nbsp; var USE_PLAYER_COLOR = false; // Set to true to override all color formatting to &nbsp; &nbsp; var USE_PLAYER_COLOR = true; // Set to true to override all color formatting On your issue with what's happening in your output chat... I'm not sure offhand, since we don't see what the macros actually have written in them. Thanks for your help understanding the $Atk etc. I think I may be starting to actually understand that part. With the $Atk do you have to use the regular character sheets like 5e or 5e Shaped or can you use the base sheets that are in the default to Roll20? Also, I think I saw in some codes above or on previous pages where there is $"***" ***=Any other abbreviated word, does the $ have to be a set word or is that just a symbol used to DEFINE something? As to the USE_PLAYER_COLOR, I already have that set to true, but it's not showing up. I think it may be because I'm doing everything as the GM and not the actual character. Time will tell with that one. As for the output chat, I don't know what the problem was. It happened no matter what was written in them, whether it was a basic macro, default template macro, or power card macro. I don't know what the cause was, but I cleared the chat, logged out, cleared the chat log and logged back in, and all was right with the world again. Weird.
You can use anything for the label. A macro I set up for my mother, for example, has a bunch of them. It's all just a matter of calling them correctly later on when you want to use them. The "$" is necessary, and must be within a set of brackets (e.g.:[$Thiscanbeusedforanything]). As for what you can use them with, they will work with just about anything. They can call other macros you have made, attributes from a character sheet or the journal itself, as well as having everything hard-coded. GM-wise, it doesn't matter since it will default to your player color. If your color is orange, then the title area in a macro will be orange. If someone else were on, and their color was blue, it would be blue.
Can you call other API commands like say, the ammo command:&nbsp;!ammo @{selected|token_id} Hit Dice -1
Arthur B. said: Can you call other API commands like say, the ammo command:&nbsp;!ammo @{selected|token_id} Hit Dice -1 You can just put that in the macro, but not inside the powercard part.
HoneyBadger said: Arthur B. said: Can you call other API commands like say, the ammo command:&nbsp;!ammo @{selected|token_id} Hit Dice -1 You can just put that in the macro, but not inside the powercard part. I tried that, but for some reason it wouldn't work and would crash the API.
Do it at the very end. For example: !power {{ @{format} --charid|@{character_id} --emote|@{selected|token_name} quickly and calmly nocks, draws, and looses sharp death upon his enemies from a distance. --name|@{selected|token_name} Attack --leftsub|Attack Action --rightsub|Ranged Lots of things in here, and then The end... }} !ammo @{selected|token_id} rangedammo1 -?{Attack?} It has to be completely and utterly outside of a PowerCard macro. If you use the {{ }} method of the code, put it after the closing braces. If you make a loooooooong line of code instead, make sure you hit enter.
That's what I tried doing, butt it still won't call the !Ammo info. I will post the macro and output tomorrow.
Are you calling the name of the field you want to change? I ask because I'm curious as to whether the name of the field is, in fact, named Hit Dice.
The name is actually HitDice. I just forgot to leave out the space when I typed it in here.
Also, if there's no way to call another API script "in" the power cards, is there a way to simulate, in the power cards, what the Ammo API does?
Not that I am aware of. I don't know why it's not working for you, unless there is some sort of a typo somewhere. I have no problems using it, and I have it hard coded into my character sheet for spells, ammo and class resources. So, it's a little weird.