To Do List: Add handout configuration option Add FX integration Dec 11th, 2017 ~ 10:43 am eastern Version: 3.5.1 Link: https://gist.github.com/Sky-Captain-13/452330a3d926b32da49c Bugfix: Fixed issue with alterbar and soundfx commands which contained a _ or - April 11th, 2017 ~ 9:20 am eastern Version: 3.4.4 Link: https://gist.github.com/Sky-Captain-13/452330a3d9... Bugfix: Fixed Silvyre's bug with multiple [^RollIDs] in the same tag/content. April 10th, 2017 ~ 7:40 am eastern Version: 3.4.3a - Guilty Spark Bugfix: Re-wrote logic for searching and replacing RollID's and the different options when multiple instances were used in the same line, such as [^R.base] [^R.ones] [^R.total] Update: --titlefontshadow| can be used to add shadows or colored outlines around the name of the powercard using the CSS text-shadow properties. This defaults to either a black outline or white outline based on player color and can be removed using --titlefontshadow|none Update: --titlebackground| can possibly be used to add images (untested), using the css background properties. It defaults to a linear gradient from white to transparent which can be removed with --titlebackground|none. Adding an image this way to the top of the powercard is entirely untested and not supported. I only added it to fade the color from light to dark. April 9th, 2017 ~ 10:30 am eastern Version: 3.4.2 Bugfix: Fixed missing borders on single row powercards with or without a titlebox. April 9th, 2017 ~ 10:30 am eastern Version: 3.4.1 Minor Update: If --name is not defined in the powercard, the title/background block will not be displayed. Bugfix: Command buttons now work in chat and not just whispers. March 21st, 2017 ~ 8:45 am eastern Version: 3.4.0 Major Update: You can now send a command to the AlterBars script written by me as well. This means you can use PowerCards to apply damage to a target automatically. Much like the soundfx option, you have to replace the -- in the alterbar commands with a single underscore. --alterbar1|_target|@{target||token_id} _bar|1 _amount|-[^Dmg] _show|GM The sample macro below shows how to apply damage to the target of an attack based on their AC, using the D&D 5e OGL sheet armor class attribute npc_ac: !power {{
--name|Shortbow
--Attack:|[[ [$Atk] 1d20+5]] vs @{target||npc_ac} AC
--?? $Atk < @{target||npc_ac} ?? !Missed|**You missed!**
--?? $Atk >= @{target||npc_ac} ?? soundfx1|_play|ArrowHits
--?? $Atk >= @{target||npc_ac} AND $Atk.base <> 20 ?? Hit:|[[ [$Dmg] 1d8+3]] piercing damage
--?? $Atk >= @{target||npc_ac} AND $Atk.base <> 20 ?? alterbar1|_target|@{target||token_id} _bar|1 _amount|-[^Dmg] _show|GM
--?? $Atk.base == 20 ?? Critical Hit:|[[ [$CritDmg] 2d8+3]] piercing damage
--?? $Atk.base == 20 ?? alterbar2|_target|@{target||token_id} _bar|1 _amount|-[^CritDmg] _show|GM
}}
February 21st, 2017 ~ 12:20 am eastern Version: 3.3.1 Link: https://gist.github.com/Sky-Captain-13/452330a3d9... Bugfix: The script was rounding rolls with decimal points when used in a conditional. [[ [$Roll] 0d0 + 0.5 ]] would return as 1 instead of 0.5 in a conditional, meaning ?? $Roll == 0.5 ?? would never return as true. TLDR... decimal points weren't working properly. February 11th, 2017 ~ 10:00 am eastern Version: 3.3.0 Major Update: Added the --soundfx tag which integrates with the Roll20 Audio Master Scott C. script available as a one-click install script. To use this tag, you need to use the R20AM commands, but replace the -- of their tags with an underscore. To use multiple soundfx tags, just append a number to the end. --soundfx|_play|Bite --?? $Atk >= @{target|AC} ?? soundfx1|_play|Shortbow Minor Update: Included error catching from Shaangor . January 16th, 2017 ~ 9:50 am eastern Version: 3.2.23 Minor Update: Added double dash fix from TheAaron for urls. Should solve the old issue with double dashes in token and character id's too. November 23rd, 2016 ~ 5:00 pm eastern Version: 3.2.22 Update: Added getAttrRefValues function written by Sines . This allows you to use autocalculated attributes on character sheets with target charms. Such as the armor class attribute on most D&D character sheets. Note: This update is untested by me. I simply added the function as is into the script. PowerCards... What are they? They are simply macro's formatted using --tags that are interpreted by the script to apply html and css to contents of the macro. This string is then sent to the chat window via the API using /direct to allow the html and css formatting to work. This has the benefit of reducing the spam in the chat window (while admittedly creating a new kind of spam) and reduces the number of macros needed. This script can turn this... ... or this ... ... into this! Using the Script Note: You must be a PRO level subscriber to Roll20 to utilize API scripts. Step 1: Copy the script into the API section of your campaign and save it. Step 2: Create macros/abilities for your monsters, characters, magic items, or whatever else you want to use it for. D&D 4e Example: !power {{
--emote|HoneyBadger resorts to the simple attack he learned when he first picked up a weapon.
--format|atwill
--name|Melee Basic Attack
--leftsub|At-Will
--rightsub|Standard Action
--Attack|[[1d20 + 4 [Strength Mod] + 3 [Longsword Prof.]]] vs AC
--Hit|[[1d8 + 4 [Strength Mod]]] slashing damage
}} D&D 5e Example: !power {{
--emote|HoneyBadger slashes at his foe with a longsword.
--format|atwill
--name|Melee Attack
--leftsub|Action
--rightsub|Reach 5 ft.
--Attack|[[1d20 + 3 [Strength Mod] + 2 [Proficiency]]] | [[1d20 + 3 [Strength Mod] + 2 [Proficiency]]] vs AC
--Hit|[[1d8 + 3 [Strength Mod]]] slashing damage
}}
These two macro's show up as... Using Tags Tags are used to tell the script how to identify the Content that follows and help tell the script what to do in some cases. For example, the --name| tag is used to set the name at the top of the power card. Tag Format Examples: GOOD: --Tag|Content GOOD: --Effect|This is an effect. GOOD: --A Custom Tag|This is a custom tag. BAD: effect | This is a bad tag. BAD: -BadTag| This is also a bad tag. Tag Options: These are used to further customize the appearance and features of the power cards. Hidden Tag : Adding an exclamation mark ! at the start of a tag will hide that tag and not display it in the power card, but it will show the contents of the tag in the power card. This is useful for adding blocks of text without a tag. Example: --!Tag|Content Indent: Adding a caret mark ^ followed by a number will indent that entire line and its contents slightly. The indentation option ranges from a minimum of zero (used to reset the indent to default) to a maximum of nine, though at nine, you will not have very much room for content at all. Example: --^1Tag|Content The indent tag option can be used in conjunctions with the hidden tag option, but the exclamation mark must be first. Example: --!^1Tag|Content Repeat: To repeat a tag and its contents, add a hash mark followed by the number of times you want the content to repeat. You can also use roll queries to add a pop-up in roll20 to determine the number of times to repeat the tag when you click the macro (see second example). Example: Tag#4|Content Example: Attack#?{Number of attacks|1}|[[1d20+4]] Using the repeat tag will generate unique rolls for each inline roll in each repeated tag. Same Name: This tag option is used to enable the use tags with the same name. Unlike repeating tags, the content is unique to each tag of the same name. To use this tag, add an asterisk * followed by a number (cannot use the same numbers). Example: Tag *1|Content Example: Tag *2|Content Hides Tag & Content: Add a $ in front of the tag to hide the tag and the content. Using ?{Hit delete to show|$} makes this configurable on the fly. Example: --$Tag|Content Example: --?{Hit delete to show Hex damage|$}Hex:|[[1d6]] necrotic damage Reserved Tags: These tags are reserved for specific use by the script and cannot be used for anything else. charid - Gets the character_id of the character triggering the macro. Combines with --emote to create a custom look to emotes. Usage: --charid|@{character_id} emote - Creates an emote on top of the power card. Set CUSTOM_EMOTES to false in script to return to standard Roll20 orange emotes. If you have charid and emote together in the macro to use the power card styled emotes, you can put an exclamation mark in front of the emote to not show the avatar for that macro. Example: --emote|This emote would have an avatar. Example:--emote|!This emote would not have an avatar. format - An option for GM's to make setting text and background colors easier. See the Format Tag section below for more detailed information. Example: --format|atwill Example: --format|encounter name - The name of the power, skill, ability, etc. being used or whatever else you can think of. Appears at the very top of the card. title - Sets a tooltip on the colored title box. Useful for hiding information that would otherwise clutter the chat window. leftsub - Creates a smaller subtitle beneath the name of the power card, left of the diamond if used in conjunction with rightsub. rightsub - Creates a smaller subtitle beneath the name of the power card, right of the diamond if used in conjunction with leftsub. txcolor - Sets the color of the text in the title box using hex code (#000000). bgcolor - Sets the background color of the title box using hex code (#000000). erowtx - Sets the text color of even numbered rows in the body of the power card using hex code (#000000). erowbg - Sets the background color of even numbered rows in the body of the power card using hex code (#000000). orowtx - Sets the text color of odd numbered rows in the body of the power card using hex code (#000000). orowbg - Sets the background color of odd numbered rows in the body of the power card using hex code (#000000). whisper - Sends the title box and body of the power card to the designated target. For example --whisper|GM would send the power card to the GM. target_list - Creates a list of targets in conjunction with multiple uses of the @{target|Nth Target|token_id} roll query for each possible target. Example: --target_list|@{target|1st Target|token_id} | @{target|2nd Target|token_id} | @{target|3rd Target|token_id} A method for replacing text in the powercard with information from the target_list objects will be added later. titlefont - Sets the font of the title of the power card. subtitlefont - Sets the font of the subtitles beneath the title of the power card. bodyfont - Sets the font of the body of the power card. Word of caution, this absolutely will alter the font of the inline rolls as well. corners - Defaults to 5... set to 0 to remove rounded corners or higher to round them even more. titlefontsize - Sets the size of the name of the powercard subtitlefontsize - Sets the size of the text of leftsub and rightsub bodyfontsize - Sets the size of the text in the body of the powercard border - Can be used to set the size style color of borders using this format: --border|1px solid #000 tokenid - This tag lets you use the token image instead of character avatar for custom emotes. Must be used with either: @{selected|token_id} @{target|self|token_id} hroll - This tag allows you to make as many hidden rolls as needed without them showing up on the powercard. Combined with a RollID, you can reference these rolls later without showing the math. Example: !power {{--hroll|[[ [$Atk] 1d20 + 10 ]]
--Attack:|[^Atk.total] or [! [^Atk.total] !] vs AC}} soundfx - This tag sends an api command to the Roll20 Audio Master (R20AM) script available as a one-click script install. Follow the link for more information on how to use R20AM. --soundfx|_play|Bite --?? $Atk >= @{target|AC} ?? soundfx1|_play|Shortbow Inline Roll Options: Add this before the die roll you want to modify and make sure there is a space between the [[ brackets and the roll option. Such as follows: [[ [NH] 1d4 + @{DEX Mod] [Dex Mod] ]] You can use multiple roll options by separating them with a vertical pipe character such as: [[ [nh|trkr] 1d20]] [NH] - Disables inline roll highlighting for crit success and crit failure. [TRKR] - Adds an entity to the Turn Order Tracker. If the powercard macro does not have --tokenid or --charid, it will use the Display Name of the player that triggered the macro. If you use --charid, it will look for a token that is representing the character and use that id, but fall back to the character name if there are no tokens representing the character. [TXT] - Causes an inline roll to show up as text only instead of as an inline roll. [XPND] - This inline roll option expands the roll into the full formula/expression instead of just the result. [[1d20 + @{Dex Mod}]] becomes [(18) + 3 = 21] instead of [21] Examples: GOOD: [[ [NH] 1d6]] BAD: [[[NH] 1d6]] Text Formatting: You can use the options below to format text in the content of a tag. These can be combined in any number of ways. **Bold** //Italics// __Underline__ ~L, ~C, ~R aligns text in between those tags to the (L)eft, (C)enter, and (R)ight. ~L This text would be left aligned. ~L ~C This text would be centered. ~C ~R This text would be right aligned. ~R ~~~ inserts a horizontal rule. ^^ adds a line break ^*Indents the first line of a paragraph in the content of a tag. @@url@@ - Naked url, requires that ALLOW_URLS to be set to true in the script. @@url||test@@ - Hidden url, requires that ALLOW_HIDDEN_URLS to be set to true in the script. Must have double bars in between the url and the text. $$#400|This text will be in dark red.$$ The Format Tag The --format tag is one of the more heavily revamped tags in the 2.0 version of power cards. Instead of specifying a game system as it did in the past, it instead can be used to specify the text and background colors of the macro in one tag. The GM of the campaign must create a handout and name it exactly PowerCard Formats so that the script can find the information and parse the formatting info as needed. You absolutely must follow the format shown in the example below to get the --format tag to work properly. This image is an example of the D&D 4e power usage colors. I recommend setting this handout as viewable by all players so that they can see what options are available for them to use in their own power card macros. Target Info Charms This new feature lets you grab info from a character sheet or token by using --target_list|@{target|1st Target|token_id} | @{target|2nd Target|token_id} | etc to create the list of targets and then adding target info charms into the content of your powercard such as %%token_name%% to get the name of the token. The types of charms are broken down into two categories: token charms and attribute charms. Token charms area set list that grab information like bar values and the name of the token. Attribute charms can be any attribute on a character sheet and they are case sensitive. AC is not the same as aC, Ac, or ac. Finally... and this is very important ...all charms referring to a target must be in the same tag. You cannot have charms split between tags. If you want to create a kind of stat sheet, use line breaks ^^ to create new lines. Good Examples !power --name|Single Target Attack --target_list|@{target| |token_id} --Attack|[[1d20+5]] | [[1d20+5]] vs %%AC%% Armor Class (%%token_name%%) --Hit|[[1d8+3]] slashing damage !power --name|Scorching Burst | Nine Targets --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} | @{target|7th|token_id} | @{target|8th|token_id} | @{target|9th|token_id} --Attack#?{Number of targets|1}|[[1d20+5]] vs %%Reflex%% Reflex (%%token_name%%) --Hit|[[1d8+3]] fire damage For a multi-attack power like Scorching Burst in D&D 4e, you create the macro as above and just click nine times and then when the pop up for number of targets appears, type in the actual number of targets in the area and hit enter. The script will ignore the rest of the targets in the list. For example, in the snip below... I clicked nine tokens pretty quickly. Only the first four mattered since those were my actual targets. Then I typed in the number of targets and hit enter when the pop up appeared. !power --name|Stats --target_list|@{target|1st Target|token_id} --Target|%%token_name%% ^^ **Hit Points:** %%bar3%%/%%bar3_max%% ^^ **Defenses:** AC %%AC%%, Fort %%Fortitude%%, Reflex %%Reflex%%, Will %%Will%% Bad Example !power --name|Bad Example --target_list|@{target| |token_id} --Target|%%token_name%% --Attack|[[1d20+5]] | [[1d20+5]] vs %%AC%% Armor Class --Hit|[[1d8+3]] slashing damage to %%token_name%% In the example above, the %%AC%% and second %%token_name%% charms would not be replaced with the proper info. Token Charms %%token_name%% %%bar1%% %%bar1_max%% %%bar2%% %%bar2_max%% %%bar3%% %%bar3_max%% Sample Attribute Charms %%Strength%% %%Strength Mod%% %%Fortitude% %%Reflex%% %%Will%% %%HP%% %%Hit Points%% Other Charms %%who%% - gets the DisplayName of whomever triggered the macro/powercard ConditionalsConditionals are simple logic using either the base value of a die roll or the total value of the entire inline roll. They can only be used at the start of a tag right now, but will eventually be able to be used in the content of a tag to selectively show or hide information. Conditionals are used by wrapping them in double question marks at the start of a tag, telling the script which roll to use, whether to use the base value or total, how to compare it, and to what to compare it to. For example... a basic crit macro for a D&D 4e basic melee attack with a long sword: !power {{ --name|Basic Attack --leftsub|Longsword --rightsub|Range Melee --Attack:|[[ [$Atk] 1d20 + 4 [Str Mod] + 3 [Weapon Proficiency] ]] vs AC --Hit:|[[ 1d8 + 4 [Str Mod] ]] slashing damage --?? $Atk.base == 20 ?? Critical Hit:| Add [[1d8]] slashing damage }} Structure of a Conditional ?? LeftValue vs RightValue ?? LeftValue and RightValue can be a number, a roll id ($Roll), or a roll query ( ?{target|AC} ), or even an attribute call ( @{attribute} ). vs can be one of the following operands: <, <=, ==, >=, >, <> (not equal), % (evenly divisible), ~% (not evenly divisible) Very important!! You must have a space between each part of the conditional. No spaces will cause an undefined variable crash. Roll $ID's must be defined in an inline roll as a label in front of the roll you want to use later. It must be in single square brackets and must start with a dollar sign ($). Next, you will want to determine if you are going to check the base value of the roll of the total value of the entire inline roll. For example if you use [[ [$Atk] 1d20 + 4 ]] and roll a 10 on the d20, the base value will be 10 and the total value will be 14. Add .base to the $ID for the base value and .total for the total value ($ID.base or $ID.total). The symbol can be one of the following: <, <=, ==, >=, >, <>, %, and ~%. They are in order: less than, less than or equal to, equal to, greater than or equal to, greater than, not equal to, modulo, and negated modulo (see below). Modulo Symbol The modulo symbol, added in version 3.0.2, is a percentage sign % and can be used to divide the left side by the right side. By itself, modulo will return true if the left side is evenly divisible by the target number. This can be used to show something if it is an even number (?? $ID.base % 2 ??). Adding the tilde ~ in front of the module will negate or reverse the outcome. So if you do ~% 2 instead, it will be true if the number is odd. Extending Conditionals Conditionals can also be extended to test for multiple values, but keep the following in mind... any conditional with AND will stop immediately when it finds a false statement and any conditional with OR will stop immediately when it finds a true statement. Here is an example of an extended conditional with complex logic for a D&D 5e melee attack: !power {{ --name|Basic Attack --leftsub|Longsword --rightsub|Range Melee --Attack:|[[ [$Atk] 1d20 + 3 [Str Mod] + 2 [Proficiency] ]] vs AC --?? $Atk.base == 1 OR $Atk.total < @{target|AC}?? !Miss:|You missed. --?? $Atk.total >= @{target|AC} AND $Atk.base <> 1 AND $Atk.base <> 20 ?? Hit:|[[1d8 + 3]] slashing damage --?? $Atk.base == 20 ?? Critical Hit:|[[2d8 + 3]] slashing damage }} Stacking Conditionals You can also stack conditionals one after the other and they will be executed in that order, left to right. It basically works like AND, but may be a little cleaner to read. May be more useful after conditionals can be used in the content of a tag and not just the tag itself. Contributors The following members of the Roll20 community have greatly aided with the creation and enhancement of this script either through their scripting expertise or their suggestions to improve features of the script and their relentless bug hunts! Alex L. Brian Chris N. Rob J. The Aaron GenKitty Sean G Janick H. Previous Discussion Thread https://app.roll20.net/forum/post/2165711/script-p...

Previous Update Notes October 4th, 2016 ~ 4:00 am eastern Version: 3.2.21 Link: gist.github.com/Sky-Captain-13/452330a3d926b32da49c Minor Update: Moved when status icons and info are added into the powercard to support usage of powercard formatting options like ^^ for line breaks. This means you can use all the bold, underline, links and more in the PowerCards Status List handout if you're using that to store your status information like this... dazed|half-haze|You grant combat advantage. ^^ You can take either a **standard action**, a **move action**, or a **minor action** on your turn (you can also take free actions). You can't take immediate actions or opportunity actions. You can't flank an enemy. July 20th, 2016 ~ 9:00 am eastern Version: 3.2.20 Minor Update: Added --whisper|all per request from Silvyre. Script will send powercard to all online players only. I have no idea what would happen if it tried to whisper offline players as well. The script uses the _displayname attribute of the Player object to determine who to send the whisper to. July 19th, 2016 ~ 10:00 pm eastern Version: 3.2.19 Bugfix: Change to fix concatenation errors when using multiple scripts. (per TheAaron) March 29th, 2016 ~ 10:00 am eastern Version: 3.2.18 Minor Update: Added RPND which is a reverse of XPND. [[ [rpnd] 1d20 + 4 ]] will show up as Total = Roll + Mods (YAGKR... =^_^= ) Minor Update: Added PowerCards Status List as an allowed name for the handout used to define status icon names and information. (YAGKR... =^_^= ) February 20th, 2016 ~ 10:00 am eastern Version: 3.2.17a Update: PowerCard Status List now accepts a third option to include a description of the status effect. Though this was created for D&D 4e conditions... I'm sure you'll find some other use for it as well. If you do not include the description and just use dazed|half-haze, the script will ignore that and print anything you put in that tag. Usage: dazed|half-haze|You grant combat advantage. You can take either a standard action, a move action, or a minor action on your turn (you can also take free actions). You can't take immediate actions or opportunity actions. You can't flank an enemy. --Dazed|[+dazed] The above will show, in chat, the full description of dazed as set in the PowerCards Status List handout. February 19th, 2016 ~ 9:30 am eastern Version: 3.2.16 Minor Update: Roll ID's will now get the table id number from a rollable table and can be accessed as the base number of a roll id. [[ [$Tbl] 1t[RandomWeather] ]] Tbl.base will get the tableidx rolled on the table, including the weight. So if you have a table with three items weighted item1 (10), item2 (5), and item3 (1), you'll get a number between 0 and 15, with item1 on the table being covered by number 0-9, item2 by 10-14, and item3 by 15. February 17th, 2016 ~ 6:30 pm eastern Version: 3.2.15 Update (GenKitty Request): Added an option to create a list of status icons and conditions and display them in a powercard. You can either use the actual status icon name or create a handout named PowerCard Status List and define an alias for each status icon, such as dazed|half-haze or blinded|bleeding-eye Usage : --Dazed:|[+dazed] or [+half-haze] The creature is unable to act normally. A dazed creature can take no actions, but has no penalty to AC. Example in use... February 14th, 2016 ~ 1:06 pm eastern Version: 3.2.14a Minor Update (Silvyre's Request): Added option to count number of ones in a roll using a Roll ID. To display the number of ones rolled use: [[ [$Roll] 10d10 ]] [^Roll.ones] February 14th, 2016 ~ 1:00 pm eastern Version: 3.2.14 Major Bugfix: Fixed a major bug that would crash the script if you ran any powercard with inlinerolls that did not create a mods or mods.success property in msg.inlinerolls. February 13th, 2016 ~ 1:30 pm eastern Version: 3.2.13 Update: Added the Skills5e reserved tag to PowerCards. This tag will automatically print a list of your character's skills, drawn from the attributes of the D&D 5e Community character sheet. It will not work with the OGL or the Shaped 5e character sheets. Update: Added an option to display number of successes or test against number of successes using Conditionals. [^RollID.ss] will display the number of successes from that roll. [^RollID.base] is always a sum of all the rolls, no modifiers. Base has nothing to do with successes at all. [^RollID.total] is always a sum of the successes of all rolls in the inline roll, not just the RollID used. So if you use multiple roll ID's in the same inline roll as below, it will always be the total result of all the rolls. The use of .ss is to break out successes from individual rolls within a multi-roll inline roll like this: [[ [$R1] 3d6>3 + [$R2] 3d6>3 ]]. The use of ^R1.ss will only show the successes from the first roll. November 22nd, 2015 ~ 12:30 pm eastern Version: 3.2.12 Bugfix: Content hidden by conditionals will not be processed. This really only affects the [trkr] roll option that sends a token to the turn order tracker. Example: -- ?? ?{Send to Init|Yes|No} == Yes ?? Initiative:|[[ [trkr] 1d20 ]] If you select no, the token will not be added to the turn order tracker, nor will its existing initiative be modified. Update: You can now display the base value of a Roll ID by adding [^Roll ID] to your PowerCard. This cannot be used as a stored variable to do math with however. Example: --Damage:| [[ [$Physical] 1d8 + [$Fire] 1d6 + [$Necrotic] 2d6 ]] ([^Fire] fire, [^Necrotic] necrotic) would show up as Damage: [19] (4 fire, 9 necrotic) If you want to include a modifier as part of the base value, you must wrap the roll and modifier in curly brackets like this: [[ [$Physical] {1d8 + 3 [Str Mod] } + [$Fire] {2d6 + 3} ]] Bugfix: As part of the above update, I was able to get Roll ID's to work with multiple dice and their base sum. Before the bugfix, $ID.base would only use the last number rolled, regardless of the number dice rolled. Example: If you rolled [[ [$Fire] 3d6 + 10 ]] and rolled a 3, 3, 5... [^Fire] would only show the five and any conditionals trying to use $Fire.base would only test against the value of five instead of eleven, the sum of the dice only. This would be most useful for system that use multiple dice for a roll that may or may not have modifiers applied, but also bases things like critical success off the base rolls. Like using 3d6 for attacks rolls in D&D instead of 1d20. You would be able to do the following, which did not work before. -- Attack:| [[ [$Atk] 3d6 + 3 [Str Mod] ]] vs AC -- ?? $Atk.base >= 18 ?? Critical Hit:|You got a critical hit! November 20th, 2015 ~ 4:30 pm eastern Version: 3.2.11 Bugfix: You can now use self as part of multiple target whispers. Example: --whisper|self,gm Courtesy of TheAaron Minor Bugfix: Added a blank line semi-colon at the start of the script to help reduce possible errors of a missing semi-colon in another script. Will not have any affect if you have no other scripts. Added after reading about it in one of TheAaron's other posts somewhere. Update / Bugfix: Conditionals now properly test for both text and numbers. However, you're only going to get text from a roll query or attribute call and not an inline roll. So for example, in my D&D 5e game, I set up an attribute (AttackRoll ) on my character sheet and put ?{Attack|Standard, 1d20|w/Advantage, 2d20kh1|w/Disadvantage, 2d20kl1} in that attribute. I can now reference it via @{AttackRoll}. If I select Standard, it returns 1d20 and Advantage returns 2d20kh1. These conditionals are case sensitive. Yes does not equal yes or yEs or YEs or any combination other than Yes. Example: -- ?? @{AttackRoll} == 2d20kh1 ?? Advantage|I have advantage! Example: -- ?? ?{Flanking?|Yes|No} == Yes ??Flanking:|I am flanking! Courtesy of Nate W. July 31st, 2015 ~ 8:45 pm eastern Version: 3.2.10 Bugfix: Passing a message to PowerCard.Process does not require a player object any longer and will not crash the script without one. What this allows you to do is write a script for whatever you want and send a message to PowerCard.Process (formatted like a powercard macro) and display it in chat. If you have questions about this and what you can do with it, just ask in the thread. July 27th, 2015 ~ 8:15 am eastern Version: 3.2.9 Bugfix: Line 63 updated with TheAaron's latest fix for floor() and ceil() issues. Bugfix: Corrected default Roll20 emote display error, where it would clip the first word from the emote. July 23rd, 2015 ~ 12:45 am eastern Version: 3.2.8 (The Aaron Line 63 Update) Major Bugfix: This update fixes a number of crashes due to sendChat interaction with the API. June 10th, 2015 ~ 6:00 am eastern Version: 3.2.7 Bugfix: Adjusted padding and margins on rows and inline rolls to make them all line up properly. This includes right aligned content using ~R formatting which may or may not include inline rolls as well. Bugfix: Negative numbers work in math only inline rolls now. [[-4]] will not crash the script. June 9th, 2015 ~ 10:00 am eastern Version: 3.2.6 Bugfix: Conditionals will now work with any combination of numbers, inline rolls, and roll id's. See valid examples below. ?? 1 < 2 ?? ?? $Atk >= 20 ?? ?? $Atk >= @{AC} ?? ?? @{AC} >= [[1d20]] ?? Bugfix: USE_PLAYER_COLOR will not conflict/override USE_DEFAULT FORMAT By default, PowerCards will use a players chosen color (the little square next to their name at the bottom of the map) for the background of the title of all their powercards unless they use --bgcolor and --txcolor to change the colors. Setting USE_PLAYER_COLOR to true will force all powercards to use the player color regardless of any background or text color tags in their macro. Use of the --format tag however will allow you to change the colors as needed for situations like D&D 4e at-will, encounter, and daily powers while leaving saving throws and skill checks as the player color. Minor Update: Padding on right aligned text ( ~R ) has been removed... don't know why I put it there in the first place. Minor Update: Weight on top part of the horizontal rule (~~~) has been increased to 0.3... it looks better now. (Thanks GenKitty!)

I'm having an issue using icons on my power cards, I'm doing something horribly wrong I feel like. so the only script im running atm is power cards and this is the powercard that I have written up !power {{ --emote| With a shout, you command an ally to attack --format|atwill --name|Commander's Strike --leftsub|At-Will --rightsub|Standard Action --Melee| Weapon ^^**Target** One Creature --Keywords| Martial, Weapon --Effect:| One of your allies can take a free action to make a melee basic attack against the target. The ally gains a bonus to the damage roll equal to your Int modifier (+2). --Blinded|[+blinded] }} I have a handout handout that has this written in there Blinded|bleeding-eye|You grant combat advantage this is not written in the GMs comment at all, just the blank spot above it. the name of the handout is PowerCards Status List . so when I run this macro it freezes up roll20, and I am then no longer allowed to use macros and it crashes the javascript TypeError: Cannot read property 'icon' of undefined TypeError: Cannot read property 'icon' of undefined at statusSymbol (apiscript.js:926:50) at String.replace (native) at formatter (apiscript.js:967:18) at doInlineFormatting (apiscript.js:1001:11) at apiscript.js:582:23 at Array.forEach (native) at apiscript.js:580:14 at checkFinishedOps (eval at (/home/node/d20-api-server/api.js:148:36), :758:7) at eval (eval at (/home/node/d20-api-server/api.js:148:36), :838:8) at null._onTimeout (/home/node/d20-api-server/node_modules/underscore/underscore.js:768:19)

Yeah... I need to fix that problem where an icon doesn't exist and make it fail without crashing the API. Try adding some more status effects and get rid of the blank line at the top. Then reload the campaign.

SkyCaptainXIII said: Yeah... I need to fix that problem where an icon doesn't exist and make it fail without crashing the API. Try adding some more status effects and get rid of the blank line at the top. Then reload the campaign. I restarted the campaign and restarted the api and added more conditions. dominated|strong|you have lost your mind, wamp wamp wamp blinded|bleeding-eye|you can't see, so life is rough dazed|interdiction|you are also confused deafened|screaming|can't hear anything eh thats rough grappled|grab|and we aren't letting go dying|pummeled|don't worry theres a light at the end of the tunnel helpless|arrowed|you need help immobilized|tread|you can't move marked|archery-target|fight this guy trust me petrified|Aura|you are a weeping angel prone|back-pain|you want to get up restrained|fishing-net|you need to restrain from this the macro looks like !power {{ --emote| With a shout, you command an ally to attack --format|atwill --name|Commander's Strike --leftsub|At-Will --rightsub|Standard Action --Melee| Weapon ^^**Target** One Creature --Keywords| Martial, Weapon --Effect:| One of your allies can take a free action to make a melee basic attack against the target. The ally gains a bonus to the damage roll equal to your Int modifier (+2). --dominated|[+dominated] }} no spaces or extra lines anywhere and it still crashes the api TypeError: Cannot read property 'icon' of undefined
TypeError: Cannot read property 'icon' of undefined
at statusSymbol (apiscript.js:926:50)
at String.replace (native)
at formatter (apiscript.js:967:18)
at doInlineFormatting (apiscript.js:1001:11)
at apiscript.js:582:23
at Array.forEach (native)
at apiscript.js:580:14
at checkFinishedOps (eval at (/home/node/d20-api-server/api.js:148:36), :758:7)
at eval (eval at (/home/node/d20-api-server/api.js:148:36), :838:8)
at null._onTimeout (/home/node/d20-api-server/node_modules/underscore/underscore.js:768:19) I'm sorry this may be considered a repetitive repost in the end of the day lol I'm just not sure if im doing something wrong

Phoxounet said: Hi There. The best script imo. Just loving it. Couldn't play Roll20 without it. Thx for it ! :) Hear... hear, with over 1300 active powercards in my main game alone I couldn't have given my players even half the experience without it. The only real improvement I could ever think of is conditionally triggered sfx ;) ;) ;)

Ziechael said: Phoxounet said: Hi There. The best script imo. Just loving it. Couldn't play Roll20 without it. Thx for it ! :) Hear... hear, with over 1300 active powercards in my main game alone I couldn't have given my players even half the experience without it. The only real improvement I could ever think of is conditionally triggered sfx ;) ;) ;) One of these days.

