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.

PowerCards 3 (Thread 2)

1434561077
DK Heinrich
Marketplace Creator
Sheet Author
[nh] it is then, thank you for the speedy response!
1434575973

Edited 1434576011
Gen Kitty
Forum Champion
You could always do math to subtract the mods from the die type : [[ 1d20cs>[[20-?{Total Bonus to Roll?} ]] ]] -- It's similar to what I do to find the misfire range for guns in pathfinder. Or, if it is hard-coded somewhere, use attribute calls instead of a query.
One addition I made to the script version 3.2.2 for my use was a [TOTAL] attribute. It displays rolls much like the inline rolls, highlighting crits and such, but it hides the calculation tooltip, so players can't hover over the roll to see what the "real" roll was, and what modifiers were applied. <a href="https://gist.github.com/ntwest/4d25e9dfc24223a7765" rel="nofollow">https://gist.github.com/ntwest/4d25e9dfc24223a7765</a>...
If any of the tags are used ([XPND], [TXT], [NH]. [TRKR]) along with a variable, the .base attribute no longer works, but the .total does. This only happens if you put the [TXT] attribute *after* the variable name [$Test]. Example: !power {{ --A|[[ [$Test] [XPND] 1d20]] --?? $Test.total &gt;= 1 ?? Test:|Total GT 5 --?? $Test.base &gt;= 1 ?? Test2:|GT 5 }} This works: !power {{ --A|[[ [XPND] [$Test] 1d20]] --?? $Test.total &gt;= 1 ?? Test:|Total GT 5 --?? $Test.base &gt;= 1 ?? Test2:|GT 5 }} Would be good to make this clear in the documentation. Thanks :-)
They have to be part of the label like this: [[ [$ID|txt|xpnd] 1d20]]
1434650314

Edited 1434656573
DK Heinrich
Marketplace Creator
Sheet Author
!power --name|Single Target Attack --target_list|@{target| |token_id} --Attack|[[1d20+5]] | [[1d20+5]] vs %%AC%% Armor Class (%%token_name%%) --Hit|[[1d8+3]] slashing damage !power --name|Scorching Burst | Nine Targets --target_list|@{target|1st|token_id} | @{target|2nd|token_id} | @{target|3rd|token_id} | @{target|4th|token_id} | @{target|5th|token_id} | @{target|6th|token_id} | @{target|7th|token_id} | @{target|8th|token_id} | @{target|9th|token_id} --Attack#?{Number of targets|1}|[[1d20+5]] vs %%Reflex%% Reflex (%%token_name%%) --Hit|[[1d8+3]] fire damage Using the above as a template i wrote this !power {{ --emote|//@{selected|token_name} casts a spell in the area...// --charid|@{selected|character_id} --format|item --name|Vitality Burst --leftsub|Utility Spell --rightsub|Short Range --target_list|@{target|1st|token_id} | @{target|2 nd |token_id} | @{target|3 rd |token_id} --%%token_name%% heals#?{Number of targets|3}:|%%HR%% damage }} but my output is missing the call out box on my %%HR%% - I have tried it in [[ ]] and with/without a space after the | - with no luck. My theory is that since my HR is a single number attribute (no math being done) that it is not dropping it in a box... but not sure if that has anything to do with it. Its not the end of the world, but it just makes it easier to see. any and all help is welcome :) EDIT: when I use a single target version of this it puts the HR in a call out box - so I think its more a %% thingy than an attribute thingy, maybe?
1434659397

Edited 1434659415
Try placing it in [! %%HR%% !] - I believe that was added to mimic the look of inline rolls for anything.
SeanOG is right. [! %%HR%% !] should make a pretend looking inline roll. That example is from an older version of PowerCards which made numbers/info charms inline rolls by default.
1434718683

Edited 1434735880
DK Heinrich
Marketplace Creator
Sheet Author
great, thanks guys - plugging that in as soon as I can stop doing real work while at work and can get back to making power cards :) Edit - of course it worked perfectly, thanks again
I think this question came up before, but I can't seem to find it. Can you do math with conditional labels? For instance, --Roll| [[ [$att1] 1d20 + @{character|meleeweaponattack} + @{character|StrengthBonus} + @{character|ProficiencyBonus} ]] --Roll| [[ [$def1] 1d20 + @{target|Defense} + @{target|AgilityBonus} - @{target|Encumbrance} ]] --?? $att1.total &gt; $def1.total ?? |Hit! @{character|meleeweapondamage} + $att1.total Damage! I want it to subtract the Attack Roll ($att1) from the Defense Roll ($def1). I've also added conditionals for &lt;=, and == as well as == 20 in case of a critical hit.
Jador said: I think this question came up before, but I can't seem to find it. Can you do math with conditional labels? For instance, --Roll| [[ [$att1] 1d20 + @{character|meleeweaponattack} + @{character|StrengthBonus} + @{character|ProficiencyBonus} ]] --Roll| [[ [$def1] 1d20 + @{target|Defense} + @{target|AgilityBonus} - @{target|Encumbrance} ]] --?? $att1.total &gt; $def1.total ?? |Hit! @{character|meleeweapondamage} + $att1.total Damage! I want it to subtract the Attack Roll ($att1) from the Defense Roll ($def1). I've also added conditionals for &lt;=, and == as well as == 20 in case of a critical hit. Not yet. Eventually. been a little busy.
Just realized I could use Powercards to have two different rolling formulas in the same macro depending on whether a "number of dice" calculation worked out to greater than 0 or less than / equal to 0, needed for the OVA system. *Hallelujah Chorus*
Bleh... there is a bug. You can't use keep high or keep low dice rolls in conditionals. Which means my D&D 5e attack macro will fail on checks with advantage or disadvantage. Working on figuring it out now.
1434833699

