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

[Script] Power Cards

1410801783
The Aaron
Roll20 Production Team
API Scripter
;)
Ah doh... that was changed when I was using jshint.com to look for errors.
1410814440
The Aaron
Roll20 Production Team
API Scripter
Yeah, it's a sneaky one. I use JSLint from node.js locally to check my scripts. I edit all my scripts locally and can then kick off JSLint on the file just like I would compile, and get the results back into my editor as errors. JSLint is written by the author of my favorite JS book, which I'm sure you've seen me espouse before - Javascript: The Good Parts by Douglas Crockford.
1411184890
Gen Kitty
Forum Champion
Bug Report [[ [HR18]1d20r18 ]] highlights on a roll of 18+, but does not do the reroll.
That's weird... all rolls should be completed before they even hit the script.
GenKitty said: Bug Report [[ [HR18]1d20r18 ]] highlights on a roll of 18+, but does not do the reroll. Ah... r18 only re-rolls actual 18's. You need to use r>18 instead.
1411190025

Edited 1411190151
Gen Kitty
Forum Champion
That would do it. Let me test.... Yep! Thanks!
--attack|The attack roll is [[d(@{selected|agility})+d(@{selected|onehandedweapons}+(2*?{Power Level|0})-(2*?{down step?|0}))]] --Damage|The weapon deals a potential of [[d?{Weapon Damage|6}]] damage. Hey HoneyBadger! Quick question, I have a powercard (thank you by the way, these things are fantastic) and the outputs are not inline rolls on ONE of my campaigns. I have the same script for another campaign and the outputs are clear inlines, yet for one it just outputs a number but i cannot hover over it (it looks like it was typed in, but i know it wasn't). Above is the part of the card that it happens on. Is there something I am doing wrong with the macro set up or is there a function i need to make true/false? If you need more info, I would be glad to supply it.
1411229427

Edited 1411229445
The Aaron
Roll20 Production Team
API Scripter
Jake, are you using my Ammo script by chance? I ran across a bug for it that causes it to sub numbers for other scripts (didn't realize all scripts get the same msg object, not just a copy if it!).
...maybe (yes)
1411230996
The Aaron
Roll20 Production Team
API Scripter
Change the first 3 lines of the HandleInput function: HandleInput = function(msg_orig) { var msg = _.clone(msg_orig), args,attr,amount,chr,token,text=''; That will fix it. I'm working on an update that will fix that and add some of those requested features...
1411359985
Falcon
Pro
Sheet Author
Aaron - on the ammo script or the power script?
1411360237
Falcon
Pro
Sheet Author
HB - Is there any way to have the inline [[ ]] calc fields show different colors? Specifically within the macro and not the JS? Just wondering? Also - I am a huge fan of your Powercard API. Absolutely love it. Thanks for the hard work.
Aaron's fix has to do with the ammo script and no... I cannot change colors within Roll20 except in the chat window itself. Thanks for the thanks! ^_^
1411510522
Falcon
Pro
Sheet Author
HB - double checking - were you able to add calling tables from Power Cards inline? I use it to show where a target is hit.
1411518369
Wes
Sheet Author
@Black Falcon Yeah, they work for a "Text" output from the table.
1411520348
Falcon
Pro
Sheet Author
Wesley - do you mean it works within Power Card API? - I want to do it within the --emote for Power Cards. I just tried it and can't get it to work. It gives me some weird output. Am I doing something wrong? [[1t[tablename]]] right?
--text1, --text2, etc not --emote|
I dunno about emotes... never tried there.
1411534431
Wes
Sheet Author
Yeah it doesn't work behind the emote tag, Just in the body of the power card. Here is an example from my Wild Magic Surge Table.
I need help for some reason everything was working fine and dandy ... but now none of my macros are showing up powercards
Did you try saving the script to restart the api?
Aaron said: Change the first 3 lines of the HandleInput function: HandleInput = function(msg_orig) { var msg = _.clone(msg_orig), args,attr,amount,chr,token,text=''; That will fix it. I'm working on an update that will fix that and add some of those requested features... Does a similar fix need to be done for every function that takes in a msg for an API command? I'm running into a lot of stuff not working since adding the power cards.
1412112885
The Aaron
Roll20 Production Team
API Scripter
Bryan K. said: Aaron said: Change the first 3 lines of the HandleInput function: HandleInput = function(msg_orig) { var msg = _.clone(msg_orig), args,attr,amount,chr,token,text=''; That will fix it. I'm working on an update that will fix that and add some of those requested features... Does a similar fix need to be done for every function that takes in a msg for an API command? I'm running into a lot of stuff not working since adding the power cards. That was just in regard to my ammo script, which modifies the msg.contents by subbing in the values of rolls, which prevented the power cards script from getting them later on. I'm not aware that there are any other scripts that need similar treatment, though I know I've recommended similar code a few times to deal with subbing in rolls for scripts that didn't accept inline rolls.
1412115922

Edited 1412116055
My token default script is not working on token drop, until I drop an additional token on the page, then the first one is updating. It seems the Power Card script is eating up the on ready calls which is causing this.
1412117758
The Aaron
Roll20 Production Team
API Scripter
eh? That's weird... I assume you've added logging to verify that? Is there a link to the token default script somewhere?
Bug Report: --attack#| and --damage#| will repeat the rolls, but not other text. Thought I'd point this out, don't know if anyone else is having this problem with the script, but it's done it for the last few versions for me. Google Chrome on MacBook. !power --name|Sweet Cuppin' Cakes --leftsub|Live Free --rightsub|Die Hard --attack2|[[1d20]] vs Armor Class --damage3|[[1d6]] radical damage !power --name|Sweet Cuppin' Cakes --leftsub|Live Free --rightsub|Die Hard --attack2|1d20 vs Armor Class --damage3|1d6 radical damage
1412144618

Edited 1412145004
I don't know what to tell you, but it works for me using the current version... Bah, never mind... I am barely awake and see what you meant. That's not a bug. That's a design choice. I will look at making it an option.
Oh okay. I only noticed the difference after the big overhaul, seemed odd that no one had mentioned it. But yeah, it'd be great to get that working whenever you got the time to look at it. Between all the rolls that Pathfinder can use in an attack, and my ADHD, its a huge boon to not have numbers floating around on lines without context when I'm GMing. :)
Anyone know if there is a way in roll20 to tap into the color someone has selected at the bottom within roll20. I want to set the card title's background to that color. That way, everyone will know who clicked the roll.
In the configuration, set the bolded value to true (defaults to false). // USER CONFIGUATION var POWERCARD_DEFAULT_FORMAT = ""; var POWERCARD_CUSTOM_EMOTE = true; var POWERCARD_USE_PLAYER_COLOR = true; var POWERCARD_SHOW_ATTACK_DAMAGE_TAGS = true; var POWERCARD_INLINE_ROLL_NO_HIGHLIGHT = false; var POWERCARD_INLINE_ROLL_COLOR_OVERRIDE = true; var POWERCARD_ROUNDED_INLINE_ROLLS = true;
Thank you Kevin. It seems Attack can handle a variable input, but damage can't, is this correct? I'm trying to setup multiple attack and damage macros and it seems I am going to have to keep my old system since it can't handle a variable damage number (popup)?
1412342157

Edited 1412342251
--damage?{Damage|1}|[[1d6]] should work.
!power --format|dnd5e --name|@{selected|token_name} @{IsPC} --leftsub|@{multiweaponname1} --rightsub|damages for --damage?{Number of Hits|1}|[[@{multidmg1} [Base damage] + @{multidmgbonus1} [Damage Bonus] + @{global_ranged_damage_bonus} [Active Range Damage Bonus]]] @{multidmgtype1} --Critical|[[@{multidmg1}]] Not sure why this isn't firing when my attack works : !power --format|dnd5e --name|@{selected|token_name} @{IsPC} --leftsub|@{multiweaponname1} Attack --rightsub|@{target|Target 1|token_name} --attack?{Number of Attacks|1}|[[ [LR(1 + @{multitohit1} + @{global_ranged_attack_bonus} + @{fumble})] [HR(20 + @{multitohit1} + @{global_ranged_attack_bonus} - @{critical})] 1d20 + @{multitohit1} [To Hit] + @{global_ranged_attack_bonus} [Active Ranged Attack Bonus] ]] | [[ [LR(1 + @{multitohit1} + @{global_ranged_attack_bonus} + @{fumble})] [HR(20 + @{multitohit1} + @{global_ranged_attack_bonus} - @{critical})] 1d20 + @{multitohit1} [To Hit] + @{global_ranged_attack_bonus} [Active Ranged Attack Bonus] ]] vs AC \n@{multitrackammo1} \n!mark @{target|Target 1|token_id} \n/w gm Target @{target|Target 1|token_name} 's AC @{target|Target 1|bar3} @{weaponenchant}
Try using it without the format tag and see if it works.
Bennett S. said: Oh okay. I only noticed the difference after the big overhaul, seemed odd that no one had mentioned it. But yeah, it'd be great to get that working whenever you got the time to look at it. Between all the rolls that Pathfinder can use in an attack, and my ADHD, its a huge boon to not have numbers floating around on lines without context when I'm GMing. :) It's known, It's a matter of how the multi roller works. I've looked into fixing it but it's not trivial, mostly due to how the roll20 does sendMsg(...).
I just went back to my old system to calculate the number of hits and damage to show on the power card. My 5e Character sheet is now using powercards on all rolls. Thank you HoneyBadger!
How do you get the card to fill the whole space?
Turn off chat avatars.
1412600079

Edited 1412602791
Can't figure out why the box isn't turning green on 19s when I have @{critical} --attack|[[ [HR(20 + @{meleetohit1} + @{global_melee_attack_bonus} - @{critical})] 1d20 + @{meleetohit1} [To Hit] + @{global_melee_attack_bonus} [Active Melee Attack Bonus] ]] Do calculates in the HR not work? Wait a second, I think I should just be doing 20 - @critical right? I'm guessing it doesn't take the total value, but just the 1d20 roll (before all of the additions)
It compares just the base roll. So you should just put the number... HR18 for crits on 18 or higher .
Guidance on this? Using a relatively simple macro, and the information is displayed, but incorrectly. Instead of displaying as a power card, it spits out a string that looks like this. +1 RapierAction ♦ AttackAttack: 9 | 25 vs. ACBless Bonus: 1Hit: 7 | Critical 8Damage Type: Piercing
You have to paste what text you are passing in
1412731315

Edited 1412734929
Doh, sorry about that. !power --emote|Tholman stabs something. --format|dnd5e --bgcolor|#003399 --txcolor|#FFFFFF --name|+1 Rapier --leftsub|Action --rightsub|Attack --Attack|[[1d20+6]] | [[1d20+6]] vs. AC --Bless Bonus|[[1d4]] --damage|[[1d8+4]] | ** Critical [[1d8]] --Damage Type|Piercing
You're missing the closing ** to make something bold
1412782701

Edited 1412783070
I feel silly, but I'm trying to understand the HR system. !power --emote|@{selected|token_name} POWERFULLY ATTACKS with his falchion. --name|Melee Power Attack --usage|At-Will --action|Standard Action --attack|[[ [HR18] 1d20+@{STR}+@{BAB}-1]] l --damage|[[2d4+@{STR}+(@{STR}/2)+2]] --dmgtype|slashing What simple thing have I ignored that is not causing this to highlight on 18 or above?
Dunno. If you have the latest version of the script, that should be working.
And the latest version is always what's on top in "The Script"?
Yup.