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

[Script] PowerCards 3 (Thread 5)

1523236214

Edited 1543765389
Kurt J.
Pro
API Scripter
PowerCards 3 Current One-Click Install Version : 3.8.8 Current Development Version: 3.8.10 Dev Source Link: <a href="https://gist.github.com/kjaegers/7fd81c55517014704b9fe3986660341c" rel="nofollow">https://gist.github.com/kjaegers/7fd81c55517014704b9fe3986660341c</a> PCM Helper Development Version: 1.0 .2 PCM Helper Source Link: <a href="https://gist.github.com/kjaegers/d73e276e3a5f5b56e197abba441dc0d2" rel="nofollow">https://gist.github.com/kjaegers/d73e276e3a5f5b56e197abba441dc0d2</a> Previous Thread: <a href="https://app.roll20.net/forum/post/4285059/script-powercards-3-thread-4/?pagenum=1" rel="nofollow">https://app.roll20.net/forum/post/4285059/script-powercards-3-thread-4/?pagenum=1</a> Attribute-Based Tags Demo Video: <a href="https://www.youtube.com/watch?v=JwUkdO-F3LQ" rel="nofollow">https://www.youtube.com/watch?v=JwUkdO-F3LQ</a> Templates and Replacements Video: <a href="https://www.youtube.com/watch?v=ESfovaVMddw" rel="nofollow">https://www.youtube.com/watch?v=ESfovaVMddw</a> If you wish to support PowerCards development, there is now a Patreon account set up : <a href="https://www.patreon.com/KurtJaegers" rel="nofollow">https://www.patreon.com/KurtJaegers</a> . Of course, this is completely optional and you should feel in no way obligated to do so. NOTE: This post had grown too large to edit, so I've trimmed out the tag descriptions and most of the table-like structures. For documentation on these options, please visit the PowerCards Wiki Page. I will also keep this post updated with the current change logs from development. See this post : <a href="https://app.roll20.net/forum/post/6264588/script-powercards-3-thread-5/?pageforid=6577204#post-6577204" rel="nofollow">https://app.roll20.net/forum/post/6264588/script-powercards-3-thread-5/?pageforid=6577204#post-6577204</a> for information about manually patching PowerCards to support the 7/11/2018 update to Roll20 to allow your existing macros to work while you update them over time. --- 2018-11-13 Verison 3.8.8 Added the --replaceattrlist tag. See Wiki for details. Cleaned up extraneous log commands that were resulting in clutter in the API console. Updated getSpellMacro function (non-breaking). If the spell macro attribute being referenced begins with a #, it will be assumed to be a global macro. If not, it will be assumed to be an on-character macro and will have the character's ID prepended in the command button. 2018-07-21 Version 3.8.1 You can now use !power, !powercard, or !powercards (with any variation of upper/lower case) to trigger PowerCards. Previously, only !power (all lower case) was allowed. New tag : --replaceattrs creates a number of replacement pairs for a particular character. See this section of the wiki for details. new tag : --replacespell creates a number of replacement pairs for a given spell. See this section of the wiki for details. 2018-07-15 Version 3.8.0 New tag --inlinereplace allows you to define replacement sets without a handout. The format is the same as if you had added the line from a replacement handout into the card (for example, --inlinereplace|Hi|Hello;Bye|Goodbye will produce ~Hi$ and ~Bye$ replacement keys with values of Hello and Goodbye respectively. As with standard replacements, these are processed before any other part of the card, so they can be used in rolls, templates, comparisons, etc. You can use a roll query to assign the value via the chat server as well. Any roll using replacements (of any type) needs to be hidden from the chat server (see the next bullet) and use a Roll ID. You can now use [#[ and ]#] in place of [[ and ]] to prevent the chat server from processing a roll and avoid using replacement variables for [[ and ]]. In these cases, you need to use a roll ID in the roll. For example, --damage|You deal [[ [$dmg] 1d6 ]] and --damage|You deal [#[ [$dmg] 1d6 ]#] are equivalent, but the chat server won't try to process the second one. Multiple replacement, format, and template handouts are now available. As long as your handout name starts with "PowerCard Replacements", "PowerCard Templates", or "PowerCard Formats", the handout will be processed and cumulatively added to the appropriate list. Read order is not guaranteed, so it is best to not have duplicates between handouts. Consolidated code for processing handouts to speed things up a little. Not really noticeable, but worth doing anyway. Handout processing now strips out non-breaking spaces (&amp;nbsp;) and paragraph starts (&lt;p&gt;) sequences, and converts paragraph end (&lt;/p&gt;) sequences to line breaks (&lt;br&gt;) in order to work around issues introduced by the new editor. 2018-07-07 Version 3.7.9 Sandbox protection code. The first part of my effort to implement protection into the PowerCards code base to try to prevent the API Sandbox from being crashed by issues with cards, templates, and replacements. Many of these are uncommon, but adding code the prevent them will help reduce frustration when something goes awry during a game. Added code to the format handout processor to attempt to compensate for oddness introduced by the latest Roll20 update that replaced the text editor. The format processor now strips out all HTML code from the handout lines while processing them. Exposed the Process function so PowerCards can be used by other API scripts (Such as The Aaron's PCPP (PowerCard Pre Processor)). The external function name is PowerCards.Process 2018-06-29 Version 3.7.8 Updated --replacement to accept multiple replacement sets on a single line, separated by semicolons (;) Modified the order that template and replacement tags are processed in to enable additional features Templates now support execution-time optional tags. Prefixing a tag with something in [square brackets] will trigger this evaluation. If the content of the brackets is a simple non-empty value, the tag will be displayed. If they are empty, the tag will not be added to the card. If the contents of the brackets are an evaluatable javascript expression, the tag will be added if the expression is true. 2018-06-18 Version 3.7.7 (See the full post on Page 4 for examples and usage info) -Now supporting templates and replacement values! This is a pretty major update, and will stay on the development GIST for a while before moving to One-Click. PowerCards now supports two new reserved tags: --template : Imports the tags defined in a handout called "PowerCard Templates". Templates are named sets of tags that can include parameters that get passed in by the content of the --template tag when the PowerCard is evaluated. The format for the Templates handout is similar to the PowerCard Formats handout: One line per template (they can wrap around as much as you like, but lines are ended with a carriage return). Templates start with a name, followed by a colon. Then a list of tags denoted by the standard -- prefix. A template can allow for value substitution by including ~#! in the line, where # is a parameter number starting at 0 (so, ~0! is the first parameter, ~1! is the second, and so on). When a template tag is used in a PowerCard macro, it is in the format: --template|TemplateName|Parameter0;Parameter1;Parameter2 @{} notation (like @{selected|character_name}, etc) is supported when calling the template, but not within the template itself (the API doesn't have the necessary information to deal with that notation as it is done by the chat server, which just passes IDs). The position of the template tag in the PowerCard is preserved, so other lines can appear before or after it. --replacement : Basically the opposite of templates. Another new handout called "PowerCard Replacements" can define replacement sets by name, followed by a colon, followed by a list of replacement keys and values. Key/Value pairs are separated from each other with semicolons, and keys and values themselves are separated by vertical bars (|). A replacement tag will look at all of the other tags in the PowerCard and replace the keys with the given values. Keys in a PowerCard are denoted with ~keyname$ notation (start with a ~ and end with a $). Both --template and --replacement can be used multiple times with the "Same Tag" modifier (--template*1, --template*2, etc). They can also be used together. All --template lines are processed first, then all --replacement lines, so values passed in as parameters to templates could be specified by replacement entries. Multiple uses of the replacement tag are cumulative, with earliest definition of a replacement key being the one that will get used. 2018-06-09 - Version 3.7.6 - Fixed a sandbox crash when using the [TRKR] roll modifier with an invalid --charid specified. - Added new formatting tags for creating HTML tables. These are (compared to other PowerCards formatting commands) a bit more complicated to use: The table MUST be properly formatted (opening and closing all tags) and MUST be contained within a single PowerCards tag. The formatting tags are [TTB] and [TTE] to open and close a table (&lt;table&gt; and &lt;/table&gt;), [TRB] and [TRE] to open and close a table row (&lt;tr&gt; and &lt;/tr&gt;) and [TDB] and [TDE] to open and close a table cell (&lt;td&gt; and &lt;/td&gt;).&nbsp; You can place modifiers to the HTML tags inside the square brackets (alignment, coloring, etc). Here is an example: !power {{ &nbsp; --name|Testing &nbsp; --!Hello|~C[TTB 'width=100%' 'bgcolor=Black'][TRB][TDB align=left colspan=10]**$$#fff|Male Dwarf$$**[TDE][TRE] &nbsp; [TRB][TDB width='10%']**$$#fff|B$$**[TDE][TDB width='10%']**$$#fff|A$$**[TDE][TDB width='10%']**$$#fff|R$$**[TDE][TDB width='10%']**$$#fff|S$$**[TDE][TDB width='10%']**$$#fff|W$$**[TDE][TDB width='10%']**$$#fff|L$$**[TDE][TDB width='10%']**$$#fff|I$$**[TDE][TDB width='10%']**$$#fff|C$$**[TDE][TDB width='10%']**$$#fff|EDG$$**[TDE][TDB width='10%']**$$#fff|ESS$$**[TDE][TRE] &nbsp; [TRB 'bgcolor=#444444'][TDB width='10%']**$$#fff|5(6)$$**[TDE][TDB width='10%']**$$#fff|4$$**[TDE][TDB width='10%']**$$#fff|4(5)$$**[TDE][TDB width='10%']**$$#fff|6$$**[TDE][TDB width='10%']**$$#fff|6$$**[TDE][TDB width='10%']**$$#fff|5$$**[TDE][TDB width='10%']**$$#fff|5$$**[TDE][TDB width='10%']**$$#fff|3$$**[TDE][TDB width='10%']**$$#fff|2$$**[TDE][TDB width='10%']**$$#fff|4.3$$**[TDE][TRE][TTE]~C }} which will produce the following: 2018-05-15 - Version 3.7.5 - The action list tags (--npc_action_list, etc) use a different method of detection repeating sections on character sheets (thanks to Jackob's post in another thread!). They will no longer display mislabeled buttons when used on a character sheet that has had its repeating sections reordered. 2018-05-12 - Version 3.7.4 - The --api_ tag will now process inline formatting before sending the API command. This allows the use of RollIDs in API commands, providing a way to use calculated/rolled values in API calls. It might also cause trouble for existing PowerCards using the --api_ tag if any of the inline formatting characters are used in the API string (likely uncommon, but still possible). 2018-05-06 - Version 3.7.3 - Updated the --npc_action_list and --npc_legendaryaction_list tags to check for attributes on the character sheet in the format "action_$0_macro" and "action-l_$0_macro" (with $0 being replaced by the appropriate repeating action index). If a matching value is present for an action, the content of the attribute will be used instead of the default OGL action button, which allows you to specifying a macro to use instead of the standard action (include the #). With the correct macros set up, this allows a summary PowerCard to create&nbsp; buttons that call other PowerCards if defined, with a fallback to the default button format. Specifying "NONE" as the value of the associated attribute will prevent a button from being created for that action at all (attr-based or fallback). - Added --ogl_pc_attack_list tag to generate a list of repeating attack buttons for PCs using the OGL sheet - Updated tags that generate buttons for actions, legendary actions, etc to use the actor's character ID instead of @{selected} so it is not necessary to maintain the token as the selected token in order to use the abilitiy from the power card. - Updated the _list and _summary tags to display a horizontal rule and title if they contain data, and nothing if they don't. This allows for a single macro to be used for PCs and NPCs if desired. 2018-04-14 - Version 3.7.2 - Corrected bugs with the status icon system (specifying a status that did not exist would crash the sandbox). This system looks to me like it was never fully implemented, so I'll be taking a more in-depth look at it in the near future. - Added support for Custom FX in the --vfx_opt and --vfxattr commands. Interestingly, since I need to calculate the angle manually, they aim more accurately than the default effects. - Added getAttrOrEmptyString and outputIfNotEmpty utility functions. - Added getRepeatingCount function to retrieve the number of repeating item entries to prevent spamming the sandbox log with "You tried to access a repeating section..." errors. They didn't hurt anything, but I would rather not clutter the log. - Rewrote the _list and _summary tag code to utilize getRepeatingCount. This makes them sorter and cleans things up a bit. - Moved the check for setting TargetToken outside of the emote section, so we no longer need an emote to use targeted --vfxattr effects. - Modified last updated date format to simply updating the date - Bugfix: --npc_attribute_summary now shows (0) instead of () if an attribute modifier is 0 - First cut at limited multi-sheet support via an attribute translation lookup table. Spell Slots and attributes summary should work for 5E OGL and 5E Shaped now. More work to do on this. 2018-04-10 - Version 3.7.1 - Updated script to be enclosed in an anonymous function to prevent polluting the global area. - Added the "use strict" directive and cleaned up errors that produced with undeclared variables. - Added --spell_slots tag to display a formatted list of available spell slots. - Updated --spell_list to hide the entire row if the list is empty. --- Overview PowerCards allows you to define highly customizable templated output for PC and NPC actions, spells, abilities, statistics, or almost any other purpose you can come up with. Their original purpose was to present ability and attack information (powers) in a format similar to the power blocks from the official D&amp;D 4E products, but the format works well for any system. PowerCards are output to the chat window with full HTML/CSS formatting. A handful of options use information from the 5E OGL sheet, but these options are not critical to the functioning of the core features of the script. Here is an example PowerCard with an NPC attacking one of my player characters: Here we can see that the Grave Hound is attacking our druid Kara with a multiattack that consists of two Necrotic Bite attacks. Both are hits agains Kara's AC of 13. In total, Kara will be taking 7 points of piercing damage and 11 points of Necrotic damage from this attack. Behind the scenes, this card also played a growling sound effect when the hound attacked and showed a splatter of blood on Kara's token since the attack hit. Using the Script A PowerCard is the result of a chat string beginning with the “!power” API command, followed by a list of lines or configuration options you want to display on the card, with the whole thing enclosed in double curly brackets ({{ and }}). These lines and options are identified by tags, which always start with two dashes (--) followed by the tag name. This is followed by a vertical bar (|) and then the content of the tag. The output of the PowerCard is divided into two sections: an optional emote section that identifies the actors, describes the action, etc., and the card itself, which consists of a title block and alternately colored line sections that correspond to the tags on the card. Lets begin by looking at a very simple card: !power {{ --name|Melee Attack --Attack:|[[ 1d20 ]] vs AC }} The output for this card will look something like this: Any line that doesn’t contain a reserved tag name will be displayed as bold text followed by the tag contents. In this case, a 1d20 is being rolled (die rolls are specified by enclosing them in double square brackets) , followed by the rest of the text in the content of the tag. Multiple tags can be used, and will create new rows for each tag: !power {{ --name|Melee Attack --Attack:|[[ 1d20 ]] vs AC --Damage:|Target takes [[ 1d8 + 2 ]] damage on a hit. }} Now we will get output like this: Character Sheet Information Tags These tags are described in the Wiki. Here are a couple of screenshots using them: !power {{ --name|@{selected|character_name} --whisper|GM --format|badguys --emote| --tokenid|@{selected|token_id} --npc_attribute_summary|@{selected|character_id} --npc_qualities_summary|@{selected|character_id} --npc_skills_summary|@{selected|character_id} --!Actions|**Available Actions** --npc_action_list|@{selected|character_id} --!Reactions|**Available Reactions** --npc_reaction_list|@{selected|character_id} --!LA|**Legendary Actions** --npc_legendaryaction_list|@{selected|character_id} --!TR|**@{selected|character_name} Traits** --npc_trait_list|@{selected|character_id} }} Here is an example that combines both the --spell_slots and the --spell_list tags: !power {{ --format|bigbad --orowbg|#CEC7B6 --erowbg|#CEC7B6 --name|Spell List --tokenid|@{selected|token_id} --emote|@{selected|character_name} --leftsub|Atk Bonus: @{selected|spell_attack_bonus} --rightsub|Save DC: @{selected|spell_save_dc} --spell_slots|@{selected|character_id} --spell_list|@{selected|character_id} }}
Hi everyone, I've somes troubles to put multiple attack in macro, i don't understand why. Here the result in picture : Here the macro :&nbsp; !power {{ --tokenid|@{selected|token_id} --emote|**@{selected|token_name}** saute à la gorge de @{target|character_name} --name|Griffes --leftsub|Action --rightsub|Cac 1.5m --target_list|@{target|1st Target|token_id} --Attaque :#2|[[ [$Atk] ?{Advantage?| Normal, 1d20 + [[4]] | Advantage, 2d20kh1 + [[4]] | Disadvantage, 2d20kl1 + [[4]] [PROF]]} ]] vs AC --?? $Atk.base == 1 OR $Atk.total &lt; @{target|AC}?? !Miss:|Echec. --?? $Atk &lt; @{target|AC} ?? soundfx|_play|miss --?? $Atk &gt;= @{target|AC} ?? soundfx|_play|bite --?? $Atk.total &gt;= @{target|AC} AND $Atk.base &lt;&gt; 1 AND $Atk.base &lt;&gt; 20 ?? Dégâts :|[[ [$Dmg] 1d6 + 3]] Dommage Tranchant --?? $Atk &gt;= @{target||ac} AND $Atk.base &lt;&gt; 20 ?? alterbar1|_target|@{target||token_id} _bar|1 _amount|-[^Dmg] _show|all --?? $Atk.base == 20 ?? Coup critique :|[[ [$CritDmg] 2d6 +3]] Dommage Tranchant --?? $Atk.base == 20 ?? alterbar2|_target|@{target||token_id} _bar|1 _amount|-[^CritDmg] _show|all }} The Nothic have 2 attacks, and the 2 rolls is ok, but the damages tick one time only. Thanks for ur advice.
1523268800
Kurt J.
Pro
API Scripter
Every tag is treated as its own separate entity and doesn't know anything about other tags on the card, so while Attaque: #2 will cause that particular line to repeat twice, it doesn't have any impact on the rest of the card (in fact, you'll find that all of the conditionals will be dependent upon the second attack roll, since it overwrites the $Atk RollID. To handle multiple attacks, you would need something along these lines (note I also cleaned up multiple target references so you only get prompted once): !power {{ --tokenid|@{selected|token_id} --emote|**@{selected|token_name}** saute à la gorge de @{target|character_name} --name|Griffes --leftsub|Action --rightsub|Cac 1.5m --target_list|@{target|token_id} --Attaque *1|[[ [$Atk1] ?{Advantage?| Normal, 1d20 + [[4]] | Advantage, 2d20kh1 + [[4]] | Disadvantage, 2d20kl1 + [[4]] [PROF]]} ]] vs AC --?? $Atk1.base == 1 OR $Atk1.total &lt; @{target|AC}?? !Miss*1:|Echec. --?? $Atk1 &lt; @{target|AC} ?? soundfx*1|_play|miss --?? $Atk1 &gt;= @{target|AC} ?? soundfx*2|_play|bite --?? $Atk1.total &gt;= @{target|AC} AND $Atk1.base &lt;&gt; 1 AND $Atk1.base &lt;&gt; 20 ?? Dégâts*1:|[[ [$Dmg1] 1d6 + 3]] Dommage Tranchant --?? $Atk1 &gt;= @{target|AC} AND $Atk1.base &lt;&gt; 20 ?? alterbar*1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg1] _show|all --?? $Atk1.base == 20 ?? Coup critique*1:|[[ [$CritDmg1] 2d6 +3]] Dommage Tranchant --?? $Atk1.base == 20 ?? alterbar*2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg1] _show|all --Attaque *2|[[ [$Atk2] ?{Advantage?| Normal, 1d20 + [[4]] | Advantage, 2d20kh1 + [[4]] | Disadvantage, 2d20kl1 + [[4]] [PROF]]} ]] vs AC --?? $Atk2.base == 1 OR $Atk2.total &lt; @{target|AC}?? !Miss*2:|Echec. --?? $Atk2 &lt; @{target|AC} ?? soundfx*3|_play|miss --?? $Atk2 &gt;= @{target|AC} ?? soundfx*4|_play|bite --?? $Atk2.total &gt;= @{target|AC} AND $Atk2.base &lt;&gt; 1 AND $Atk2.base &lt;&gt; 20 ?? Dégâts*2:|[[ [$Dmg2] 1d6 + 3]] Dommage Tranchant --?? $Atk2 &gt;= @{target|AC} AND $Atk2.base &lt;&gt; 20 ?? alterbar*3|_target|@{target|token_id} _bar|1 _amount|-[^Dmg2] _show|all --?? $Atk2.base == 20 ?? Coup critique*2:|[[ [$CritDmg2] 2d6 +3]] Dommage Tranchant --?? $Atk2.base == 20 ?? alterbar*4|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg2] _show|all }} (I don't use alterbar, so it isn't shown in this screenshot)
That's work perfectly, thanks you.
Hey very minor issue, was wondering if there was an easy fix. So it seems like --spell_list is working great for PCs in taking off their spell slots when they use a spell. However it doesn't seem to be taking the slots off for NPCs. Any ideas?
1523311004
Kurt J.
Pro
API Scripter
Anthony V. said: Hey very minor issue, was wondering if there was an easy fix. So it seems like --spell_list is working great for PCs in taking off their spell slots when they use a spell. However it doesn't seem to be taking the slots off for NPCs. Any ideas? The spellcasting buttons created by the spell_list tag are just links to the spells in the 5E OGL character sheet, so other than creating the button itself, PowerCards isn't involved in that process. Spell slot tracking is handled by the 5E OGL Companion script (if the option to track spells is on), and unfortunately, the 5E OGL Companion Script explicitly excludes NPC spellcasting from spell tracking.
Kurt J. said: Anthony V. said: Hey very minor issue, was wondering if there was an easy fix. So it seems like --spell_list is working great for PCs in taking off their spell slots when they use a spell. However it doesn't seem to be taking the slots off for NPCs. Any ideas? The spellcasting buttons created by the spell_list tag are just links to the spells in the 5E OGL character sheet, so other than creating the button itself, PowerCards isn't involved in that process. Spell slot tracking is handled by the 5E OGL Companion script (if the option to track spells is on), and unfortunately, the 5E OGL Companion Script explicitly excludes NPC spellcasting from spell tracking. Ahh okay gotcha thank you for clarifying that!
Kurt J. said: Anthony V. said: Hey very minor issue, was wondering if there was an easy fix. So it seems like --spell_list is working great for PCs in taking off their spell slots when they use a spell. However it doesn't seem to be taking the slots off for NPCs. Any ideas? The spellcasting buttons created by the spell_list tag are just links to the spells in the 5E OGL character sheet, so other than creating the button itself, PowerCards isn't involved in that process. Spell slot tracking is handled by the 5E OGL Companion script (if the option to track spells is on), and unfortunately, the 5E OGL Companion Script explicitly excludes NPC spellcasting from spell tracking. Just did some testing it does seem to use ammo tracking if the spell rolls for damage, if its a spell like detect magic where its just a spell card it doesn't trigger.
1523377389

Edited 1523377452
Kurt J.
Pro
API Scripter
2018-04-10 - Version 3.7.1 - Updated script to be enclosed in an anonymous function to prevent polluting the global area. - Added the "use strict" directive and cleaned up errors that produced with undeclared variables. - Added --spell_slots tag to display a formatted list of available spell slots. - Updated --spell_list to hide the entire row if the list is empty. (Note: I've submitted this version to the official API repository as a first step towards getting it into the one-click install section, but I will maintain the "external" GIST for testing and more rapid updates. Stable scripts will be pushed to the official repo over time). Here is an example that combines both the --spell_slots and the --spell_list tags: !power {{ --format|bigbad --orowbg|#CEC7B6 --erowbg|#CEC7B6 --name|Spell List --tokenid|@{selected|token_id} --emote|@{selected|character_name} --leftsub|Atk Bonus: @{selected|spell_attack_bonus} --rightsub|Save DC: @{selected|spell_save_dc} --spell_slots|@{selected|character_id} --spell_list|@{selected|character_id} }}
1523408143

Edited 1523411963
Kurt J. said: 2018-04-10 - Version 3.7.1 - Updated script to be enclosed in an anonymous function to prevent polluting the global area. - Added the "use strict" directive and cleaned up errors that produced with undeclared variables. - Added --spell_slots tag to display a formatted list of available spell slots. - Updated --spell_list to hide the entire row if the list is empty. (Note: I've submitted this version to the official API repository as a first step towards getting it into the one-click install section, but I will maintain the "external" GIST for testing and more rapid updates. Stable scripts will be pushed to the official repo over time). Here is an example that combines both the --spell_slots and the --spell_list tags: !power {{ --format|bigbad --orowbg|#CEC7B6 --erowbg|#CEC7B6 --name|Spell List --tokenid|@{selected|token_id} --emote|@{selected|character_name} --leftsub|Atk Bonus: @{selected|spell_attack_bonus} --rightsub|Save DC: @{selected|spell_save_dc} --spell_slots|@{selected|character_id} --spell_list|@{selected|character_id} }} Super cool! I was wondering if there was any way to add for the next wave of suggestions! --pc_attribute_summary|@{selected|character_id} (similar concept with Level instead of CR and player AC instead of NPC AC) --pc_features_summary|@{selected|character_id}&nbsp; (similar concept with as traits but would use the features section ) --pc_skills_summary|@{selected|character_id}&nbsp; (similar concept with skills instead of NPC skills) --pc_action_list|@{selected|character_id} (similar concept with with list of prepared attacks section) Thanks again for the great script!!! I use this as a base right now! !power {{ --name|@{selected|character_name} --format|badguys --emote| --tokenid|@{selected|token_id} --npc_attribute_summary|@{selected|character_id} --AC:|@{selected|ac} --Speed:|@{selected|speed} --**Spell Save DC**| [[@{selected|spell_save_dc}]] ^^**Spell Attack Bonus** [[@{selected|spell_attack_bonus} ]] --spell_slots|@{selected|character_id} --spell_list|@{selected|character_id} -- ~~~ --!Actions|**Available Actions:**^^ [@{selected|repeating_attack_$0_atkname}](~selected|repeating_attack_$0_attack)^^ [@{selected|repeating_attack_$1_atkname}](~selected|repeating_attack_$1_attack)^^ [@{selected|repeating_attack_$2_atkname}](~selected|repeating_attack_$2_attack)^^ [@{selected|repeating_attack_$3_atkname}](~selected|repeating_attack_$3_attack)^^ [@{selected|repeating_attack_$4_atkname}](~selected|repeating_attack_$4_attack)^^ [@{selected|repeating_attack_$5_atkname}](~selected|repeating_attack_$5_attack)^^ [@{selected|repeating_attack_$6_atkname}](~selected|repeating_attack_$6_attack)^^ [@{selected|repeating_attack_$7_atkname}](~selected|repeating_attack_$7_attack)^^ [@{selected|repeating_attack_$8_atkname}](~selected|repeating_attack_$8_attack)^^ [@{selected|repeating_attack_$9_atkname}](~selected|repeating_attack_$9_attack)^^ }}
Greeting, I have a question. This is how my PC' spellbook look like. Now I understand that when I click on the spell buttons, it call for the default spell roll button in the OGL sheet. I'm fine with just using those, but is there a way to incorporate some simple powercard functions like audio and visual effects, without modify the character sheet? I suppose modify the Ability Command Buttons itself would work, but I like the way the script only show prepared spell, because I don't want to redo the spells buttons everytime.
Kurt J. said: 2018-04-10 - Version 3.7.1 - Updated script to be enclosed in an anonymous function to prevent polluting the global area. - Added the "use strict" directive and cleaned up errors that produced with undeclared variables. - Added --spell_slots tag to display a formatted list of available spell slots. - Updated --spell_list to hide the entire row if the list is empty. (Note: I've submitted this version to the official API repository as a first step towards getting it into the one-click install section, but I will maintain the "external" GIST for testing and more rapid updates. Stable scripts will be pushed to the official repo over time). Here is an example that combines both the --spell_slots and the --spell_list tags: !power {{ --format|bigbad --orowbg|#CEC7B6 --erowbg|#CEC7B6 --name|Spell List --tokenid|@{selected|token_id} --emote|@{selected|character_name} --leftsub|Atk Bonus: @{selected|spell_attack_bonus} --rightsub|Save DC: @{selected|spell_save_dc} --spell_slots|@{selected|character_id} --spell_list|@{selected|character_id} }} Will this work only for the OGL sheet, or can it be used with other sheets? I'm currently using the 5e Shaped Sheet, which pretty much has this built in, but I'm looking to try and make a few modifications, maybe.
Yeah, it would be nice if the Shaped sheet printed out the Bonus and the Save but I bet if it was proposed it could get added. Seems simple enough.
1523482621
Kurt J.
Pro
API Scripter
Arthur B. said: Will this work only for the OGL sheet, or can it be used with other sheets? I'm currently using the 5e Shaped Sheet, which pretty much has this built in, but I'm looking to try and make a few modifications, maybe. Jerry F. said: Yeah, it would be nice if the Shaped sheet printed out the Bonus and the Save but I bet if it was proposed it could get added. Seems simple enough. Well, the attack bonus can be shown by changing the PowerCard itself (no coding changes required). In the Shaped sheet, this " --leftsub|Atk Bonus: @{selected|spell_attack_bonus}" would be replaced with " --leftsub|Atk Bonus: @{selected|spell_to_hit}", since spell_to_hit is the name of that attribute on the shaped sheet. I've also been working on a reasonable system for supporting multiple sheet types for the tags that pull info from character sheets. The main requirement is that the sheet must support the "character_sheet" attribute describe by The Aaron in this post :&nbsp; <a href="https://app.roll20.net/forum/post/4714294/characte" rel="nofollow">https://app.roll20.net/forum/post/4714294/characte</a>... I've added support for the Shaped sheet, and am updating the code for the current crop of --npc_* and --spell_* tags right now.
Hi again, I work on my Eclipse Phase macro. In this game, the weapon have some different firing mode and i want one macro per weapon. For exemple, a laser hand have a mode with one single shot (CC), and a mode with 2 quick shot (SA). I made a macro like this, the second mode (SA) dosen't work. I've try a bunch of solutions, but i can't find the good : !power {{ --tokenid|@{selected|token_id} --emote|@{selected|token_name} fait jailler un laser de sa main @{target|character_name} --target_list|@{target|token_id} --name|Mains-Laser --leftsub|Action --rightsub|Distance 75m --Attack|[[ [$Dmg] ?{Mode de tir?| CC, 1d10+1d6-@{target|armor_energy_value}kh1 [CC]] | SA, [[1d10+1d6kh1 - @{target|armor_energy_value}]] [[1d10+1d6kh1 - @{target|armor_energy_value}]] [SA]} ]] --alterbar1|_target|@{target||token_id} _bar|1 _amount|-[^Dmg] _show|all --soundfx|_play|Laser1 --vfx_opt|@{target|token_id} glow-fire }} The CC mode works perfectly : Extra question : in a second time, with de the same problem of different firing mode. Do you think it's possible to have a mode with single target et a mode with multiple target in the same macro ?
1523566882

Edited 1523569124
Hello Kurt, Loving your new additions to powercards. I do have a question about using custom fx on the powercards. I created a custom fx call "critical" but i am not able to fire it once i write it on the&nbsp;--vfx_opt|@{target|token_id} critical. I tried to add blood or other color but it dont work. Do you know if it should be like that or i am missing something? I also wonder if you can explain the&nbsp;--audioattr tag, I read the text but didnt really understood how to use it Thx Danny
1523570153
Kurt J.
Pro
API Scripter
Ziterman S. said: Hi again, I work on my Eclipse Phase macro. In this game, the weapon have some different firing mode and i want one macro per weapon. For exemple, a laser hand have a mode with one single shot (CC), and a mode with 2 quick shot (SA). I made a macro like this, the second mode (SA) dosen't work. I've try a bunch of solutions, but i can't find the good : !power {{ --tokenid|@{selected|token_id} --emote|@{selected|token_name} fait jailler un laser de sa main @{target|character_name} --target_list|@{target|token_id} --name|Mains-Laser --leftsub|Action --rightsub|Distance 75m --Attack|[[ [$Dmg] ?{Mode de tir?| CC, 1d10+1d6-@{target|armor_energy_value}kh1 [CC]] | SA, [[1d10+1d6kh1 - @{target|armor_energy_value}]] [[1d10+1d6kh1 - @{target|armor_energy_value}]] [SA]} ]] --alterbar1|_target|@{target||token_id} _bar|1 _amount|-[^Dmg] _show|all --soundfx|_play|Laser1 --vfx_opt|@{target|token_id} glow-fire }} The CC mode works perfectly : Extra question : in a second time, with de the same problem of different firing mode. Do you think it's possible to have a mode with single target et a mode with multiple target in the same macro ? Generally, you'll need to handle things like this with entirely separate lines/rolls. I do something along these lines for D&D multi-attacks, and have two completely separate sections of attack and damage handling lines because combining them together gets wacky.
1523570426
Kurt J.
Pro
API Scripter
Danny C. said: Hello Kurt, Loving your new additions to powercards. I do have a question about using custom fx on the powercards. I created a custom fx call "critical" but i am not able to fire it once i write it on the&nbsp;--vfx_opt|@{target|token_id} critical. I tried to add blood or other color but it dont work. Do you know if it should be like that or i am missing something? I also wonder if you can explain the&nbsp;--audioattr tag, I read the text but didnt really understood how to use it Thx Danny I have support for Custom FX in my current dev build. They rely on a completely separate command (spawnFxWithDefinition) so there is some additional code to determine if you are attempting to use a custom effect and retrieve the definition and play it. That said, my current code supports Custom FX for both single point and targeted effects by calculating the required angle and modifying the definition (in the script only - doesn't change your Custom FX definition) to fill in the appropriate angle. The upside of the way I'm doing it is that the syntax is exactly the same as the current --vfx tags. It does require that there not be spaces in the effect name, but I don't believe the interface lets you put a space in anyway.
Ok, looking forward on the update then :), thx for answering. What about&nbsp;--audioattr tag, how do I use it correctly? any more examples, i didnt really understood how to use it
1523578377

Edited 1523597632
Kurt J.
Pro
API Scripter
Danny C. said: Ok, looking forward on the update then :), thx for answering. What about&nbsp;--audioattr tag, how do I use it correctly? any more examples, i didnt really understood how to use it Sure thing. I have 5 generic macros for NPC attacks, the only difference between them being the repeating attack number and effect numbers. Here is my #card-atk0 macro I use for Attack #0 that is a single target attack with one damage type: !power {{ --format|badguys --name|@{selected|repeating_npcaction_$0_name} Attack --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|character_name}^^Attacking^^@{target|character_name} --leftsub|Against @{target|token_name} --rightsub|@{selected|repeating_npcaction_$0_attack_type} @{selected|repeating_npcaction_$0_attack_range} --api_token-mod|_ids @{selected|token_id} _ignore-selected _set statusmarkers|stopwatch --audioattr *1|@{selected|token_id} Attack_0_Sound --Attack *1|[[ [$Atk] @{selected|AttackRoll} + @{selected|repeating_npcaction_$0_attack_tohit} ]] vs **AC** [[@{target|BAR2}]] --?? $Atk.base == 1 OR $Atk.total &lt; @{target|BAR2} ?? Miss *1|The attack missed. --?? $Atk.base == 1 OR $Atk.total &lt; @{target|BAR2} ?? audioattr *2|@{selected|token_id} Audio_OnMiss_0 --?? $Atk.total &gt;= @{target|BAR2} AND $Atk.base &lt;&gt; 1 AND $Atk.base &lt;&gt; 20 ?? Hit *1|@{target|token_name} takes [[ @{selected|repeating_npcaction_$0_attack_damage} ]] @{selected|repeating_npcaction_$0_attack_damagetype} damage --?? $Atk.total &gt;= @{target|BAR2} AND $Atk.base &lt;&gt; 1 AND $Atk.base &lt;&gt; 20 ?? vfxattr *1|@{target|token_id} Effect_OnHurt --?? $Atk.total &gt;= @{target|BAR2} AND $Atk.base &lt;&gt; 1 AND $Atk.base &lt;&gt; 20 ?? audioattr *3|@{target|token_id} Audio_OnHurt --?? $Atk.total &gt;= @{target|BAR2} AND $Atk.base &lt;&gt; 1 AND $Atk.base &lt;&gt; 20 ?? audioattr *4|@{selected|token_id} Audio_OnHit_0 --?? $Atk.base == 20 ?? Critical Hit *1:|@{target|token_name} takes [[ @{selected|repeating_npcaction_$0_attack_damage} + @{selected|repeating_npcaction_$0_attack_damage} ]] @{selected|repeating_npcaction_$0_attack_damagetype} damage --?? $Atk.base == 20 ?? vfxattr *2|@{target|token_id} Effect_OnCritical --?? $Atk.base == 20 ?? audioattr *5|@{target|token_id} Audio_OnCritical --?? $Atk.base == 1 ?? Fumble *1|[[ [TXT] 1t[fumble-table]]] --?? $Atk.base == 1 ?? audioattr *6|@{selected|token_id} Audio_OnFumble --!Desc|@{selected|repeating_npcaction_$0_description} --vfxattr *3|@{selected|token_id} Effect_OnAttack_0 }} (Two notes for anyone that might want to adapt this macro: I use BAR2 for armor class in my game; also, I have an attribute on all characters called AttackRoll that is either 1d20, 2d20kh1 or 2d20kl1 to account for normal, advantage, and disadvantage. I have a macro to toggle these based on the situation that updates this attribute instead of using the character sheet to set it). I've bolded the pertinent lines above (audioattr and vfxattr, since for this discussion they both work the same way). This line : &nbsp; --audioattr*1|@{selected|token_id} Attack_0_Sound always runs, and checks to see if the attacker (selected) has an attribute called "Attack_0_Sound" and plays it if so. if the attack miss, this line will run: &nbsp; --?? $Atk.base == 1 OR $Atk.total &lt; @{target|BAR2} ?? audioattr *2|@{selected|token_id} Audio_OnMiss_0 which will look for "Audio_OnMiss_0" on the attacker and play it if it exists. if the attack hits (and isn't a critical) these three lines will run: &nbsp; --?? $Atk.total &gt;= @{target|BAR2} AND $Atk.base &lt;&gt; 1 AND $Atk.base &lt;&gt; 20 ?? vfxattr *1|@{target|token_id} Effect_OnHurt &nbsp; --?? $Atk.total &gt;= @{target|BAR2} AND $Atk.base &lt;&gt; 1 AND $Atk.base &lt;&gt; 20 ?? audioattr *3|@{target|token_id} Audio_OnHurt &nbsp; --?? $Atk.total &gt;= @{target|BAR2} AND $Atk.base &lt;&gt; 1 AND $Atk.base &lt;&gt; 20 ?? audioattr *4|@{selected|token_id} Audio_OnHit_0 The first will play a video effect specified by "Effect_OnHurt" on the target. The second plays an audio track specified by "Audio_OnHurt" on the target, and the third plays an audio track specified by "Audio_OnHit_0" on the attacker. If the attack critically hits, these lines will run: &nbsp; --?? $Atk.base == 20 ?? vfxattr *2|@{target|token_id} Effect_OnCritical &nbsp; --?? $Atk.base == 20 ?? audioattr *5|@{target|token_id} Audio_OnCritical These are mostly the same as on a hit, but they have different attribute names to allow different effects to be played for crits. On a fumble, this line will run: --?? $Atk.base == 1 ?? audioattr *6|@{selected|token_id} Audio_OnFumble to play a sound if the attacker fumbles. finally, this line always runs to play a visual effect (if one is specified) when the attacker attacks: --vfxattr *3|@{selected|token_id} Effect_OnAttack_0 Lets look at four different characters. One of my players is a female elven ranger with a panther companion. I've got a variety of other players as well, but she works as a good example. Female Elf Ranger Attributes: Effect_OnHurt = "t glow-blood" Audio_OnHurt = "--play|FemaleOuch" Panther Attributes: Attack_0_Sound = "--play|CatGrowl" Effect_OnHurt = "t glow-blood" Audio_OnHurt = "--play|AnimalYelp" Skeleton Attributes: Attack_0_Sound = "--play|EQSkeletonLaugh" Audio_OnHurt = "--play|BoneClatter" Audio_OnHit_0 = "--play|BoneCrunch" Baby Dragon: Attack_0_Sound = "--play|DragonBreath" Effect_OnAttack_0 = "s t breath-fire" Because the ranger is a player, she doesn't use the macro above (but a modified one, still generic and similar). All three other characters, though, are NPCs and all use the same macro for their Attack #0. If the skeleton attacks the ranger he will laugh. If the attack hits she will play a pain sound, he will play a bone crunch, and a blood splatter effect will take place on the ranger's token. If the skeleton attacks the panther he will laugh. If the attack hits, the panther will yelp, the skeleton's bone crunch will play, and a blood splatter effect will play on the panther's token. If the panther attacks the skeleton the panther will growl. If the attack hits, the skeleton's bone clatter will play. A blood splatter wouldn't look right here - he's a skeleton :) If the baby dragon attacks the ranger, he will play a fire breath animation from his token towards the ranger and a dragon breath sound will play. If the attack hits, she will play a pain sound and a blood splatter effect will take place on her token. That blood splatter might not be 100% the right thing in this case, but there it is :) The point, though, is that all of these variations are possible with the same macro by using attributes on the characters (PCs and NPCs) to determine what effects (video and audio) get played, and if I don't set up one or more of the attributes, the effects just don't happen. This is very often the case - I rarely have an Effect_OnAttack_* attribute - only if the attack makes sense to have one. Sometimes it also takes some time to find decent audio effects to link to characters, so they might be silent too :) As a side note, I have several old-school EverQuest players in my group... the first time a skeleton attacked them and played the laugh sound, half the group lost it :)
Kurt J. said: Generally, you'll need to handle things like this with entirely separate lines/rolls. I do something along these lines for D&D multi-attacks, and have two completely separate sections of attack and damage handling lines because combining them together gets wacky. Thanks, i'll try this. I try to make a macro for the aptitudes test on Eclipse Phase. !power {{ --tokenid|@{selected|token_id} --tokenid|@{selected|token_id} --emote|**@{selected|token_name}** --titlebackground|none --titlefontshadow|none --corners|10 --format|atwill --name|Aptitudes --Modificateur :|[[ [$Rol] 1d100 ?{Modificateur ?| +30 Impossilbe, +30 | +20 Très difficile, +20 | +10 Difficile, +10 | 0 Normal, 0 | -10 Facile, -10 | -20 Très facile, -20 | -30 Enfntin, -30} ]] --!Aptitude :| ?{Aptitudes| Cognition, **Cognition** ♦ [[@{selected|cog_base}*3 +@{selected|cog_morph} *3]] | Coordination, **Coordination** ♦ [[[[@{selected|coo_base}+@{selected|coo_morph}]] *3 ]] | Intuition, **Intuition** ♦ [[[[ @{selected|int_base}+@{selected|int_morph}]] *3]] | Réflexe, **Réflexe** ♦ [[[[@{selected|ref_base}+@{selected|ref_morph}]] *3]] | Astuce, **Astuce** ♦ [[[[@{selected|sav_base}+@{selected|sav_morph}]] *3]] | Somatique, **Somatique** ♦ [[[[@{selected|som_base}+@{selected|som_morph}]] *3]] | Vonté, **Volonté** ♦ [[[[@{selected|wil_base}+@{selected|wil_morph}]] *3]]} }} In game the result look like that : But, i want to compare the roll of "modificateur" line, with the résults of "!aptitude" line, i've try somes command, but i can't find the solution, i spend few hours on this, that's drive me crazy. I can't assign a roll ID to attribute for compare with the "modificateur" roll. But, maybe you have a better solution.
1523610043
Kurt J.
Pro
API Scripter
I don't know much about Eclipse Phase, but you actually can assign a rollid to those entries by adding a +0d0 (which will always be 0 so won't change the resulting value). The attributes below are from the 5E OGL sheet, but the principal is the same: !power {{ --name|test --testroll|[[ [$score] 1d100 ]] --!roll|?{Pick|Constitution, **Constitution** [[ [$rx] @{selected|constitution} * 2 + @{selected|constitution_mod} + 0d0 ]] | Intelligence, **Intelligence** [[ [$rx] @{selected|intelligence} * 5 + 0d0 ]] } --?? $score.total &gt;= $rx.total ?? Success|You got it --?? $score.total &lt; $rx.total ?? Missed|Sorry! }} The roll id should always be the same ($rx in this case) so that the comparison will work later.
With your example and the 0d0 add, it's ok now ! That't works perfectly, thanks.
But how do the Api, knows which sound to play. As I understand if my character sheet have a attribute called Audio_OnHurt it will play&nbsp;"--play|FemaleOuch". But where do you put the&nbsp;"--play|FemaleOuch". In the jukebox it will be&nbsp;FemaleOuch. But where do i write the&nbsp;--play|FemaleOuch and connected to&nbsp;Audio_OnHurt? Mind for a picture or a small lesson in discord? I got even more lose now :D. DO you just write&nbsp;Audio_OnHurt = "--play|FemaleOuch" on the attribute? Sorry, powercards are my first attempting to coding ever
1523723723
Kurt J.
Pro
API Scripter
Danny C. said: But how do the Api, knows which sound to play. As I understand if my character sheet have a attribute called Audio_OnHurt it will play&nbsp;"--play|FemaleOuch". But where do you put the&nbsp;"--play|FemaleOuch". In the jukebox it will be&nbsp;FemaleOuch. But where do i write the&nbsp;--play|FemaleOuch and connected to&nbsp;Audio_OnHurt? Mind for a picture or a small lesson in discord? I got even more lose now :D. DO you just write&nbsp;Audio_OnHurt = "--play|FemaleOuch" on the attribute? Sorry, powercards are my first attempting to coding ever Ok. This took a while, as I've never even considered recording a YouTube video before, but here you go :) <a href="https://www.youtube.com/watch?v=JwUkdO-F3LQ" rel="nofollow">https://www.youtube.com/watch?v=JwUkdO-F3LQ</a>
Thx you so much Kurt!, great explanation, easy to follow instruction and just a super awesome feature added to powercards. Looking forward t see all you come up with :)
1523737503

Edited 1523738103
Kurt J.
Pro
API Scripter
For some reason, I'm having trouble updating the first post in this thread. Anyway, the development GIST has the 3.7.2 code on it now, with the following changes: 2018-04-14 - Version 3.7.2 - Corrected bugs with the status icon system (specifying a status that did not exist would crash the sandbox). This system looks to me like it was never fully implemented, so I'll be taking a more in-depth look at it in the near future. - Added support for Custom FX in the --vfx_opt and --vfxattr commands. Interestingly, since I need to calculate the angle manually, they aim more accurately than the default effects. - Added getAttrOrEmptyString and outputIfNotEmpty utility functions. - Added getRepeatingCount function to retrieve the number of repeating item entries to prevent spamming the sandbox log with "You tried to access a repeating section..." errors. They didn't hurt anything, but I would rather not clutter the log. - Rewrote the _list and _summary tag code to utilize getRepeatingCount. This makes them sorter and cleans things up a bit. - Moved the check for setting TargetToken outside of the emote section, so we no longer need an emote to use targeted --vfxattr effects. - Modified last updated date format to simply updating the date - Bugfix: --npc_attribute_summary now shows (0) instead of () if an attribute modifier is 0 - First cut at limited multi-sheet support via an attribute translation lookup table. Spell Slots and attributes summary should work for 5E OGL and 5E Shaped now. More work to do on this.
Hello Kurt,&nbsp; When using the custom fx do i have to use the s t for it to work? I tried to use the effect "ball" custom into the vfx optin but dident work. Im i missing something? --vfx_opt|@{target|token_id} ball thx again for your patient Danny
1523820432
Kurt J.
Pro
API Scripter
Danny C. said: Hello Kurt,&nbsp; When using the custom fx do i have to use the s t for it to work? I tried to use the effect "ball" custom into the vfx optin but dident work. Im i missing something? --vfx_opt|@{target|token_id} ball thx again for your patient Danny No, custom effects should work exactly like built-in ones... Keep in mind that the player ribbon has to be on the page in order to see the effect, and effect names are case sensitive, so Ball and ball are two different effects. If you use a non-existent effect name, it should show up as a burning ball of flames, as that appears to be the default effect. The "s" and "t" parameters only apply to attribute-based effects.
Yep, it was sensitive case the problem. Thx you
1523825933

Edited 1523826444
dont know if its possible, just dropping out in the air Kurt, but would it be possible to make it to color the text in just a direct line for example something like --Line 1| [ [Red] This line would come out in red ] --Line 2| [ [Blue] This line would come out in Blue ] --Line 3| This line just come out as the setting of the powercard. Just an idea, I am just throwing things that i think wuld be helpful. As you ask for suggestion and so. The otehr thing was about doing mathematics with the RollID.&nbsp; something like $roll -&nbsp;$attack or&nbsp;$roll.base x&nbsp;$attack.round Hope you udnerstand what i mean Thx you, dont take this as a ungrateful person, i am more than happy with the new features you have put, but just bringing ideas out. You say you where open for suggestions&nbsp; :) Danny
Hello, I was wondering if it was possible to put a conditional in a --name tag in order to have a single powercard for a spell that changes name with it's level.
Hello guys, I am in need on some help to incorporate the ammo script into my powercards. I have a gun that fired in different rate of fires and the player choose for example this boltgun have single and semiauto (3) shots. Atm I have a drop down query wich let the players selcet wich rate of fire they choose, and i would like to connect it to the ammo script but i dont know how. Wonder if i can get some help. I post the script and i mark in bold what i think can be relevant. !power {{ --titlefontshadow|none --titlefont|Georgia --titlefontsize| 20px --orowbg|#D87E7E --erowbg|#DA3C3C --corners|10 --format|Attack --name|Astartes Bolter --rightsub| Tearing --leftsub|100 Meters --tokenid|@{selected|Token_Id} --targettokenid|@{target|token_id} --emote| **@{selected|character_name}** Attacks **@{target|character_name}** --?? $ARoll.base &lt;= $Target ?? Damage|?{Type|Single Shot, [^Dmg1]|Semi Auto, [^Dmg1] ♦️ [^Dmg2] ♦️ [^Dmg3] } ~R **Pen** 4 ~R --Degrees| ~R [[ floor(([[@{Selected|BallisticSkill}+?{Modifier|0}+@{Selected|advanceBS}]] - [$ARoll] 1d100) / 10) ]] ~R --hroll|[[ [$Dmg1] 0d0 + [[2d10kh1 + 9]] ]] [[ [$Dmg2] 0d0 + [[2d10kh1 + 9]] ]] [[ [$Target] 0d0 + [[ @{Selected|BallisticSkill}+?{Modifier|0}+@{Selected|advanceBS} ]] ]] [[ [$Dmg3] 0d0 + [[2d10kh1 + 9]] ]] --?? $ARoll.base &gt; $Target AND $ARoll.base &lt;= 95 ?? Outcome|~R //Miss// ~R --?? $ARoll.base &gt; $Target AND $ARoll.base &gt;= 96 ?? Outcome|~R //Weapon Jam// ~R --?? $ARoll.base &lt;= $Target ?? Outcome|~R //Hit **[^ARoll.base]**// ~R --?? $Dmg1 == 19 AND $ARoll.base &lt;= $Target ?? Righteous Fury 1|~R + [[1d10]] If BS succeed ~R --?? $Dmg2 == 19 AND $ARoll.base &lt;= $Target ?? Righteous Fury 2 |~R + [[1d10]] If BS succeed ~R --?? $Dmg3 == 19 AND $ARoll.base &lt;= $Target ?? Righteous Fury 3|~R + [[1d10]] If BS succeed ~R --?? $ARoll.base &lt;= $Target ?? soundfx1|_play|Bolt Burst --?? $ARoll.base &gt; $Target AND $ARoll.base &lt;= 93 ?? soundfx2|_play|Bullet Miss --?? $ARoll.base &gt; $Target AND $ARoll.base &gt;= 94 ?? soundfx3|_play|Gun Jam }}
1523918448
Kurt J.
Pro
API Scripter
Danny C. said: dont know if its possible, just dropping out in the air Kurt, but would it be possible to make it to color the text in just a direct line for example something like --Line 1| [ [Red] This line would come out in red ] --Line 2| [ [Blue] This line would come out in Blue ] --Line 3| This line just come out as the setting of the powercard. This is actually already in PowerCards :) If you enclose text in $$#XXX| and $$ or $$#XXXXXX| and $$, it will colorize the text using XXX or XXXXXX as a hex color value. For example: --Line 1|$$#900|This line would come out in red$$ would do exactly that. You can also mix and match: --Line 2|This is in $$#900|Red$$, $$#090|Green$$, and $$#009|Blue$$ It was hinted at in Sky's documentation, but the syntax wasn't correct in his post, so it took me a while to puzzle out what the Regex was looking for. The otehr thing was about doing mathematics with the RollID.&nbsp; something like $roll -&nbsp;$attack or&nbsp;$roll.base x&nbsp;$attack.round Hope you udnerstand what i mean Thx you, dont take this as a ungrateful person, i am more than happy with the new features you have put, but just bringing ideas out. You say you where open for suggestions&nbsp; :) Danny There have been a couple of requests for the ability to do math with roll ids. I need to do some thinking about how this would work, so while I can't give a definite answer one way or the other, it is on the list of possibilities. Nicolas B. said: Hello, I was wondering if it was possible to put a conditional in a --name tag in order to have a single powercard for a spell that changes name with it's level. The way PowerCards is written, I don't see any way to easily do this... There is more or less no processing that happens with the 'name' tag, and its value is used directly in the output.
1523918732
Kurt J.
Pro
API Scripter
Danny C. said: Hello guys, I am in need on some help to incorporate the ammo script into my powercards. I have a gun that fired in different rate of fires and the player choose for example this boltgun have single and semiauto (3) shots. Atm I have a drop down query wich let the players selcet wich rate of fire they choose, and i would like to connect it to the ammo script but i dont know how. Wonder if i can get some help. I post the script and i mark in bold what i think can be relevant. What ammo script are you using?
1523920496

Edited 1523920569
Thx Kurt, Dident know it was possible. Is not written in the istructions or? I maybe just dont understand I am using the AAron ammo script !ammo @{selected|token_id} rangeammo1 -1 He told me it would not be possible so he suggested to get another roll query !ammo @{selected|token_id} rangeammo1 -?{shots used|1|3} Any otehr way to bypass this?
Maybe would be good to write about the&nbsp;$$&nbsp;$$ in the instruction under text formating.
1524094528
Kurt J.
Pro
API Scripter
We are now on one-click install! :) As a result (and because the first post in this thread was so large I couldn't edit it any longer) I've moved the bulk of the documentation to the Wiki page ( <a href="https://wiki.roll20.net/Script:PowerCards" rel="nofollow">https://wiki.roll20.net/Script:PowerCards</a> ) . I've updated the formatting documentation section to include the text coloring options.
Cool
Kurt J. said: We are now on one-click install! :) Woot!
1524294302

Edited 1524313497
Kurt J. said: We are now on one-click install! :) As a result (and because the first post in this thread was so large I couldn't edit it any longer) I've moved the bulk of the documentation to the Wiki page ( <a href="https://wiki.roll20.net/Script:PowerCards" rel="nofollow">https://wiki.roll20.net/Script:PowerCards</a> ) . I've updated the formatting documentation section to include the text coloring options. Congrats is well deserved. I come back here because i want to make my macro of one click attack f or Eclipse Phase. But it's a hard macro with 3 phases : 1 / The roll of the selected token for hit. Hit go step 2, Miss stop here. 2/ The roll of the target token for fray. Succes stop here, miss go step 3. 3/ The damages. !power {{ --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|**@{selected|token_name}** tire une rafale sur @{target|character_name} --name|[Fusil-automatique]( <a href="http://journal.roll20.net/handout/-LA23j9-pH2wTRCq6zHn" rel="nofollow">http://journal.roll20.net/handout/-LA23j9-pH2wTRCq6zHn</a> ) --leftsub|Canon électrique --rightsub|Distance 200m --Test |[[ [$Rol] [XPND] 1d100 ?{Modificateur ?| +30 Impossible, +30 | +20 Très difficile, +20 | +10 Difficile, +10 | 0 Normal, 0 | -10 Facile, -10 | -20 Très facile, -20 | -30 Enfantin, -30} ]] --Armes :| [[ [$rx] @{selected|total-Guns} + 0d0 ]] -- ?? $Rol.total &gt; $rx.total ?? Loupé| Tu manques ta cible. --?? $Rol.total &lt;= $rx.total ?? Test d’esquive :|[[ [$Esq] [XPND] 1d100 ?{Esquive Mod ?| +30 Impossible, +30 | +20 Très difficile, +20 | +10 Difficile, +10 | 0 Normal, 0 | -10 Facile, -10 | -20 Très facile, -20 | -30 Enfantin, -30} ]] --?? $Rol.total &lt;= $rx.total ?? Esquive :| [[ [$rz] @{target|total-Fray}/2 + 0d0 ]] -- ?? $Esq.total &gt; $rz.total ?? Résultat| Ta cible anticipe tes tirs. --?? $Esq.total &lt;= $rz.total ?? Dommages :|[[ [$Dmg] {2d10+2+?{Modifier|0}-@{target|armor_kinetic_value}, 0d0}kh1]] --?? $Esq.total &lt;= $rz.total ?? alterbar1|_target|@{target||token_id} _bar|1 _amount|-[^Dmg] _show|all --soundfx|_play|rafale --vfx_opt|@{target|token_id} glow-blood }} !ammo @{selected|token_id} weapon_ammo -10 charges But look at the last lines, they activate even in case of failure : Maybe this macro become more simple if i can make the test of fray or guns in one line ? Thanks for ur advice. EDIT : Ok my brain is on overload but it's work now. !power {{ --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|**@{selected|token_name}** tire une rafale sur @{target|character_name} --name|[Fusil-automatique](<a href="http://journal.roll20.net/handout/-LA23j9-pH2wTRCq6zHn" rel="nofollow">http://journal.roll20.net/handout/-LA23j9-pH2wTRCq6zHn</a>) --leftsub|Canon électrique --rightsub|Distance 200m --Test |[[ [$Rol] [XPND] 1d100 ?{Modificateur ?| +30 Impossible, +30 | +20 Très difficile, +20 | +10 Difficile, +10 | 0 Normal, 0 | -10 Facile, -10 | -20 Très facile, -20 | -30 Enfantin, -30} ]] --Armes :| [[ [$rx] @{selected|total-Guns} + 0d0 ]] -- ?? $Rol.total &gt; $rx.total ?? Loupé| Tu manques ta cible. --?? $Rol.total &lt;= $rx.total ?? Test d’esquive :|[[ [$Esq] [XPND] 1d100 ?{Esquive Mod ?| +30 Impossible, +30 | +20 Très difficile, +20 | +10 Difficile, +10 | 0 Normal, 0 | -10 Facile, -10 | -20 Très facile, -20 | -30 Enfantin, -30} ]] --?? $Rol.total &lt;= $rx.total ?? Esquive :| [[ [$rz] @{target|total-Fray}/2 + 0d0 ]] -- ?? $Esq.total &lt;= $rz.total AND $Rol.total &lt;= $rx.total ?? Résultat| Ta cible anticipe tes tirs. --?? $Esq.total &gt;= $rz.total AND $Rol.total &lt;= $rx.total ?? Dommages :|[[ [$Dmg] {2d10+2+?{Modifier|0}-@{target|armor_kinetic_value}, 0d0}kh1]] --?? $Esq.total &gt;= $rz.total AND $Rol.total &lt;= $rx.total ?? alterbar1|_target|@{target||token_id} _bar|1 _amount|-[^Dmg] _show|all --soundfx|_play|rafale --vfx_opt|@{target|token_id} glow-blood }} !ammo @{selected|token_id} weapon_ammo -10 charges Guns test succes and dodge test fail :&nbsp; Guns test succes and dodge test succes :
1524506968

Edited 1524507097
So i have been setting up basic attack macros for my players using this macro and I am having great success with all but one character. On one I have this as the Macro in the Abilities section of the character sheet: !power {{ --emote|** Attacks ** --titlebackground|none --titlefontshadow|none --whisper|@{Serena|character_name} --corners|10 --format|atwill --name|Attacks --leftsub|@{Serena|character_name} --Attacks:| [@{Serena|repeating_attack_$0_atkname}](~Serena|repeating_attack_$0_attack) [@{Serena|repeating_attack_$1_atkname}](~Serena|repeating_attack_$1_attack) [@{Serena|repeating_attack_$2_atkname}](~Serena|repeating_attack_$2_attack) }} The character name on the sheet is Serena and works without a hitch. On the other however, I have the same code which I will paste below: !power {{ --emote|** Attacks ** --titlebackground|none --titlefontshadow|none --whisper|@{Craigor|character_name}, GM --corners|10 --format|atwill --name|Attacks --leftsub|@{Craigor|character_name} --Attacks:| [@{Craigor|repeating_attack_$0_atkname}](~Craigor|repeating_attack_$0_attack) [@{Craigor|repeating_attack_$1_atkname}](~Craigor|repeating_attack_$1_attack) [@{Craigor|repeating_attack_$2_atkname}](~Craigor|repeating_attack_$2_attack) }} The name on the Character sheet is Craigor but I get the below output in chat The items in plain text seem to actually be hyperlinks that lead to a nothing page on roll20, and I have no earthly idea why. I have recreated the character sheet and all macros from scratch and I still get the same result for this one character. I would super appreciate some help looking into this as I am at a loss as to the cause. Edit: as a note, the whisper to GM portion is just for testing at the moment, and the Serena one worked fine with that in line as well.
I would really like to know how others would handle Wands and stuff that has charges with PowerCards. I use the shaped sheet and I'm trying to wrap my head around something like wand of magic missiles or fireball. I have an idea but I am having a difficult time putting that together in the API form.
1524525126
Kurt J.
Pro
API Scripter
Russell S. said: --Attacks:| [@{Craigor|repeating_attack_$0_atkname}](~Craigor|repeating_attack_$0_attack) [@{Craigor|repeating_attack_$1_atkname}](~Craigor|repeating_attack_$1_attack) [@{Craigor|repeating_attack_$2_atkname}](~Craigor|repeating_attack_$2_attack) What to Craigor's first two entries in the Attacks and Spellcasting section look like in the character sheet when opened for editing?
The attacks look like this
1524611446
Kurt J.
Pro
API Scripter
Hmmm... I don't see anything that should pose a problem. If you type [@{Craigor|repeating_attack_$0_atkname}](~Craigor|repeating_attack_$0_attack) directly into the chat window, does it create a button correctly?
Yep, had no issues at all. Iit seems like it's just within the powercards script and only for this character. Also, I tried rearranging the attacks in case there was something in the first one it didn't like as a lead for some reason. It always does plaintext for all attacks except the last attack in the list, no matter which actual attack is in the last spot.
1524632491

Edited 1524632558
Also, I just did a little testing. I created several more character sheets to see if I could get a similar issue or if it would just work. I made 3, Jim, Zaknizzt, and Barry. Jim displayed the same issue as Craigor, the other 2 did not. I then changed the name of Craigor to something else then Barry to Craigor and it started messing up. Changed it back to Barry and it worked again. tried changing it to Jim and got the broken thing again, then back to Barry and it worked again. So for some reason it almost seems like the script does not like the names Craigor or Jim, which makes absolutely no sense.
OK, so I have now done one more bit of testing. -I created a brand new game, set up power cards, and created a new character sheet for the character Craigor. Still didn't work. -I created another character sheet where the name started with 'C' and it failed in the same way. -Changed the name to just 'C', still failed. -Changed the name to 'B', worked like it is supposed to. -Went through the whole alphabet and it seems there is an issue with the character name starting with the following letters: C, J, L, and R. Not sure if someone with a bit more knowledge of the code behind this script could look into this as it is very odd and on a personal level, makes it so one of my players doesn't get an ease of use macro that everyone else gets, just because he chose the name Craigor for his PC.