Edited 1434833718
Here's a workaround until I get it fixed... !power {{ @{format} --charid|@{character_id} --emote|//Nameless unleashes a blast of raw eldritch energy.// --title|HoneyBadger --name|Eldritch Blast --leftsub|Ranged Attack --rightsub|120 ft --title|Attack Type: [[ [$Van] ?{Advantage 2, Disadvantage 1, Standard 0|0} + 0d0 ]] ^^ Hex: [[ [$Hex] ?{Hex|0} + 0d0 ]] --Attack:|[[ [$Atk1] 1d20]] | [[ [$Atk2] 1d20]] vs AC -- ?? $Van == 0 AND $Atk1.base == 1 ?? !StdCritMiss|$$#A00|**You critically missed!**$$ -- ?? $Van == 0 AND $Atk1.base &lt;&gt; 20 ?? !StdHit|**Hit:** [[ [nh] 1d10]] force damage and the target is pushed up to ten feet. -- ?? $Van == 0 AND $Atk1.base == 20 ?? !StdCritHit|**Critical Hit:** [[ [nh] 2d10]] force damage and the target is pushed up to ten feet. -- ?? $Van == 0 AND $Atk1.base &lt;&gt; 1 AND $Atk1.base &lt;&gt; 20 AND $Hex &lt;&gt; 0 ?? !StdHex|^* **+** [[ [nh] 1d6]] necrotic damage (Hex) -- ?? $Van == 1 AND $Atk1.base == 1 OR $Atk2.base == 1 ?? !DisCritMiss|$$#A00|**You critically missed!**$$ -- ?? $Van == 1 AND $Atk1.base &lt;= $Atk2.base AND $Atk1.base &lt;&gt; 1 AND $Atk1.base &lt;&gt; 20 ?? !Dis1Hit|**Hit:** [[ [nh] 1d10]] force damage and the target is pushed up to ten feet. -- ?? $Van == 1 AND $Atk1.base &lt;= $Atk2.base AND $Atk1.base &lt;&gt; 1 AND $Atk1.base &lt;&gt; 20 AND $Hex &lt;&gt; 0 ?? !DisHex1Hit|^* **+** [[ [nh] 1d6]] necrotic damage (Hex) -- ?? $Van == 1 AND $Atk1.base &gt; $Atk2.base AND $Atk2.base &lt;&gt; 1 AND $Atk2.base &lt;&gt; 20 ?? !Dis2Hit|**Hit:** [[ [nh] 1d10]] force damage and the target is pushed up to ten feet. -- ?? $Van == 1 AND $Atk1.base &gt; $Atk2.base AND $Atk2.base &lt;&gt; 1 AND $Atk2.base &lt;&gt; 20 AND $Hex &lt;&gt; 0 ?? !DisHex2Hit|^* **+** [[ [nh] 1d6]] necrotic damage (Hex) -- ?? $Van == 1 AND $Atk1.base == 20 AND $Atk2.base == 20 ?? !DisCritHit|**Critical Hit:** [[ [nh] 2d10]] force damage and the target is pushed up to ten feet. -- ?? $Van == 1 AND $Atk1.base == 20 AND $Atk2.base == 20 AND $Hex &lt;&gt; 0 ?? !DisCritHex|^* **+** [[ [nh] 2d6]] necrotic damage (Hex) -- ?? $Van == 2 AND $Atk1.base == 1 AND $Atk2.base == 1 ?? !AdvCritMiss|$$#A00|**You critically missed!**$$ -- ?? $Van == 2 AND $Atk1.base &gt;= $Atk2.base AND $Atk1.base &lt;&gt; 1 AND $Atk1.base &lt;&gt; 20 ?? !Adv1Hit|**Hit:** [[ [nh] 1d10]] force damage and the target is pushed up to ten feet. -- ?? $Van == 2 AND $Atk1.base &gt;= $Atk2.base AND $Atk1.base &lt;&gt; 1 AND $Atk1.base &lt;&gt; 20 AND $Hex &lt;&gt; 0 ?? !AdvHex1Hit|^* **+** [[ [nh] 1d6]] necrotic damage (Hex) -- ?? $Van == 2 AND $Atk1.base &lt; $Atk2.base AND $Atk2.base &lt;&gt; 1 AND $Atk2.base &lt;&gt; 20 ?? !Adv2Hit|**Hit:** [[ [nh] 1d10]] force damage and the target is pushed up to ten feet. -- ?? $Van == 2 AND $Atk1.base &lt; $Atk2.base AND $Atk2.base &lt;&gt; 1 AND $Atk2.base &lt;&gt; 20 AND $Hex &lt;&gt; 0 ?? !AdvHex2Hit|^* **+** [[ [nh] 1d6]] necrotic damage (Hex) -- ?? $Van == 2 AND $Atk1.base == 20 OR $Atk2.base == 20 ?? !AdvCritHit|**Critical Hit:** [[ [nh] 2d10]] force damage and the target is pushed up to ten feet. -- ?? $Van == 2 AND $Atk1.base == 20 OR $Atk2.base == 20 AND $Hex &lt;&gt; 0 ?? !AdvCritHex|^* **+** [[ [nh] 2d6]] necrotic damage (Hex) }}
1434911828

