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)

1531550312
Kurt J.
Pro
API Scripter
Craven said: Kurt J. said: Craven said: Templates are not working even with simple commands. format:--charid|~0! --emote|~1! <br /> attacks <br /> ~3! --target_list|~2! --name|~4! --format|~5! --leftsub|~6! --rightsub|~7! --Attack|[[ [$Atk]  1d20 + ~8! [~9!] + ~10! [PROF] ]] vs ~11! once I add --Attack|[[ [$Atk]  1d20 + ~8! [~9!] + ~10! [PROF] ]] vs ~11! I get a single grey line. my power card looks like this: !power {{ --template|format|@{selected|character_id};@{selected|token_name};@{target|token_id};@{target|character_name};Longbow;atwill;Ranged;150'/600';@{selected|dexterity_mod};DEX;@{selected|pb};@{target|ac} }} If you can post the full content of your template handout, I'll see if I can duplicate this in my test system. that is the full thing Template format:--charid|~0! --emote|~1! <br /> attacks <br /> ~3! --target_list|~2! --name|~4! --format|~5! --leftsub|~6! --rightsub|~7! --Attack|[[ [$Atk]  1d20 + ~8! [~9!] + ~10! [PROF] ]] vs ~11! Powercard !power {{ --template|format|@{selected|character_id};@{selected|token_name};@{target|token_id};@{target|character_name};Longbow;atwill;Ranged;150'/600';@{selected|dexterity_mod};DEX;@{selected|pb};@{target|ac} }} I had it working up until I tried to add conditions. then it stop. This is the powercard I am trying to template. !power {{ --emote|** @{selected|token_name} Aims a Longbow. ** --tokenid|@{selected|token_id} --titlefontshadow|none --format|atwill --name|Longbow --leftsub|Ranged Attack --rightsub| 150' / 600' --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + 0d0 [Magic] + [[@{selected|dexterity_mod}]] [DEX] + [[@{selected|pb}]] [PROF]] | Advantage, 2d20KH1 + 0d0 [Magic] +[[@{selected|dexterity_mod}]] [DEX] + [[@{selected|pb}]] [PROF]] | Disadvantage, 2d20KL1 + 0d0 [Magic] + [[@{selected|dexterity_mod}]] [DEX] + [[@{selected|pb}]] [PROF]]} ]] vs **AC** [[@{target||npc_ac}]] --?? $Atk < @{target||npc_ac} ?? !Missed|**You missed!** --?? $Atk < @{target||npc_ac} ?? soundfx1|_play|ArrowMiss --?? $Atk >= @{target||npc_ac} ?? soundfx1|_play|ArrowHits --?? $Atk >= @{target||npc_ac} AND $Atk.base <> 20 ?? Hit:|[[ [$Dmg] 1d8 + 0d0 [Magic] + [[@{selected|dexterity_mod}]]]] piercing damage --?? $Atk >= @{target||npc_ac} AND $Atk.base <> 20 ?? alterbar1|_target|@{target||token_id} _bar|1 _amount|-[^Dmg] _show|all --?? $Atk.base == 20 ?? Critical Hit:|[[ [$CritDmg] 2d8 + 0d0 [Magic] + [[@{selected|dexterity_mod}]]]] piercing damage --?? $Atk.base == 20 ?? alterbar2|_target|@{target||token_id} _bar|1 _amount|-[^CritDmg] _show|all --?? $Atk.base == 1 ?? !|**Fumble:** [[ [TXT] 1t[CFSRW] ]] --Ammo:|[[@{other_resource}]] **@{other_resource_name} left.** }} Thanks Frustratingly enough, I think this is another case of the new editor interfering. When I pasted your template into my game, this line: --Attack|[[ [$Atk]  1d20 + ~8! [~9!] + ~10! [PROF] ]] vs ~11! caused a problem because there are two spaces after [$Atk]. The editor replaced one of them with   which the roll system doesn't know what to do with. After I take out the second space, everything works as intended. I've uploaded 3.8.0 to the dev gist that strips out   characters from all three handout types, so if you update to that it should no longer be an issue, even if the editor throws them in.
1531581756

Edited 1531582307
Kurt J. said: Craven said: Kurt J. said: Craven said: Templates are not working even with simple commands. format:--charid|~0! --emote|~1! <br /> attacks <br /> ~3! --target_list|~2! --name|~4! --format|~5! --leftsub|~6! --rightsub|~7! --Attack|[[ [$Atk]  1d20 + ~8! [~9!] + ~10! [PROF] ]] vs ~11! once I add --Attack|[[ [$Atk]  1d20 + ~8! [~9!] + ~10! [PROF] ]] vs ~11! I get a single grey line. my power card looks like this: !power {{ --template|format|@{selected|character_id};@{selected|token_name};@{target|token_id};@{target|character_name};Longbow;atwill;Ranged;150'/600';@{selected|dexterity_mod};DEX;@{selected|pb};@{target|ac} }} If you can post the full content of your template handout, I'll see if I can duplicate this in my test system. that is the full thing Template format:--charid|~0! --emote|~1! <br /> attacks <br /> ~3! --target_list|~2! --name|~4! --format|~5! --leftsub|~6! --rightsub|~7! --Attack|[[ [$Atk]  1d20 + ~8! [~9!] + ~10! [PROF] ]] vs ~11! Powercard !power {{ --template|format|@{selected|character_id};@{selected|token_name};@{target|token_id};@{target|character_name};Longbow;atwill;Ranged;150'/600';@{selected|dexterity_mod};DEX;@{selected|pb};@{target|ac} }} I had it working up until I tried to add conditions. then it stop. This is the powercard I am trying to template. !power {{ --emote|** @{selected|token_name} Aims a Longbow. ** --tokenid|@{selected|token_id} --titlefontshadow|none --format|atwill --name|Longbow --leftsub|Ranged Attack --rightsub| 150' / 600' --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + 0d0 [Magic] + [[@{selected|dexterity_mod}]] [DEX] + [[@{selected|pb}]] [PROF]] | Advantage, 2d20KH1 + 0d0 [Magic] +[[@{selected|dexterity_mod}]] [DEX] + [[@{selected|pb}]] [PROF]] | Disadvantage, 2d20KL1 + 0d0 [Magic] + [[@{selected|dexterity_mod}]] [DEX] + [[@{selected|pb}]] [PROF]]} ]] vs **AC** [[@{target||npc_ac}]] --?? $Atk < @{target||npc_ac} ?? !Missed|**You missed!** --?? $Atk < @{target||npc_ac} ?? soundfx1|_play|ArrowMiss --?? $Atk >= @{target||npc_ac} ?? soundfx1|_play|ArrowHits --?? $Atk >= @{target||npc_ac} AND $Atk.base <> 20 ?? Hit:|[[ [$Dmg] 1d8 + 0d0 [Magic] + [[@{selected|dexterity_mod}]]]] piercing damage --?? $Atk >= @{target||npc_ac} AND $Atk.base <> 20 ?? alterbar1|_target|@{target||token_id} _bar|1 _amount|-[^Dmg] _show|all --?? $Atk.base == 20 ?? Critical Hit:|[[ [$CritDmg] 2d8 + 0d0 [Magic] + [[@{selected|dexterity_mod}]]]] piercing damage --?? $Atk.base == 20 ?? alterbar2|_target|@{target||token_id} _bar|1 _amount|-[^CritDmg] _show|all --?? $Atk.base == 1 ?? !|**Fumble:** [[ [TXT] 1t[CFSRW] ]] --Ammo:|[[@{other_resource}]] **@{other_resource_name} left.** }} Thanks Frustratingly enough, I think this is another case of the new editor interfering. When I pasted your template into my game, this line: --Attack|[[ [$Atk]  1d20 + ~8! [~9!] + ~10! [PROF] ]] vs ~11! caused a problem because there are two spaces after [$Atk]. The editor replaced one of them with   which the roll system doesn't know what to do with. After I take out the second space, everything works as intended. I've uploaded 3.8.0 to the dev gist that strips out   characters from all three handout types, so if you update to that it should no longer be an issue, even if the editor throws them in. I uploaded 3.8 and even removed the space and I still get the same output. So frustrating but I would like to thank you for your effort. I strip ever thing from the template and started over and it seems to be working. Will templates work with ?{ Advantage?| normal,
1531584561

Edited 1531584700
Kurt J.
Pro
API Scripter
Craven said: Will templates work with ?{ Advantage?| normal, Not in the template part, but it can be used in the macro itself (2d20kh1, 1d20, 2d20kl1) as a parameter the template uses. Roll Queries are done by the chat server, so having them in a template will just produce the text. If you look at the templates I posted above, I define replacement sets for the attributes set on the OGL sheet when you pick Advangate/Normal/Disadvantage and use those as replacements for the three dice types. This allows my players to manage advantage on their character sheet without a popup every time they do something, but that is really just a personal preference... some find it annoying to open the character sheet to change it every time the situation changes :) If you really want to get into the weeds, line 247 of 3.8.0 contains   //log(entry); which is a commented out command to output every template line to the API log. If you uncomment it (remove the // at the beginning) you can see what the script thinks it is dealing with to see if the editor is adding any other weirdness to the handout.
well with the help of Victor B I got the sound working again my config was showing a blank window but all of a sudden it started working. Vol was %1. I changed the Vol to 100%, removed all then imported again. The new command in powercards is --?? $Atk < @{target||npc_ac} ?? soundfx|_audio,play,nomenu|ArrowMiss --?? $Atk >= @{target||npc_ac} ?? soundfx|_audio,play,nomenu|ArrowHits
1531666577