SkyCap, I'd like to request a feature for the To Do List: An extension/formalization of "Stacking Conditionals" such that multiple Conditionals could be "grouped" within a single tag. e.g. --?? Condition 1 AND Condition 2 ?? OR ?? Condition 3 AND Condition 4 ?? !|Displays if at least (1+2) or (3+4) are true. e.g. --?? Condition 1 OR Condition 2 ?? AND ?? Condition 3 OR Condition 4 ?? !|Displays if at least (1+3) or (1+4) or (2+3) or (2+4) are true. However, if adding this would require a complete revamp of Conditionals, please don't bother!

I seem to be having an issue with multiple sites, including Roll20, progressively lagging with Google Chrome. I switched to Microsoft Edge (because it was there) and noticed that the lag issues no longer existed, but many of the Power Card macros (perhaps notably the ones on the bottom bar, not the ones attached to the tokens) that worked with Chrome do not work when running on Edge. Does anyone have any experience with this issue, and know of a workaround or at least what the problem may be?

Silvyre said: SkyCap, I'd like to request a feature for the To Do List: An extension/formalization of "Stacking Conditionals" such that multiple Conditionals could be "grouped" within a single tag. e.g. --?? Condition 1 AND Condition 2 ?? OR ?? Condition 3 AND Condition 4 ?? !|Displays if at least (1+2) or (3+4) are true. e.g. --?? Condition 1 OR Condition 2 ?? AND ?? Condition 3 OR Condition 4 ?? !|Displays if at least (1+3) or (1+4) or (2+3) or (2+4) are true. However, if adding this would require a complete revamp of Conditionals, please don't bother! That seems like it would be really difficult to add unfortunately.