Edited 1434912576
June 21st, 2015 ~ 2:40 pm eastern Version: 3.2.3 Link: gist.github.com/Sky-Captain-13/452330a3d926b32da49c Bugfix/Update: Conditionals that rely on $ID.base will now work with rolls like 2d20kh1 and 2d20kl1, such as for Advantage/Disadvantage in D&D 5e. It will not work for any rolls that keep more than one die.
This is a single target ranged spell attack macro (Eldritch Blast) for Warlocks in D&D 5e. The methods used here can be adapted for other single target attacks as well. Attacks that target multiple targets aren't suited for complex conditionals. The attribute calls @{charisma_mod} and @{PB} are part of the D&D 5e sheet and can be replaced with whatever mods you want to use. . !power {{ --charid|@{character_id} --emote|//Nameless unleashes a blast of raw eldritch energy.// --name|Eldritch Blast --leftsub|Ranged Attack --rightsub|120 ft --title|Attack Type: [[ [$Van] ?{Advantage 2, Disadvantage 1, Standard 0|0} + 0d0 ]] ^^ Hex: [[ [$Hex] ?{Hex|0} + 0d0 ]] ^^ Target AC: [[ [$AC] [[@{target||AC}]] + 0d0 ]] -- ?? $Van == 0 ?? !StdAtk|**Attack:** [[ [$StdAtk] 1d20 + [[@{charisma_mod}]] [Cha Mod] + [[@{PB}]] [Proficiency] ]] vs [[ [txt] @{target||AC} + 0d0]] AC (@{target||token_name}) -- ?? $Van == 1 ?? !DisAtk|**Attack:** [[ [$DisAtk] 2d20kl1 + [[@{charisma_mod}]] [Cha Mod] + [[@{PB}]] [Proficiency] ]] vs [[ [txt] @{target||AC} + 0d0]] AC (@{target||token_name}) -- ?? $Van == 2 ?? !AdvAtk|**Attack:** [[ [$AdvAtk] 2d20kh1 + [[@{charisma_mod}]] [Cha Mod] + [[@{PB}]] [Proficiency] ]] vs [[ [txt] @{target||AC} + 0d0]] AC (@{target||token_name}) -- ?? $Van == 0 AND $StdAtk.base == 1 ?? !StdCritFail|$$#A00|**You critically missed!**$$ -- ?? $Van == 0 AND $StdAtk.base &lt;&gt; 1 AND $StdAtk.total &lt; $AC ?? !StdMiss|$$#A00|**You missed!**$$ -- ?? $Van == 0 AND $StdAtk.base &lt;&gt; 1 AND $StdAtk.total &gt;= $AC AND $StdAtk.base &lt;&gt; 20 ?? !StdHit|**Hit:** [[ [nh] 1d10 ]] force damage and the target is pushed ten feet -- ?? $Van == 0 AND $StdAtk.base &lt;&gt; 1 AND $StdAtk.total &gt;= $AC AND $StdAtk.base &lt;&gt; 20 AND $Hex &lt;&gt; 0 ?? !StdHex|^* **+** [[ [nh] 1d6 ]] necrotic damage -- ?? $Van == 0 AND $StdAtk.base == 20 ?? !StdCritHit|**Critical Hit:** [[ [nh] 2d10]] force damage and the target is pushed ten feet -- ?? $Van == 0 AND $StdAtk.base == 20 AND $Hex &lt;&gt; 0 ?? !StdCritHex|^* **+** [[ [nh] 2d6 ]] necrotic damage -- ?? $Van == 1 AND $DisAtk.base == 1 ?? !DisCritFail|$$#A00|**You critically missed!**$$ -- ?? $Van == 1 AND $DisAtk.base &lt;&gt; 1 AND $DisAtk.total &lt; $AC ?? !DisMiss|$$#A00|**You missed!**$$ -- ?? $Van == 1 AND $DisAtk.base &lt;&gt; 1 AND $DisAtk.total &gt;= $AC AND $DisAtk.base &lt;&gt; 20 ?? !DisHit|**Hit:** [[ [nh] 1d10 ]] force damage and the target is pushed ten feet -- ?? $Van == 1 AND $DisAtk.base &lt;&gt; 1 AND $DisAtk.total &gt;= $AC AND $DisAtk.base &lt;&gt; 20 AND $Hex &lt;&gt; 0 ?? !DisHex|^* **+** [[ [nh] 1d6 ]] necrotic damage -- ?? $Van == 1 AND $DisAtk.base == 20 ?? !DisCritHit|**Critical Hit:** [[ [nh] 2d10]] force damage and the target is pushed ten feet -- ?? $Van == 1 AND $DisAtk.base == 20 AND $Hex &lt;&gt; 0 ?? !DisCritHex|^* **+** [[ [nh] 2d6 ]] necrotic damage -- ?? $Van == 2 AND $AdvAtk.base == 1 ?? !AdvCritFail|$$#A00|**You critically missed!**$$ -- ?? $Van == 2 AND $AdvAtk.base &lt;&gt; 1 AND $AdvAtk.total &lt; $AC ?? !AdvMiss|$$#A00|**You missed!**$$ -- ?? $Van == 2 AND $AdvAtk.base &lt;&gt; 1 AND $AdvAtk.total &gt;= $AC AND $AdvAtk.base &lt;&gt; 20 ?? !AdvHit|**Hit:** [[ [nh] 1d10 ]] force damage and the target is pushed ten feet -- ?? $Van == 2 AND $AdvAtk.base &lt;&gt; 1 AND $AdvAtk.total &gt;= $AC AND $AdvAtk.base &lt;&gt; 20 AND $Hex &lt;&gt; 0 ?? !AdvHex|^* **+** [[ [nh] 1d6 ]] necrotic damage -- ?? $Van == 2 AND $AdvAtk.base == 20 ?? !AdvCritHit|**Critical Hit:** [[ [nh] 2d10]] force damage and the target is pushed ten feet -- ?? $Van == 2 AND $AdvAtk.base == 20 AND $Hex &lt;&gt; 0 ?? !AdvCritHex|^* **+** [[ [nh] 2d6 ]] necrotic damage }}
1434980214
DK Heinrich
Marketplace Creator
Sheet Author
I have multi attack done like this (not as many conditionals as you have, but in theory would work for yours I think), seems to be working ok so far (this was in 3.2.2 - updating to 3.2.3 in a few minutes). !power {{ --emote|//@{selected|token_name} attacks with his bastard sword...// --charid|@{selected|character_id} --format|playerattack --name|Bastard Sword --title|Melee Attack --leftsub|1st Attack --rightsub|Reach 2 --vs.| **@{target|target1|token_name}** --Attack:|[[ [$Atk] [nh] ?{Number of Boons|0}d6k1 [boon] - ?{Number of Banes|0}d6k1 [bane] +1d20 + @{selected|STR} [str mod] ]] vs [[ @{target|target1|DEFENSE} ]] Defense --?? $Atk.total &lt; @{target|target1|DEFENSE}?? !Miss:|**You Miss...** Why do you play this game? --?? $Atk.total &gt;= @{target|target1|DEFENSE}?? Hit:|[[ [nh] 3d6]] damage --?? $Atk.total &gt;= 20 ?? Critical:| [[ [nh] 1d6]] additional damage }} !power {{ --format|playerattack --name|Bastard Sword --title|Melee Attack --leftsub|2nd Attack --rightsub|Reach 2 --vs.| **@{target|target2|token_name}** --Attack:|[[ [$Atk] [nh] ?{Number of Boons|0}d6k1 [boon] - ?{Number of Banes|0}d6k1 [bane] +1d20 + @{selected|STR} [str mod] ]] vs [[ @{target|target2|DEFENSE} ]] Defense --?? $Atk.total &lt; @{target|target2|DEFENSE}?? !Miss:|**You Miss...** Why do you play this game? --?? $Atk.total &gt;= @{target|target2|DEFENSE}?? Hit:|[[ [nh] 3d6]] damage --?? $Atk.total &gt;= 20 ?? Critical:| [[ [nh] 1d6]] additional damage }}
Ok I have tried and had no luck finding information so I resort to posting, AKA begging for guidance. I want to create a power card that resembles a DND 5E Stat block on the selected monster/npc token that could be whispered at the GM. The main details anyway AC, HP, Stats, etc... I just can't seem to find this anywhere. Is this possible? Has it already been done?
robert c. said: Ok I have tried and had no luck finding information so I resort to posting, AKA begging for guidance. I want to create a power card that resembles a DND 5E Stat block on the selected monster/npc token that could be whispered at the GM. The main details anyway AC, HP, Stats, etc... I just can't seem to find this anywhere. Is this possible? Has it already been done? Actually I am finally getting it to work, seems I had version 1 of the script which was causing me some issues when references newer examples .. but if anyone already has something like this, it would be awesome to see
1435009158
Gen Kitty
Forum Champion
Of course it is possible. It's a bunch of attribute calls, no dice rolls, and you'll want to use --whisper|GM If you need further help, let us know.
1435075112
DK Heinrich
Marketplace Creator
Sheet Author
trying to convert an option in my original version to use more conditionals and am stuck. Original is 3 posts up... this is part of new version. !power {{ --charid|@{character_id} --emote|//@{selected|token_name} swings his weapon….// --format|playerattack --name|Weapon Attack --leftsub|Melee --rightsub|Reach 1 --title|Roll Options: [[ [$Roll] ?{Boon 2, Bane 1, Standard 0|0} + 0d0 ]] --!vs.| ~C vs **@{target|token_name}** ~C -- ?? $Roll == 0 ?? !Stdroll|**Strength:** [[ [$Stdroll] 1d20 + @{selected|STR} ]] vs [[ @{target|DEFENSE} + 0d0 ]] Defense -- ?? $Roll == 1 ?? !Baneroll|**Strength:** [[ [$Baneroll] 1d20 + @{selected|STR} - ?{Number of Banes|1}d6k1 ]] vs [[ @{target|DEFENSE} + 0d0 ]] Defense -- ?? $Roll == 2 ?? !Boonroll|**Strength:** [[ [$Boonroll] 1d20 + @{selected|STR} + ?{Number of Boons|1}d6k1 ]] vs [[ @{target|DEFENSE} + 0d0 ]] Defense (more to come if I can get the above to work) Problem - If I choose any of the three options (0,1,2) (or let it default to 0) I still get asked how many Banes and how many Boons I want for every option. I only want it to ask me in the correct place (ie. Roll 2 = you have a boon, it should ask how many boons (and not how many banes)). All the math is working, and it is applying the boons and banes properly according to the $Roll option chosen - it is just asking the questions every time instead of skipping them when not relevant.
There's no way around that. It's just the way Roll20 works. Any ?{RollQueries|0} in a macro will pop up before the macro is even sent to the API and there's no way to trigger a roll query through the API.
1435150836

Edited 1435157376
DK Heinrich
Marketplace Creator
Sheet Author
was afraid of that answer, thanks again sir! EDIT: have a work around for now, does not allow for unlimited answers to the Query but allows for the most common and realistic answers. Set it up so that the Query asks for a number between 5 and -5, and have the reply for each answer. If someone has more than 5 of either (super unlikely) it can be customized for them.
Is it possible for the script to automatically determine the color of the top part of the power card by the player's chosen color? (I mean the color next to their name, that also is the default for their scribbles on the map, if they make any)
1435355440
Gen Kitty
Forum Champion
Julix, If you do not specify a color you automatically get player_color. Additionally, you can force the script to only use player color by going to line 56 and flipping FALSE to TRUE. var USE_PLAYER_COLOR = false; // Set to true to override all color formatting
Thanks GK. :)
1435381431

Edited 1435381496
A lot of the macros people post include a 0d0 (specifically when defining $Roll ids). Why is that? Is it because they are next to roll queries and won't count as a roll id without a die of some sort?
This is amazing. I never really considered it last time I had Mentorship access... I don't know why. Maybe the name "cards" made me think of those card games one can implement? I must have barely glanced over it, or not trusted myself to be able to figure it out. This looks great, should be the default! I'm assuming if it is even possible to use API in Charactersheets the manjor disadvantage would be that it would require to fork from the normal one which means I wouldn't benefit from the updates without manually implementing them when they come around... However, I still like these better than the default template, so could I make a custom character sheet for Honeybadger style rolls?
Dylan S. said: A lot of the macros people post include a 0d0 (specifically when defining $Roll ids). Why is that? Is it because they are next to roll queries and won't count as a roll id without a die of some sort? Yeah... they won't count as a Roll ID without a roll in there. Julix said: This is amazing. I never really considered it last time I had Mentorship access... I don't know why. Maybe the name "cards" made me think of those card games one can implement? I must have barely glanced over it, or not trusted myself to be able to figure it out. This looks great, should be the default! I'm assuming if it is even possible to use API in Charactersheets the manjor disadvantage would be that it would require to fork from the normal one which means I wouldn't benefit from the updates without manually implementing them when they come around... However, I still like these better than the default template, so could I make a custom character sheet for Honeybadger style rolls? Yeah, there used to be a D&D 4e sheet that had powercards built in. Given all the options available though... it's probably easier to just use a default sheet and make powercard macros that use the sheet attributes.
1435581591

Edited 1435581885
DK Heinrich
Marketplace Creator
Sheet Author
GenKitty said: Julix, If you do not specify a color you automatically get player_color. Additionally, you can force the script to only use player color by going to line 56 and flipping FALSE to TRUE. var USE_PLAYER_COLOR = false; // Set to true to override all color formatting this works even after using --format|blahblah (thank you - thank you... just made made my day).
1435584034

Edited 1435650416
Hello! I have tried to do automatic fighting macro using !power script, but I have little problem right now. !power {{ --emote|//@{selected|token_name} attacks with his primary weapon...// --charid|@{selected|character_id} --format|playerattack --name|@{selected|Attack|max} --title|Melee Attack --vs.| **@{target|target1|token_name}** --leftsub|Primary Attack [[ [$AN] [[@{selected|Attack}]] + 0d0 ]] --rightsub|Primary Defence [[ [$DN] [[@{target|target1|Defence}]] + 0d0 ]] --Attackthrow:| Primary throw: [[ [$AtkP] 1d20 ]] Secondary throw: [[ [$AtkS] 1d20 ]] --Defence:| Primary throw: [[ [$DefP] 1d20 ]] Secondary throw: [[ [$DefS] 1d20 ]] --?? $AtkP.total == 1 AND $AtkS.total &lt;= $AN.total ?? Attacker:| Critically hit! [[ [$ANu] 1d1 ]] --?? $AtkP.total == 1 AND $AtkS.total &gt; $AN.total ?? Attacker:| Special hit! [[ [$ANu] (1d1+1) ]] --?? $AtkP.total &gt;= 5 AND $AtkP.total &lt;= $AN.total ?? Attacker:| Normal hit! [[ [$ANu] (1d1+2) ]] --?? $AtkP.total &lt;= 19 AND $AtkP.total &gt; $AN.total ?? Attacker:| Miss! [[ [$ANu] (1d1+3) ]] --?? $AtkP.total == 20 AND $AtkS.total &lt;= $AN.total ?? Attacker:| Miss! [[ [$ANu] (1d1+3) ]] --?? $AtkP.total == 20 AND $AtkS.total &gt; $AN.total ?? Attacker:| FUMBLE! [[ [$ANu] (1d1+4) ]] --?? $AtkP.total &gt;= 2 AND $AtkP.total &lt;= 4 AND $AtkS.total &lt;= $AN.total ?? Attacker:| Special hit! [[ [$ANu] (1d1+1) ]] --?? $AtkP.total &gt;= 2 AND $AtkP.total &lt;= 4 AND $AtkS.total &gt; $AN.total ?? Attacker:| Normal hit! [[ [$ANu] (1d1+2) ]] --?? $DefP.total == 1 AND $DefS.total &lt;= $DN.total ?? Defender:| Critical defence! [[ [$DNu] 1d1 ]] --?? $DefP.total == 1 AND $DefS.total &gt; $DN.total ?? Defender:| Special defence! [[ [$DNu] (1d1+1) ]] --?? $DefP.total &gt;= 5 AND $DefP.total &lt;= $DN.total ?? Defender:| Normal defence! [[ [$DNu] (1d1+2) ]] --?? $DefP.total &lt;= 19 AND $DefP.total &gt; $DN.total ?? Defender:| Unsuccesful defence! [[ [$DNu] (1d1+3) ]] --?? $DefP.total == 20 AND $DefS.total &lt;= $DN.total ?? Defender:| Unsuccesful defence! [[ [$DNu] (1d1+3) ]] --?? $DefP.total == 20 AND $DefS.total &gt; $DN.total ?? Defender:| FUMBLE! [[ [$DNu] (1d1+4) ]] --?? $DefP.total &gt;= 2 AND $DefP.total &lt;= 4 AND $DefS.total &lt;= $DN.total ?? Defender:| Special defence! [[ [$DNu] (1d1+1) ]] --?? $DefP.total &gt;= 2 AND $DefP.total &lt;= 4 AND $DefS.total &gt; $DN.total ?? Defender:| Normal defence! [[ [$DNu] (1d1+2) ]] --?? $ANu.total == 2 AND $DNu.total == 2 ?? Struggle:| Normal Damage (shield parry) [[ [$Dama] 0d1+1 ]] --?? $ANu.total == 3 AND $DNu.total == 3 ?? Struggle:| Normal Damage (shield parry) [[ [$Dama] 0d1+2 ]] --?? $ANu.total &gt; 3 AND $DNu.total &gt;= 3 ?? Struggle:| No hit, no damage [[ [$Dama] 0d1+3 ]] --?? $ANu.total &gt; 3 AND $DNu.total &lt; 3 ?? Struggle:| No hit, EXTRA HIT FOR DEFENDER! [[ [$Dama] 0d1+4 ]] --?? $ANu.total &lt;= 3 AND $DNu.total == 1 ?? Struggle:| No damage [[ [$Dama] 0d1+5 ]] --?? $ANu.total == 1 AND $DNu.total == 3 ?? Struggle:| Special damage (no shield parry) [[ [$Dama] 0d1+6 ]] --?? $ANu.total == 1 AND $DNu.total == 2 ?? Struggle:| Normal damage (no shield parry) [[ [$Dama] 0d1+7 ]] --?? $ANu.total == 1 AND $DNu.total &gt; 3 ?? Struggle:| Critical damage (no shield parry) [[ [$Dama] 0d1+8 ]] --?? $ANu.total == 2 AND $DNu.total &gt; 3 ?? Struggle:| Special damage (no shield parry) [[ [$Dama] 0d1+9 ]] --?? $ANu.total == 3 AND $DNu.total &gt; 3 ?? Struggle:| Normal damage (no shield parry) [[ [$Dama] 0d1+10 ]] }} For some reason that Struggle line give always value 2. That means variables ANu and DNu are always 3. In case shown above that value should be 4 (No hit, Extra hit for defender), but for some reason value is still 2. To clarify my script, there are 2 skills which are needed from attribute list - selected|Attack and target|Defence. There is also selected|Attack|max but that contains only type of selected NPC primary weapon (1H Spear in this case). After that there is two 1d20 throws - one for attacker and one for defender (there are also secondary 1d20 throws to both of them which helps to define if attack is critical, special or fumble). Both throw's values are checked and value 1 to 5 is stored as a help variable. So attack throw will be cheked (1=critical hit, 2=special hit, 3=normal hit, 4=miss and 5=fumble) and stored variable ANu (first big if blog in script). After that defence throw will be cheked (1=critical, 2=special, 3=normal defence, 4=unsuccesful defence and 5=fumble) and stored variable DNu (second big if blog in script). Finally (last big if blog in script) there is comparison between variables ANu and DNu which defines what happens, but value is always 2 (Struggle: Normal Damage (shield parry). That means ANu and DNu are always 3. Am I storing values in variables some wrong way? In the picture that ANu variable value should be 4 (in row: attacker: Miss! 4) and DNu variable 1 (in row: defender: Critical defence 1). That means script should select script row --?? $ANu.total &gt; 3 AND $DNu.total &lt; 3 ?? Struggle:| No hit, EXTRA HIT FOR DEFENDER! [[ [$Dama] 0d1+4 ]] and value shown last line should be 4, but that is not the case. Could somebody help me? Is there some error or glitch in my syntax? Thanks in advantage! :)
1435599603

Edited 1435672653
Hi All, I've got a few questions that will probably leave me looking a little stupid, but hey if anyone can help I'd be super thankful! Firstly, is there anyway to call a [$Value] within a hidden bracket? I don't want to announce the roll anywhere because it clutters up the token in certain instances. This is the example I've got for this conundrum; !power {{ --bgcolor|#e69138 --txcolor|#ffffff --border|3px --corners|10 --name|@{Selected|character_name} --leftsub|Saving Throw --rightsub|[[ [$User] 1d1 - 1 + (?{Fort (1) / Ref (2) / Will (3)}) ]] --?? $User.total == 1 ?? !Fortitude:|~~~**Fortitude**~R[[1d20 + @{Selected|Fort}]]~R~~~ --?? $User.total == 2 ?? !Reflex:|~~~**Reflex**~R[[1d20 + @{Selected|Ref}]]~R~~~ --?? $User.total == 3 ?? !Willpower:|~~~**Willpower**~R[[1d20 + @{Selected|Will}]]~R~~~ }} Which prints as It doesn't look too bad, however It'd be fantastic if there was a way to hide the input. However changing the row to use the hidden tag as such --$rightsub|[[ [$User] 1d1 - 1 + (?{Fort (1) / Ref (2) / Will (3)}) ]] produces It's not a huge issue, however if there is a way to fix it would anyone be able to help? The second issue that I'm having is just another minor visual thing. This is almost 100% because I'm blind or something, but I've combed the page over and over again for any options, but I am at a loss at how to format the padding of the Power Cards. Instead of having 3px or 4px of blank space padding between the rows like this they've instead got what is basically a 0px buffer and touch the objects of other rows The formatting code I'm currently using is !power {{ --border|3px --bgcolor|#274e13 --txcolor|#ffffff --corners|10 --charid|@{Selected|character_id} --emote|//@{Selected|token_name} shoots that unfriendly fellow over there!// --name|@{Selected|repeating_weapon_0_name} --leftsub|@{Selected|repeating_weapon_0_notes} --rightsub|@{Selected|repeating_weapon_0_type} }} If anyone could possibly help me with my incompetence, that would be lovely!
1435602677
Wes
Pro
Sheet Author
You can hide your query in the --title|(roll goes here) This creates a hidden field that will appear when you mouse over the name of the power card in chat. I'm not sure about the padding.
1435602752
DK Heinrich
Marketplace Creator
Sheet Author
I am also new at this - but I THINK this will do what you want, I am not in a spot to test them sadly. 2nd question - I just use --format|xxx and it gives the basic power card (daily, atwill, etc) with buffer and corners and all that I need. --bgcolor|#e69138 --txcolor|#ffffff --border|3px --corners|10 --Format|atwill If you want custom color (instead of 4e color options) in the title box you can adjust the options in the document that is required to use --format (see above in the rules for this script) 1st question - I think if you put the section you want hidden in a --title|xxx line it will be only shown if you mouse-over the title bar, otherwise it does not show up. !power {{ --bgcolor|#e69138 --txcolor|#ffffff --border|3px --corners|10 --name|@{Selected|character_name} --leftsub|Saving Throw --rightsub|[[ [$User] 1d1 - 1 + (?{Fort (1) / Ref (2) / Will (3)}) ]] --title|[[ [$User] 1d1 - 1 + (?{Fort (1) / Ref (2) / Will (3)}) ]] --?? $User.total == 1 ?? !Fortitude:|~~~**Fortitude**~R[[@{Selected|Fort}]]~R~~~ --?? $User.total == 2 ?? !Reflex:|~~~**Reflex**~R[[@{Selected|Ref}]]~R~~~ --?? $User.total == 3 ?? !Willpower:|~~~**Willpower**~R[[@{Selected|Will}]]~R~~~ }} Hope I'm right and hope it helps!
Lots of stuff to go through... got a D&D game tonight with friends in meatspace. Will look at it after that.
To "fix" the padding, around line 307, look for this line of code: + "padding: 2px 5px 2px 5px; " Change the 2's to something a bit more... padded. I believe I changed mine to 4's and it looks much better.
1435669625

Edited 1435672624
Thank you SeanOG for the padding trick! Worked like a charm, looks so much nicer now. To DK Heinrich and Wes, the use of the --title| seems to have some kind of error (Or I'm doing something stupid) with having [[]] in the line. Here's the new code for that example; !power {{ --format|Skill --name|@{Selected|character_name} --leftsub|Immediate Action --rightsub|Saving Throw --title|Testing [[ [$User] 1d1 - 1 + (?{Fort (1) / Ref (2) / Will (3)}) ]] --?? $User.total == 1 ?? Fortitude:|~R[[1d20 + @{Selected|Fort}]]~R --?? $User.total == 2 ?? Reflex:|~R[[1d20 + @{Selected|Ref}]]~R --?? $User.total == 3 ?? Willpower:|~R[[1d20 + @{Selected|Will}]]~R }} And it produces the following: The first one is simply --title|[[ [$User] 1d1 - 1 + (?{Fort (1) / Ref (2) / Will (3)}) ]] The second one removes the roll (And breaks everything else) just to try the functionality with only text and it works. --title|Testing The Third one tries to combine the two, text and a roll, which produces the same result as the third, such as --title|Testing [[ [$User] 1d1 - 1 + (?{Fort (1) / Ref (2) / Will (3)}) ]] So unfortunately I'm not able to get that one working as of yet. Thanks for your input though, it looked really promising at first! Thanks again everyone for your help! :)
1435673348
DK Heinrich
Marketplace Creator
Sheet Author
Try this - I think the ? has to come before the dice for it to call everything in the correct order. so I moved it up front, corrected spacing that I gave you incorrectly above (I am new at this also) and replaced your 1d1 -1 (net 0) with 0d1 (net 0) - it gave me no errors. I dont use the the other attributes you have listed in what I play but assuming they are called correctly you should be good to go. maybe :) !power {{ --format|Skill --name|@{Selected|character_name} --leftsub|Immediate Action --rightsub|Saving Throw --title|Options: [[ [$User] ?{ Fort (1) - Ref (2) - Will (3)?|0} + 0d1 ]]
1435674951

Edited 1435676676
Alright colour me confused! I was playing around with a few things to try and get to the root of the problem, and I was getting the same error for even things like [[1d20]] in the --title. But then I copy-pasted in your suggestion and it worked like a charm! I'm not entirely sure what you did, but I'd be happy to call you a wizard! Also yeah, good call with the 0d1, I never thought to try that as I thought it might break. Thanks for your help man! Edit: Alright, so I've tried to break it down into basic elements to try and pinpoint my error, but I'm obviously overlooking something that you figured out. So the code that you've supplied me with works, which is: --title|Options: [[ [$User] ?{Fort (1) - Ref (2) - Will (3)?|0} + 0d1 ]] This code, very similar but modified to a different requirement breaks with the same errors I've shown above: --title|Options: [[ [$User] ?{Temp|0} + 1d20 ]] This code also breaks with those same errors --title|Options: [[ 1d20 ]] As does this one --title|[[ 1d20 ]] Edit 2: Now, redoing this a few times I've actually found as soon as you change the 0d1 to 1d20, or 1d1, or 1dAnything it actually stops working for some reason. I'm not entirely sure what is going on here. So code identical to the working one besides for a different value, a dice that actually rolls, produces like these two: So it appears that in changing it to a 0d1 you've stumbled across the fix for the problem I was having at least, however there still appears to be an underlying problem on my side with using any actual dice in the --title| At least that irons out the mystery. I wonder what I've done wrong since this seems to work just fine for everyone else.
1435677905
DK Heinrich
Marketplace Creator
Sheet Author
I think they all have to do with dice that give results vs. the 0d1 option and there is a reason for the 'dice' to not work in this example but I cannot remember why. Might need to combine the working string with a second one that does the math or something to that effect (beyond my ability to answer right now - if I find a way I will post). Oh, also I am very very far from being a wizard - I just happened to have been working on similar things last week and it was fresh in my aging brain.
1435681978

Edited 1435682576
Wes
Pro
Sheet Author
Sorry when I answered you yesterday I was On my phone and they arent very conveinent for typing out macros. Your first macro was correct aside from the roll being before the query. When I changed it's position and put it behind the --title|(TAG) it worked for me. MACRO: !power {{ --bgcolor|#e69138 --txcolor|#ffffff --border|3px --corners|10 --name|@{Selected|character_name} --leftsub|Saving Throw --title|[[ [$User] (?{Fort (1) / Ref (2) / Will (3)}) + 0d0 ]] --?? $User.total == 1 ?? !Fortitude:|~~~**Fortitude**~R[[1d20 + @{Selected|Fort}]]~R~~~ --?? $User.total == 2 ?? !Reflex:|~~~**Reflex**~R[[1d20 + @{Selected|Ref}]]~R~~~ --?? $User.total == 3 ?? !Willpower:|~~~**Willpower**~R[[1d20 + @{Selected|Will}]]~R~~~ }} OUTPUT: I'm Not positive but I would guess that the title line isn't using a full dice parser. It's just being used for assigning the initial query of what option you would like to output.
Weird... I have some free time today while my fiancee is away at work and I have no other plans. I am working on fixing the title dice bug and will see about adding a hidden roll tag like --hroll which will just be used for rolling dice without displaying them on the powercard anywhere, but still be available for use with conditionals.
1435686060
DK Heinrich
Marketplace Creator
Sheet Author
doing more testing with my macro above where HB gave me the bad news about roll query placement... I now have a set up where you answer the query with any number and from 0 thru x it works perfect (adding the result of the query into the d6k1 result and then adding it to my d20 and my attribute). However... if you enter a negative number it fails without any description (does not crash the script, just never gives a result). So question is... is there a way to roll a negative number of dice?
1435687603

Edited 1435689253
Negative number of dice... uh... no? Probably need to include an example of where you would want a negative dice roll or what exactly you mean... I'm confused.
1435690730

Edited 1435690772
DK Heinrich
Marketplace Creator
Sheet Author
short version of what I want to do is d20 + mod +(or -) xd6 in order to set the number that x is equal to (can change every time you attack) I have it set as a roll query to ask how many d6s and if they are added or subtracted... which moves that part of the equation to the front... +(or -) xd6 + d20 + mod when the '-' sign is the 1st thing in the equation the answer is always -x ... it disregards the d6 portion (adding up the rest correctly). So while not technically wanting roll negative amount of d6's - that is the best way I can describe it. Currently I have this (this is partial) --title|Boons/Banes: [[ [$Roll] ?{ Boons (1 to 5) -or- Banes (-1 to -5) -or- Standard (0)?|0} + 0d0 ]] ^^ Target Defense: [[ [$DEF] [[@{target|DEFENSE}]] + 0d0 ]] ^^ Target Critical: [[ [$Crit] [[ 5 + @{target|DEFENSE}]] +0d0 ]] --?? $Roll == 0 ?? !0Roll|**Agility:** [[ [$0Roll] [nh] 1d20 + @{selected|AGI} ]] vs [[ @{target|DEFENSE} + 0d0 ]] Defense --?? $Roll == 1 ?? !1Roll|**Agility:** [[ [$1Roll] [nh] 1d20 + @{selected|AGI} + 1d6k1 ]] vs [[ @{target|DEFENSE} + 0d0 ]] Defense --?? $Roll == 2 ?? !2Roll|**Agility:** [[ [$2Roll] [nh] 1d20 + @{selected|AGI} + 2d6k1 ]] vs [[ @{target|DEFENSE} + 0d0 ]] Defense --?? $Roll == 3 ?? !3Roll|**Agility:** [[ [$3Roll] [nh] 1d20 + @{selected|AGI} + 3d6k1 ]] vs [[ @{target|DEFENSE} + 0d0 ]] Defense --?? $Roll == 4 ?? !4Roll|**Agility:** [[ [$4Roll] [nh] 1d20 + @{selected|AGI} + 4d6k1 ]] vs [[ @{target|DEFENSE} + 0d0 ]] Defense --?? $Roll == 5 ?? !5Roll|**Agility:** [[ [$5Roll] [nh] 1d20 + @{selected|AGI} + 5d6k1 ]] vs [[ @{target|DEFENSE} + 0d0 ]] Defense --?? $Roll == -1 ?? !-1Roll|**Agility:** [[ [$-1Roll] [nh] 1d20 + @{selected|AGI} - 1d6k1 ]] vs [[ @{target|DEFENSE} + 0d0 ]] Defense --?? $Roll == -2 ?? !-2Roll|**Agility:** [[ [$-2Roll] [nh] 1d20 + @{selected|AGI} - 2d6k1 ]] vs [[ @{target|DEFENSE} + 0d0 ]] Defense --?? $Roll == -3 ?? !-3Roll|**Agility:** [[ [$-3Roll] [nh] 1d20 + @{selected|AGI} - 3d6k1 ]] vs [[ @{target|DEFENSE} + 0d0 ]] Defense --?? $Roll == -4 ?? !-4Roll|**Agility:** [[ [$-4Roll] [nh] 1d20 + @{selected|AGI} - 4d6k1 ]] vs [[ @{target|DEFENSE} + 0d0 ]] Defense --?? $Roll == -5 ?? !-5Roll|**Agility:** [[ [$-5Roll] [nh] 1d20 + @{selected|AGI} - 5d6k1 ]] vs [[ @{target|DEFENSE} + 0d0 ]] Defense --?? $Roll == 0 AND $0Roll.total &lt; $DEF ?? Failure:|[[ [txt] 1t[Failure] ]] --?? $Roll == 0 AND $0Roll.total &gt;= $DEF ?? Success:|Deal [[ [nh] 2d6]] damage. --?? $Roll == 0 AND $0Roll.total &gt;= $DEF AND $0Roll.total &gt;= 20 AND $0Roll.total &gt;= $Crit ?? Critical:|You //Drain// your target. It gains [! 1 !] //Corruption// and reduces its //Health// by [[ [nh] 1d6]]. While its //Health// is reduced it makes all //Strength// attack and challenge rolls with 1 bane. If its //Health// is reduced to zero it dies and a new shadow wiggles free from its body. (repeat the last 3 lines for each of the 11 $Rolls) Trying to get it down to something like this --title|Target Defense: [[ [$DEF] [[@{target|DEFENSE}]] + 0d0 ]] ^^ Target Critical: [[ [$Crit] [[ 5 + @{target|DEFENSE}]] +0d0 ]] --!RollRes|**Agility:** [[ [nh] [$RollRes] [[ ?{ Boons (1 to 5) -or- Banes (-1 to -5) -or- Standard (0)?|0} ]]d6k1 + 1d20 + @{selected|AGI} ]] --?? $RollRes.total &lt; $DEF ?? Failure:|[[ [txt] 1t[Failure] ]] --?? $RollRes.total &gt;= $DEF ?? Success:|Deal [[ [nh] 2d6]] damage! --?? $RollRes.total &gt;= $DEF AND $RollRes.total &gt;= 20 AND $RollRes.total &gt;= $Crit ?? Critical:|You //Drain// your target. It gains [! 1 !] //Corruption// and reduces its //Health// by [[ [nh] 1d6]]. While its //Health// is reduced it makes all //Strength// attack and challenge rolls with 1 bane. If its //Health// is reduced to zero it dies and a new shadow wiggles free from its body. EDIT: the current one works - is just long... so if no solution I will survive, just get sore fingers sooner :)
DK, if you're just looking to not have the script crash if the roll is negative (i.e. treat negative dice as 0 dice), one option is maybe using conditionals to check if the dice amount is positive or negative (i.e. greater than or equal to 0, or less than 0) and use two different roll formulas. For the "greater than or equal to," do it normally. For the "less than," multiply the number of dice by 0 to cancel them out.
(Sorry, posted that before your post loaded. O_O Not sure I've understood properly what you're aiming for--not familiar with that system. Will let HB take it! ^_^)
DK Heinrich said: short version of what I want to do is d20 + mod +(or -) xd6 in order to set the number that x is equal to (can change every time you attack) I have it set as a roll query to ask how many d6s and if they are added or subtracted... which moves that part of the equation to the front... +(or -) xd6 + d20 + mod when the '-' sign is the 1st thing in the equation the answer is always -x ... it disregards the d6 portion (adding up the rest correctly). Ah, ok. This isn't a powercards issue. This is a Roll20 dice parser issue. You cannot use [[-1d6]], because as you have found out... it will always disregard the d6 part of the roll. However, if you put a space between the +/- sign, you can get the shorter version to work. Might be best to do that with two roll queries though, unless your players can always remember to put the space in. [[ 1d20 ?{Boon (+) or Bane (-)|+} ?{Number of Dice|0}d6 + 0 [Mods] ]]
1435691974
DK Heinrich
Marketplace Creator
Sheet Author
Shadow of the Demon Lord (by: Robert J. Schwalb) (core book is in layout, I am alpha tester and trying to set up for when its available). One of the mechanics in the game is Boons and Banes. Each time you have a possitive circumstance to your action you gain a boon, each time you have a negative circumstance you get a bane. They cancel eachother out on a 1:1 basis. So with 2 boons, and 4 banes... all I really have is 2 banes. When you roll your boons or banes (assuming more than 1) you only count the highest number. A boon is a d6 that is added to your d20 roll. A bane is a d6 that is subtracted from you d20 roll. I attack you with my sword: I am master fighter (+1 boon) - I would roll 1d20+modifier+1d6 I am drunk (+1 bane) - I would roll 1d20+modifier-1d6 I am drunk and frightened (+2 banes), but my sword is magical (+1 boon) - I would roll 1d20+modifier-1d6 So the d6's can change often and they swing from adding to subtracting from your roll as the situations in the game change... The long version works perfectly - but its really long... just looking to shorten it if possible.
1435692644

Edited 1435693530
Also, the dice rolls in the title tag causing issues are because of nested single and double quotation marks and the nested span/div/title html tags. So... it's really difficult to troubleshoot. Long story short... don't use dice rolls in the title tag anymore. I'm almost done with the hide rolls tag (--hroll) which won't have this issue. Edit - Ok, that was ridiculously easy to add.... I am embarassed I didn't think of it before. &gt;_&lt;