Edited 1531672858
Is there a way to have Power Cards store a selected Level? --hroll|[[ [$Level] ?{Level?|1|2|3|4|5|6|7|8|9} ]] I am intending on using it in a situation of spells: At Higher Level: [[ [^Level] * 1d6 ]] damage Then again, I could easily do: --?? $Level==1 ?? Damage| [[1d6]] damage --?? $Level==2 ?? Damage| [[2d6]] damage --?? $Level==3 ?? Damage| [[3d6]] damage --?? $Level==4 ?? Damage| [[4d6]] damage --?? $Level==5 ?? Damage| [[5d6]] damage --?? $Level==6 ?? Damage| [[6d6]] damage --?? $Level==7 ?? Damage| [[7d6]] damage --?? $Level==8 ?? Damage| [[8d6]] damage --?? $Level==9 ?? Damage| [[9d6]] damage EDIT: Found the solution
1531672785
Kurt J.
Pro
API Scripter
Theodore S. said: Is there a way to have Power Cards store a selected Level? --hroll|[[ [$Level] ?{Level?|1|2|3|4|5|6|7|8|9} ]] I am intending on using it in a situation of spells: At Higher Level: [[ [^Level] * 1d6 ]] damage Then again, I could easily do: --?? $Level==1 ?? Damage| [[1d6]] damage --?? $Level==2 ?? Damage| [[2d6]] damage --?? $Level==3 ?? Damage| [[3d6]] damage --?? $Level==4 ?? Damage| [[4d6]] damage --?? $Level==5 ?? Damage| [[5d6]] damage --?? $Level==6 ?? Damage| [[6d6]] damage --?? $Level==7 ?? Damage| [[7d6]] damage --?? $Level==8 ?? Damage| [[8d6]] damage --?? $Level==9 ?? Damage| [[9d6]] damage At the moment you can't do this directly, due to the sequence in which things get processed, however you could use replacement sets to do this. If you defined nine replacement sets: Level1:L|1 Level2:L|2 Level3:L|3 ... and so on... (No, I don't know why the editor thinks those are links above... *sigh*) You could include the level prompt in the card: --replacement|Level?{Level?|1|2|3|4|5|6|7|8|9} This would mean you would have a replacement key (~L$) that you could then use in the rest of the card, with the advantage that you don't need all of the conditional lines because it will substitute in the replacement key (but you need to use roll IDs, and might need to use replacements for [[ and ]] (I'm typing this off the top of my head :)) !power {{ --name|Testing --replacement|Level?{Level?|1|2|3|4|5|6|7|8|9} --Damage|Your spell deals [[ [$dmg] ~L$d6 damage ]] }} As I said above, it may be necessary to replace the [[ and ]] with replacement keys. I do have plans to remove/work around that requirement, but they aren't in the code yet.
Theodore S. said: Is there a way to have Power Cards store a selected Level? --hroll|[[ [$Level] ?{Level?|1|2|3|4|5|6|7|8|9} ]] I am intending on using it in a situation of spells: At Higher Level: [[ [^Level] * 1d6 ]] damage Then again, I could easily do: --?? $Level==1 ?? Damage| [[1d6]] damage --?? $Level==2 ?? Damage| [[2d6]] damage --?? $Level==3 ?? Damage| [[3d6]] damage --?? $Level==4 ?? Damage| [[4d6]] damage --?? $Level==5 ?? Damage| [[5d6]] damage --?? $Level==6 ?? Damage| [[6d6]] damage --?? $Level==7 ?? Damage| [[7d6]] damage --?? $Level==8 ?? Damage| [[8d6]] damage --?? $Level==9 ?? Damage| [[9d6]] damage If you are using the characters level you can use something like [[(@{base_level})]]d6 I use ?{Sneak Attack|no, 0|yes, [[ceil((@{base_level}) / 2)]]}d6 for rogue sneak attack. Again you can't use [^Level]  * At Higher Level: [[ [^Level] * 1d6 ]] damage
Theodore S. said: Is there a way to have Power Cards store a selected Level? --hroll|[[ [$Level] ?{Level?|1|2|3|4|5|6|7|8|9} ]] I am intending on using it in a situation of spells: At Higher Level: [[ [^Level] * 1d6 ]] damage Then again, I could easily do: --?? $Level==1 ?? Damage| [[1d6]] damage --?? $Level==2 ?? Damage| [[2d6]] damage --?? $Level==3 ?? Damage| [[3d6]] damage --?? $Level==4 ?? Damage| [[4d6]] damage --?? $Level==5 ?? Damage| [[5d6]] damage --?? $Level==6 ?? Damage| [[6d6]] damage --?? $Level==7 ?? Damage| [[7d6]] damage --?? $Level==8 ?? Damage| [[8d6]] damage --?? $Level==9 ?? Damage| [[9d6]] damage EDIT: Found the solution Solution I came up with !power {{ --hroll|[[ [$Level] ?{Level?|1, 1 + 1d0|2, 2 + 1d0|3, 3 + 1d0|4, 4 + 1d0|5, 5 + 1d0|6, 6 + 1d0|7, 7 + 1d0|8, 8 + 1d0|9, 9 + 1d0} ]] --emote|** @{selected|token_name} cast Guiding Bolt at @{target|1st|character_name}** --tokenid|@{selected|token_id} --format|attacks --corners|10 --name|Guiding Bolt --leftsub|Spell Attack --rightsub|Ranged --Range| 60 feet --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + [[ @{selected|spell_attack_bonus} ]] | Advantage, 2d20KH1 + [[ @{selected|spell_attack_bonus} ]] | Disadvantage, 2d20KL1 + [[ @{selected|spell_attack_bonus} } ]] vs **AC** [[ @{target|1st|npc_ac} ]] --?? $Atk < @{target|1st|npc_ac} ?? !Missed|**You missed!** --?? $Atk >= @{target|1st|npc_ac} AND $Atk.base <> 20 AND $Level.base == 9 ?? Level 9 Damage:|[[ 12d6 ]] radiant damage --?? $Atk.base == 20 AND $Level.base == 9 ?? Level 9 Critical Hit:|[[ 24d6 ]] radiant damage --?? $Atk >= @{target|1st|npc_ac} AND $Atk.base <> 20 AND $Level.base == 8 ?? Level 8 Damage:|[[ 11d6 ]] radiant damage --?? $Atk.base == 20 AND $Level.base == 8 ?? Level 8 Critical Hit:|[[ 22d6 ]] radiant damage --?? $Atk >= @{target|1st|npc_ac} AND $Atk.base <> 20 AND $Level.base == 7 ?? Level 7 Damage:|[[ 10d6 ]] radiant damage --?? $Atk.base == 20 AND $Level.base == 7 ?? Level 7 Critical Hit:|[[ 20d6 ]] radiant damage --?? $Atk >= @{target|1st|npc_ac} AND $Atk.base <> 20 AND $Level.base == 6 ?? Level 6 Damage:|[[ 9d6 ]] radiant damage --?? $Atk.base == 20 AND $Level.base == 6 ?? Level 6 Critical Hit:|[[ 18d6 ]] radiant damage --?? $Atk >= @{target|1st|npc_ac} AND $Atk.base <> 20 AND $Level.base == 5 ?? Level 5 Damage:|[[ 8d6 ]] radiant damage --?? $Atk.base == 20 AND $Level.base == 5 ?? Level 5 Critical Hit:|[[ 16d6 ]] radiant damage --?? $Atk >= @{target|1st|npc_ac} AND $Atk.base <> 20 AND $Level.base == 4 ?? Level 4 Damage:|[[ 7d6 ]] radiant damage --?? $Atk.base == 20 AND $Level.base == 4 ?? Level 4 Critical Hit:|[[ 14d6 ]] radiant damage --?? $Atk >= @{target|1st|npc_ac} AND $Atk.base <> 20 AND $Level.base == 3 ?? Level 3 Damage:|[[ 6d6 ]] radiant damage --?? $Atk.base == 20 AND $Level.base == 3 ?? Level 3 Critical Hit:|[[ 12d6 ]] radiant damage --?? $Atk >= @{target|1st|npc_ac} AND $Atk.base <> 20 AND $Level.base == 2 ?? Level 2 Damage:|[[ 5d6 ]] radiant damage --?? $Atk.base == 20 AND $Level.base == 2 ?? Level 2 Critical Hit:|[[ 10d6 ]] radiant damage --?? $Atk >= @{target|1st|npc_ac} AND $Atk.base <> 20 AND $Level.base == 1 ?? Level 1 Damage:|[[ 4d6 ]] radiant damage --?? $Atk.base == 20 AND $Level.base == 1 ?? Level 1 Critical Hit:|[[ 8d6 ]] radiant damage --?? $Atk.base == 1 ?? !|**Fumble:** --Effect|A flash of light streaks toward a creature of your choice within range. Make a ranged spell attack against the target. On a hit, the target takes 4d6 radiant damage, and the next attack roll made against this target before the end of your next turn has advantage, thanks to the mystical dim light glittering on the target until then.^^ ^^ When you cast this spell using a spell slot of 2nd level or higher, the damage increases by 1d6 for each slot level above 1st. }}
1531676353