Arthur P. said: many of the Power Card macros (perhaps notably the ones on the bottom bar, not the ones attached to the tokens) that worked with Chrome do not work when running on Edge. Does anyone have any experience with this issue, and know of a workaround or at least what the problem may be? While Roll20 will work in a variety of browsers, in order to maximize
your playing experience and take advantage of everything that Roll20 can
do, you should use the latest, non-beta, version of either Google Chrome or Mozilla Firefox. Other browsers are not supported and if they have issues they will not be troubleshot.

GenKitty said While Roll20 will work in a variety of browsers, in order to maximize
your playing experience and take advantage of everything that Roll20 can
do, you should use the latest, non-beta, version of either Google Chrome or Mozilla Firefox. Other browsers are not supported and if they have issues they will not be troubleshot. Understood, thank you. I will see about downloading Firefox. Hopefully it will not have the lagging issues I've been experiencing with Chrome.

SkyCaptainXIII said: Silvyre said: SkyCap, I'd like to request a feature for the To Do List: An extension/formalization of "Stacking Conditionals" such that multiple Conditionals could be "grouped" within a single tag. That seems like it would be really difficult to add unfortunately. Ah, then please don't bother. Thanks for letting me know! Grognard said: Instead of an attack roll for a higher level warrior being 1d20+1d20+1d14 = attack, it should have been split into separate attacks. Also, this sucks because now I'd have to create 3x the amount of table entries for crits and fumbles wouldn't I? It's actually only about twice the number of tags, because the second and third attacks only use Table 5. Give this a try.

