Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account
This post has been closed. You can still view previous posts, but you can't post any new replies.

[Script] PowerCards 3 (Thread 3)

1436451939

Edited 1475568216
To Do List: Add RPND to show SUM = EXPRESSION Add PowerCards Status List as option for handout name Work on adding Handout configuration options Look at FX Integration Add --whisper|all option 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!) Power Cards 3 ~ LINK: gist.github.com/Sky-Captain-13/452330a3d926b32da49c 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} 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.
Okay, in answer to your question (...don't know why I put it there in the first place...) with regards to the -2px margins on the ~R tag, the reason is best visualized below: This is how it looks with the -2px margin (top and bottom): This is how it looks without the -2px margin (top and bottom): The difference is purely aesthetics, but the OCD in me did not like the idea of the ~R pushing the overall height of the DIV layer cell down, making the words to the left unnaturally higher (thus uncentered vertically) than the inline roll. That's why I added the -2px (top and bottom) margin, to correct that offset. It was just a quick fix that worked for that correction.
Ah. I see. CSS is a pain in the ass. >_< I'll poke around with the tag/content stuff and try to make it all work together nicely.
1436461384
vÍnce
Pro
Sheet Author
Thanks for the update and bugfix HB. Working as expected.
1436462706
DK Heinrich
Marketplace Creator
Sheet Author
Sean... how did you get the purple shield'ish box to appear around your AC result?
He probably created a custom inline formatting option using the [! !] as a base and then put a border-radius bottom around it and changed the color.
1436462902

Edited 1436463316
DK Heinrich
Marketplace Creator
Sheet Author
way out of my skill range - but if hes willing to share.... :) EDIT: and that got me thinking - if you can do that to make a purple shield? could you do the same thing to make boxes that are always a color other than the default yellow? and could you have multiple of those boxes (so attack is yellow, defense is green, hit is red, miss is white, ect)?
Eh, it's just CSS/HTML stuff. This is the css for the fake inline rolls using [! Text !] and you could add your own to the code by altering this and using some other combination of characters. Such as [~ Shield ~]. Anything that isn't already use. .replace(/\[\!(.*?)\!\]/g, "<span style='text-align: center; font-size: 100%; font-weight: bold; display: inline-block; min-width: 1.75em; border-radius: 3px; padding: 2px 2px 1px 2px; border: 1px solid; background-color: #FFFEA2; border-color: #87850A; color: #000000;' title='Created by PowerCards' class='showtip tipsy'>$1</span>");
1436463394
DK Heinrich
Marketplace Creator
Sheet Author
cool, thanks - I will try and screw it up later today :)
1436466050

Edited 1436466105
DK Heinrich said: way out of my skill range - but if hes willing to share.... :) EDIT: and that got me thinking - if you can do that to make a purple shield? could you do the same thing to make boxes that are always a color other than the default yellow? and could you have multiple of those boxes (so attack is yellow, defense is green, hit is red, miss is white, ect)? Yes, you could. The issue is that those boxes are fake inline rolls and do not have real tooltips. I may look at adding an inline roll option like [nh] or [trkr] that would allow you to choose the color of the inline roll that way.
1436467794