Edited 1531676628
Powercard for the Guiding Bolt Spell !power {{ --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|token_name} ^^ attacks ^^ @{target|token_name} --format|atwill --name|Guiding Bolt --leftsub|Spell Range Attack --rightsub|120' --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]] | Advantage, 2d20KH1 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]] | Disadvantage, 2d20KL1 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]]} ]] vs **AC** [[@{target|npc_ac}]] --?? $Atk < @{target|npc_ac} ?? !Missed|**You missed!** --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? Hit:|[[ [$Dmg] ?{Spell Level?|1, 4|2,5|3,6|4,7|5,8|6,9|7,10|8,11|9,12}d6 ]] Radiant Damage --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all --?? $Atk.base == 20 ?? Critical Hit:|[[ [$CritDmg] ?{Spell Level?|1, 4|2,5|3,6|4,7|5,8|6,9|7,10|8,11|9,12}d6 +(?{Spell Level?})d6 ]] Radiant Damage --?? $Atk.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg] _show|all --?? $Atk.base == 1 ?? !|**Fumble:** Spell goes horrible wrong! --Description:|A flash of light streaks toward a creature of your choice within range. Make a ranged spell attack against the target. On a hit, the target takes 4d6 radiant damage, and the next attack roll made against this target before the end of your next turn has advantage, thanks to the mystical dim light glittering on the target until then. --Higher Level:| When you cast this spell using a spell slot of 2nd level or higher, the damage increases by 1d6 for each slot level above 1st. }}
1531678146

Edited 1531678423
Kurt J.
Pro
API Scripter
Version 3.8.0 on the development server has been updated with the following changes: 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 ( ) and paragraph starts (<p>) sequences, and converts paragraph end (</p>) sequences to line breaks (<br>) in order to work around issues introduced by the new editor.
Kurt J. said: Version 3.8.0 on the development server has been updated with the following changes: 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 ( ) and paragraph starts (<p>) sequences, and converts paragraph end (</p>) sequences to line breaks (<br>) in order to work around issues introduced by the new editor. What is the purpose for the following section? 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.
Theodore S. said: Kurt J. said: Version 3.8.0 on the development server has been updated with the following changes: 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 ( ) and paragraph starts (<p>) sequences, and converts paragraph end (</p>) sequences to line breaks (<br>) in order to work around issues introduced by the new editor. What is the purpose for the following section? 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. Did you watch his video of templates and replacements ? I there he explains the chats server doesn't know what to do with the replacement variables and this is his work around 
1531685391

Edited 1531685421
Kurt J.
Pro
API Scripter
Theodore S. said What is the purpose for the following section? 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. If a rolls is not valid at chat-time, the chat server will throw an error unless the fact that it is a roll is hidden from the chat server. Because templates and replacements substitute values for codes that are not valid roll components by themselves, some mechanism to hide them is necessary. For example, this roll: [[ [$dmg] ~DamageDice$ + ~AbilityMod$ [~AbilityName$] ]] would be completely invalid at chat-time (when the macro gets passed to PowerCards), but using replacement variables it would actually resolve to a valid roll after they had been filled in. If the chat server tries to process it, it will say something like "expected [, { ...blah...blah...blah but found `" or some such. By replacing this with [#[ [$dmg] ~DamageDice$ + ~AbilityMod$ [~AbilityName$] ]#] the chat server doesn't recognize it as a roll, so it doesn't complain about it. Previous to 3.8.0, you could define replacements (I use ~RB$ and ~RE$ for [[ and ]] (Roll Begin and Roll End), but this notation [#[ and ]#] is easier/simpler.
1531687463

Edited 1531687546
Craven said: Powercard for the Guiding Bolt Spell !power {{ --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|token_name} ^^ attacks ^^ @{target|token_name} --format|atwill --name|Guiding Bolt --leftsub|Spell Range Attack --rightsub|120' --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]] | Advantage, 2d20KH1 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]] | Disadvantage, 2d20KL1 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]]} ]] vs **AC** [[@{target|npc_ac}]] --?? $Atk < @{target|npc_ac} ?? !Missed|**You missed!** --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? Hit:|[[ [$Dmg] ?{Spell Level?|1, 4|2,5|3,6|4,7|5,8|6,9|7,10|8,11|9,12}d6 ]] Radiant Damage --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all --?? $Atk.base == 20 ?? Critical Hit:|[[ [$CritDmg] ?{Spell Level?|1, 4|2,5|3,6|4,7|5,8|6,9|7,10|8,11|9,12}d6 +(?{Spell Level?})d6 ]] Radiant Damage --?? $Atk.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg] _show|all --?? $Atk.base == 1 ?? !|**Fumble:** Spell goes horrible wrong! --Description:|A flash of light streaks toward a creature of your choice within range. Make a ranged spell attack against the target. On a hit, the target takes 4d6 radiant damage, and the next attack roll made against this target before the end of your next turn has advantage, thanks to the mystical dim light glittering on the target until then. --Higher Level:| When you cast this spell using a spell slot of 2nd level or higher, the damage increases by 1d6 for each slot level above 1st. }} I love this method for the spells. Now is there any way to integrate this with: !setattr --name @{selected|character_name} --modb --lvl1_slots_expended|-1 --silent !power {{ --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|token_name} ^^ attacks ^^ @{target|token_name} --format|atwill --name|Guiding Bolt --leftsub|Spell Range Attack --rightsub|120'  --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]] | Advantage, 2d20KH1 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]] | Disadvantage, 2d20KL1 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]]} ]] vs **AC** [[@{target|npc_ac}]] --?? $Atk < @{target|npc_ac} ?? !Missed|**You missed!** --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? Hit:|[[ [$Dmg] ?{Spell Level?|1, 4|2,5|3,6|4,7|5,8|6,9|7,10|8,11|9,12}d6 ]] Radiant Damage --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all --?? $Atk.base == 20 ?? Critical Hit:|[[ [$CritDmg] ?{Spell Level?|1, 4|2,5|3,6|4,7|5,8|6,9|7,10|8,11|9,12}d6 +(?{Spell Level?})d6 ]] Radiant Damage --?? $Atk.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg] _show|all --?? $Atk.base == 1 ?? !|**Fumble:** Spell goes horrible wrong! --Description:|A flash of light streaks toward a creature of your choice within range. Make a ranged spell attack against the target. On a hit, the target takes 4d6 radiant damage, and the next attack roll made against this target before the end of your next turn has advantage, thanks to the mystical dim light glittering on the target until then. --Higher Level:| When you cast this spell using a spell slot of 2nd level or higher, the damage increases by 1d6 for each slot level above 1st. --Spell Slots Left:|  [[ @{selected|lvl1_slots_expended} - 1 ]] }} Of course have spell slots deplete depending on your Spell Level selection.
1531698908

Edited 1531699818
Theodore S. said: Craven said: Powercard for the Guiding Bolt Spell !power {{ --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|token_name} ^^ attacks ^^ @{target|token_name} --format|atwill --name|Guiding Bolt --leftsub|Spell Range Attack --rightsub|120' --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]] | Advantage, 2d20KH1 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]] | Disadvantage, 2d20KL1 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]]} ]] vs **AC** [[@{target|npc_ac}]] --?? $Atk < @{target|npc_ac} ?? !Missed|**You missed!** --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? Hit:|[[ [$Dmg] ?{Spell Level?|1, 4|2,5|3,6|4,7|5,8|6,9|7,10|8,11|9,12}d6 ]] Radiant Damage --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all --?? $Atk.base == 20 ?? Critical Hit:|[[ [$CritDmg] ?{Spell Level?|1, 4|2,5|3,6|4,7|5,8|6,9|7,10|8,11|9,12}d6 +(?{Spell Level?})d6 ]] Radiant Damage --?? $Atk.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg] _show|all --?? $Atk.base == 1 ?? !|**Fumble:** Spell goes horrible wrong! --Description:|A flash of light streaks toward a creature of your choice within range. Make a ranged spell attack against the target. On a hit, the target takes 4d6 radiant damage, and the next attack roll made against this target before the end of your next turn has advantage, thanks to the mystical dim light glittering on the target until then. --Higher Level:| When you cast this spell using a spell slot of 2nd level or higher, the damage increases by 1d6 for each slot level above 1st. }} I love this method for the spells. Now is there any way to integrate this with: !setattr --name @{selected|character_name} --modb --lvl1_slots_expended|-1 --silent !power {{ --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|token_name} ^^ attacks ^^ @{target|token_name} --format|atwill --name|Guiding Bolt --leftsub|Spell Range Attack --rightsub|120'  --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]] | Advantage, 2d20KH1 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]] | Disadvantage, 2d20KL1 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]]} ]] vs **AC** [[@{target|npc_ac}]] --?? $Atk < @{target|npc_ac} ?? !Missed|**You missed!** --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? Hit:|[[ [$Dmg] ?{Spell Level?|1, 4|2,5|3,6|4,7|5,8|6,9|7,10|8,11|9,12}d6 ]] Radiant Damage --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all --?? $Atk.base == 20 ?? Critical Hit:|[[ [$CritDmg] ?{Spell Level?|1, 4|2,5|3,6|4,7|5,8|6,9|7,10|8,11|9,12}d6 +(?{Spell Level?})d6 ]] Radiant Damage --?? $Atk.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg] _show|all --?? $Atk.base == 1 ?? !|**Fumble:** Spell goes horrible wrong! --Description:|A flash of light streaks toward a creature of your choice within range. Make a ranged spell attack against the target. On a hit, the target takes 4d6 radiant damage, and the next attack roll made against this target before the end of your next turn has advantage, thanks to the mystical dim light glittering on the target until then. --Higher Level:| When you cast this spell using a spell slot of 2nd level or higher, the damage increases by 1d6 for each slot level above 1st. --Spell Slots Left:|  [[ @{selected|lvl1_slots_expended} - 1 ]] }} Of course have spell slots deplete depending on your Spell Level selection. You can use --spell_slots|@{selected|character_id} at the end will show all spell slots. you will want tot use !setattr --name @{selected|character_name} --modb --lvl?{Spell Level|1|2|3|4|5|6|7|8|9}_slots_expended|-1 --silent because you need to remove the spell slot used not just level 1. EDIT:Wait I might be able to do better Kurt add calling other API's 
1531701670