You can't use the Base tag over and over like that. Each tag needs to be unique. I would use hidden tags and formatting to make this or as Silvyre already suggested. --?? $StarSc.total >= 7 AND $Star.total == 5 ?? !Scout1|**Base:** Scout 1

SkyCaptainXIII said: You can't use the Base tag over and over like that. Each tag needs to be unique. I would use hidden tags and formatting to make this or as Silvyre already suggested. --?? $StarSc.total >= 7 AND $Star.total == 5 ?? !Scout1|**Base:** Scout 1 Ahhhh ok. Thanks.

hiya, again thanks for the help you have provided me personaly so far Sky, awesome stuff. so I was just curious why my "select a target" pop-up would have me select the target twice when using most of my macros. I know that it has something to do with the Conditional statements in my macros because when I remove them completely, than I only have to single click the desired token. this is how most of my conditionals look, I pasted my basic attack macro as an example. !power {{ --emote| You resort to the simple attack you learned when you first picked up a melee weapon --format|atwill --name|Melee Basic Attack --leftsub|At-Will --rightsub|Standard Action --Melee| Weapon ^^**Target** One Creature --Keywords|Weapon --target_list| @{target| |token_id} --Attack| [[ [$Atk] 1d20 + ?{Modifier|0} + @{weapon-1-attack} + @{strength-mod}]] vs AC (%%token_name%%) --?? $Atk.base == 1 OR $Atk.total < @{target|ac}?? !Miss:|You missed! --?? $Atk.total >= @{target|ac} AND $Atk.base <> 1 AND $Atk.base <> 20 ?? Hit:|[[1d8 + @{weapon-1-damage} + @{strength-mod}]] damage --?? $Atk.base == 20 ?? Critical Hit:|[[ 8 + @{weapon-1-damage} + @{strength-mod}]] DAMAGE!!! }} so yeah when I combine the target_list with conditionals it seems like whenever I have to choose the target I have to click twice as shown in these pictures. Again, not sure if I could be entering the conditionals differently, I admittedly used your example in your first post to setup a hit/miss/critical condition for the power card. anyways, if it can't be worked around thats also fine, I am mostly just curious why this could be happening lol. Overall, Power Cards is saving me potential headaches down the road.