Edited 1436468039
DK Heinrich
Marketplace Creator
Sheet Author
If you could enter [#000000] and it would pull that color for the box background that might be pretty useful.
Ugh... fuck CSS. Seriously. --Text:|21px height div --Roll:|[[1d20]] 24px height div The extra 3px is coming from 2px worth of borders (top & bottom) and 1px of padding (top) on inline rolls... so, this is why when I float:right the right aligned span/div for ~R inline formatting... the row that it is "in" is not affected by the inline roll padding or border. Which is why when you combine right aligned inline rolls with others, they get all wonky and I don't see any easy way to solve this issue. >_<
1436473439

Edited 1436473493
Silvyre
Forum Champion
While we’re on the topic of customizable formatting—expanding the capacities of the $$ tags from: $$#400|This text will be in dark red.$$ ...to something along the lines of: $$#000000 Helvetica 14px|This is the default body text.$$ ...would definitely herald another great leap forward in the ability to personalize PowerCards. Keep up the great work!
1436475314
Gen Kitty
Forum Champion
I am NOT awake enough to parse the commentary about how to make the shield, so I'll simply attempt to use Big Blue Eyes (TM) on Sean and ask him to show the macro section he's using for the odd purple shape ^_^ I'm getting the bit about changing the color, but changing the shape?
1436475874

Edited 1436476068
GenKitty said: I am NOT awake enough to parse the commentary about how to make the shield, so I'll simply attempt to use Big Blue Eyes (TM) on Sean and ask him to show the macro section he's using for the odd purple shape ^_^ I'm getting the bit about changing the color, but changing the shape? He just added a really big border-radius number to the bottom left and right to get the shield like shape.
1436477479
Gen Kitty
Forum Champion
I'm going to need to see the actual code snippet for that for it to make sense to me, sorry :/
GenKitty said: I'm going to need to see the actual code snippet for that for it to make sense to me, sorry :/ The one I posted before. Just add border-bottom-right-radius and border-bottom-left-radius to the css. Something like this would work. .replace(/\[\~(.*?)\~\]/g, "<span style='text-align: center; font-size: 100%; font-weight: bold; display: inline-block; min-width: 1.75em; padding: 2px 2px 1px 2px; border: 1px solid; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; background-color: #FFFEA2; border-color: #87850A; color: #000000;' title='Created by PowerCards' class='showtip tipsy'>$1</span>");
Ugh... brain hurts. Tired. Going to mess with the padding and other crap later. It's nap time. When I wake, I'll try to sort out the right-align text padding and row height issues.
1436486185

Edited 1436501382
As HB said, I created my own inline mock-up for AC output. Since I am moving most of my attack information with PowerCards to be a table layout, I didn't want to have much in the line of confusion cutting out labels. So, I made a custom inline format for it: .replace(/\†\†(.*?)\†\†/g,"<span style='text-align: center; font-size: 100%; font-weight: bold; vertical-align: text-middle; display: inline-block; min-width: 1.75em; border-radius: 0px 0px 12px 12px; padding: 2px 2px 0px 2px; background-color: #CC99FF; border-color: #62317A; border: 1px solid; color: #000000; cursor: help;' title='Armor Class' class='a inlinerollresult showtip tipsy-n'>$1</span>") Granted, using a Mac, making the † is as simple as pressing Option-T. The output for PowerCards looks like this (with table layout): Granted, it may seem confusing as to what is being looked at, but it makes sense. Top Row (Not including target header): First Attack Roll | AC | Second Attack Roll (if Advantage/Disadvantage). Bottom Row: Damage | Type Damage | Crit Once we can add conditionals to the body, it will allow me to alter the look a bit to hide the crit unless one is scored, but still -- it's functional. I also made one for DC as well, which is shaped like a D, instead of a "shield" for AC: .replace(/\†\$(#([a-fA-F0-9]{3}|[a-fA-F0-9]{6}))\|(.*?)\†\$/g,"<span style='text-align: center; font-size: 100%; font-weight: bold; vertical-align: text-middle; display: inline-block; min-width: 1.75em; border-radius: 0px 9px 9px 0px; padding: 2px 2px 0px 2px; background-color: $1; border-color: #000000; border: 1px solid; color: #000000; cursor: help;' title='DC' class='a inlinerollresult showtip tipsy-n'>$3</span>") That one's a little more complicated because in the custom character sheet, it calls a color coded DC hexadecimal output for each Saving Throw. It also uses a table layout, and changes which layout to use based upon whether there is damage output, or something else (like Charm Person): Top Row (Not including target header): Damage | Type Damage | DC (color coded for what Saving Throw to match) Bottom Row: Successful Save I like to tinker...
Silvyre said: While we’re on the topic of customizable formatting—expanding the capacities of the $$ tags from: $$#400|This text will be in dark red.$$ ...to something along the lines of: $$#000000 Helvetica 14px|This is the default body text.$$ ...would definitely herald another great leap forward in the ability to personalize PowerCards. Keep up the great work! You can add the following to enable the ability to change font size: .replace(/\~\$([0-9]{1}|[0-9]{2})\|(.*?)\~\$/g, "<span style='font-size: $1pt;'>$2</span>") To use, you would do the following: ~$18|This would be 18-point font~$
1436495714
Silvyre
Forum Champion
That's very useful to know, Sean; thank you. HB: just a heads-up that USE_PLAYER_COLOR is currently set to true on gist.
FINALLY! Stupid ass CSS bullshit... I finally kicked it's ass. RAWR! (╯°□°)╯︵ ┻━┻ First, I was trying to solve why adding a right aligned inline roll would cause the text of the tag or rest of the content of that row to move up one pixel. I gave up on that when I noticed the top/bottom padding on other rows was alternating between 6 top 7 bottom and 7 top six bottom. Got that fixed by adding 1em height to inline rolls. This makes the height of the inline rolls match the height of the bodyfontsize text. So I got that working and now the padding is 6/6 top bottom for single lines of text in the default powercard settings... but I was still getting the 1 pixel shift with right aligned inline rolls only. --Tag|~R [[Roll]] ~R would cause the Tag to shift up one causing a 5/7 padding issue that my OCD wouldn't let me leave alone. It took an hour of just jiggling around margins on top of and below the right aligned div and then finally I got it fixed by adding a -1 to the top margin on inline rolls and +1 to the bottom. So three hours later and over thirty layers of screenshots in photoshop (zoomed way in so I could see the pixel grid) ... my OCD is at last satisfied. I'll post the update here in a moment.
1436515258
Gen Kitty
Forum Champion
*patpat* We appreciate your hard work and sacrifices!
GenKitty said: *patpat* We appreciate your hard work and sacrifices! Thank you. I was going nuts trying to fix it... and my OCD wouldn't let me not fix it.
June 10th, 2015 ~ 6:00 am eastern Version: 3.2.7 Link: gist.github.com/Sky-Captain-13/452330a3d926b32da49c 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.
1436532667

Edited 1436532695
I was going nuts trying to fix it... and my OCD wouldn't let me not fix it. I love you so much, let the OCDs of many rejoice this day! Time to upgrade my script!
1436537319
DK Heinrich
Marketplace Creator
Sheet Author
I never bothered to ~R anything... but now I might just have to since all the work was done. On a side note - to those new in here (like me) who read this... I have had nothing but kick ass help from all of the 'big dogs' and from the regular folks like me. The community really does rock, and makes me glad to be a part (albeit small) of it. Ok, done stroking y'all... get back to work coding things I dont know how to :)
1436538450
DK Heinrich
Marketplace Creator
Sheet Author
just updated and rattled off a string of powercards to clip and show one of my players and I noticed that the number in the call out box has shifted up slightly and is now touching the top of the box. I am not using --format, or ~R or ~L I am using custom row colors, and my player color is set to true. the only one that looks like it did pre-update is the 1st callout in the 4th card... and it is a fake one [! x !] the rest are all doing math.
Might be the font you're using.
1436557381
DK Heinrich
Marketplace Creator
Sheet Author
i did not set any custom font and am cutting and pasting the same font from word into roll20 as I was prior to the last update. I will try to paste in a different font now to check, and try a powercard that I have not played with since before the update.
1436557999
DK Heinrich
Marketplace Creator
Sheet Author
older format not adjusted since pre-update 2nd is same as 1st except has a [! x !] that looks normal 3rd is after I changed font in word to something different and re-cut and pasted I have not messed with padding or font - and have not even toyed with custom colors like we discussed above... this is just add in new update and push the button.
1. By font, I mean the font in the script itself. Not the font you type it up in. Line 89 has the PowerCard.bodyfont = "Helvetica" line. 2. What browser are you using?
1436558408
DK Heinrich
Marketplace Creator
Sheet Author
and line 89 shows as Helvetica Chrome
I don't know then. It looks fine on my screen.
1436558963

Edited 1436559021
DK Heinrich
Marketplace Creator
Sheet Author
Line 22: var INLINE_ROLL_STYLE = "text-align: center; font-size: 100%; font-weight: bold; display: inline-block; min-width: 1.75em; height: 1em; border-radius: 3px; margin-top: -1px ; margin-bottom: 1px; padding: 0px; border: 1px solid;"; went into script and search for 'height' and say this - margin-top: -1px is that relevant?
Yes, that has to be there. Margin is outside the border and wouldn't affect the text inside like that.
1436559552
DK Heinrich
Marketplace Creator
Sheet Author
grrr - ok well maybe it will hit someone else so I dont feel so insane.
Are you using a PowerCard Formats handout? If so, what are the settings there?
So of course, the first thing I did after I upgrade was screw around with the padding a bit. And then the in-line rolls... And then all of the shit that I broke... But after a while I think I've got it to something I'm happy with! Thanks for the update HB!
1436789665

Edited 1436793511
DK Heinrich
Marketplace Creator
Sheet Author
sorry HB - I was away from devices all weekend... I am using format on some of those examples and on others I have deleted that line to use the default. The handout I am using is exactly what you have in the example above, it is being used in the 1st example above. The next two have no --format line. what it looks like to me is that the yellow box has shrunk for all my rolls - font looks normal, fake box looks normal - only thing off is the actual size of the call out box. if you can direct me to that portion in the script I will look at it to see what mine says vs others. (but I have reinstealled the newest update twice now and made not mods to it... im willing to try). EDIT: found the section based on our short 'shield box' discussion above - and all my shit is the same. reinstalled again today and same thing. started new campaign and same thing. Not that it should matter but I am also using the following scripts isGM Ammo (modified version by Greysion) Conditions next plan is to disable them and go back to just powercard and work forward made no difference...
1436795762
DK Heinrich
Marketplace Creator
Sheet Author
Line 22: padding: 0px in script as is - and looks like my cards above adjusting to Line 22: padding: 2px looks like it used to look and how the [! !] looks If that will kill something else please let me know - otherwise its my 'fix'
I changed the height to 1em on the inline rolls to make them smaller. And so they would scale better with font size changes. I don't know why your text would stick out of the inline box like that.
1436803551
DK Heinrich
Marketplace Creator
Sheet Author
I messed with the #em also - and making it bigger just gave me more blank space below the number, with the number still sticking out the top. The padding change from 0 to 2 seems to have worked for now. Thank you for looking into it!
1437496903

Edited 1437497691
Been trying out the script with the new update to the site and it appears to have an error crop out now. /home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1 orts, require, module, __filename, __dirname) { function g(a){throw a;}var j=v ^ SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "$" found. Not sure what's suddenly gone wrong in the script now. It was working perfectly last night before the update occurred. Update: Having another look into the matter. It only seems to bug out when there is a dice roll in the powercard itself. Those with just pure decription or inline calculations without the roll work perfectly normal.
I haven't been able to get any of my powercard macros working since the update, actually, even the ones without rolls. Still poking around with it, though.
1437499044
DK Heinrich
Marketplace Creator
Sheet Author
Same boat, all powercards getting above error (my !pic) are working fine - others that i use are used with powercards so not sure how they are doing atm.
1437499138
The Aaron
Pro
API Scripter
Calhanol said: Been trying out the script with the new update to the site and it appears to have an error crop out now. /home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1 orts, require, module, __filename, __dirname) { function g(a){throw a;}var j=v ^ SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "$" found. Not sure what's suddenly gone wrong in the script now. It was working perfectly last night before the update occurred. Can you post your macro (or preferably a minimal reproducible case)?
Thinking about it, it could be since API now works with 3D dice and it is somehow bugging the powercards out.
1437499377
The Aaron
Roll20 Production Team
API Scripter
Go ahead and post in&nbsp; <a href="https://app.roll20.net/forum/post/2211618/new-desi" rel="nofollow">https://app.roll20.net/forum/post/2211618/new-desi</a>...
You need to use the Dev Powercards version starting today on Main. See here:&nbsp;<a href="https://app.roll20.net/forum/permalink/2212062/" rel="nofollow">https://app.roll20.net/forum/permalink/2212062/</a>
1437499880
DK Heinrich
Marketplace Creator
Sheet Author
ok, post on thread The Aaron suggested - will go remove it if that is the problem. I assume that means we hang out until the authors of said scripts push out their update (assuming their dev version is not published somewhere already)?