Edited 1531702551
Kurt J.
Pro
API Scripter
Craven said: Theodore S. said: Craven said: Powercard for the Guiding Bolt Spell !power {{ --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|token_name} ^^ attacks ^^ @{target|token_name} --format|atwill --name|Guiding Bolt --leftsub|Spell Range Attack --rightsub|120' --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]] | Advantage, 2d20KH1 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]] | Disadvantage, 2d20KL1 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]]} ]] vs **AC** [[@{target|npc_ac}]] --?? $Atk < @{target|npc_ac} ?? !Missed|**You missed!** --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? Hit:|[[ [$Dmg] ?{Spell Level?|1, 4|2,5|3,6|4,7|5,8|6,9|7,10|8,11|9,12}d6 ]] Radiant Damage --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all --?? $Atk.base == 20 ?? Critical Hit:|[[ [$CritDmg] ?{Spell Level?|1, 4|2,5|3,6|4,7|5,8|6,9|7,10|8,11|9,12}d6 +(?{Spell Level?})d6 ]] Radiant Damage --?? $Atk.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg] _show|all --?? $Atk.base == 1 ?? !|**Fumble:** Spell goes horrible wrong! --Description:|A flash of light streaks toward a creature of your choice within range. Make a ranged spell attack against the target. On a hit, the target takes 4d6 radiant damage, and the next attack roll made against this target before the end of your next turn has advantage, thanks to the mystical dim light glittering on the target until then. --Higher Level:| When you cast this spell using a spell slot of 2nd level or higher, the damage increases by 1d6 for each slot level above 1st. }} I love this method for the spells. Now is there any way to integrate this with: !setattr --name @{selected|character_name} --modb --lvl1_slots_expended|-1 --silent !power {{ --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|token_name} ^^ attacks ^^ @{target|token_name} --format|atwill --name|Guiding Bolt --leftsub|Spell Range Attack --rightsub|120'  --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]] | Advantage, 2d20KH1 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]] | Disadvantage, 2d20KL1 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]]} ]] vs **AC** [[@{target|npc_ac}]] --?? $Atk < @{target|npc_ac} ?? !Missed|**You missed!** --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? Hit:|[[ [$Dmg] ?{Spell Level?|1, 4|2,5|3,6|4,7|5,8|6,9|7,10|8,11|9,12}d6 ]] Radiant Damage --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all --?? $Atk.base == 20 ?? Critical Hit:|[[ [$CritDmg] ?{Spell Level?|1, 4|2,5|3,6|4,7|5,8|6,9|7,10|8,11|9,12}d6 +(?{Spell Level?})d6 ]] Radiant Damage --?? $Atk.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg] _show|all --?? $Atk.base == 1 ?? !|**Fumble:** Spell goes horrible wrong! --Description:|A flash of light streaks toward a creature of your choice within range. Make a ranged spell attack against the target. On a hit, the target takes 4d6 radiant damage, and the next attack roll made against this target before the end of your next turn has advantage, thanks to the mystical dim light glittering on the target until then. --Higher Level:| When you cast this spell using a spell slot of 2nd level or higher, the damage increases by 1d6 for each slot level above 1st. --Spell Slots Left:|  [[ @{selected|lvl1_slots_expended} - 1 ]] }} Of course have spell slots deplete depending on your Spell Level selection. You can use --spell_slots|@{selected|character_id} at the end will show all spell slots. you will want tot use !setattr --name @{selected|character_name} --modb --lvl?{Spell Level|1|2|3|4|5|6|7|8|9}_slots_expended|-1 --silent because you need to remove the spell slot used not just level 1. EDIT:Wait I might be able to do better Kurt add calling other API's  With inline replacements in 3.8.0, you can do this: !power {{ --inlinereplace|SL|?{Slot Level?|1|2|3|4|5|6|7|8|9}; --api_setattr|_name @{selected|character_name} _modb _lvl~SL$_slots_expended|-1 _silent --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|token_name} ^^ attacks ^^ @{target|token_name} --format|atwill --name|Guiding Bolt --leftsub|Spell Range Attack --rightsub|120' --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]] | Advantage, 2d20KH1 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]] | Disadvantage, 2d20KL1 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]]} ]] vs **AC** [[@{target|npc_ac}]] --?? $Atk < @{target|npc_ac} ?? !Missed|**You missed!** --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SL$+4)d6 ]#] Radiant Damage --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all --?? $Atk.base == 20 ?? Critical Hit:|[#[ [$CritDmg] ((~SL$+4)*2)d6 ]#] Radiant Damage --?? $Atk.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg] _show|all --?? $Atk.base == 1 ?? !|**Fumble:** Spell goes horrible wrong! --Description:|A flash of light streaks toward a creature of your choice within range. Make a ranged spell attack against the target. On a hit, the target takes 4d6 radiant damage, and the next attack roll made against this target before the end of your next turn has advantage, thanks to the mystical dim light glittering on the target until then. --?? ~SL$ > 1 ??Higher Level:| When you cast this spell using a spell slot of 2nd level or higher, the damage increases by 1d6 for each slot level above 1st. With a level ~SL$ slot, damage for this casting was [#[ [$dice|TXT] (~SL$+4)d1 ]#]d6. --spell_slots|@{selected|character_id} }} I put the setattr near the top of the macro so it has time to happen before it gets to the --spell_slots command... otherwise the deduction will happen, but the display is too fast and you still get the old number. Also, I assume the alterbar works, but I don't use alterbar, so not certain :) Edit: Modified a bit for the right damage (I was using a base of 2d6 instead of 4). Only shows higher level text if you cast it at a higher level, and shows the total damage dice used if cast at a higher level (not counting for crits).
Hey Kurt, I am trying to get this command to work inside power card any ideas !setattr --name @{selected|character_name} --modb --lvl2_slots_expended|-1 --api_setattr --name @{selected|character_name} --modb --lvl2_slots_expended|-1 is not working. and a side note the video link you have in the wiki for replacements and templates is not correct.
1531702643

