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 5)

Kurt J. said: Theodore S. said: Is this issue ever going to be fixed or a workaround for it? In the situation of a "Successful saving throw causes half damage": [[ [^Roll] / 2 ]] damage I know there are other APIs that can do what I am looking for but I love how Power Cards/Alter Bar work together and reduce my work. Well, it is a pretty fundamental part of PowerCards that the results of a roll can't be used in another roll because of the way they are processed. That said, there are two types of workarounds - one you can do right now (include the /2 in the roll itself and apply it twice on a failed save) and one that I've got in 3.8.6 (which will be along in a few days). I've added ".halfbase" and ".halftotal" to the modifiers you can use when displaying the value of a roll, so [^Roll.halftotal] will be replaced with half (rounded down) of the total value of the roll. Any progress on version 3.8.6? Would love to use the .halfbase and .halftotal
1535019144

Edited 1535019244
GiGs
Pro
Sheet Author
API Scripter
Theodore S. said: G G said: When I've used the XPND command it hasnt printed it out, it just shows the dice in the hovertext. Whats the proper syntax for using it to reveal the dice without needing to use hovertext? Did you do something like [[ [XPND] 3d6 ]] ? sorry, i misremembered my issue. When the dice are expanded, I need to see the die size. In roll20's /roll function, it shows the numbers inside dice icons, so you can see if what the d8 rolled, what the d6 rolled, etc. For the system I was trying it with, you need to be able to see at a glance if a die rolled maximum (there's no automatic roll-up, you can choose to roll up if willing to pay the price), so just spitting out numbers with no dice image doesn't do what i need.
Well, maybe that is something that Kurt could put into the API at a later date. He has already teased with .halfbase and .halftotal which is totally needed for saving throws in 5E.
1535062980

Edited 1535081573
Kurt J.
Pro
API Scripter
Version 3.8.6 is up on the development GIST. Hey all, sorry for the radio silence. I've been on vacation, but I'm back and have my first Roll20 game in three weeks tonight :) Version 3.8.6 is up on dev, with the following modifications: Added .halfbase and .halftotal modifiers to Roll IDs (ie, $Dmg.halftotal will return one half (rounded down) of the roll total). This SHOULD work wherever Roll IDs are referenced (except the expanded conditionals, which currently always work on the total roll value. Still contemplating a viable solution for that). Modified the --spell_list tag to use character IDs instead of "selected" for the buttons it creates, so it is no longer necessary to keep a token selected to use buttons generated by the tag. Added two ways to prevent inline formatting. You can prefix the content of a tag (after the |) with [NIF] and that line won't process formatting characters, or you can include a --NoInlineFormatting|1 tag (case sensitive,the value after the | doesn't matter) to prevent the entire card from processing inline formatting characters. This tag can be placed in the a format handout as well. This is in response to the issue that has come up a couple of time where character names that are immediately proceeded by a tilde (~) and start with R, C, J, or L were causing what looked like very odd issues because if the entry appeared twice it a tag they were being interpreted as formatting characters. Example: !power {{ --Centered|~C This will be centered! ~C --NotCentered|[NIF]~C This __won't__ be centered! ~C }} Example 2: !power {{   --NoInlineFormatting|1   --StillNotCentered|~C This won't be centered either! ~C }} Note that this is true for all inline formatting characters except bolding (Surrounding something with **double asterisks**). There must be some deeper level of formatting being performed by Roll20 itself for that, as I can't seem to make it not happen.
what is the trick to having a script send out a Power Card chat message?  I tried a really simple test but it only works intermittently.  When I just send a regular chat message it works all the time so it's something to do with my Power Card message.  I even tried in a fresh game and same problem.  It will work a couple times in a row and then nothing for the next few times. on("chat:message", function(msg) {   if(msg.type == "api" && msg.content.indexOf("!commandroll ") !== -1) {     sendChat(msg.who, "!power {{ --name|Roll }}");   } });
1535148210

