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 4)

You are the best! <3
Good luck!
1493843534

Edited 1493843734
I would like to use this script for WoD Vampire where you roll multiple d10s against a difficulty number. Is this possible? Nevermind - I got it to work.
1493858342

Edited 1493858359
Hello! I love this mod Sky/HB, I'm using it extensively for my monsters and making extensive notes about what each one does.  I couldn't live without it.  :) One problem I'm having though is sometimes it'll look like the power card is on one line, but it's not.  So when I run my ability to 'test' the card part of the card comes up and part of the creatures abilities are dumped straight into chat.  Not ideal, particularly in the middle of combat.  Is there a way to have this work with 'talktomyself' or something similar so I can test and debug without wiping my chat archive all the time? Thank you in advance, Suds
Need you to post your card to trouble shoot it.
Example powercard pasted below.  The techincal issue is that there is a carriage return where there shouldn't be, but from the textbox of the 'abilities' section on the character sheet it's difficult to see.  IMHO the power card is working properly; it took a one line string and parsed it till the <cr>.  It has no idea the <cr> is out of order; the following text could be a description, or anything else.  If powercards worked with 'talktomyself' then that would never show up for the players while I'm troubleshooting.  But not knowing how that all works on the backend I don't know if that's possible. .:: Working ::.: !power --whisper|gm --format|standard --name|Slam --leftsub|Action --rightsub|Reach 5 ft. --Slam|[[1d20cs>20 + 14 ]] for damage [[ 1d8 + 10 ]] plus mummy rot --Mummy rot| Mummy Rot: curse and disease—slam; save Fort DC [[16]]; onset 1 minute; frequency 1/day; effect [[1d6]] Con and [[1d6]] Cha; cure —. Mummy rot is both a curse and disease and can only be cured if the curse is first removed, at which point the disease can be magically removed. Even after the curse element of mummy rot is lifted, a creature suffering from it cannot recover naturally over time. Anyone casting a conjuration (healing) spell on the afflicted creature must succeed on a DC [[20]] caster level check, or the spell is wasted and the healing has no effect. Anyone who dies from mummy rot turns to dust and cannot be raised without a resurrection or greater magic. .:: Broken Example ::. !power --whisper|gm --format|standard --name|Slam --leftsub|Action --rightsub|Reach 5 ft. --Slam|[[1d20cs>20 + 14 ]] for damage [[ 1d8 + 10 ]] plus mummy rot --Mummy rot| Mummy Rot: curse and disease—slam; save Fort DC [[16]]; onset 1 minute; frequency 1/day; effect [[1d6]] Con and [[1d6]] Cha; cure —. Mummy rot is both a curse and disease and can only be cured if the curse is first removed, at which point the disease can be magically removed. Even after the curse element of mummy rot is lifted, a creature suffering from it cannot recover naturally over time. Anyone casting a conjuration (healing) spell on the afflicted creature must succeed on a DC [[20]] caster level check, or the spell is wasted and the healing has no effect. Anyone who dies from mummy rot turns to dust and cannot be raised without a resurrection or greater magic.
It's the carriage return that is breaking it. Use the following format to avoid those issues: !power {{ --whisper|GM --format|standard --name|Slam --leftsub|Action --rightsub|Reach 5ft etc... }}
I uh....  had no idea that was a thing.  That will clean up soooo many macros.  Thank you very much!
1493864649