Edited 1531702906
Kurt J.
Pro
API Scripter
Craven said: Hey Kurt, I am trying to get this command to work inside power card any ideas !setattr --name @{selected|character_name} --modb --lvl2_slots_expended|-1 --api_setattr --name @{selected|character_name} --modb --lvl2_slots_expended|-1 is not working. and a side note the video link you have in the wiki for replacements and templates is not correct. See the post above yours :) But whenever you call an API command that uses --, you need to replace them with a single underscore, and you need a vertical bar after api_setattr, so: --api_setattr |_ name @{selected|character_name} _ modb _ lvl2_slots_expended|-1 (oh, and it looks for _ with a space before it for replacing, so it doesn't interfere with "lvl2_slots_expended" ) Also, fixed video link in wiki :) Thanks!
Thanks Ok Ted if you add these 2 lines to your power card for Guiding Bolt then it will remove 1 from the chosen spell slot. --hroll|[[ [$Val] (?{Spell Level?}) - 3d1 ]] --api_setattr|_name @{selected|character_name} _modb _lvl[^Val]_slots_expended|-1 _silent
OK. Now you get me excited for 3.8.0 do we know when it goes to One-Click?
1531714766

Edited 1531716094
OK. Minor fix to your Guiding Bolts Kurt: !power {{ --inlinereplace|SL|?{Spell Level?|1|2|3|4|5|6|7|8|9}; --hroll|[[ [$Val] (?{Spell Level?}) - 1d0 ]] --api_setattr|_name @{selected|character_name} _modb _lvl[^Val]_slots_expended|-1 _silent --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|token_name} ^^ attacks ^^ @{target|token_name} --format|atwill --name|Guiding Bolt --leftsub|Spell Range Attack --rightsub|120'  --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]] | Advantage, 2d20KH1 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]] | Disadvantage, 2d20KL1 + [[@{selected|wisdom_mod}]] [WIS] + [[@{selected|pb}]] [PROF]]} ]] vs **AC** [[@{target|npc_ac}]] --?? $Atk < @{target|npc_ac} ?? !Missed|**You missed!** --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SL$+3)d6 ]#] Radiant Damage --?? $Atk.base == 20 ?? Critical Hit:|[#[ [$CritDmg] ((~SL$+3)*2)d6 ]#] Radiant Damage --?? $Atk.base == 1 ?? !|**Fumble:** Spell goes horribly wrong! --Description:|A flash of light streaks toward a creature of your choice within range. Make a ranged spell attack against the target. On a hit, the target takes 4d6 radiant damage, and the next attack roll made against this target before the end of your next turn has advantage, thanks to the mystical dim light glittering on the target until then. --?? ~SL$ > 1 ??Higher Level:| When you cast this spell using a spell slot of 2nd level or higher, the damage increases by 1d6 for each slot level above 1st. With a level ~SL$ slot, damage for this casting was [#[ [$dice|TXT] (~SL$+3)d1 ]#]d6. }} The error I found was (~SL$+3)d6 so at level 2, would be 5d6. Atempted a different spell (Cure Wounds): !power {{ --inlinereplace|SL|?{Spell Level?|1|2|3|4|5|6|7|8|9}; --hroll|[[ [$Val] (?{Spell Level?}) - 1d0 ]] --api_setattr|_name @{selected|character_name} _modb _lvl[^Val]_slots_expended|-1 _silent --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|token_name} ^^ heals ^^ @{target|token_name} --format|atwill --name|Cure Wounds --leftsub|Healing Spell --rightsub|Touch --?? ~SL$ == 1 ?? Heal:|[#[ ~SL$}d8 + @{selected|wisdom_mod} ]#] Hit Points --?? ~SL$ > 1 ?? Heal:|[#[ ~SL$+1}d8 + @{selected|wisdom_mod} ]#] Hit Points --Description:|A creature you touch regains a number of hit points equal to 1d8 + your spellcasting ability modifier. This spell has no effect on undead or constructs. -- ?? ~SL$ > 1 ?? Higher Level:| When you cast this spell using a spell slot of 2nd level or higher, the healing increases by 1d8 for each slot level above 1st. With a level ~SL$ slot, healing for this casting was [#[ [$dice|TXT] (~SL$+1)d1 ]#]d8 + 4. }} Tested at level 1. Errored with: SyntaxError: Expected "[" or [ |\t] but "1" found. undefined
1531733032

Edited 1531733314
Kurt J.
Pro
API Scripter
Theodore S. said: Atempted a different spell (Cure Wounds): !power {{ --inlinereplace|SL|?{Spell Level?|1|2|3|4|5|6|7|8|9}; --hroll|[[ [$Val] (?{Spell Level?}) - 1d0 ]] --api_setattr|_name @{selected|character_name} _modb _lvl[^Val]_slots_expended|-1 _silent --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|token_name} ^^ heals ^^ @{target|token_name} --format|atwill --name|Cure Wounds --leftsub|Healing Spell --rightsub|Touch --?? ~SL$ == 1 ?? Heal:|[#[ ~SL$}d8 + @{selected|wisdom_mod} ]#] Hit Points --?? ~SL$ > 1 ?? Heal:|[#[ ~SL$+1}d8 + @{selected|wisdom_mod} ]#] Hit Points --Description:|A creature you touch regains a number of hit points equal to 1d8 + your spellcasting ability modifier. This spell has no effect on undead or constructs. -- ?? ~SL$ > 1 ?? Higher Level:| When you cast this spell using a spell slot of 2nd level or higher, the healing increases by 1d8 for each slot level above 1st. With a level ~SL$ slot, healing for this casting was [#[ [$dice|TXT] (~SL$+1)d1 ]#]d8 + 4. }} Tested at level 1. Errored with: SyntaxError: Expected "[" or [ |\t] but "1" found. undefined The lines with the healing rolls in them have an extra } in them, and need to use a roll id since they are hidden from chat. And you only need one. It should be: --Heal:|[#[ [$heal] ~SL$d8 + @{selected|wisdom_mod} ]#] Hit Points also, you don't need the hroll line if you are using the inline replacements. Instead, you can simply use: --api_setattr|_name @{selected|character_name} _modb _lvl~SL$_slots_expended|-1 _silent Finally, this line needs to be updated to reflect the right number of dice and dynamic wisdom modifier: -- ?? ~SL$ > 1 ?? Higher Level:| When you cast this spell using a spell slot of 2nd level or higher, the healing increases by 1d8 for each slot level above 1st. With a level ~SL$ slot, healing for this casting was [#[ [$dice|TXT] ~SL$d1 ]#]d8 + @{selected|wisdom_mod}.
1531870613
Kurt J.
Pro
API Scripter
Version 3.8.0 is now live on OneClick.
For some reason, the --api_setattr|_name @{selected|character_name} _modb other-resource|-1 _silent isn't working. Verified there is a number in the boxes needed. !power {{ --target_list|@{target|token_id} --api_setattr|_name @{selected|character_name} _modb other-resource|-1 _silent --emote|@{selected|token_name} ^^ attacks ^^ @{target|token_name} --tokenid|@{selected|token_id} --format|attacks --corners|10 --name|Dart --leftsub|Ranged Attack --rightsub| 20'/60' --Normal Damage:|1d4 + @{selected|dexterity_mod} piercing  --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + [[ @{selected|dexterity_mod} ]] [DEX] + [[ @{selected|pb} ]] [PROF] | Advantage, 2d20KH1 + [[ @{selected|dexterity_mod} ]] [DEX] + [[ @{selected|pb} ]] [PROF] | Disadvantage, 2d20KL1 + [[@{selected|dexterity_mod}]] [DEX] + [[@{selected|pb}]] [PROF]]} ]] vs **AC** [[ @{target|npc_ac} ]] --?? $Atk < @{target|npc_ac} ?? !Missed|**You missed!** --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? Hit:|[[ 1d4 + @{selected|dexterity_mod} ]] piercing damage --?? $Atk.base == 20 ?? Critical Hit:|**Effect:** [[ [TXT] 1t[P-Setback-Piercing-(Lv.1-4)] ]] --?? $Atk.base == 1 ?? Fumble:|[[ [TXT] 1t[Awkward-Ranged-(Lv.1-4)] ]] }}
1531956070
Kurt J.
Pro
API Scripter
Theodore S. said: For some reason, the --api_setattr|_name @{selected|character_name} _modb other-resource|-1 _silent isn't working. Verified there is a number in the boxes needed. !power {{ --target_list|@{target|token_id} --api_setattr|_name @{selected|character_name} _modb other-resource|-1 _silent --emote|@{selected|token_name} ^^ attacks ^^ @{target|token_name} --tokenid|@{selected|token_id} --format|attacks --corners|10 --name|Dart --leftsub|Ranged Attack --rightsub| 20'/60' --Normal Damage:|1d4 + @{selected|dexterity_mod} piercing  --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + [[ @{selected|dexterity_mod} ]] [DEX] + [[ @{selected|pb} ]] [PROF] | Advantage, 2d20KH1 + [[ @{selected|dexterity_mod} ]] [DEX] + [[ @{selected|pb} ]] [PROF] | Disadvantage, 2d20KL1 + [[@{selected|dexterity_mod}]] [DEX] + [[@{selected|pb}]] [PROF]]} ]] vs **AC** [[ @{target|npc_ac} ]] --?? $Atk < @{target|npc_ac} ?? !Missed|**You missed!** --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? Hit:|[[ 1d4 + @{selected|dexterity_mod} ]] piercing damage --?? $Atk.base == 20 ?? Critical Hit:|**Effect:** [[ [TXT] 1t[P-Setback-Piercing-(Lv.1-4)] ]] --?? $Atk.base == 1 ?? Fumble:|[[ [TXT] 1t[Awkward-Ranged-(Lv.1-4)] ]] }} Are you certain that command works outside of a PowerCard? I believe the attribute is other_resource, not other-resource.
Kurt J. said: Theodore S. said: For some reason, the --api_setattr|_name @{selected|character_name} _modb other-resource|-1 _silent isn't working. Verified there is a number in the boxes needed. !power {{ --target_list|@{target|token_id} --api_setattr|_name @{selected|character_name} _modb other-resource|-1 _silent --emote|@{selected|token_name} ^^ attacks ^^ @{target|token_name} --tokenid|@{selected|token_id} --format|attacks --corners|10 --name|Dart --leftsub|Ranged Attack --rightsub| 20'/60' --Normal Damage:|1d4 + @{selected|dexterity_mod} piercing  --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + [[ @{selected|dexterity_mod} ]] [DEX] + [[ @{selected|pb} ]] [PROF] | Advantage, 2d20KH1 + [[ @{selected|dexterity_mod} ]] [DEX] + [[ @{selected|pb} ]] [PROF] | Disadvantage, 2d20KL1 + [[@{selected|dexterity_mod}]] [DEX] + [[@{selected|pb}]] [PROF]]} ]] vs **AC** [[ @{target|npc_ac} ]] --?? $Atk < @{target|npc_ac} ?? !Missed|**You missed!** --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? Hit:|[[ 1d4 + @{selected|dexterity_mod} ]] piercing damage --?? $Atk.base == 20 ?? Critical Hit:|**Effect:** [[ [TXT] 1t[P-Setback-Piercing-(Lv.1-4)] ]] --?? $Atk.base == 1 ?? Fumble:|[[ [TXT] 1t[Awkward-Ranged-(Lv.1-4)] ]] }} Are you certain that command works outside of a PowerCard? I believe the attribute is other_resource, not other-resource. You are correct. My oops on that.
A new testing: Basics of what I am trying to do is Crossbow Bolts are in _other_resource and expended bolts are in _repeating_resource_$0_resource_left From testing, it is only reading the last setattr and ignoring the other. !power {{ --target_list|@{target|token_id} --api_setattr|_name @{selected|character_name} _modb _other_resource|-1 _silent --api_setattr|_name @{selected|character_name} _modb _repeating_resource_$0_resource_left|1 _silent --emote|@{selected|token_name} ^^ attacks ^^ @{target|token_name} --tokenid|@{selected|token_id} --format|attacks --corners|10 --name|Heavy Crossbow --leftsub|Ranged Attack --rightsub|100'/400' --Normal Damage:|1d10 + @{selected|dexterity_mod} piercing  --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + [[ @{selected|dexterity_mod} ]] [DEX] + [[ @{selected|pb} ]] [PROF] | Advantage, 2d20KH1 + [[ @{selected|dexterity_mod} ]] [DEX] + [[ @{selected|pb} ]] [PROF] | Disadvantage, 2d20KL1 + [[@{selected|dexterity_mod}]] [DEX] + [[@{selected|pb}]] [PROF]]} ]] vs **AC** [[ @{target|npc_ac} ]] --?? $Atk < @{target|npc_ac} ?? !Missed|**You missed!** --?? $Atk >= @{target|npc_ac} AND $Atk.base <> 20 ?? Hit:|[[ 1d10 + [[@{selected|dexterity_mod}]] ]] piercing damage --?? $Atk.base == 20 ?? Critical Hit:|**Effect:** [[ [TXT] 1t[P-Setback-Piercing-(Lv.1-4)] ]] --?? $Atk.base == 1 ?? Fumble:|[[ [TXT] 1t[Awkward-Ranged-(Lv.1-4)] ]] }} Is there a way to get both to get reduced/added in the same powercard?
1532080485
Kurt J.
Pro
API Scripter
Theodore S. said: A new testing: Basics of what I am trying to do is Crossbow Bolts are in _other_resource and expended bolts are in _repeating_resource_$0_resource_left From testing, it is only reading the last setattr and ignoring the other. !power {{ --target_list|@{target|token_id} --api_setattr|_name @{selected|character_name} _modb _other_resource|-1 _silent --api_setattr|_name @{selected|character_name} _modb _repeating_resource_$0_resource_left|1 _silent --emote|@{selected|token_name} ^^ attacks ^^ @{target|token_name} --tokenid|@{selected|token_id} --format|attacks --corners|10 --name|Heavy Crossbow --leftsub|Ranged Attack --rightsub|100'/400' --Normal Damage:|1d10 + @{selected|dexterity_mod} piercing&nbsp; --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + [[ @{selected|dexterity_mod} ]] [DEX] + [[ @{selected|pb} ]] [PROF] | Advantage, 2d20KH1 + [[ @{selected|dexterity_mod} ]] [DEX] + [[ @{selected|pb} ]] [PROF] | Disadvantage, 2d20KL1 + [[@{selected|dexterity_mod}]] [DEX] + [[@{selected|pb}]] [PROF]]} ]] vs **AC** [[ @{target|npc_ac} ]] --?? $Atk &lt; @{target|npc_ac} ?? !Missed|**You missed!** --?? $Atk &gt;= @{target|npc_ac} AND $Atk.base &lt;&gt; 20 ?? Hit:|[[ 1d10 + [[@{selected|dexterity_mod}]] ]] piercing damage --?? $Atk.base == 20 ?? Critical Hit:|**Effect:** [[ [TXT] 1t[P-Setback-Piercing-(Lv.1-4)] ]] --?? $Atk.base == 1 ?? Fumble:|[[ [TXT] 1t[Awkward-Ranged-(Lv.1-4)] ]] }} Is there a way to get both to get reduced/added in the same powercard? This is the expected behavior... all tags have to be unique, so you can't use two tags named --api_setattr. To use multiple tags of the same name, you need to use the Same Name modifier (see <a href="https://wiki.roll20.net/Script:PowerCards#Tag_Modifiers" rel="nofollow">https://wiki.roll20.net/Script:PowerCards#Tag_Modifiers</a> ). Essentially, you have to add * and a number after the tag name to prevent them from overriding each other.
I am SOOOO close to getting the recovery PowerCard to work. Is there a way to get a calculation like floor(@{selected|repeating_resource_$0_resource_left}/2) to work with --api_setattr and automatically add the result to other_resource?
1532123569