Ryan T. said: @{target| |token_id} @{target|ac} You'll want to either remove the target name from the first targeted Attribute call (within the --target_list tag), or add the same target name to the other Attribute calls.

after reading the documentation and removing the --target_list from the macro, it makes way more sense knowing target is part of default roll20. thank you very much for pointing me in the right direction SkyCaptain and Silvyre

I've looked through all of the updates and didn't see this. I did see that someone requested the ability to do math with variables like: --Test1|[[ [$Uno] 2d6-7 ]]
--Test2|[[ [$Dos] 2d6+2 ]]
--Test3|[[ [$Tres] $Uno.total + $Dos.total ]]
--?? $Tres.total >= 0 ?? !Success|**Success** Is this still on the table or even possible somehow? Any alternatives? In my system you have to add the result of 2 different things and that becomes the value of the 3rd thing. Then if the 3rd thing is >= $var; Something happens.

I think I'm having trouble using the new addition for Sines' contribution to the script. so if im reading this right, this should allow me to use autocalculated attributes while using @{target|ac} in my the target conditionals right? so I guess im trying to figure out the correct syntax, ive been playing around with the syntax from his post but no dice !power {{ --emote| You resort to the simple attack you learned when you first picked up a melee weapon --format|atwill --name|Melee Basic Attack --leftsub|At-Will --rightsub|Standard Action --Melee| Weapon ^^**Target** One Creature --Keywords|Weapon --Attack| [[ [$Atk] 1d20 + ?{Modifier|0} + @{weapon-1-attack} + @{strength-mod}]] vs AC @{target|token_name} --?? $Atk.base == 1 OR $Atk.total < @{target|ac}?? !Miss:|You missed! --?? $Atk.total >= @{target|ac} AND $Atk.base <> 1 AND $Atk.base <> 20 ?? Hit:|[[1d8 + @{weapon-1-damage} + @{strength-mod}]] damage --?? $Atk.base == 20 ?? Critical Hit:|[[ 8 + @{weapon-1-damage} + @{strength-mod}]] DAMAGE!!! }} now this works just fine as long as the token's attribute page has "ac" as a defined value, but since by default, ac is an auto calculated variable it does not show up under the attribute list. if ac is not defined on the attribute page, than it does not show any of the text from the conditionals