Edited 1493865665
Sudain said: Example powercard pasted below.  The techincal issue is that there is a carriage return where there shouldn't be, but from the textbox of the 'abilities' section on the character sheet it's difficult to see.  IMHO the power card is working properly; it took a one line string and parsed it till the <cr>.  It has no idea the <cr> is out of order; the following text could be a description, or anything else.  If powercards worked with 'talktomyself' then that would never show up for the players while I'm troubleshooting.  But not knowing how that all works on the backend I don't know if that's possible. .:: Working ::.: !power --whisper|gm --format|standard --name|Slam --leftsub|Action --rightsub|Reach 5 ft. --Slam|[[1d20cs>20 + 14 ]] for damage [[ 1d8 + 10 ]] plus mummy rot --Mummy rot| Mummy Rot: curse and disease—slam; save Fort DC [[16]]; onset 1 minute; frequency 1/day; effect [[1d6]] Con and [[1d6]] Cha; cure —. Mummy rot is both a curse and disease and can only be cured if the curse is first removed, at which point the disease can be magically removed. Even after the curse element of mummy rot is lifted, a creature suffering from it cannot recover naturally over time. Anyone casting a conjuration (healing) spell on the afflicted creature must succeed on a DC [[20]] caster level check, or the spell is wasted and the healing has no effect. Anyone who dies from mummy rot turns to dust and cannot be raised without a resurrection or greater magic. .:: Broken Example ::. !power --whisper|gm --format|standard --name|Slam --leftsub|Action --rightsub|Reach 5 ft. --Slam|[[1d20cs>20 + 14 ]] for damage [[ 1d8 + 10 ]] plus mummy rot --Mummy rot| Mummy Rot: curse and disease—slam; save Fort DC [[16]]; onset 1 minute; frequency 1/day; effect [[1d6]] Con and [[1d6]] Cha; cure —. Mummy rot is both a curse and disease and can only be cured if the curse is first removed, at which point the disease can be magically removed. Even after the curse element of mummy rot is lifted, a creature suffering from it cannot recover naturally over time. Anyone casting a conjuration (healing) spell on the afflicted creature must succeed on a DC [[20]] caster level check, or the spell is wasted and the healing has no effect. Anyone who dies from mummy rot turns to dust and cannot be raised without a resurrection or greater magic. Here is screen shots of what she means Broken Working Looks like a error when coping if you remove the space between it works fine. If you copy text from some where paste it in a word process like word. Stripe all the formatting and then copy and paste into your macros. 
Is there a way to make Power Cards private so everyone does not see them ?  Basically I want to be able to have private rolls between the player and the GM only without everyone in the game seeing it. Xargun
1493935029
vÍnce
Pro
Sheet Author
  I believe Whisper is the command your looking for.  Top of this thread has the command info about powercards. Cheers whisper - Sends the title box and body of the power card to the designated target. For example --whisper|GM would send the power card to the GM.
Vince said:   I believe Whisper is the command your looking for.  Top of this thread has the command info about powercards. Cheers whisper - Sends the title box and body of the power card to the designated target. For example --whisper|GM would send the power card to the GM. I feel silly - I even looked around for the commands list but apparently I was on the wrong pages.. thanks
All the options are scattered here and there... some day I should collect them all into one place.
1493940794