Edited 1532123999
Kurt J.
Pro
API Scripter
Theodore S. said: I am SOOOO close to getting the recovery PowerCard to work. Is there a way to get a calculation like floor(@{selected|repeating_resource_$0_resource_left}/2) to work with --api_setattr and automatically add the result to other_resource? Actually, an inline roll might work for that...&nbsp; [[ floor((7d1)/2) ]] works from chat as an inline roll, so you could probably do something like (untested!): [#[ [$junk|TXT] floor(@{selected|repeating_resource_$0_resource_left}/2) ]#] as the numeric parameter in the setattr call.
1532131632

Edited 1532149066
Kurt J. said: Theodore S. said: I am SOOOO close to getting the recovery PowerCard to work. Is there a way to get a calculation like floor(@{selected|repeating_resource_$0_resource_left}/2) to work with --api_setattr and automatically add the result to other_resource? Actually, an inline roll might work for that...&nbsp; [[ floor((7d1)/2) ]] works from chat as an inline roll, so you could probably do something like (untested!): [#[ [$junk|TXT] floor(@{selected|repeating_resource_$0_resource_left}/2) ]#] as the numeric parameter in the setattr call. I will test that when I get home. EDIT: !power {{ --api_setattr|_name @{selected|character_name} _modb _other_resource|[#[ [$junk|TXT] floor(@{selected|repeating_resource_$0_resource_left}/2) ]#] _silent --emote|@{selected|token_name} recovers ammo --tokenid|@{selected|token_id} --format|attacks --corners|10 --name|Ammo Recovery --leftsub|Searching --rightsub|1 minute --!|You recovered half your ammo after one minute of searching }} Error:&nbsp; PowerCards: &nbsp;"Could not determine result type of: [{\"type\":\"L\",\"text\":\"$junk|TXT\"},{\"type\":\"M\",\"expr\":\"floor(2/2)\"}]" My second attempt: !power {{ --emote|@{selected|token_name} recovers ammo --tokenid|@{selected|token_id} --format|attacks --corners|10 --name|Ammo Recovery --leftsub|Searching --rightsub|1 minute --!|You recovered [#[ [$junk|TXT] floor(@{selected|expended_arrows}/2) ]#] after one minute of searching --api_setattr|_name @{selected|character_name} _sel _expended_arrows|0 _silent }} PowerCards: &nbsp;"Could not determine result type of: [{\"type\":\"L\",\"text\":\"$junk|TXT\"},{\"type\":\"M\",\"expr\":\"floor(2/2)\"}]" CONCLUSION: Best option I could come up with is that my players will have to manually add their recovered ammo to their inventory. !power {{ --emote|@{selected|token_name} recovers ammo --tokenid|@{selected|token_id} --format|attacks --corners|10 --name|Ammo Recovery --leftsub|Searching --rightsub|1 minute --!|You recovered [[ floor(@{selected|expended_arrows}/2) ]] after one minute of searching --api_setattr|_name @{selected|character_name} _sel _expended_arrows|0 _silent }}
1532196256
Kurt J.
Pro
API Scripter
Version 3.8.1 is now up on the development server. As I progress closer and closer to the functionality I want to have in place, I've been adding things that I need in order to create they types of PowerCard macros I want - flexible, easy to maintain, and reliant mostly on information already stored in Roll20 so creating new macros is just a matter of replacing a name or parameter on one line of a macro I've copy/pasted somewhere. Here are the changes in 3.8.1: - You can now use "!power", "!powercard" or "!powercards" (with any arrangement of upper and lower case) to trigger a PowerCard macro. (Only "!power" worked prior to this). - New tag : --replaceattrs. Generates replacement key/value pairs for a given character and a slew of their attributes. Please see this section of the Wiki for additional information. - New tag : --replacespell. Generates replacement key/value pairs for a given spell on a character's character sheet. Please see this section of the Wiki for additional information. My current template/replacement/macro setup uses these two new tags to allow me to have a single macro for attack spells, and all I need to do is change the spell name.
1532196752

Edited 1532196878
Kurt J. said: Version 3.8.1 is now up on the development server. As I progress closer and closer to the functionality I want to have in place, I've been adding things that I need in order to create they types of PowerCard macros I want - flexible, easy to maintain, and reliant mostly on information already stored in Roll20 so creating new macros is just a matter of replacing a name or parameter on one line of a macro I've copy/pasted somewhere. Here are the changes in 3.8.1: - You can now use "!power", "!powercard" or "!powercards" (with any arrangement of upper and lower case) to trigger a PowerCard macro. (Only "!power" worked prior to this). - New tag : --replaceattrs. Generates replacement key/value pairs for a given character and a slew of their attributes. Please see this section of the Wiki for additional information. - New tag : --replacespell. Generates replacement key/value pairs for a given spell on a character's character sheet. Please see this section of the Wiki for additional information. My current template/replacement/macro setup uses these two new tags to allow me to have a single macro for attack spells, and all I need to do is change the spell name. Maybe a little early, but went to Dev Server and wasn't able to use 3.8.1 This is an exciting addition to PowerCards. Can't wait to use it in my game.
1532199958
Kurt J.
Pro
API Scripter
Theodore S. said: Kurt J. said: Version 3.8.1 is now up on the development server. As I progress closer and closer to the functionality I want to have in place, I've been adding things that I need in order to create they types of PowerCard macros I want - flexible, easy to maintain, and reliant mostly on information already stored in Roll20 so creating new macros is just a matter of replacing a name or parameter on one line of a macro I've copy/pasted somewhere. Here are the changes in 3.8.1: - You can now use "!power", "!powercard" or "!powercards" (with any arrangement of upper and lower case) to trigger a PowerCard macro. (Only "!power" worked prior to this). - New tag : --replaceattrs. Generates replacement key/value pairs for a given character and a slew of their attributes. Please see this section of the Wiki for additional information. - New tag : --replacespell. Generates replacement key/value pairs for a given spell on a character's character sheet. Please see this section of the Wiki for additional information. My current template/replacement/macro setup uses these two new tags to allow me to have a single macro for attack spells, and all I need to do is change the spell name. Maybe a little early, but went to Dev Server and wasn't able to use 3.8.1 This is an exciting addition to PowerCards. Can't wait to use it in my game. When I say the Dev server, I mean the development GIST. See the first post in the thread for a link. I will usually have several development releases before promoting one to One Click.
Kurt J. said: Theodore S. said: Kurt J. said: Version 3.8.1 is now up on the development server. As I progress closer and closer to the functionality I want to have in place, I've been adding things that I need in order to create they types of PowerCard macros I want - flexible, easy to maintain, and reliant mostly on information already stored in Roll20 so creating new macros is just a matter of replacing a name or parameter on one line of a macro I've copy/pasted somewhere. Here are the changes in 3.8.1: - You can now use "!power", "!powercard" or "!powercards" (with any arrangement of upper and lower case) to trigger a PowerCard macro. (Only "!power" worked prior to this). - New tag : --replaceattrs. Generates replacement key/value pairs for a given character and a slew of their attributes. Please see this section of the Wiki for additional information. - New tag : --replacespell. Generates replacement key/value pairs for a given spell on a character's character sheet. Please see this section of the Wiki for additional information. My current template/replacement/macro setup uses these two new tags to allow me to have a single macro for attack spells, and all I need to do is change the spell name. Maybe a little early, but went to Dev Server and wasn't able to use 3.8.1 This is an exciting addition to PowerCards. Can't wait to use it in my game. When I say the Dev server, I mean the development GIST. See the first post in the thread for a link. I will usually have several development releases before promoting one to One Click. Gotcha. Well, I am going to give 3.8.1 a nice test as I am working towards a very Power Cards intensive game. And I always have the One-Click ready in case the Dev GIST breaks.
Notes on 3.8.1: Using ~SP-LEVEL$ and ~SP-SCHOOL$, Cantrips give the value of "c" and school give a lowercase version of Spell School like in example below: Also, one replacement that could be helpful and missing would be SP-CASTING - Spell Casting Time and SP-SAVE - Spell Saving Throw
1532202599
Kurt J.
Pro
API Scripter
Theodore S. said: Notes on 3.8.1: Using ~SP-LEVEL$ and ~SP-SCHOOL$, Cantrips give the value of "c" and school give a lowercase version of Spell School like in example below: Also, one replacement that could be helpful and missing would be SP-CASTING - Spell Casting Time and SP-SAVE - Spell Saving Throw I updated dev. Cantrips now return 0 for level, and added the following: SP-CASTINGTIME SP-SAVE SP-SAVESUCCESS SP-HEALING I'll upper-case the first letter of the school at some point as well, but that isn't done yet :)
Kurt J. said: Theodore S. said: Notes on 3.8.1: Using ~SP-LEVEL$ and ~SP-SCHOOL$, Cantrips give the value of "c" and school give a lowercase version of Spell School like in example below: Also, one replacement that could be helpful and missing would be SP-CASTING - Spell Casting Time and SP-SAVE - Spell Saving Throw I updated dev. Cantrips now return 0 for level, and added the following: SP-CASTINGTIME SP-SAVE SP-SAVESUCCESS SP-HEALING I'll upper-case the first letter of the school at some point as well, but that isn't done yet :) Keep up the great work. I love 3.8.1 so far.
1532203260