Edited 1535152509
Kurt J.
Pro
API Scripter
Michael D. said: what is the trick to having a script send out a Power Card chat message?  I tried a really simple test but it only works intermittently.  When I just send a regular chat message it works all the time so it's something to do with my Power Card message.  I even tried in a fresh game and same problem.  It will work a couple times in a row and then nothing for the next few times. on("chat:message", function(msg) {   if(msg.type == "api" && msg.content.indexOf("!commandroll ") !== -1) {     sendChat(msg.who, "!power {{ --name|Roll }}");   } }); PowerCards exposes a function (PowerCards.Process) that can be passed a power card string to display it. I've never used it for anything, but there is a script called PowerCard PreProcessor (PCPP) (one of The Aaron's) that demonstrates how to use it.
Thanks Kurt, I'll check it out.  I assumed I could just send it as a chat message like you can by just typing in the chat box.  The strange thing is it works sometimes but not sure why.
1535159559
Kurt J.
Pro
API Scripter
Michael D. said: Thanks Kurt, I'll check it out.  I assumed I could just send it as a chat message like you can by just typing in the chat box.  The strange thing is it works sometimes but not sure why. I think it has to do with the way inline rolls get processed... if you use [#[ and ]#] instead of [[ and ]] it might work...
1535161099

Edited 1535161121
Kurt J. said: Michael D. said: Thanks Kurt, I'll check it out.  I assumed I could just send it as a chat message like you can by just typing in the chat box.  The strange thing is it works sometimes but not sure why. I think it has to do with the way inline rolls get processed... if you use [#[ and ]#] instead of [[ and ]] it might work... You mean like this? --test|[#[ [XPND] 6d6sa ]#] It lists them out without having to hover but it's not going to work for what I want to do.  I am actually trying to group matching rolls to different lines.  I was trying to make a script to do this but then I ran into the trouble above where sending out a chat message with !power wasn't working.
I don't know if this is a bug but you can't link to more than one image in PowerCards like you can in chat.&nbsp; For instance if you try this you will get the broken image link symbol. !power {{--tag|[x](<a href="https://one.png" rel="nofollow">https://one.png</a>) [x](<a href="https://two.png" rel="nofollow">https://two.png</a>) }}" But if you just type this into chat it works fine. [x](<a href="https://one.png" rel="nofollow">https://one.png</a>) [x](<a href="https://two.png" rel="nofollow">https://two.png</a>)
1535173388

Edited 1535205246
Theodore S. said: Everyone, it may not be pretty but I have created a PowerCard for Dragonborn Acid Breath that works with version 3.8.6 !power {{ --replacespell|@{selected|character_id}|Breath Weapon --api_setattr|_name @{selected|character_name} _modb _repeating_resource_$0_resource_right|-1 _silent --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|1st|token_id} | @{target|2nd|token_id} | @{target|3rd|token_id} | @{target|4th|token_id} | @{target|5th|token_id} | @{target|6th|token_id} --replaceattrs|S-|@{selected|character_id} --replaceattrs|T1-|@{target|1st|character_id} --replaceattrs|T2-|@{target|2nd|character_id} --replaceattrs|T3-|@{target|3rd|character_id} --replaceattrs|T4-|@{target|4th|character_id} --replaceattrs|T5-|@{target|5th|character_id} --replaceattrs|T6-|@{target|6th|character_id} --inlinereplace|CL|~S-L$ --emote|~S-CN$ ^^ uses ^^ Acid Breath --format|encounter --name|~SP-NAME$ --leftsub|Ranged Attack Spell --rightsub|~SP-RANGE$ --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Casting Time:|~SP-CASTINGTIME$ --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Duration:|~SP-DURATION$ --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Saving Throw:|~SP-SAVE$ @{selected|breath_dc} --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Breath*1:| [#[ [$save1] 1d20 + ~T1-MDEX$ ]#] --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Breath*2:| [#[ [$save2] 1d20 + ~T2-MDEX$ ]#] --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Breath*3:| [#[ [$save3] 1d20 + ~T3-MDEX$ ]#] --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Breath*4:| [#[ [$save4] 1d20 + ~T4-MDEX$ ]#] --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Breath*5:| [#[ [$save5] 1d20 + ~T5-MDEX$ ]#] --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Breath*6:| [#[ [$save6] 1d20 + ~T6-MDEX$ ]#] --?! @{selected|repeating_resource_$0_resource_right} -le 0 !? !Out|You must take a short rest or long rest before using this ability again --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and ~CL$ -le 5 !? Damage:| [#[ [$dmg1] 2d6 ]#] Acid --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and ~CL$ -ge 6 -and ~CL$ -le 10 !? Damage:| [#[ [$dmg2] 3d6 ]#] Acid --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and ~CL$ -ge 11 -and ~CL$ -le 15 !? Damage:| [#[ [$dmg3] 4d6 ]#] Acid --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and ~CL$ -ge 16 !? Damage:| [#[ [$dmg4] 5d6 ]#] Acid --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Description:|~SP-DESCRIPTION$ --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and ~CL$ -gt 5 !? Higher Level:|~SP-ATHIGHER$ --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Breath Weapon Uses Left:|[[ @{selected|repeating_resource_$0_resource_right} - 1]] --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save1 -lt @{selected|breath_dc} !? alterbar*1|_target|@{target|1st|token_id} _bar|3 _amount|-[^dmg1] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save1 -ge @{selected|breath_dc} !? alterbar*2|_target|@{target|1st|token_id} _bar|3 _amount|-[^dmg1.halfbase] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save2 -lt @{selected|breath_dc} -and "~T2-CID$" -ne "~T1-CID$" !? alterbar*3|_target|@{target|2nd|token_id} _bar|3 _amount|-[^dmg1] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save2 -ge @{selected|breath_dc} -and "~T2-CID$" -ne "~T1-CID$" !? alterbar*4|_target|@{target|2nd|token_id} _bar|3 _amount|-[^dmg1.halfbase] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save3 -lt @{selected|breath_dc} -and "~T3-CID$" -ne "~T1-CID$" -and "~T3-CID$" -ne "~T2-CID$" !? alterbar*5|_target|@{target|3rd|token_id} _bar|3 _amount|-[^dmg1] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save3 -ge @{selected|breath_dc} -and "~T3-CID$" -ne "~T1-CID$" -and "~T3-CID$" -ne "~T2-CID$" !? alterbar*6|_target|@{target|3rd|token_id} _bar|3 _amount|-[^dmg1.halfbase] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save4 -lt @{selected|breath_dc} -and "~T4-CID$" -ne "~T1-CID$" -and "~T4-CID$" -ne "~T2-CID$" -and "~T4-CID$" -ne "~T3-CID$" !? alterbar*7|_target|@{target|4th|token_id} _bar|3 _amount|-[^dmg1] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save4 -ge @{selected|breath_dc} -and "~T4-CID$" -ne "~T1-CID$" -and "~T4-CID$" -ne "~T2-CID$" -and "~T4-CID$" -ne "~T3-CID$" !? alterbar*8|_target|@{target|4th|token_id} _bar|3 _amount|-[^dmg1.halfbase] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save5 -lt @{selected|breath_dc} -and "~T5-CID$" -ne "~T1-CID$" -and "~T5-CID$" -ne "~T2-CID$" -and "~T5-CID$" -ne "~T3-CID$" -and "~T5-CID$" -ne "~T4-CID$" !? alterbar*9|_target|@{target|5th|token_id} _bar|3 _amount|-[^dmg1] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save5 -ge @{selected|breath_dc} -and "~T5-CID$" -ne "~T1-CID$" -and "~T5-CID$" -ne "~T2-CID$" -and "~T5-CID$" -ne "~T3-CID$" -and "~T5-CID$" -ne "~T4-CID$" !? alterbar*10|_target|@{target|5th|token_id} _bar|3 _amount|-[^dmg1.halfbase] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save6 -lt @{selected|breath_dc} -and "~T6-CID$" -ne "~T1-CID$" -and "~T6-CID$" -ne "~T2-CID$" -and "~T6-CID$" -ne "~T3-CID$" -and "~T6-CID$" -ne "~T4-CID$" -and "~T6-CID$" -ne "~T5-CID$" !? alterbar*11|_target|@{target|6th|token_id} _bar|3 _amount|-[^dmg1] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save6 -ge @{selected|breath_dc} -and "~T6-CID$" -ne "~T1-CID$" -and "~T6-CID$" -ne "~T2-CID$" -and "~T6-CID$" -ne "~T3-CID$" -and "~T6-CID$" -ne "~T4-CID$" -and "~T6-CID$" -ne "~T5-CID$" !? alterbar*12|_target|@{target|6th|token_id} _bar|3 _amount|-[^dmg1.halfbase] _show|all }} If you can come up with a way to make it less cumbersome, provide feedback. Alright. Further testing and if you select 2-5 creatures, it only hits one of them. I am confused why it isn't working. If you select 2 creatures, Target # 2 - 6 are Target 2. EDIT : Found out that ~T#-CID$ does not work as it isn't unique. You have to compare @{target|token_id}
Properly functioning Dragon Breath (Acid): !power {{ --replacespell|@{selected|character_id}|Breath Weapon --api_setattr|_name @{selected|character_name} _modb _repeating_resource_$0_resource_right|-1 _silent --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|1st|token_id} | @{target|2nd|token_id} | @{target|3rd|token_id} | @{target|4th|token_id} | @{target|5th|token_id} | @{target|6th|token_id} --replaceattrs|S-|@{selected|character_id} --replaceattrs|T1-|@{target|1st|character_id} --replaceattrs|T2-|@{target|2nd|character_id} --replaceattrs|T3-|@{target|3rd|character_id} --replaceattrs|T4-|@{target|4th|character_id} --replaceattrs|T5-|@{target|5th|character_id} --replaceattrs|T6-|@{target|6th|character_id} --inlinereplace|CL|~S-L$ --emote|~S-CN$ ^^ uses ^^ Acid Breath --format|encounter --name|~SP-NAME$ --leftsub|Ranged Attack Spell --rightsub|~SP-RANGE$ --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Casting Time:|~SP-CASTINGTIME$ --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Duration:|~SP-DURATION$ --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Saving Throw:|~SP-SAVE$ @{selected|breath_dc} --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Breath*1:| [#[ [$save1] 1d20 + ~T1-MDEX$ ]#] --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Breath*2:| [#[ [$save2] 1d20 + ~T2-MDEX$ ]#] --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Breath*3:| [#[ [$save3] 1d20 + ~T3-MDEX$ ]#] --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Breath*4:| [#[ [$save4] 1d20 + ~T4-MDEX$ ]#] --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Breath*5:| [#[ [$save5] 1d20 + ~T5-MDEX$ ]#] --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Breath*6:| [#[ [$save6] 1d20 + ~T6-MDEX$ ]#] --?! @{selected|repeating_resource_$0_resource_right} -le 0 !? !Out|You must take a short rest or long rest before using this ability again --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and ~CL$ -le 5 !? Damage:| [#[ [$dmg1] 2d6 ]#] Acid --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and ~CL$ -ge 6 -and ~CL$ -le 10 !? Damage:| [#[ [$dmg2] 3d6 ]#] Acid --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and ~CL$ -ge 11 -and ~CL$ -le 15 !? Damage:| [#[ [$dmg3] 4d6 ]#] Acid --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and ~CL$ -ge 16 !? Damage:| [#[ [$dmg4] 5d6 ]#] Acid --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Description:|~SP-DESCRIPTION$ --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and ~CL$ -gt 5 !? Higher Level:|~SP-ATHIGHER$ --?! @{selected|repeating_resource_$0_resource_right} -gt 0 !? Breath Weapon Uses Left:|[[ @{selected|repeating_resource_$0_resource_right} - 1]] --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save1 -lt @{selected|breath_dc} !? alterbar*1|_target|@{target|1st|token_id} _bar|3 _amount|-[^dmg1] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save1 -ge @{selected|breath_dc} !? alterbar*2|_target|@{target|1st|token_id} _bar|3 _amount|-[^dmg1.halfbase] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save2 -lt @{selected|breath_dc} -and "@{target|2nd|token_id}" -ne "@{target|1st|token_id}" !? alterbar*3|_target|@{target|2nd|token_id} _bar|3 _amount|-[^dmg1] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save2 -ge @{selected|breath_dc} -and "@{target|2nd|token_id}" -ne "@{target|1st|token_id}" !? alterbar*4|_target|@{target|2nd|token_id} _bar|3 _amount|-[^dmg1.halfbase] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save3 -lt @{selected|breath_dc} -and "@{target|3rd|token_id}" -ne "@{target|1st|token_id}" -and "@{target|3rd|token_id}" -ne "@{target|2nd|token_id}" !? alterbar*5|_target|@{target|3rd|token_id} _bar|3 _amount|-[^dmg1] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save3 -ge @{selected|breath_dc} -and "@{target|3rd|token_id}" -ne "@{target|1st|token_id}" -and "@{target|3rd|token_id}" -ne "@{target|2nd|token_id}" !? alterbar*6|_target|@{target|3rd|token_id} _bar|3 _amount|-[^dmg1.halfbase] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save4 -lt @{selected|breath_dc} -and "@{target|4th|token_id}" -ne "@{target|1st|token_id}" -and "@{target|4th|token_id}" -ne "@{target|2nd|token_id}" -and "@{target|4th|token_id}" -ne "@{target|3rd|token_id}" !? alterbar*7|_target|@{target|4th|token_id} _bar|3 _amount|-[^dmg1] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save4 -ge @{selected|breath_dc} -and "@{target|4th|token_id}" -ne "@{target|1st|token_id}" -and "@{target|4th|token_id}" -ne "@{target|2nd|token_id}" -and "@{target|4th|token_id}" -ne "@{target|3rd|token_id}" !? alterbar*8|_target|@{target|4th|token_id} _bar|3 _amount|-[^dmg1.halfbase] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save5 -lt @{selected|breath_dc} -and "@{target|5th|token_id}" -ne "@{target|1st|token_id}" -and "@{target|5th|token_id}" -ne "@{target|2nd|token_id}" -and "@{target|5th|token_id}" -ne "@{target|3rd|token_id}" -and "@{target|5th|token_id}" -ne "@{target|4th|token_id}" !? alterbar*9|_target|@{target|5th|token_id} _bar|3 _amount|-[^dmg1] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save5 -ge @{selected|breath_dc} -and "@{target|5th|token_id}" -ne "@{target|1st|token_id}" -and "@{target|5th|token_id}" -ne "@{target|2nd|token_id}" -and "@{target|5th|token_id}" -ne "@{target|3rd|token_id}" -and "@{target|5th|token_id}" -ne "@{target|4th|token_id}" !? alterbar*10|_target|@{target|5th|token_id} _bar|3 _amount|-[^dmg1.halfbase] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save6 -lt @{selected|breath_dc} -and "@{target|6th|token_id}" -ne "@{target|1st|token_id}" -and "@{target|6th|token_id}" -ne "@{target|2nd|token_id}" -and "@{target|6th|token_id}" -ne "@{target|3rd|token_id}" -and "@{target|6th|token_id}" -ne "@{target|4th|token_id}" -and "@{target|6th|token_id}" -ne "@{target|5th|token_id}" !? alterbar*11|_target|@{target|6th|token_id} _bar|3 _amount|-[^dmg1] _show|all --?! @{selected|repeating_resource_$0_resource_right} -gt 0 -and $save6 -ge @{selected|breath_dc} -and "@{target|6th|token_id}" -ne "@{target|1st|token_id}" -and "@{target|6th|token_id}" -ne "@{target|2nd|token_id}" -and "@{target|6th|token_id}" -ne "@{target|3rd|token_id}" -and "@{target|6th|token_id}" -ne "@{target|4th|token_id}" -and "@{target|6th|token_id}" -ne "@{target|5th|token_id}" !? alterbar*12|_target|@{target|6th|token_id} _bar|3 _amount|-[^dmg1.halfbase] _show|all }}
1535329888

Edited 1535329901
I came across this spellbook: !power {{ --tokenid|@{selected|token_id} --titlebackground|none --titlefontshadow|none --whisper|@{selected|character_name},GM --corners|10 --format|atwill --name|^^Spell Book --leftsub|@{selected|character_name} --rightsub|Level @{selected|level} @{selected|class}^^ ^^ --**Spell Save DC:**| [[ 8 + [[@{selected|pb}]]+ @{selected|wisdom_mod}]] ^^**Spell Attack Bonus:** [[ [[@{selected|pb}]]&nbsp; + @{selected|wisdom_mod} ]] --Prepared Spells:| [[@{selected|wisdom_mod} + @{Selected|Level} ]] ^^^^ ~C ** Available Spells ** ~C&nbsp; &nbsp; **Level 1 :** [[@{selected|lvl1_slots_total}]] **Remaining:** [[@{selected|lvl1_slots_expended}]]^^ **Level 2 :** [[@{selected|lvl2_slots_total}]] **Remaining:** [[@{selected|lvl2_slots_expended}]]^^ **Level 3 :** [[@{selected|lvl3_slots_total}]] **Remaining:** [[@{selected|lvl3_slots_expended}]]^^ --spell_list|@{selected|character_id} }} I was wondering if there was a way to tie an existing spell macro into this. For example, I have the following macro for Fireball: ?{Spell Level|3} !roll20AM --audio,play,nomenu|fireball !power {{ --name|Fireball --Damage|[[8d6]] + [[(?{Spell Level|0}-3)d6]] --Save|@{spell_save_dc} --School|Evocation --Casting Time| 1 action --Range| 150 feet --Components| V S M (A tiny ball of bat guano and sulfur) --Duration|Instantaneous --Description| A bright streak flashes from your pointing finger to a point you choose within range and then blossoms with a low roar into an explosion of flame. Each creature in a 20-foot-radius sphere centered on that point must make a Dexterity saving throw. A target takes 8d6 fire damage on a failed save, or half as much damage on a successful one. The fire spreads around corners. It ignites flammable objects in the area that aren’t being worn or carried. At Higher Levels: When you cast this spell using a spell slot of 4th level or higher, the damage increases by 1d6 for each slot level above 3rd. }}&nbsp;&nbsp;&nbsp;&nbsp; Is there some way I could call the spell macros I have using the spellbook? More than anything, I'd like to get sound to work when using the spellbook. Any help is appreciated. Thanks!
1535360783

Edited 1535360822
Kurt J.
Pro
API Scripter
Sam said: I came across this spellbook: !power {{ --tokenid|@{selected|token_id} --titlebackground|none --titlefontshadow|none --whisper|@{selected|character_name},GM --corners|10 --format|atwill --name|^^Spell Book --leftsub|@{selected|character_name} --rightsub|Level @{selected|level} @{selected|class}^^ ^^ --**Spell Save DC:**| [[ 8 + [[@{selected|pb}]]+ @{selected|wisdom_mod}]] ^^**Spell Attack Bonus:** [[ [[@{selected|pb}]]&nbsp; + @{selected|wisdom_mod} ]] --Prepared Spells:| [[@{selected|wisdom_mod} + @{Selected|Level} ]] ^^^^ ~C ** Available Spells ** ~C&nbsp; &nbsp; **Level 1 :** [[@{selected|lvl1_slots_total}]] **Remaining:** [[@{selected|lvl1_slots_expended}]]^^ **Level 2 :** [[@{selected|lvl2_slots_total}]] **Remaining:** [[@{selected|lvl2_slots_expended}]]^^ **Level 3 :** [[@{selected|lvl3_slots_total}]] **Remaining:** [[@{selected|lvl3_slots_expended}]]^^ --spell_list|@{selected|character_id} }} I was wondering if there was a way to tie an existing spell macro into this. For example, I have the following macro for Fireball: ?{Spell Level|3} !roll20AM --audio,play,nomenu|fireball !power {{ --name|Fireball --Damage|[[8d6]] + [[(?{Spell Level|0}-3)d6]] --Save|@{spell_save_dc} --School|Evocation --Casting Time| 1 action --Range| 150 feet --Components| V S M (A tiny ball of bat guano and sulfur) --Duration|Instantaneous --Description| A bright streak flashes from your pointing finger to a point you choose within range and then blossoms with a low roar into an explosion of flame. Each creature in a 20-foot-radius sphere centered on that point must make a Dexterity saving throw. A target takes 8d6 fire damage on a failed save, or half as much damage on a successful one. The fire spreads around corners. It ignites flammable objects in the area that aren’t being worn or carried. At Higher Levels: When you cast this spell using a spell slot of 4th level or higher, the damage increases by 1d6 for each slot level above 3rd. }}&nbsp;&nbsp;&nbsp;&nbsp; Is there some way I could call the spell macros I have using the spellbook? More than anything, I'd like to get sound to work when using the spellbook. Any help is appreciated. Thanks! Yes, you can. Check the wiki for the --spell_list tag ( <a href="https://wiki.roll20.net/Script:PowerCards#Character_Sheet_Information_Tags" rel="nofollow">https://wiki.roll20.net/Script:PowerCards#Character_Sheet_Information_Tags</a> ) for the syntax, but essentially you define an attribute on the character that specifies what macro the spell_list should use instead of the default spell call.
Great. Thanks Kurt!
Is there a way to create an action macro in a character sheet and have it linked to action_$0_macro, spell_name_macro, etc?
I wrote up a macro using Powercards for NPC attack.&nbsp; It works great, except for one issue.&nbsp; I wrote this to include the damage from a secondary source like the black pudding's pseudopod attack which is bludgeoning and acid.&nbsp; However, the macro will not work if there is only one source of damage in the attack.&nbsp; What I want is for it to not try to process a second damage type if there isn't one. Here is the macro: !power {{&nbsp; --format|bigbad --name|@{selected|repeating_npcaction_$0_name} Attack --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|token_name}^^attacks^^@{target|token_name} --leftsub|@{selected|repeating_npcaction_$0_attack_type} --rightsub|@{selected|repeating_npcaction_$0_attack_range} --Attack *1|[[ [$Atk] ?{Attack|Standard, 1d20|w/Advantage, 2d20KH1|w/Disadvantage, 2d20KL1} + @{selected|repeating_npcaction_$0_attack_tohit} ]] vs **AC** [[@{target|BAR2}]] --?? $Atk.base == 1 OR $Atk.total &lt; @{target|BAR2} ?? !Miss|The attack missed. --?? $Atk.total &gt;= @{target|BAR2} AND $Atk.base &lt;&gt; 1 AND $Atk.base &lt;&gt; 20 ?? Hit|@{target|token_name} takes [[ @{selected|repeating_npcaction_$0_attack_damage} ]] @{selected|repeating_npcaction_$0_attack_damagetype} damage and [[ @{selected|repeating_npcaction_$0_attack_damage2} ]] @{selected|repeating_npcaction_$0_attack_damagetype2} damage --?? $Atk.base == 20 ?? Critical Hit:|@{target|token_name} takes [[ @{selected|repeating_npcaction_$0_attack_damage} + @{selected|repeating_npcaction_$0_attack_crit} ]] @{selected|repeating_npcaction_$0_attack_damagetype} damage and [[ @{selected|repeating_npcaction_$0_attack_damage2} + @{selected|repeating_npcaction_$0_attack_crit2}+0 ]] @{selected|repeating_npcaction_$0_attack_damagetype2} damage --!Desc|@{selected|repeating_npcaction_$0_description} }}
1535999552

Edited 1535999745
Dan L. said: I wrote up a macro using Powercards for NPC attack.&nbsp; It works great, except for one issue.&nbsp; I wrote this to include the damage from a secondary source like the black pudding's pseudopod attack which is bludgeoning and acid.&nbsp; However, the macro will not work if there is only one source of damage in the attack.&nbsp; What I want is for it to not try to process a second damage type if there isn't one. Here is the macro: !power {{&nbsp; --format|bigbad --name|@{selected|repeating_npcaction_$0_name} Attack --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|token_name}^^attacks^^@{target|token_name} --leftsub|@{selected|repeating_npcaction_$0_attack_type} --rightsub|@{selected|repeating_npcaction_$0_attack_range} --Attack *1|[[ [$Atk] ?{Attack|Standard, 1d20|w/Advantage, 2d20KH1|w/Disadvantage, 2d20KL1} + @{selected|repeating_npcaction_$0_attack_tohit} ]] vs **AC** [[@{target|BAR2}]] --?? $Atk.base == 1 OR $Atk.total &lt; @{target|BAR2} ?? !Miss|The attack missed. --?? $Atk.total &gt;= @{target|BAR2} AND $Atk.base &lt;&gt; 1 AND $Atk.base &lt;&gt; 20 ?? Hit|@{target|token_name} takes [[ @{selected|repeating_npcaction_$0_attack_damage} ]] @{selected|repeating_npcaction_$0_attack_damagetype} damage and [[ @{selected|repeating_npcaction_$0_attack_damage2} ]] @{selected|repeating_npcaction_$0_attack_damagetype2} damage --?? $Atk.base == 20 ?? Critical Hit:|@{target|token_name} takes [[ @{selected|repeating_npcaction_$0_attack_damage} + @{selected|repeating_npcaction_$0_attack_crit} ]] @{selected|repeating_npcaction_$0_attack_damagetype} damage and [[ @{selected|repeating_npcaction_$0_attack_damage2} + @{selected|repeating_npcaction_$0_attack_crit2}+0 ]] @{selected|repeating_npcaction_$0_attack_damagetype2} damage --!Desc|@{selected|repeating_npcaction_$0_description} }} Try this: !power {{ --hroll|[[ [$number] ?{Damage Types?|1|2} ]] --format|bigbad --name|@{selected|repeating_npcaction_$0_name} Attack --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|token_name}^^attacks^^@{target|token_name} --leftsub|@{selected|repeating_npcaction_$0_attack_type} --rightsub|@{selected|repeating_npcaction_$0_attack_range} --Attack *1|[[ [$Atk] ?{Attack|Standard, 1d20|w/Advantage, 2d20KH1|w/Disadvantage, 2d20KL1} + @{selected|repeating_npcaction_$0_attack_tohit} ]] vs **AC** [[@{target|BAR2}]] --?? $Atk.base == 1 OR $Atk.total &lt; @{target|BAR2} ?? !Miss|The attack missed. --?? $number == 1 AND $Atk.total &gt;= @{target|BAR2} AND $Atk.base &lt;&gt; 1 AND $Atk.base &lt;&gt; 20 ?? Hit|@{target|token_name} takes [[ @{selected|repeating_npcaction_$0_attack_damage} ]] @{selected|repeating_npcaction_$0_attack_damagetype} damage --?? $number == 2 AND $Atk.total &gt;= @{target|BAR2} AND $Atk.base &lt;&gt; 1 AND $Atk.base &lt;&gt; 20 ?? Hit|@{target|token_name} takes [[ @{selected|repeating_npcaction_$0_attack_damage} ]] @{selected|repeating_npcaction_$0_attack_damagetype} damage and [[ @{selected|repeating_npcaction_$0_attack_damage2} ]] @{selected|repeating_npcaction_$0_attack_damagetype2} damage --?? $number == 1 AND $Atk.base == 20 ?? Critical Hit:|@{target|token_name} takes [[ @{selected|repeating_npcaction_$0_attack_damage} + @{selected|repeating_npcaction_$0_attack_crit} ]] @{selected|repeating_npcaction_$0_attack_damagetype} damage --?? $number == 2 AND $Atk.base == 20 ?? Critical Hit:|@{target|token_name} takes [[ @{selected|repeating_npcaction_$0_attack_damage} + @{selected|repeating_npcaction_$0_attack_crit} ]] @{selected|repeating_npcaction_$0_attack_damagetype} damage and [[ @{selected|repeating_npcaction_$0_attack_damage2} + @{selected|repeating_npcaction_$0_attack_crit2}+0 ]] @{selected|repeating_npcaction_$0_attack_damagetype2} damage --!Desc|@{selected|repeating_npcaction_$0_description} }}
Thanks for the reply, Theodore, but that does not work.&nbsp; Plus I was hoping that it would determine both types if there are two or one type if there is one automatically.
1536055462
Kurt J.
Pro
API Scripter
Dan L. said: Thanks for the reply, Theodore, but that does not work.&nbsp; Plus I was hoping that it would determine both types if there are two or one type if there is one automatically. It is possible to do this with templates and optional inclusion. I'll post my own NPC attack macro this evening.
Kurt J. said: Dan L. said: Thanks for the reply, Theodore, but that does not work.&nbsp; Plus I was hoping that it would determine both types if there are two or one type if there is one automatically. It is possible to do this with templates and optional inclusion. I'll post my own NPC attack macro this evening. Thank you, Kurt.
1536101880

Edited 1536102224
Kurt J.
Pro
API Scripter
Here is the template I use (note that templates have to be on a single line, which is why this is so long): MonsterAttack: --["~NPCA-TYPE$" -eq "ATTACK"]Attack:|[#[ [$Atk] ~0! + ~NPCA-TOHIT$ [Attack Bonus] ]#] vs **AC** [#[~T-AC$]#] --["~NPCA-TYPE$" -eq "ATTACK"]?? $Atk &lt; ~T-AC$ ?? !Missed|**The ~NPCA-NAME$ attack missed!** --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -eq ""]?? $Atk &gt;= ~T-AC$ AND $Atk.base &lt;&gt; 20 ?? Hit:|[#[ [$Dmg] ~NPCA-DAMAGE$ ]#] ~NPCA-DAMAGETYPE$ damage --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -ne ""]?? $Atk &gt;= ~T-AC$ AND $Atk.base &lt;&gt; 20 ?? Hit:|[#[ [$Dmg] ~NPCA-DAMAGE$ ]#] ~NPCA-DAMAGETYPE$ damage and [#[ [$Dmg2] ~NPCA-DAMAGE2$ ]#] ~NPCA-DAMAGETYPE2$ damage --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -eq ""]?? $Atk.base == 20 ?? Hit:|[#[ [$Dmg] ~NPCA-CRIT$ ]#] ~NPCA-DAMAGETYPE$ damage --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -ne ""]?? $Atk.base == 20 ?? Hit:|[#[ [$Dmg] ~NPCA-CRIT$ ]#] ~NPCA-DAMAGETYPE$ damage and [#[ [$Dmg2] ~NPCA-CRIT2$ ]#] ~NPCA-DAMAGETYPE2$ damage --["~NPCA-TYPE$" -eq "ATTACK"]?? $Atk.base == 1 ?? Fumble|The attack goes horribly wrong! --["~NPCA-DESCRIPTION$" -ne "" ]Description|~NPCA-DESCRIPTION$ And here is the macro I use to call it: !power {{ --replacenpcaction|@{selected|character_id}|Bite --replacement|RollVars;Advantage --replaceattrs|S-|@{selected|character_id} --replaceattrs|T-|@{target|character_id} --template|NPCBasics|@{selected|token_id};@{target|token_id};uses ~NPCA-NAME$;~NPCA-NAME$;~NPCA-ATYPE$;~NPCA-RANGE$ --template|MonsterAttack|~@{selected|rtype}$ }} I actually designate an attribute on the monster with "action_$0_macro" pointing to this macro. "Bite" is the name of the attack on the NPC character sheet, and the template reads the parameters from there.If it has more than one damage type, it should act appropriately. Many types of monsters have similarly named attacks (Bite, Longsword, etc) so I have macros for the most common types and then just reference them. I then use a macro that displays the NPC summary card: !power {{ &nbsp; --name|@{selected|character_name} &nbsp; --whisper|self,GM &nbsp; --format|charinfo &nbsp; --emote| &nbsp; --tokenid|@{selected|token_id} &nbsp; --npc_attribute_summary|@{selected|character_id} &nbsp; --npc_qualities_summary|@{selected|character_id} &nbsp; --npc_skills_summary|@{selected|character_id} &nbsp; --ogl_pc_attack_list|@{selected|character_id} &nbsp; --npc_action_list|@{selected|character_id} &nbsp; --npc_reaction_list|@{selected|character_id} &nbsp; --npc_legendaryaction_list|@{selected|character_id} &nbsp; --npc_trait_list|@{selected|character_id} }} That way I can just pick the attack buttons off of the list. I actually have similar templates and macros for my player characters that do the same thing for PC attacks and spells. In the case of player spells, I have an attribute that defines the spells a character knows of each level (so for my cleric, I have an attribute that has a value of "Sacred Flame|Guidance|Spare the Dying|Thaumaturgy". I then have a generic "Cast Cantrip" macro that uses a roll query with a nested attribute lookup (something like --replacespell|@{selected|character_id}|?{Cantrip to cast?@{selected|cantrip_list}} ) which prompts the player for a target and what cantrip to use. The rest of the macro uses a template to figure out the effect and display an appropriate card. Hmm... Might be time for another video :)
Thanks, Kurt.&nbsp; Where do you add the template?
How do you change the height or padding of the title bar?&nbsp; When I increase the titlefontsize it spills over.
Is there a way to limit the number of targets a person has to select? Example: If a person casts Bless at level 1, they choose 3 creatures, level 2, they choose 4, etc. Currently, I am having to create 12 targets and force my players to select 12 targets even if they only need 3. Is there a better way to have targeting done for spells like that?
Theodore S. said: Is there a way to limit the number of targets a person has to select? Example: If a person casts Bless at level 1, they choose 3 creatures, level 2, they choose 4, etc. Currently, I am having to create 12 targets and force my players to select 12 targets even if they only need 3. Is there a better way to have targeting done for spells like that? Setup a conditional, they pick the cast level and the conditional would create the target list. --?? $SL = 1 ?? --target_list|@{target|1st|token_id} | @{target|2nd|token_id} | @{target|3rd|token_id} --?? $SL = 2 ?? --target_list|@{target|1st|token_id} | @{target|2nd|token_id} | @{target|3rd|token_id} |@{target|4th|token_id} Something like that maybe?
Kurt J. said: Sam said: I came across this spellbook: !power {{ --tokenid|@{selected|token_id} --titlebackground|none --titlefontshadow|none --whisper|@{selected|character_name},GM --corners|10 --format|atwill --name|^^Spell Book --leftsub|@{selected|character_name} --rightsub|Level @{selected|level} @{selected|class}^^ ^^ --**Spell Save DC:**| [[ 8 + [[@{selected|pb}]]+ @{selected|wisdom_mod}]] ^^**Spell Attack Bonus:** [[ [[@{selected|pb}]]&nbsp; + @{selected|wisdom_mod} ]] --Prepared Spells:| [[@{selected|wisdom_mod} + @{Selected|Level} ]] ^^^^ ~C ** Available Spells ** ~C&nbsp; &nbsp; **Level 1 :** [[@{selected|lvl1_slots_total}]] **Remaining:** [[@{selected|lvl1_slots_expended}]]^^ **Level 2 :** [[@{selected|lvl2_slots_total}]] **Remaining:** [[@{selected|lvl2_slots_expended}]]^^ **Level 3 :** [[@{selected|lvl3_slots_total}]] **Remaining:** [[@{selected|lvl3_slots_expended}]]^^ --spell_list|@{selected|character_id} }} I was wondering if there was a way to tie an existing spell macro into this. For example, I have the following macro for Fireball: ?{Spell Level|3} !roll20AM --audio,play,nomenu|fireball !power {{ --name|Fireball --Damage|[[8d6]] + [[(?{Spell Level|0}-3)d6]] --Save|@{spell_save_dc} --School|Evocation --Casting Time| 1 action --Range| 150 feet --Components| V S M (A tiny ball of bat guano and sulfur) --Duration|Instantaneous --Description| A bright streak flashes from your pointing finger to a point you choose within range and then blossoms with a low roar into an explosion of flame. Each creature in a 20-foot-radius sphere centered on that point must make a Dexterity saving throw. A target takes 8d6 fire damage on a failed save, or half as much damage on a successful one. The fire spreads around corners. It ignites flammable objects in the area that aren’t being worn or carried. At Higher Levels: When you cast this spell using a spell slot of 4th level or higher, the damage increases by 1d6 for each slot level above 3rd. }}&nbsp;&nbsp;&nbsp;&nbsp; Is there some way I could call the spell macros I have using the spellbook? More than anything, I'd like to get sound to work when using the spellbook. Any help is appreciated. Thanks! Yes, you can. Check the wiki for the --spell_list tag ( <a href="https://wiki.roll20.net/Script:PowerCards#Character_Sheet_Information_Tags" rel="nofollow">https://wiki.roll20.net/Script:PowerCards#Character_Sheet_Information_Tags</a> ) for the syntax, but essentially you define an attribute on the character that specifies what macro the spell_list should use instead of the default spell call. Could you explain this a little more. So i use the macro to call the spell book and cast the spell fireball. How do you make it call a powercard called fireball instead of the default spell template?
Kurt J. said: Hmm... Might be time for another video :) Yes please! :D
1536359888

Edited 1536359969
Craven said: Theodore S. said: Is there a way to limit the number of targets a person has to select? Example: If a person casts Bless at level 1, they choose 3 creatures, level 2, they choose 4, etc. Currently, I am having to create 12 targets and force my players to select 12 targets even if they only need 3. Is there a better way to have targeting done for spells like that? Setup a conditional, they pick the cast level and the conditional would create the target list. --?? $SL = 1 ?? --target_list|@{target|1st|token_id} | @{target|2nd|token_id} | @{target|3rd|token_id} --?? $SL = 2 ?? --target_list|@{target|1st|token_id} | @{target|2nd|token_id} | @{target|3rd|token_id} |@{target|4th|token_id} Something like that maybe? I was thinking about that and will have to test it thoroughly.&nbsp; At that point,&nbsp; I will come back with my results.&nbsp; Otherwise,&nbsp; maybe Kurt can come up with a solution.&nbsp;
1536404829

Edited 1536404911
Craven said: Kurt J. said: Sam said: I came across this spellbook: !power {{ --tokenid|@{selected|token_id} --titlebackground|none --titlefontshadow|none --whisper|@{selected|character_name},GM --corners|10 --format|atwill --name|^^Spell Book --leftsub|@{selected|character_name} --rightsub|Level @{selected|level} @{selected|class}^^ ^^ --**Spell Save DC:**| [[ 8 + [[@{selected|pb}]]+ @{selected|wisdom_mod}]] ^^**Spell Attack Bonus:** [[ [[@{selected|pb}]]&nbsp; + @{selected|wisdom_mod} ]] --Prepared Spells:| [[@{selected|wisdom_mod} + @{Selected|Level} ]] ^^^^ ~C ** Available Spells ** ~C&nbsp; &nbsp; **Level 1 :** [[@{selected|lvl1_slots_total}]] **Remaining:** [[@{selected|lvl1_slots_expended}]]^^ **Level 2 :** [[@{selected|lvl2_slots_total}]] **Remaining:** [[@{selected|lvl2_slots_expended}]]^^ **Level 3 :** [[@{selected|lvl3_slots_total}]] **Remaining:** [[@{selected|lvl3_slots_expended}]]^^ --spell_list|@{selected|character_id} }} I was wondering if there was a way to tie an existing spell macro into this. For example, I have the following macro for Fireball: ?{Spell Level|3} !roll20AM --audio,play,nomenu|fireball !power {{ --name|Fireball --Damage|[[8d6]] + [[(?{Spell Level|0}-3)d6]] --Save|@{spell_save_dc} --School|Evocation --Casting Time| 1 action --Range| 150 feet --Components| V S M (A tiny ball of bat guano and sulfur) --Duration|Instantaneous --Description| A bright streak flashes from your pointing finger to a point you choose within range and then blossoms with a low roar into an explosion of flame. Each creature in a 20-foot-radius sphere centered on that point must make a Dexterity saving throw. A target takes 8d6 fire damage on a failed save, or half as much damage on a successful one. The fire spreads around corners. It ignites flammable objects in the area that aren’t being worn or carried. At Higher Levels: When you cast this spell using a spell slot of 4th level or higher, the damage increases by 1d6 for each slot level above 3rd. }}&nbsp;&nbsp;&nbsp;&nbsp; Is there some way I could call the spell macros I have using the spellbook? More than anything, I'd like to get sound to work when using the spellbook. Any help is appreciated. Thanks! Yes, you can. Check the wiki for the --spell_list tag ( <a href="https://wiki.roll20.net/Script:PowerCards#Character_Sheet_Information_Tags" rel="nofollow">https://wiki.roll20.net/Script:PowerCards#Character_Sheet_Information_Tags</a> ) for the syntax, but essentially you define an attribute on the character that specifies what macro the spell_list should use instead of the default spell call. Could you explain this a little more. So i use the macro to call the spell book and cast the spell fireball. How do you make it call a powercard called fireball instead of the default spell template? In the attributes section of your character sheet,&nbsp; create an attribute called spell_Fireball_macro and in the value field #Fireball. I have been doing this for my players and it works quite well.&nbsp;
So, I have another question... The following code works fine, but I was hoping to use the roll20AM features inside the macro. !power {{&nbsp; --emote|The soldier carefully aims his pistols, both leveled at your chest, and pulls their triggers, releasing two huge gouts of billowing smoke behind a pair of tiny balls flying faster than your eye could hope to track! --name|Flintlock Pistol --leftsub|action --rightsub|range 15/60 ft. --Attacks|[[ [$Atk1] 1d20 + 5] ]] / [[ [$Atk2] 1d20 + 5] ]] vs @{target|Target1|token_name}'s @{target|Target1|bar2} AC --?? $Atk1.base &gt; 2 AND $Atk1.total &lt; @{target|Target1|bar2} ?? First Miss|Your shot goes wide, missing altogether. --?? $Atk1.total &gt;= @{target|Target1|bar2} AND $Atk1.base &gt; 2 AND $Atk1.base &lt;&gt; 20 ?? First Damage|[[1d8 + 3]] piercing damage --?? $Atk1.base == 20 ?? First Critical Hit|[[2d8 + 3]] piercing damage --?? $Atk2.base &gt; 2 AND $Atk2.total &lt; @{target|Target1|bar2} ?? Second Miss|Your shot goes wide, missing altogether. --?? $Atk2.total &gt;= @{target|Target1|bar2} AND $Atk2.base &gt; 2 AND $Atk2.base &lt;&gt; 20 ?? Second Damage|[[1d8 + 3]] piercing damage --?? $Atk2.base == 20 ?? Second Critical Hit|[[2d8 + 3]] piercing damage --?? $Atk1.base &lt; 3 OR $Atk2.base &lt; 3 ?? Misfire|You may spend an action to clear the misfire (no check required), but if you do not, a second misfire will cause an explosion and break the weapon. This explosion deals the weapon’s listed [[ 1d8 ]] / [[ 1d8 ]] piercing damage to you and any creatures or objects within five feet. }} !roll20AM --audio,play,nomenu|small_pistol_1 !roll20AM --audio,play,nomenu|small_pistol_2 However, when I drop this: --soundfx|_play|small_pistol_1 --soundfx|_play|small_pistol_2 ... above the final brackets, it outputs no audio whatsoever, and gives me a bonus error of: gm: &nbsp;Invalid Roll20AM Command. Valid commands are --audio, --edit, --config I'm assuming the syntax within Roll20AM has changed since the caller was written for PowerCards, but that's outside my realm. Any recommendations?
Patrick said: So, I have another question... The following code works fine, but I was hoping to use the roll20AM features inside the macro. !power {{&nbsp; --emote|The soldier carefully aims his pistols, both leveled at your chest, and pulls their triggers, releasing two huge gouts of billowing smoke behind a pair of tiny balls flying faster than your eye could hope to track! --name|Flintlock Pistol --leftsub|action --rightsub|range 15/60 ft. --Attacks|[[ [$Atk1] 1d20 + 5] ]] / [[ [$Atk2] 1d20 + 5] ]] vs @{target|Target1|token_name}'s @{target|Target1|bar2} AC --?? $Atk1.base &gt; 2 AND $Atk1.total &lt; @{target|Target1|bar2} ?? First Miss|Your shot goes wide, missing altogether. --?? $Atk1.total &gt;= @{target|Target1|bar2} AND $Atk1.base &gt; 2 AND $Atk1.base &lt;&gt; 20 ?? First Damage|[[1d8 + 3]] piercing damage --?? $Atk1.base == 20 ?? First Critical Hit|[[2d8 + 3]] piercing damage --?? $Atk2.base &gt; 2 AND $Atk2.total &lt; @{target|Target1|bar2} ?? Second Miss|Your shot goes wide, missing altogether. --?? $Atk2.total &gt;= @{target|Target1|bar2} AND $Atk2.base &gt; 2 AND $Atk2.base &lt;&gt; 20 ?? Second Damage|[[1d8 + 3]] piercing damage --?? $Atk2.base == 20 ?? Second Critical Hit|[[2d8 + 3]] piercing damage --?? $Atk1.base &lt; 3 OR $Atk2.base &lt; 3 ?? Misfire|You may spend an action to clear the misfire (no check required), but if you do not, a second misfire will cause an explosion and break the weapon. This explosion deals the weapon’s listed [[ 1d8 ]] / [[ 1d8 ]] piercing damage to you and any creatures or objects within five feet. }} !roll20AM --audio,play,nomenu|small_pistol_1 !roll20AM --audio,play,nomenu|small_pistol_2 However, when I drop this: --soundfx|_play|small_pistol_1 --soundfx|_play|small_pistol_2 ... above the final brackets, it outputs no audio whatsoever, and gives me a bonus error of: gm: &nbsp;Invalid Roll20AM Command. Valid commands are --audio, --edit, --config I'm assuming the syntax within Roll20AM has changed since the caller was written for PowerCards, but that's outside my realm. Any recommendations? Try changing _play to _audio
Ok, I no longer get the error after the fact, but it still does not play the audio with the code as follows: !power {{&nbsp; --emote|The soldier carefully aims his pistols, both leveled at your chest, and pulls their triggers, releasing two huge gouts of billowing smoke behind a pair of tiny balls flying faster than your eye could hope to track! --name|Flintlock Pistol --leftsub|action --rightsub|range 15/60 ft. --Attacks|[[ [$Atk1] 1d20 + 5] ]] / [[ [$Atk2] 1d20 + 5] ]] vs @{target|Target1|token_name}'s @{target|Target1|bar2} AC --?? $Atk1.base &gt; 2 AND $Atk1.total &lt; @{target|Target1|bar2} ?? First Miss|Your shot goes wide, missing altogether. --?? $Atk1.total &gt;= @{target|Target1|bar2} AND $Atk1.base &gt; 2 AND $Atk1.base &lt;&gt; 20 ?? First Damage|[[1d8 + 3]] piercing damage --?? $Atk1.base == 20 ?? First Critical Hit|[[2d8 + 3]] piercing damage --?? $Atk2.base &gt; 2 AND $Atk2.total &lt; @{target|Target1|bar2} ?? Second Miss|Your shot goes wide, missing altogether. --?? $Atk2.total &gt;= @{target|Target1|bar2} AND $Atk2.base &gt; 2 AND $Atk2.base &lt;&gt; 20 ?? Second Damage|[[1d8 + 3]] piercing damage --?? $Atk2.base == 20 ?? Second Critical Hit|[[2d8 + 3]] piercing damage --?? $Atk1.base &lt; 3 OR $Atk2.base &lt; 3 ?? Misfire|You may spend an action to clear the misfire (no check required), but if you do not, a second misfire will cause an explosion and break the weapon. This explosion deals the weapon’s listed [[ 1d8 ]] / [[ 1d8 ]] piercing damage to you and any creatures or objects within five feet. --soundfx|_audio|play|small_pistol_1 --soundfx|_audio|play|small_pistol_2 }}
Also, somewhat related, this does not work either: !power {{&nbsp; --name|VFX Test --vfx_opt|@{selected|token_id} @{target|token_id} breath-fire }} No error output - it just outputs the name field and does nothing else.
1536422254

Edited 1536422576
Kurt J.
Pro
API Scripter
Going to try to answer a bunch of things in one post: From Dan L. : Where do you add the template? You need to create a handout called "PowerCard Templates" (there are some variants allowed, check the wiki for details) and place it there. It works just like for formats handout. From Michael D. :&nbsp; How do you change the height or padding of the title bar?&nbsp; When I increase the titlefontsize it spills over. I would need a specific example, as I'm not sure what you mean. Given that it is an HTML construct, it should expand automatically to encompass any content. From Theodore S. : Is there a way to limit the number of targets a person has to select? Unfortunately, no. None of the suggested workarounds will function because target selection is handled by the chat server before anything in the macro gets processed. By the time PowerCards starts running, any @{selected} and @{target} (and any ?{Roll Queries} too) have already been determined. From Ravenknight : Yes please! :D I'm working on a new video explaining how I use templates for my own game. It will cover PC abilities, monster/NPC attacks, and spells. From Craven : Could you explain this a little more. So i use the macro to call the spell book and cast the spell fireball. How do you make it call a powercard called fireball instead of the default spell template? Theodore is correct. If you create attributes on any character sheet (PC or NPC) in a specific format, the various summary/list tags will use the content of the attribute as the action to perform instead of the sheet default for that action when it creates buttons. This is true for the spell lists, for NPC actions, NPC legendary actions, and for PC attacks. Check this section of the wiki : <a href="https://wiki.roll20.net/Script:PowerCards#Character_Sheet_Information_Tags" rel="nofollow">https://wiki.roll20.net/Script:PowerCards#Character_Sheet_Information_Tags</a> for details. I just noticed that this isn't implemented for NPC reactions, so I'll likely go ahead and add that in the near future. From Patrick : The following code works fine, but I was hoping to use the roll20AM features inside the macro. When calling roll20AM, use the same syntax you would use from outside powercards, excepting that you replace -- with _. In this case: !roll20AM --audio,play,nomenu|small_pistol_1 becomes --soundfx|_audio,play,nomenu|small_pistol_1 but you also remember that tag names need to be unique. If you have more than one --soundfx, you need to add "same name" modifiers, so --soundfx*1, --soundfx*2, etc. Also, I updated the wiki... it was showing the old syntax for Roll20AM before they drastically changed how that script works :) From Patrick : (--vfx_opt not working) Make sure your player ribbon is on the page you are testing on... I forget that all the time. The vfx plays on the page the players can see.Same note as above, too... tags have to be unique so if you have multiple --vfx_opt tags, use *1, *2, etc after them.
Hi, Kurt, just a heads-up, several pages back in this thread a comment reported an issue with legendary actions throwing up error messages. You correctly attributed it to a rogue "$" attached to repeating_npcaction_l_ , but its still present in the current one-click build on line 470 (as of 3.8.5). Once removed it goes back to working as it should. Thanks for creating one of the most helpful tools on roll20!
Thanks Kurt - both alterations have done the trick. I was running off what the Wiki was saying, so I'm sure your changes to that will help more than just myself.&nbsp;
1536496599
Kurt J.
Pro
API Scripter
Greenglade said: Hi, Kurt, just a heads-up, several pages back in this thread a comment reported an issue with legendary actions throwing up error messages. You correctly attributed it to a rogue "$" attached to repeating_npcaction_l_ , but its still present in the current one-click build on line 470 (as of 3.8.5). Once removed it goes back to working as it should. Thanks for creating one of the most helpful tools on roll20! Thank you. Looks like I never actually made the change in my own version of the code :) It will be fixed in the next OneClick version.
1536524137
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
Hey everyone, I need help on this. I want to replace the Roll query ?{Rounds Hit|0} with an auto-calculated attribute. --Damage#?{Rounds Hit|1}|
Scott S. said: Hey everyone, I need help on this. I want to replace the Roll query ?{Rounds Hit|0} with an auto-calculated attribute. --Damage#?{Rounds Hit|1}| What attribute are you looking for? and what calculation?
1536530662
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
&lt;input type="text" name="attr_rounds-hit" value="[[ (floor(?{Margin|0} / @{recoil})) ]]" /&gt; So the rounds-hit is derived from the the margin dived by the recoil rounded down to the nearest whole number.
Scott S. said: &lt;input type="text" name="attr_rounds-hit" value="[[ (floor(?{Margin|0} / @{recoil})) ]]" /&gt; So the rounds-hit is derived from the the margin dived by the recoil rounded down to the nearest whole number. --Damage#?{Rounds Hit:|1}:| [#[ [$dmg] floor(?{Margin|0} / @{recoil}) ]#]
1536541255

Edited 1536542412
GM Matt
Sheet Author
Shot in the dark, here, but there is no way to incorporate a RollID into a subsequent inline roll, is there? Ex: --hroll|[[ [$MyRoll] 1d6 + 3 ]] --Complex Outcome:| [[ [$ComplexOutcome] 1d6 + [^MyRoll] ]] (I know this doesn't work cause I've tried it, but maybe something like it?) Edit: Never mind, I now see in the Wiki that this isn't possible...
1536547402

Edited 1536547436
Kurt J. said: From Michael D. :&nbsp; How do you change the height or padding of the title bar?&nbsp; When I increase the titlefontsize it spills over. I would need a specific example, as I'm not sure what you mean. Given that it is an HTML construct, it should expand automatically to encompass any content. This is from a fresh game with no other scripts.&nbsp; First was 25pt then 35pt.
1536587425
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
Theodore S. said: Scott S. said: &lt;input type="text" name="attr_rounds-hit" value="[[ (floor(?{Margin|0} / @{recoil})) ]]" /&gt; So the rounds-hit is derived from the the margin dived by the recoil rounded down to the nearest whole number. --Damage#?{Rounds Hit:|1}:| [#[ [$dmg] floor(?{Margin|0} / @{recoil}) ]#] Theo, I see what you did there but what I need is the number of rounds determined by floor(Margin / recoil)
1537887953

Edited 1537888164
Ravenknight
KS Backer
Hi guys. I'm having a problem. I've created a haggle-macro for players that want to sell stuff in town. The prices are kept in a drop down menu on the merchant token bar2|max ?{ Selling armor |Breastplate, [[75 [Breastplate] ]] |Chain Shirt, [[ 25 [Chain Shirt] ]] } I can access the price using @{selected|bar2|max} outside of Powercards just fine but when used within Powercards I get the following message: Any ideas?
Try adding a $ before each of the named variables like below. Also, an afterthought... not sure that you can have one that is separated by a space. Might need to try [$Chain_Shirt] instead. ?{ Selling armor |Breastplate, [[75 [$Breastplate] ]] |Chain Shirt, [[ 25 [$Chain Shirt] ]] } Ravenknight said: Hi guys. I'm having a problem. I've created a haggle-macro for players that want to sell stuff in town. The prices are kept in a drop down menu on the merchant token bar2|max ?{ Selling armor |Breastplate, [[75 [Breastplate] ]] |Chain Shirt, [[ 25 [Chain Shirt] ]] } I can access the price using @{selected|bar2|max} outside of Powercards just fine but when used within Powercards I get the following message: Any ideas?