Edited 1493941397
Hello again!  I found a quirk that I wasn't expecting, though it's probably a detail that I've never appreciated until now.  If I add an 'fx' line after the powercard it will work if I select my 'target'.  If I escape out (because I want the information on the powercard, and not the fx) the powercard doesn't show up.  Is that expected, or is there a workaround, or is something else I don't appreciate at play? Thank you again for all your hard work.  :) !power { ...awesome powercard stuff here... } /fx 120Breath @{selected|token_id} @{target|token_id} Edit: ... Derp.  I can 'talktomyself' as a workaround.
If you cancel a @{target command like that, it cancels the entire thing.
Ah, that would explain it.  Okay thank you.
1494002040

Edited 1494002261
Sudain said: Hello again!  I found a quirk that I wasn't expecting, though it's probably a detail that I've never appreciated until now.  If I add an 'fx' line after the powercard it will work if I select my 'target'.  If I escape out (because I want the information on the powercard, and not the fx) the powercard doesn't show up.  Is that expected, or is there a workaround, or is something else I don't appreciate at play? Thank you again for all your hard work.  :) !power { ...awesome powercard stuff here... } /fx 120Breath @{selected|token_id} @{target|token_id} Edit: ... Derp.  I can 'talktomyself' as a workaround. Could you make the fx a macro and call to the macro and then if you esc out it might only affect that macro. Worth a try. Or maybe a ?{Use Fx | no, | yes, #macro}
I have my power card spell book macro setup and on my mac it looks like this. The green check box with the white check mark is a Unicode symbol.  But on windows machine it looks like this Anyone know how or even if i can fix this?
I'll check into that Craven!  Thank you. As far as the checkmark goes I think unicode symbols will display based upon what system it's being loaded from.  I blaim MS and apple.  
1494015202
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Sudain said: I'll check into that Craven!  Thank you. As far as the checkmark goes I think unicode symbols will display based upon what system it's being loaded from.  I blaim MS and apple.   This is true. They will also look different on a Chromebook, or on Facebook, etc. They are Unicode characters, not a real font.  Here is an example of the "White Heavy Check Mark" on a variety of systems.
Craven said: I have my power card spell book macro setup and on my mac it looks like this. The green check box with the white check mark is a Unicode symbol.  But on windows machine it looks like this Anyone know how or even if i can fix this? Looks awesome. Don't forget you can use ^^ to create line breaks in powercards to put things on their own line inside the same tag. I would also put an empty box in the prepsymbol-0 to line everything up neatly.
1494234362

Edited 1494234626
Can you explain why the following code will crash the api when used on some characters, but work perfectly fine on others?  Taking off the alterbars conditional lets it work on every character, but doesn't apply damage.  All characters have their health on bar 3. TypeError: Cannot read property 'get' of undefined !power {{ --charid|@{character_id} --emote|@{character_name} looses an arrow at @{target|character_name} --format|encounter --name|@{repeating_attack_$0_name} --title|@{repeating_attack_$0_content} --leftsub|@{repeating_attack_$0_attack_damage_dice}@{repeating_attack_$0_attack_damage_die} + @{dexterity_mod} + @{repeating_attack_$0_attack_damage_bonus} --rightsub|@{repeating_attack_$0_attack_damage_type} --hroll| [[ [$Atk] 1d20 @{repeating_attack_$0_to_hit}]] [[ [$Dmg] @{repeating_attack_$0_attack_damage_dice}@{repeating_attack_$0_attack_damage_die} + @{dexterity_mod} + @{repeating_attack_$0_attack_damage_bonus}]] [[ [$CDmg] [[@{repeating_attack_$0_attack_damage_dice}*2]]@{repeating_attack_$0_attack_damage_die} + @{dexterity_mod} + @{repeating_attack_$0_attack_damage_bonus}]] --?? $Atk.base == 1 AND @{target|HP} > 0 ?? !CritMiss:|@{target|character_name} completely misses. --?? $Atk.base > 1 AND $Atk.total <= [[@{target|AC}/2]] AND @{target|HP} > 0 ?? !Miss:|@{target|character_name} dodges @{character_name}'s arrow. --?? $Atk.total > [[@{target|AC}/2]] AND $Atk.total < @{target|AC} AND @{target|HP} > 0 ?? !Armor:|@{character_name}'s arrow helplessly plinks off of @{target|character_name}'s @{repeating_armor_$0_name} armor. --?? $Atk.total >= @{target|AC} ?? alterbar1|_target|@{target|token_id} _bar|3 _amount|-[^Dmg] _show|none --?? $Atk.total >= @{target|AC} AND @{target|HP} > 0 ?? !Hit:|@{character_name}'s arrow strikes @{target|character_name} doing [^Dmg] damage. --?? $Atk.base == 20 AND @{target|HP} > 0 ?? !Hit:|@{character_name}'s arrow pierces @{target|character_name} in the chest doing [^CDmg] damage. --?? $Atk.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|3 _amount|-[^CDmg] _show|none --?? @{target|HP} == 0 ?? !Dead:|@{character_name}'s arrow hits @{target|character_name}'s corpse, confusing those around him. }}
Which character sheet is his using?
All the characters use the  DnD5e Shaped Character Sheet
1494282838
Pktome
Pro
Sheet Author
How do I correct this error? And what could cause this error? TypeError: Cannot read property 'get' of undefined TypeError: Cannot read property 'get' of undefined at Object.AlterScript.Process (apiscript.js:3255:36) at apiscript.js:3163:15 at eval (eval at (/home/node/d20-api-server/api.js:146:1), :65:16) at Object.publish (eval at (/home/node/d20-api-server/api.js:146:1), :70:8) at /home/node/d20-api-server/api.js:1510:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) at Zd.Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425)
Hello, I have a small question, is there a way to make 1 / 2 = 1 instead of 0.5 ? I just want to keep the interger like 5 / 2 = 3 instead of 2.5? my formula looklike this : [[ ((@{miles} * 10) * @{valueterrain}) / @{valuemodetravel} ]] Thank you. 
Yeah, use ceil(1/2). Other problems, I'll try looking at them tomorrow or Thursday.
1494431943