Edited 1532203895
Minor Glitch: !power {{ --replacespell|@{selected|character_id}|Acid Splash --replaceattr|S-|@{selected|character_id} --inlinereplace|CL|?{Character Level?|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20} --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|token_name} ^^ attacks ^^ @{target|token_name} --format|atwill --name|~SP-NAME$ --leftsub|Spell Save Attack --rightsub|~SP-RANGE$ --Level:|~SP-LEVEL$ --Casting Time:|~SP-CASTINGTIME$ --Saving Throw:|~SP-SAVE$ ~S-SSDC$ --Spell Save/DC| *Dexterity @{selected|spell_save_dc}* --?? ~CL$ &gt;= 1 AND ~CL$ &lt;= 4 ?? Hit:| [[1d6]] Acid Damage --?? ~CL$ &gt;= 5 AND ~CL$ &lt;= 10 ?? Hit:| [[2d6]] Acid Damage --?? ~CL$ &gt;= 11 AND ~CL$ &lt;= 16 ?? Hit:| [[3d6]] Acid Damage --?? ~CL$ &gt;= 17 AND ~CL$ &lt;= 20 ?? Hit:| [[4d6]] Acid Damage --Description:|~SP-DESCRIPTION$ --Higher Level:|~SP-ATHIGHER$ }} returns EDIT: Found the "bug": The command is --replaceattrs . Wiki and Forum says -replaceattr. !power {{ --replacespell|@{selected|character_id}|Acid Splash --replaceattrs|S-|@{selected|character_id} --inlinereplace|CL|?{Character Level?|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20} --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|token_name} ^^ attacks ^^ @{target|token_name} --format|atwill --name|~SP-NAME$ --leftsub|Spell Save Attack --rightsub|~SP-RANGE$ --Level:|~SP-LEVEL$ --Casting Time:|~SP-CASTINGTIME$ --Saving Throw:|~SP-SAVE$ ~S-SSDC$ --?? ~CL$ &gt;= 1 AND ~CL$ &lt;= 4 ?? Hit:| [[1d6]] Acid Damage --?? ~CL$ &gt;= 5 AND ~CL$ &lt;= 10 ?? Hit:| [[2d6]] Acid Damage --?? ~CL$ &gt;= 11 AND ~CL$ &lt;= 16 ?? Hit:| [[3d6]] Acid Damage --?? ~CL$ &gt;= 17 AND ~CL$ &lt;= 20 ?? Hit:| [[4d6]] Acid Damage --Description:|~SP-DESCRIPTION$ --Higher Level:|~SP-ATHIGHER$ }} returns
1532212118
Kurt J.
Pro
API Scripter
Fixed the Wiki entry for --replaceattrs :) Thanks. And Character Level is part of replaceattrs, so the prompt for level in the macro above could be removed and ~S-L$ used in place of ~CL$
Theodore S. said: Minor Glitch: !power {{ --replacespell|@{selected|character_id}|Acid Splash --replaceattr|S-|@{selected|character_id} --inlinereplace|CL|?{Character Level?|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20} --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|token_name} ^^ attacks ^^ @{target|token_name} --format|atwill --name|~SP-NAME$ --leftsub|Spell Save Attack --rightsub|~SP-RANGE$ --Level:|~SP-LEVEL$ --Casting Time:|~SP-CASTINGTIME$ --Saving Throw:|~SP-SAVE$ ~S-SSDC$ --Spell Save/DC| *Dexterity @{selected|spell_save_dc}* --?? ~CL$ &gt;= 1 AND ~CL$ &lt;= 4 ?? Hit:| [[1d6]] Acid Damage --?? ~CL$ &gt;= 5 AND ~CL$ &lt;= 10 ?? Hit:| [[2d6]] Acid Damage --?? ~CL$ &gt;= 11 AND ~CL$ &lt;= 16 ?? Hit:| [[3d6]] Acid Damage --?? ~CL$ &gt;= 17 AND ~CL$ &lt;= 20 ?? Hit:| [[4d6]] Acid Damage --Description:|~SP-DESCRIPTION$ --Higher Level:|~SP-ATHIGHER$ }} returns EDIT: Found the "bug": The command is --replaceattrs . Wiki and Forum says -replaceattr. !power {{ --replacespell|@{selected|character_id}|Acid Splash --replaceattrs|S-|@{selected|character_id} --inlinereplace|CL|?{Character Level?|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20} --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|token_name} ^^ attacks ^^ @{target|token_name} --format|atwill --name|~SP-NAME$ --leftsub|Spell Save Attack --rightsub|~SP-RANGE$ --Level:|~SP-LEVEL$ --Casting Time:|~SP-CASTINGTIME$ --Saving Throw:|~SP-SAVE$ ~S-SSDC$ --?? ~CL$ &gt;= 1 AND ~CL$ &lt;= 4 ?? Hit:| [[1d6]] Acid Damage --?? ~CL$ &gt;= 5 AND ~CL$ &lt;= 10 ?? Hit:| [[2d6]] Acid Damage --?? ~CL$ &gt;= 11 AND ~CL$ &lt;= 16 ?? Hit:| [[3d6]] Acid Damage --?? ~CL$ &gt;= 17 AND ~CL$ &lt;= 20 ?? Hit:| [[4d6]] Acid Damage --Description:|~SP-DESCRIPTION$ --Higher Level:|~SP-ATHIGHER$ }} returns your card hurts my eyes lol
They are better than the first options created LOL
1532217249
Kurt J.
Pro
API Scripter
Updated 3.8.1 on the Dev gist again. Added some error handling to prevent a sandbox crash if you try to use --replacespell with a spell name that doesn't exist on the character. Now it just won't add any variables.
Oh yeah. I did get that error when I was accidentally trying to cast Cure Wounds with a sorcerer instead of a cleric.
1532219853

Edited 1532219886
Kurt J.
Pro
API Scripter
One last update to 3.8.1 before I head for bed. Added a new spell replacer called "SP-MORECANTRIPDAMAGE" which will be 1 if the text "damage increases by" is in the spell description. It seems very random which cantrips have increased damage (ie, Ray of Frost does, but Fire Bolt does not, even though both require attack rolls and both have extra effects associated with them). I'm using this in my one-template-to-rule-them-all template for cantrips, which I believe will now handle attack and save cantrips with and without extra damage with the only change to the macro being the name of the spell, and the macro itself just being: !power {{ --replacespell|@{selected|character_id}|Sacred Flame --replaceattrs|S-|@{selected|character_id} --replaceattrs|T-|@{target|character_id} --replacement|Advantage --template|Basics|@{selected|token_id};@{target|token_id};casts ~SP-NAME$;~SP-NAME$;Cantrip;~SP-RANGE$ --template|CantripAttack|~@{selected|rtype}$ }} When I'm happy with everything, I'll put the required templates and replacement sets in the Wiki's template library section :)
1532263682

