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 2 (Thread 2)

1428087351

Edited 1431342749
May 9th, 2015 ~ 8:00 pm eastern Version: 2.4.15a Bugfix: Fixed an issue with custom emotes not properly aligning with inline formatting. May 5th, 2015 ~ 5:30 am eastern Version: 2.4.15 Bugfix: Dice rolls with a less than symbol in the expression, such as 1d20cf&lt;3, will show the full tooltip properly now. Minor Update: Justify has been added to inline formatting. Use it the same way as other text alignment. Surround the text to be justified with ~J on either side as below: Example: ~J This text is justified. ~J Minor Update: Emotes now accept left, right, and justify inline formatting (~L, ~R, ~J). Emotes by default are centered. May 5th, 2015 ~ 4:10 am eastern Version: 2.4.14 (no update) This is not an update of the script. Instead, it is an informational update about using roll options like [NH] and [XPND]. You must put a space between the roll option and the opening brackets [[ of an inline roll. This is due to the Nested Inline Rolls update put out by Roll20. If you get the error shown below, you probably have an [NH] roll option without the space in between. GOOD: [[ [NH] 1d6]] BAD: [[[NH] 1d6]] April 29th, 2015 ~ 2:40 pm eastern Version: 2.4.14 Minor Update: Text in custom emotes will wrap around the token/avatar. Minor Update: Removed italics formatting from custom emotes. April 24th, 2015 ~ 11:20 am eastern Version: 2.4.13 Bugfix: Changed the horizontal rule inline formatting to ~~~ instead of ]_[ April 16th, 2015 ~ 12:10 am eastern Version: 2.4.12 Bugfix: Added code to highlight dice rolls using the re-roll once roll option (1d20ro&lt;1 for example). Power Cards 2 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. What this script is not! This is not a script meant to automate combat in any kind of game. It is simply a way to format the output of a macro in a more aesthetically pleasing manner and to facilitate multiple attack rolls within the same macro to reduce screen clutter. 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 mentor 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 Thanks to TheAaron, you can now create powercards on multiple lines in macros as shown below: !power {{ --tokenid|@{selected|token_id} --emote|Pikkle unleashes a blast of eldritch energy. --format|atwill --name|Eldritch Blast --title|Components: V, S ^^ Duration: Instantaneous ^^ Eldritch Blast creates additional beams at 5th, 11th, and 17th level. You can direct all the beams on the same target or at different ones. Make a separate attack roll for each beam. --leftsub|Standard Action --rightsub|Range 120 ft. --Attack:|[[ 1d20cs&gt;2 + 4 [Cha Mod] + 2 [Proficiency] ]] | [[ 1d20 + 4 [Cha Mod] + 2 [Proficiency] ]] vs AC --Hit:|[[ [NH] 1d10 ]] force damage and the target is pushed up to 10 ft away --?{Hit delete to show hex damage|$}Hex:|[[1d6]] necrotic damage --Critical Hit:| --!Crit1|^* **+** [[1d10]] force damage --?{Hit delete to show hex damage|$}!HexCrit|^* **+** [[1d6]] necrotic damage }} The above macros show up as the following... 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 : 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 Hide 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] ]] [NH] - Disables inline roll highlighting for crit success and crit failure. [XPND] - (EXPERIMENTAL) This buggy inline roll option expands the roll into the full formula instead of just the result. [[1d20 + @{Dex Mod}]] becomes [(18) + 3 = 21] instead of [21] 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. @@ <a href="http://www.roll20.net@@" rel="nofollow">www.roll20.net@@</a> - Naked url, requires that ALLOW_URLS to be set to true in the script. @@ <a href="http://www.roll20.net||Roll20@@" rel="nofollow">www.roll20.net||Roll20@@</a> - Hidden url, requires that ALLOW_HIDDEN_URLS to be set to true in the script. @@url||text@@ &lt;-- 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 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.
Have to do this... Whoot! First reply! I never get that in.
The format change (mulitple lines) helps in de-bugging
1428103521
Gen Kitty
Forum Champion
%%who%% needs adding somewhere to the Charms info. ^_^ Thanks for the new thread, I was noticing some extreme chug at times in getting the previous one loaded!
1428105479
The Aaron
Roll20 Production Team
API Scripter
Ditto. I can close the old one if you want. =D
Sure. I was asked by a mod to make the new thread. Wish we had pages so it wouldn't be necessary.
GenKitty said: %%who%% needs adding somewhere to the Charms info. ^_^ Thanks for the new thread, I was noticing some extreme chug at times in getting the previous one loaded! I'll get that done when I get home from work in the morning.
1428243877
vÍnce
Pro
Sheet Author
HoneyBadger said: Sure. I was asked by a mod to make the new thread. Wish we had pages so it wouldn't be necessary. Might I suggest you post suggestions to the Suggestion Forum... :-P
guys i am having a problem, i am trying to clean up my powercard attack roll and damage macros using: !pcpp v0.3 (unsure if its the latest) powercards2.4.6 actoba's 5e D&D sheet. what i want to see is: [[ (1d20cs&gt;@{Selected|meleeweaponcritrange1}) + (@{Selected|pb}) [Prof. Bonus] + (@{Selected|meleeattackstat1}) [Atk Mod] + @{Selected|meleemagic1} [Magic Mod] (@Selected|global_melee_attack_bonus}) [Misc Global Mod] ]] turn into: [[ (1d20cs&gt;20) + (2) [Prof. Bonus] + (3) [Atk Mod] + (1) [Magic Mod] + (4) [Misc Global Mod] ]] for some reason i cant get it to work T.T
1428300681
Gen Kitty
Forum Champion
Can you elaborate on "I can't get it to work"? Tell us what you're doing, what you expect to see happen. and what actually happens.
i am using the !pcpp to try and get this powercard macro: !pcpp --name|@{Selected|meleeweaponname1} --^1Attack *1|[#[ (1d20cs&gt;@{Selected|meleeweaponcritrange1}) + (@#{Selected|pb}) [Prof Bonus] + (@#{Selected|meleeattackstat1}) [Atk Mod] + (@#{Selected|meleemagic1}) [Magic Mod] + (@#{Selected|global_melee_attack_bonus}) [Global Melee Mod] ]#] to show in the mouseover tooltip: Roll: (1d20cs&gt;melee weapon 1's crit on #) + (characters prof bonus) + (atk mod for the weapon) + (magic bonus of weapon) + (global misc mods) or Roll: ((19)) + (2) [Prof Bonus] + (5) [Atk Mod] + (1) [ Magic Mod] + (3) [Global Melee Mod] but what i get is : Roll: (1d20&gt;19) +(0)[ProfBonus] + (0)[AtkMod] + (0)[MagicMod] + (0)[GlobalMeleeMod] Results: ((17)) + (0) + (0) + (0) + (0) = 17 When i input @{Selected|"attribute"} in the chat window it outputs the following: @{Selected|meleeweaponcritrange1} = 19 @{Selected|pb} = (ceil((0 + 0 + 0 + 0 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0)/1e10) + ceil((0 + 0 + 0 + 0 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0)/4)) @{Selected|meleeattackstat1} = (floor((20-10)/2)) @{Selected|meleemagic1} = 1 @{Selected|global_melee_attack_bonus} = 3
1428315317
Gen Kitty
Forum Champion
This may need The Aaron's touch, as PCPP is his baby. You're mixing two scripts together here, plus you've got a character sheet that uses floor and ceil which do not play well with inline rolls. My first guess is that the floor/ceil are causing the primary issues.
Try using [[ [XPND] rollstuff ]] and see what happens. Without the pcpp script stuff.
1428323216
The Aaron
Pro
API Scripter
For the record, unless you've got some other script modifying attributes, there's not reason to use the !pcpp stuff.
1428329390

Edited 1428329482
HoneyBadger said: Try using [[ [XPND] rollstuff ]] and see what happens. Without the pcpp script stuff. !power --name|@{Selected|meleeweaponname1} --^1Attack *1|[[ [XPND] (1d20cs&gt;@{Selected|meleeweaponcritrange1}) + (@{Selected|pb}) [Prof Bonus] + @{Selected|meleeattackstat1} [Atk Mod] + (@{Selected|meleemagic1}) [Magic Mod] + (@{Selected|global_melee_attack_bonus}) [Global Melee Atk Mod] ]] gives me this error: /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: Unexpected end of input at processRoll (evalmachine.&lt;anonymous&gt;:536:34) at evalmachine.&lt;anonymous&gt;:458:16 at Array.forEach (native) at buildInline (evalmachine.&lt;anonymous&gt;:457:27) at Object.PowerCard.Process (evalmachine.&lt;anonymous&gt;:221:16) at evalmachine.&lt;anonymous&gt;:21:19 at eval ( The Aaron said: For the record, unless you've got some other script modifying attributes, there's not reason to use the !pcpp stuff. we use it to allow us a variable number of targets based on math with attributes.
1428329738
The Aaron
Pro
API Scripter
The Sadistic Dungeon Master™, TPKing your party since 1989. said: The Aaron said: For the record, unless you've got some other script modifying attributes, there's not reason to use the !pcpp stuff. we use it to allow us a variable number of targets based on math with attributes. Ah! Very clever!
1428330023
The Aaron
Pro
API Scripter
The Sadistic Dungeon Master™, TPKing your party since 1989. said: HoneyBadger said: Try using [[ [XPND] rollstuff ]] and see what happens. Without the pcpp script stuff. !power --name|@{Selected|meleeweaponname1} --^1Attack *1|[[ [XPND] (1d20cs&gt;@{Selected|meleeweaponcritrange1}) + (@{Selected|pb}) [Prof Bonus] + @{Selected|meleeattackstat1} [Atk Mod] + (@{Selected|meleemagic1}) [Magic Mod] + (@{Selected|global_melee_attack_bonus}) [Global Melee Atk Mod] ]] gives me this error: /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: Unexpected end of input at processRoll (evalmachine.&lt;anonymous&gt;:536:34) at evalmachine.&lt;anonymous&gt;:458:16 at Array.forEach (native) at buildInline (evalmachine.&lt;anonymous&gt;:457:27) at Object.PowerCard.Process (evalmachine.&lt;anonymous&gt;:221:16) at evalmachine.&lt;anonymous&gt;:21:19 at eval ( Without the [XPND], does it have the error? Try replacing each of the @{} reverences with a number, one at a time until the error goes away, then look at what is in the last replaced @{}. Try it without the ! on the front and see if all the math works.
1428341229

Edited 1428341718
removing [XPND] allows everything to roll correctly,
!power --name|TEST --A|[[ [XPND] (1d20cs&gt;19) + (2) + 5 + (1) + (3) ]] produces this error: /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: Unexpected end of input at processRoll (evalmachine. :536:34) at evalmachine. :458:16 at Array.forEach (native) at buildInline (evalmachine. :457:27) at Object.PowerCard.Process (evalmachine. :221:16) at evalmachine. :21:19 at eval (
1428344943
The Aaron
Pro
API Scripter
Great! Minimal repeatable cases always make it easier to debug. I'll try to look at it later tonight, or HB may solve it by then.
1428357566

Edited 1428362232
The error is because of the parentheses around the numbers and the die roll. Will see if I can dig into this further.
Well, you found a bug I need to fix... but it doesn't do anything to solve your original problem, lol. Sorry. You'll have to ask Aaron more about his pcpp script. I have not looked at that one at all.
1428360818
The Aaron
Pro
API Scripter
PCPP just creates a command line and the supporting structure and passes it into your process function. It's entirely possible that fixing those ( ) will fix his original problem, but if not, I'll be happy to debug it! =D
1428363517

Edited 1428364064
The Aaron said: PCPP just creates a command line and the supporting structure and passes it into your process function. It's entirely possible that fixing those ( ) will fix his original problem, but if not, I'll be happy to debug it! =D well that is hopeful news, let me know if i am wrong and pcpp isnt designed for it, but what im trying to do is get the attributes like prof bonus formula and others from the character sheet to be displayed in the mouse over as: 1d20 + (3) [Prof Bonus] + (5) [Ability Mod] + (6) [Magic Mod] + (7) [Global Mod] ( the [Mod] being just labels, and the (#) being the result of formulas in the @{attribute} pulled from the character sheet ) while the powercard shows: Attack: [17] | [12] (1d20cs&gt;@{Selected|meleeweaponcritrange1} + @{Selected|pb} and other attributes from the sheet as above.) vs AC 13 (i use !pcpp **[=[@{target|ac}]=]** here so it doesnt show as [13] )
1428374091
vÍnce
Pro
Sheet Author
HB can you add the link to the latest version at the top the new thread? Pretty please.
1428378817

Edited 1428379625
Oops. Fixed.
1428379809
vÍnce
Pro
Sheet Author
Thank you sir. Now all I need is a script that takes all my current powercarded macros adds the curly brackets {{ }}, and creates a line break just before each tag. Maybe a notepad++ macro can do that for me...?
HoneyBadger said: Oops. Fixed. as in the ( ) error or the link missing?
Missing link. Why are you putting parentheses around the roll anyway? It's not necessary.
1428381485

Edited 1428381637
Vince said: Thank you sir. Now all I need is a script that takes all my current powercarded macros adds the curly brackets {{ }}, and creates a line break just before each tag. Maybe a notepad++ macro can do that for me...? You could write a script to do that in roll20, I think.
1428386039
The Aaron
Pro
API Scripter
HoneyBadger said: Vince said: Thank you sir. Now all I need is a script that takes all my current powercarded macros adds the curly brackets {{ }}, and creates a line break just before each tag. Maybe a notepad++ macro can do that for me...? You could write a script to do that in roll20, I think. You definitely could. =D This does it for attributes, abilities and macros. I tested it on one campaign and it worked fine. You might want to backup your campaign before running it just to be sure. on('ready',function() { "use strict"; var getMultilinedText = function(text){ var acc=[]; _.each( text.split(/\n/), function(t){ var args; if(/^!power.*/.test(t) && !/^!power.*\{\{/.test(t)){ args=t.split(/\s+--/); acc.push(args.shift()+" {{ "); _.each(args,function(a){ acc.push(" --"+a); }); acc.push("}} "); } else { acc.push(t); } }); return acc.join("\n"); }, count = 0; _.each(filterObjs(function(o){ return _.contains(['macro','ability','attribute'], o.get('type')); }), function(o){ var p,t,tp; p = (o.get('type') === 'attribute' ? 'current' : 'action'); t=o.get(p); if(_.isString(t)){ tp=getMultilinedText(t); if(tp !== t) { o.set(p,tp); ++count; } } }); log('PowerCard Calls Multilined: '+count); });
1428388340
vÍnce
Pro
Sheet Author
HoneyBadger said: Vince said: Thank you sir. Now all I need is a script that takes all my current powercarded macros adds the curly brackets {{ }}, and creates a line break just before each tag. Maybe a notepad++ macro can do that for me...? You could write a script to do that in roll20, I think. I couldn't, but Aaron could. :-) Do you ever rest?
1428388820

Edited 1428388921
vÍnce
Pro
Sheet Author
The Aaron said: HoneyBadger said: Vince said: Thank you sir. Now all I need is a script that takes all my current powercarded macros adds the curly brackets {{ }}, and creates a line break just before each tag. Maybe a notepad++ macro can do that for me...? You could write a script to do that in roll20, I think. You definitely could. =D This does it for attributes, abilities and macros. I tested it on one campaign and it worked fine. You might want to backup your campaign before running it just to be sure. "PowerCard Calls Multilined: 5629" THAT is sweet! I'm sure lots of powercard users are going to love this. Thanks Aaron
5,629 powercard macros?! Holy shit...
1428389361
Gen Kitty
Forum Champion
*peers at Vince* over five thousand macros, in one campaign? GOOD LORD, man!
1428389540

Edited 1428389702
vÍnce
Pro
Sheet Author
Yep... I still have a grin after running that script. Truth be told, I use a script from Kevin that auto-generates a crap-ton of ability macros. Obviously, most never get seen or used.
1428389557
The Aaron
Pro
API Scripter
Sleep is for the weak!!! =D Too much coffee tonight... =/
Vince said: Yep... I still have a grin after running that script. Truth be told, I use a script from Kevin that auto-generates a crap-ton of ability macros. Obviously, most never get seen or used. O.O really, could you point us to this wonderous utility? HoneyBadger said: Missing link. Why are you putting parentheses around the roll anyway? It's not necessary. to clean up the mouseover tooltip ive been running into level 3 characters with +20 to hit...
Sounds like your players are filling out their sheets wrong. There's no way a level three character in 5th edition D&D can have a +20 to hit.
HoneyBadger said: Sounds like your players are filling out their sheets wrong. There's no way a level three character in 5th edition D&D can have a +20 to hit. i wish it was that.. some people just need to "win" at D&D, and they have been geting sneaky about it by changing the mods, rolling and changing back.
Find new players then. Those kind of people aren't worth your time as a DM. Seriously.
the problem is, its happening not in my main campaign but in my One shots i use for recruiting to my main campaign. so i end up not taking anyone.
1428408842

Edited 1428408884
Gen Kitty
Forum Champion
I was about to suggest pre-gen characters with journals they don't have control over... but you can't let a player control a linked token without them controlling the journal as well. Meh. You might do your macros a different way. Something like so: (Pretend the numbers are your character fields) !power {{ --name|@{selected|token_name} | Melee Attack --Attack|vs AC --^2BAB:|[[4 [BAB] ]] --Stat Bonus:|3 --Magic Bonus:|2 --Misc Temp Bonus:|?{Misc bonus to hit?|0} --^1Total Bonuses:|[[1d0cf2+ (all the fields referenced above)]] --^0Final total:[[1d20csWHATEVER + (all the fields above)]] --Damage:|1d8 --^2Stat Bonus:|3 --Magic Bonus:|2 --Misc Temp Bonus:|?{Misc Bonus to Damage?|0} --^1Total Bonuses:[[1d0cf2 + (all fields referenced above)]] --^0Final Total [[1d8+ (all fields referenced above)]] }} The 1d0 is because math-only inline 'rolls' do NOT accept inline labels. I was lazy and didn't put all the inline-labels you might because this was just an example. Yes, this is long and spammy, but it lays everything out clearly so no one can argue about anything.
1428416630
vÍnce
Pro
Sheet Author
Bruticus said: Vince said: Yep... I still have a grin after running that script. Truth be told, I use a script from Kevin that auto-generates a crap-ton of ability macros. Obviously, most never get seen or used. O.O really, could you point us to this wonderous utility? This is written for the Pathfinder sheet and it's attributes . I've modded this to work for me. It creates the powercarded ability macros the way I want and they use Aaron's Mark script. You may need to go thru and make changes to have them create the macros to your liking. You may be able to use the script as a guide to create your own 5e version... <a href="https://gist.github.com/vince-roll20/b065ed066ea1fae01c12" rel="nofollow">https://gist.github.com/vince-roll20/b065ed066ea1fae01c12</a> // this script will generate common ability macros for the Pathfinder sheet and add them as ability macros to the selected token // use [ !pcmacro ] --&lt;npc&gt; or &lt;character&gt; NPC's will generate whispered macros. Characters (only the targets info are whispered) Cheers
1428434259

Edited 1428434914
thank you greatly Vince Aaron i noticed you cant use the linebreak macros with !pcpp like: !power {{ --name|Linebreaker testing --leftsub|WARNING --rightsub|INC TEST! --!testline|~C Line Test ~C --Did it break?|yes / no }} With !pcpp T.T it returns only the header with "Undefined": !pcpp {{ --name|Linebreaker testing --leftsub|WARNING --rightsub|INC TEST! --!testline|~C Line Test ~C --Did it break?|yes / no }}
@Bruticus - Sent you a PM regarding a 5e script for creating default macros, as it is unrelated directly to Powercards, I didn't want to further derail the thread.
1428441928

Edited 1428442009
GenKitty said: I was about to suggest pre-gen characters with journals they don't have control over... but you can't let a player control a linked token without them controlling the journal as well. Meh. You might do your macros a different way. Something like so: (Pretend the numbers are your character fields) !power {{ HUGE MACRO &lt;SNIP&gt; }} The 1d0 is because math-only inline 'rolls' do NOT accept inline labels. I was lazy and didn't put all the inline-labels you might because this was just an example. Yes, this is long and spammy, but it lays everything out clearly so no one can argue about anything. this will work great for now until the bug can be found and fixed, thank you. I am hoping to have it all laid out in the mouseover eventually so as not to spam chat... it is soo sad there is such a high turnover from LFG, even after a long skype interview, players in LFG are so hit/miss &gt;.&lt; ... ...that is, when they are not demanding a DM play on thier time/ thier way. Kevin said: @Bruticus - Sent you a PM regarding a 5e script for creating default macros, as it is unrelated directly to Powercards, I didn't want to further derail the thread. thanks mang ill look at at it right quick!
1428442880
The Aaron
Pro
API Scripter
Easy fix, I'll get it rolled out.
Kevin said: @Bruticus - Sent you a PM regarding a 5e script for creating default macros, as it is unrelated directly to Powercards, I didn't want to further derail the thread. Meh. I welcome thread derailments. :D
1428457036
The Aaron
Pro
API Scripter
HoneyBadger said: Meh. I welcome thread derailments. :D YEAH!! BREAK EVERYTHING!!!! <a href="http://youtu.be/MepBeEpEQcM" rel="nofollow">http://youtu.be/MepBeEpEQcM</a> :)
GenKitty said: floor and ceil which do not play well with inline rolls. Any known workarounds for this?