Almost there. So, doing the variable adding and what not. It works with two new variables but I can't seem to find a way to then use a new third variable and add it to a recently used variable. The first instance works and calculates a planet's Atmosphere by rolling 2d6-7 and adding the Size of the planet which is 2d6-2. In order to determine a planet's Hydrographics you then roll 2d6-7 + the planet's Size which is 2d6-2. This works: !power {{ --format|worldgen --bodyfontsize|12px --name|World Profile --Name|~C[[ [TXT] t[first-name] ]]-[[ [TXT] t[second-name] ]]~C --hroll|[! [^Atmos1] !]-[! [^Size1] !]-[[ [$Vars1] [$Atmos1] 2d6-7 + [$Size1] 2d6-2 ]]
--?? $Size1.base == 2 ?? Size2|([^Size1]) **World Size:** 800 km. Surface Gravity: Negligible --?? $Vars1 == 0 ?? !Atmos0|([^Vars1]) **Atmosphere:** None. Pressure 0.00. Vacc suit required. }} How do I then add the previous result of [$Size1] to a new variable of [$Hydro1] or even be able to add the previous result of something like --Hydro|[[ [$Size1] + [[ 2d6-7 ]] ]] ? Am I getting into the realm of "you should just do this with javascript" again?

Roll IDs can't be [^called] into inline rolls. What you're trying to do would be very easy with a custom script , but very tedious using PowerCards. It's probably not useful to think of Roll IDs as variables.