Edited 1532265151
So I am finally understand the new updates involving replacements. I have come up with a great macro for my game that uses replacements. This is for a Monk using Quarterstaff: }}!power {{ --replacement|Quarterstaff --replaceattrs|S-|@{selected|character_id} --replaceattrs|T-|@{target|character_id} --target_list|@{target|token_id} --emote|~S-CN$ ^^ attacks ^^ ~T-CN$ --tokenid|@{selected|token_id} --format|attacks --corners|10 --name|~1H$ ~WEP$ --leftsub|~TYPE$ ~ATK$ --rightsub| ~RANGE$ --Normal Damage:|1d6 + ~S-MDEX$ ~DTYPE$ --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + ~S-MDEX$ [DEX] + ~S-PB$ [PROF] | Advantage, 2d20KH1 + ~S-MDEX$ [DEX] + ~S-PB$ [PROF] | Disadvantage, 2d20KL1 + ~S-MDEX$ [DEX] + ~S-PB$ [PROF] } ]] vs **AC** ~T-AC$ --?? $Atk &lt; ~T-AC$ ?? !Missed|**You missed!** --?? $Atk &gt;= ~T-AC$ AND $Atk.base &lt;&gt; 20 ?? Hit:|[[ 1d6 + ~S-MDEX$ ]] ~DTYPE$ damage --?? $Atk.base == 20 ?? Critical Hit:|**Effect:** [[ [TXT] 1t[P-Setback-Bludgeoning-(Lv.1-4)] ]] --?? $Atk.base == 1 ?? Fumble:|[[ [TXT] 1t[Awkward-Melee-(Lv.1-4)] ]] }} Replacement Handout: Battleaxe:1H|One-Handed;2H|Two-Handed;WEP|Battleaxe;TYPE|Melee;ATK|Attack;DTYPE|slashing;RANGE|5 feet Quarterstaff:1H|One-Handed;2H|Two-Handed;WEP|Quarterstaff;TYPE|Melee;ATK|Attack;DTYPE|bludgeoning;RANGE|5 feet Trident:1H|One-Handed;2H|Two-Handed;WEP|Trident;TYPE|Melee;ATK|Attack;DTYPE|piercing;RANGE|5 feet Warhammer:1H|One-Handed;2H|Two-Handed;WEP|Warhammer;TYPE|Melee;ATK|Attack;DTYPE|bludgeoning;RANGE|5 feet
1532277610

Edited 1532278016
Trying to do this in a healing PowerCard: !power {{ --inlinereplace|SL|?{Spell Level?|1|2|3|4|5|6|7|8|9}; --api_setattr *1|_name @{selected|character_name} _modb _lvl~SL$_slots_expended|-1 _silent --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|charactername} heals @{target|token_name} with the power of Moradin! --format|default --name|**Cure Wounds** --leftsub|**Healing Spell** --rightsub|**Touch** --Heal:|[#[ [$heal] ~SL$d8 + @{selected|charisma_mod} ]#] hit points healed. --alterbar1| _target|@{target|token_id} _bar|3 _amount|[^heal] --Description:|A creature you touch regains a number of hit points equal to 1d8 + your spellcasting ability modifier. This spell has no effect on undead or constructs. --Higher Level:|When you cast this spell using a spell slot of 2nd level or higher, the healing increases by 1d8 for each slot level above 1st. With a level ~SL$ slot, healing for this casting was [#[ [$dice|TXT] ~SL$d1 ]#]d8 + @{selected|charisma_mod}. --Current Spell Slots:|Level ~SL$: [#[ @{selected|lvl~SL$_slots_expended} ]#] of [#[ @{selected|lvl~SL$_slots_total} ]#] }} But get this error due to that last line: No attribute was found for @{selected|lvl~SL$_slots_expended} The spell slot reduction works great as does the inline replace on the spell level, in the healing roll.&nbsp; Just can't seem to get that last line to work though. Getting something similar in a "Lay On Hands" macro: !power {{ --inlinereplace|LH|?{Heal Pool Points Used?}|0}; --api_setattr _name @{selected|character_name} _modb _repeating_resource_$0_resource_left|-~LH$ --silent --charid|@{selected|character_id} --target_list|@{target|token_id} --emote|With softly glowing hands, @{selected|charactername} heals @{target|token_name} with the power of Moradin! --format|default --name|**Lay On Hands** --leftsub|Class Trait --rightsub|Level @{selected|level} @{selected|class} --Heal:[#[ [$heal] ~SL$ ]#] hit points healed. --alterbar1| _target|@{target|token_id} _bar|3 _amount|[^heal] --Action:|Your blessed touch can heal wounds. You have a pool of healing power that replenishes when you take a long rest. With that pool, you can restore a total number of hit points equal to your paladin level x 5.^^ ^^ As an action, you can touch a creature and draw power from the pool to restore a number of hit points to that creature, up to the maximum amount remaining in your pool.^^ ^^ Alternatively, you can expend 5 hit points from your pool of healing to cure the target of one disease or neutralize one poison affecting it. You can cure multiple diseases and neutralize multiple poisons with a single use of Lay on Hands, expending hit points separately for each one.^^ ^^ This feature has no effect on undead and constructs.^^ ^^ --Heal Pool Pts. Left:|[[ @{selected|repeating_resource_$0_resource_left} ]] }} No error, but that "Heal" line doesn't seem to do anything.&nbsp; I'm sure its something simple that is completely escaping me at the moment. Thanks in advance!
1532278360

Edited 1532278389
Craig L. said: Trying to do this in a healing PowerCard: --inlinereplace|SL|?{Spell Level?|1|2|3|4|5|6|7|8|9}; --api_setattr *1|_name @{selected|character_name} _modb _lvl~SL$_slots_expended|-1 _silent . . . --Current Spell Slots:|Level ~SL$: [#[ @{selected|lvl~SL$_slots_expended} ]#] of [#[ @{selected|lvl~SL$_slots_total} ]#] But get this error due to that last line: No attribute was found for @{selected|lvl~SL$_slots_expended} The spell slot reduction works great as does the inline replace on the spell level, in the healing roll.&nbsp; Just can't seem to get that last line to work though. Thanks in advance! I could never get that figured out but the moment you pull a new Player-Info, it shows correct:
1532279249
Kurt J.
Pro
API Scripter
Craig L. said: Trying to do this in a healing PowerCard: !power {{ --inlinereplace|SL|?{Spell Level?|1|2|3|4|5|6|7|8|9}; --api_setattr *1|_name @{selected|character_name} _modb _lvl~SL$_slots_expended|-1 _silent --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|charactername} heals @{target|token_name} with the power of Moradin! --format|default --name|**Cure Wounds** --leftsub|**Healing Spell** --rightsub|**Touch** --Heal:|[#[ [$heal] ~SL$d8 + @{selected|charisma_mod} ]#] hit points healed. --alterbar1| _target|@{target|token_id} _bar|3 _amount|[^heal] --Description:|A creature you touch regains a number of hit points equal to 1d8 + your spellcasting ability modifier. This spell has no effect on undead or constructs. --Higher Level:|When you cast this spell using a spell slot of 2nd level or higher, the healing increases by 1d8 for each slot level above 1st. With a level ~SL$ slot, healing for this casting was [#[ [$dice|TXT] ~SL$d1 ]#]d8 + @{selected|charisma_mod}. --Current Spell Slots:|Level ~SL$: [#[ @{selected|lvl~SL$_slots_expended} ]#] of [#[ @{selected|lvl~SL$_slots_total} ]#] }} But get this error due to that last line: No attribute was found for @{selected|lvl~SL$_slots_expended} The spell slot reduction works great as does the inline replace on the spell level, in the healing roll.&nbsp; Just can't seem to get that last line to work though. Getting something similar in a "Lay On Hands" macro: !power {{ --inlinereplace|LH|?{Heal Pool Points Used?}|0}; --api_setattr _name @{selected|character_name} _modb _repeating_resource_$0_resource_left|-~LH$ --silent --charid|@{selected|character_id} --target_list|@{target|token_id} --emote|With softly glowing hands, @{selected|charactername} heals @{target|token_name} with the power of Moradin! --format|default --name|**Lay On Hands** --leftsub|Class Trait --rightsub|Level @{selected|level} @{selected|class} --Heal:[#[ [$heal] ~SL$ ]#] hit points healed. --alterbar1| _target|@{target|token_id} _bar|3 _amount|[^heal] --Action:|Your blessed touch can heal wounds. You have a pool of healing power that replenishes when you take a long rest. With that pool, you can restore a total number of hit points equal to your paladin level x 5.^^ ^^ As an action, you can touch a creature and draw power from the pool to restore a number of hit points to that creature, up to the maximum amount remaining in your pool.^^ ^^ Alternatively, you can expend 5 hit points from your pool of healing to cure the target of one disease or neutralize one poison affecting it. You can cure multiple diseases and neutralize multiple poisons with a single use of Lay on Hands, expending hit points separately for each one.^^ ^^ This feature has no effect on undead and constructs.^^ ^^ --Heal Pool Pts. Left:|[[ @{selected|repeating_resource_$0_resource_left} ]] }} No error, but that "Heal" line doesn't seem to do anything.&nbsp; I'm sure its something simple that is completely escaping me at the moment. Thanks in advance! That's because @{} notation is processed by the chat server, and it doesn't know what ~SL$ is. I've updated 3.8.1 on the dev server to include spell slot information for replaceattrs (SSL1T (SpellSlotsLevel1Total) and SSL1E (SpellSlotsLevel1Expended) for example, but keep in mind that they are set when replacements are set, so they will contain the values before anything in the card has run. Running chatsetattr will change the attribute value, but not the values reported by the ~SSL1E$ (etc) pairs.