Edited 1494432252
Alright, so I'm getting this error: Could not determine result type of: [{"type":"L","text":"$Atk"},{"type":"M","expr":"8+(floor((16-10)/2))+(ceil((7)/10000000000)+ceil((7)/4))"}] On this macro: I've narrowed it down to the Attack line but I don't really understand what's going on. Any insight? !power  --format|darktheme --tokenid|@{selected|token_id} --name|Shards Oblivion --action|Standard Action --emote|@{selected|character_name} invokes the magic of his hammer and slams it down on the ground\, causing it to scatter in a flash of blinding darkness\. --Target|@{target|character_name} --Range|30 ft\. --Effect|Dexterity saving throw. On success, half damage\. --Attack|[[ [$Atk] 8+@{selected|strength_mod}+@{selected|PB}]] vs [[ [$Sav] 1d20+@{target|dexterity_mod}]] --?? $Atk <= $Sav ?? Saved:|[[ [$Dmg] 10d4/2]] Blunt damage\. alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all --?? $Atk > $Sav ?? Hit:|[[ [$Dmg] 10d4]] Blunt damage\. alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all Edit: well, bottom rows are redundant I can just use one line of damage so gonna scrap that.
1494435688

Edited 1494435723
Replace [[ [$Atk] 8+@{selected|strength_mod}+@{selected|PB}]] with [[ [$Atk] 8+@{selected|strength_mod}+@{selected|PB} + {0} ]] There's a bug (not a PowerCards bug) with inline rolls that start with a Roll Label ; they throw an error unless they contain a sum roll .
Thank you! I was about to accept my fate and just do [[ [$Atk] 8d1+@{selected| yadda yadda.
Alright, well this is interesting. I can cast any of my macros on any token except one. When it does, it crashes the API. Here's the error. TypeError: Cannot read property 'get' of undefined TypeError: Cannot read property 'get' of undefined at Object.AlterScript.Process (apiscript.js:9766:36) at apiscript.js:9674:15 at eval (eval at (/home/node/d20-api-server/api.js:146:1), :65:16) at Object.publish (eval at (/home/node/d20-api-server/api.js:146:1), :70:8) at /home/node/d20-api-server/api.js:1510:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) at Zd.Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425)
Which version of AlterBars are you using? And what's the macro?
1494462662

Edited 1494476513
AlterBars v2.0.4 !power {{ --format|silvertheme --tokenid|@{selected|token_id} --name|@{selected|character_name} --Action|Action/Bonus Action --leftsub|Moonbeam --rightsub|Level 2 Evocation --emote|@{selected|character_name} mutters a string of arcane words and a beam of silvery light shines down upon @{target|character_name} --Target|@{target|character_name} --Range|120 ft. --Effect|Constitution saving throw. On success, half damage. --Attack|[[ [$Atk] 8+@{selected|spell_save_dc}+{0}]] vs [[ [$Sav] ?{Roll type|Normal roll, 1d20|Advantage, 2d20kh1|Disadvantage, 2d20kl1}+@{target|constitution_mod}]] --?? $Atk.total <= $Sav.total ?? Saved:|[[ [$Dmgg] floor(?{Cast at level|2|3|4|5|6|7|8|9}d10/2)]] Radiant damage. --?? $Atk.total <= $Sav.total ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmgg] _show|all --?? $Atk.total > $Sav.total ?? Failed:|[[ [$Dmg] ?{Cast at level|2|3|4|5|6|7|8|9}d10]] Radiant damage. --?? $Atk.total > $Sav.total ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all }} I've since changed the Macro, but it literally works on everyone except for one player. It's really weird. Edit: And now when I try to put it on an NPC it crashes. Hrm. Trying to tweak values, but it's weird. Updated Macro. Different error with the updated Macro: TypeError: Cannot read property 'get' of undefined TypeError: Cannot read property 'get' of undefined at Object.AlterScript.Process (apiscript.js:9766:36) at apiscript.js:9674:15 at eval (eval at (/home/node/d20-api-server/api.js:146:1), :65:16) at Object.publish (eval at (/home/node/d20-api-server/api.js:146:1), :70:8) at /home/node/d20-api-server/api.js:1510:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) at Zd.Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425)  - Randomly started working on NPC's, you can ignore this portion. PS: What program do you use for debugging? I'd love to learn how to fix API's and I'm not super new to programming, just haven't gone super in depth before.
I don't use any program for debugging. It's simply a matter of trial and error and adding log statements here and there trying to find where it crashes. Which unfortunately I can't figure out what it failing based on what you and others have posted here. Only thing I can think of is that their attributes got messed up somehow.
1494503176
The Aaron
Pro
API Scripter
TypeError: Cannot read property 'get' of undefined TypeError: Cannot read property 'get' of undefined at Object.AlterScript.Process (apiscript.js:9766:36) at apiscript.js:9674:15 at eval (eval at (/home/node/d20-api-server/api.js:146:1), :65:16) at Object.publish (eval at (/home/node/d20-api-server/api.js:146:1), :70:8) at /home/node/d20-api-server/api.js:1510:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) at Zd.Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) .get() is only ever called on Target. If the id passed to target|[TOKEN_ID] is not a graphic (a drawing, for example), it will be undefined on line 82.  if you add this on line 94 (right after the _.each()): if(!Target) { sendChat("ERROR", `/w "${who}" Not a valid target id.`); return; } It should prevent the crash and provide feedback to the caller.
Ah, makes sense. I never considered someone selecting/targeting a drawing. Thanks!
AlterBars 2 is updated with that addition. Dunno if it'll fix other's problems... but hope so!
In my Vampire game I am using a Power Card macro to roll intiative and allow characters to declare their action and dodges. Yet the macro does not report the correct initiative roll to the Tracker. Any ideas? !power {{ --whisper|GM --name|@{selected|token_name} rolls a [[1d10+@{Wits} +@{Dexterity} + @{PumpDex} + @{Armor_Dex} +@{WP} &{tracker}]] for initiative! --Action|@{selected|token_name} 's is going to ?{Action}. --Dodge|@{selected|token_name} has saved ?{Dodges} Dodge(s). }}
You can't use the built in tracker method with powercards. Instead use [[ [TRKR] 1d10 + stuff ]]
Sky said: You can't use the built in tracker method with powercards. Instead use [[ [TRKR] 1d10 + stuff ]] That worked perfectly. thank you
Since I haven't said it already, thank you SO much for your work on this API and AlterBars. Working with these has made a ton of things easier.
An update.   It now shows the "Not a valid target id." error. But it seems that dragging and dropping the token from the Journal and deleting the old one fixes it.
What am I doing wrong with this: !token-mod --set statusmarkers|!bleeding-eye:?{Turns|1} it's just supposed to ask for how many turns and set that status on with that number regardless of whether it was on before or not. Is that not possible? Or am I just doing it wrong?
1494839379

Edited 1494839832
Ziechael
Forum Champion
Sheet Author
API Scripter
Sylverlokk said: What am I doing wrong with this: !token-mod --set statusmarkers|!bleeding-eye:?{Turns|1} it's just supposed to ask for how many turns and set that status on with that number regardless of whether it was on before or not. Is that not possible? Or am I just doing it wrong? You'd be best off posting in the  tokenMod thread for help so I have answered  over there for you :)
1494883591
Dougansf
Pro
Sheet Author
Is there a way to use something like the [XPND] command that only shows results higher than 0? I'm using Power Cards for my Earthdawn character sheet.  ED uses all kinds of dice, and I have a complex macro to roll the right dice at the right time.  If I use [XPND] now, I see lots of wasted space for the dice that aren't rolled, as well as the actual dice results, and the total.
1494893012

Edited 1494893051
XPND works on the entire roll unfortunately. Post your macro and a screenshot of what it looks like as well as a short description of how the whole mechanic works and I'll see if there's anything I can do to make it better.
Thanks Ziechael I was half asleep and posted in wrong thread. 
I am working on a macro for my Vampire game and am getting an error. Can another set of eyes see what I am doing wrong? !power {{ --target_list|@{target| |token_id} --name|@{selected|token_name} stares into her target's eyes and attempts to draw out their Soul !!! --Difficulty| [[ [$Dif] (12 - %%PathoE%%) ]] --Consumption of the Soul| [[ (@{Stamina} + @{PumpSta} + @{Empathy} + @{WP})d10> [$Dif]f1 ]] --Limitations| Cannot be used on those with Path of 0 or 1, as well as some following inhuman paths. }} Basically I am reading the target for the %%PathoE%% attribute and subtracting it from 12 to get the difficulty for the roll on he next line.
Just use @{target|PathoE} instead. Target list and info charms is for when you're doing multiple rolls against multiple targets.
I have adjusted my macro as below !power {{ --name|@{selected|token_name} stares into her target's eyes and attempts to draw out their Soul !!! --Consumption of the Soul|[[ (@{Stamina} + @{PumpSta} + @{Empathy} + @{WP})d10>((12 - @{target|PathoE})f1)]] }} But am still getting the following error. "Could not determine result type of: [{\"type\":\"M\",\"expr\":\"(1+0+0+0)\"},{\"type\":\"C\",\"text\":\"d10>((12 - 4)f1) \"}]"