Silvyre said: Roll IDs can't be [^called] into inline rolls. What you're trying to do would be very easy with a custom script , but very tedious using PowerCards. It's probably not useful to think of Roll IDs as variables. Yeah, this will be my excuse to finally learn javascript. All the macros I want to create would be much easier with javascript. Thanks.

is it possible to call the power card from another macro? kind of thinking about making a macro if I can call on a powercard and just have a drop down query asking how many times I want to use the power card essentially.

Ryan T. said: is it possible to call the power card from another macro? kind of thinking about making a macro if I can call on a powercard and just have a drop down query asking how many times I want to use the power card essentially. AFAIK you can't. You could create a macro that isn't a power card macro and call another macro by just including #macroName. If you add the call in power card format the result includes the !power {{ header of the macro like: !power {{
--format|worldgen
--bodyfontsize|12px
--name|World Profile
--Name|Test3
--!Test|#Test
}}
Result:
Name Test
!power {{
Atmosphere 0
Success (0) Atmosphere works
I am but a newb though

Ryan T. said: call on a powercard and just have a drop down query asking how many times I want to use the power card essentially. Would using the Repeat tag, as documented in this thread's OP, accomplish what you're attempting? Otherwise, you might look into Command Buttons .

Here is my Macro for my Traveller game for a First Aid Check. I have the conditional at the end if they roll a total of 8+ then the check is a success. What I am trying to do is also list how much the First Aid Check heals which is the total roll minus the difficulty (in this case $Heal.total - 8). The macro below fails. Can I do what I want with the conditional? If so, what am I doing wrong? !power --target_list|@{target| |token_id} --name|@{selected|token_name} performs First Aid on %%token_name%% --Skill Roll [[ [$Heal] 2d6 + @{mod-Education} + @{skilllevel-Medic} + 2 +?{Modifier|0}]] --Time|Takes [[1d6]] minutes --?? $Heal.total >= 8 ?? Healing|[[$Heal.total - 8]] damage