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

[Script] PowerCards 3 (Thread 6)

Is there a way to convert empty text "" into 0d0? I'm running into trouble accessing the repeating_npcaction_$0_attack_damage2 value off the OGL sheet. --replacenpcaction|@{selected|character_id}|@{selected|repeating_npcaction_$1_name} --?? "~NPCA-DAMAGE2$" == "" ?? !hit|[Hit](~npc|hit) [#[ [$dmg] ~NPCA-DAMAGE$ ]#] ~NPCA-DAMAGETYPE$ --?? "~NPCA-DAMAGE2$" <> "" ?? !hit2|[Hit](~npc|hit2) [#[ [$dmg1] ~NPCA-DAMAGE$ ]#] ~NPCA-DAMAGETYPE$ + [#[ [$dmg2] ~NPCA-DAMAGE2$ ]#] ~NPCA-DAMAGETYPE2$ Apparently the roll is built with the empty string before the conditional is tested. Everything works if I set the character sheet to 0d0 and check for 0d0 instead (but I'd like to avoid doing that for all my monsters): --?? "~NPCA-DAMAGE2$" == "0d0" ?? !hit|[Hit](~npc|hit) [#[ [$dmg] ~NPCA-DAMAGE$ ]#] ~NPCA-DAMAGETYPE$ --?? "~NPCA-DAMAGE2$" <> "0d0" ?? !hit2|[Hit](~npc|hit2) [#[ [$dmg1] ~NPCA-DAMAGE$ ]#] ~NPCA-DAMAGETYPE$ + [#[ [$dmg2] ~NPCA-DAMAGE2$ ]#] ~NPCA-DAMAGETYPE2$
Solved my problem by inserting 0d0 in an hroll, then using the total in a conditional. --hroll|[[ [$dmg] @{selected|repeating_npcaction_$1_attack_damage} ]] [[ [$dmg2] 0d0 + @{selected|repeating_npcaction_$1_attack_damage2} ]] --?? $dmg2.total == 0 ?? ...
Hey so I'm really dumb and I'm trying to create a potion powercard macro that uses alterbars to change their HP bar but I can't get it to work, just says "That is not a valid bar." If anyone could help me would be greatly appreciated! !power {{ --tokenid|@{selected|token_id} --emote|@{selected|token_name} drinks a Potion of Healing --emotefont|font-family: New Century Schoolbook, serif; font-weight: bold; font-size:10pt; --border|1px solid #1ddfb3 --corners|0 --bgcolor|#ffffff --txcolor|#1f91a9 --erowtx|#ffffff --erowbg|#28baa8 --orowtx|#ffffff --orowbg|#1f91a9 --name|Potion of Healing --titlefont|New Century Schoolbook --titlefontshadow|none --subtitlefont|New Century Schoolbook --bodyfont|New Century Schoolbook --!Healing:|~C @{selected|token_name} regains [[ [$Atk] [NH] ?{Potion Rarity?|Common, 2d4+2|Greater, 4d4+4|Superior, 8d4+8|Supreme, 10d4+20} ]] HP ~C --alterbar| alterbar1|_target|@{selected|token_id} _bar|1  _amount|+[^Atk]  }}
1553694003

Edited 1553695796
Hi Caleb, here is a version of powercards macro that I use for potions with alterbars to automatically apply the healing. !power {{ --name|Potion --leftsub|1 Bonus Action --rightsub|Self --tokenid|@{selected|token_id} --emote|@{selected|character_name} drinks a potion of healing --?? $potion == 0 ?? |~C//**Potion of Healing, ^^ common//**~C --?? $potion == 1 ?? |~C//**Potion of Greater Healing, ^^uncommon//**~C --?? $potion == 2 ?? |~C//**Potion of Superior Healing ^^rare//**~C --?? $potion == 3 ?? |~C//**Potion of Supreme Healing, ^^very rare//**~C --hroll|[[ [$potion] ?{Type|Potion of Healing, 0|Potion of Greater Healing, 1|Potion of Superior Healing, 2|Potion of Supreme Healing, 3} +0d0 ]] --?? $potion == 0 ?? Result:|@{target|character_name} regains [[ [$Healing0] 2d4 +2 ]] hit points. --?? $potion == 1 ?? Result:|@{target|character_name} regains [[ [$Healing1] 4d4 +4 ]] hit points. --?? $potion == 2 ?? Result:|@{target|character_name} regains [[ [$Healing2] 8d4 +8 ]] hit points. --?? $potion == 3 ?? Result:|@{target|character_name} regains [[ [$Healing3] 10d4 +20 ]] hit points. --?? $potion == 0 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|[^Healing0] _show|none --?? $potion == 1 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|[^Healing1] _show|none --?? $potion == 2 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|[^Healing2] _show|none --?? $potion == 3 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|[^Healing3] _show|none }}
1556481895

Edited 1556524295
Ravenknight
KS Backer
Would it be possible to edit  PCM Helper to add macros for stuff like Reactions, Traits and the like? ( If so, then I'm in DM heaven. :D )  Also, can the PCM Helper be set up to show Token names instead of the character names?
1557204595
Pktome
Pro
Sheet Author
I wanted to know if it is that using the Major > or Minor < Condition within a [[xxx]]. For example: [[(ABC) * (1 + 1d100 > 50)]] that is, you would like the result "d100" to be greater than 50, double the previous value (ABC) [[(ABC) * (1 + (51)>50)]] => [[(ABC) * (1 + 1)]] => [[(ABC) * (2)]] When I put (1+1d100>50) within [[]] within [[]]: [[(ABC) * [[(1+1d100>50)]] ]] it recognizes, but this prevents me from having multiple rows with d100 with different values. !power {{ --emote|@{selected|token_name} - DNF --tokenid|@{selected|token_id} --titlefontshadow|none --emotefont|font-family: Arial; font-weight:bold; font-style:Italic; font-size: 16px; --hroll|?{Quantidade|@{selected|qtd}} [[ [$1] 0d0 + 100 + @{selected|character_rank} - @{target|Alvo|character_rank} ]] [[ [$2] 0d0 + @{target|Alvo|dnfX} - 1 ]] --?? $1.total > 0 AND $2.total > 0 ??!a2|~C**DNB** ?{Multiplicador (%)|100}% **DNF.Max:** [[  [TXT] 0d0 + floor(@{selected|dnf}*25/1000) ]]k [[  [TXT] 0d0 + @{selected|dnf}*25-floor(@{selected|dnf}*25/1000)*1000 ]] ~C --?? @{target|Alvo|bar3} > 1 AND $1.total > 0 AND $2.total > 0 ??!A1|~C **Alvo está Defendendo!** ~C --?? @{selected|bar3} > 1 AND $1.total > 0 AND $2.total > 0 ??!A2|~C **Personagem está Defendendo!** ~C --?? @{target|Alvo|DNREAL} == 1 ??!A3|~C **Alvo está levando DNR** ~C --?? $1.total > 0 AND $2.total > 0 ??!ATQ#?{Quantidade|@{selected|qtd}}| ~C **Dano:** [[ floor([[@{selected|DNF}*100/(@{selected|DNF}+@{target|Alvo|REF}-@{target|Alvo|REF}*@{target|Alvo|DNREAL})/100*@{selected|DNF}* ?{Multiplicador (%)|100}/100*@{target|Alvo|character_rerank} / 100 * @{target|Alvo|dnfX} / 100 * (100 + @{selected|character_rank} - @{target|Alvo|character_rank}) / 100 / @{target|Alvo|bar3} * @{selected|character_dnrank} / 100 / @{selected|bar3} * (25+(@{target|Alvo|bar1} * 100 / @{target|Alvo|bar1|max})*0.75) / 100 * ( 1 - @{target|Alvo|soma_rank}/100)]] * (@{selected|arma}) ) * [[(1+1d100>[[99-@{selected|CC}]]*(400-100)/100)]] ]] ~C --?? @{target|Alvo|DNEXTRA} == 1 AND $1.total > 0 AND $2.total > 0 ??!danoporvida| ~C **DN Extra:** [[ [TXT] 0d0 + floor(@{target|Alvo|bar1} * 0.1 * @{target|Alvo|character_rerank} / 100 / @{target|Alvo|bar3} * @{selected|character_dnrank} / 100 * @{target|Alvo|dnfX} / 100 * (100 + @{selected|character_rank} - @{target|Alvo|character_rank}) / 100 / @{selected|bar3} * ( 1 - @{target|Alvo|soma_rank}/100) + @{target|Alvo|bar1|max} * 0.025 * ?{Quantidade|@{selected|qtd}} * @{target|Alvo|character_rerank} / 100 * @{target|Alvo|dnfX} / 100 * (100 + @{selected|character_rank} - @{target|Alvo|character_rank}) / 100 / @{target|Alvo|bar3} * @{selected|character_dnrank} / 100 / @{selected|bar3} * (25+(@{target|Alvo|bar1} * 100 / @{target|Alvo|bar1|max})*0.75) / 100 * ( 1 - @{target|Alvo|soma_rank}/100)  ) ]] ~C --?? @{selected|m_arma} == 1 AND $1.total > 0 AND $2.total > 0 ??!extra1| ~C @{selected|mao1_texto2} ~C --?? @{selected|m_arma} == 2 AND $1.total > 0 AND $2.total > 0 ??!extra2| ~C @{selected|mao1_texto2} ^^^^ @{selected|mao2_texto2} ~C --?? $1.total <= 0 ??!explicacao1| ~C Diferença de **Rank** muito alta ~C --?? $2.total <= 0 ??!explicacao2| ~C O alvo **não recebe** esse tipo de DN ~C }} --?? $1.total > 0 AND $2.total > 0 ??!ATQ#?{Quantidade|@{selected|qtd}}| ~C **Dano:** [[ ... * [[(1+1d100>[[99-@{selected|CC}]]*(400-100)/100)]] ]] ~C and when I remove [[]], it simply does not give an error, but does not proceed with the codes.
1557450905
Kurt J.
Pro
API Scripter
Sorry all... I've been away for a few weeks :) Busy with non-gaming stuff (the horror!) Anyway... Ravenknight said: Would it be possible to edit  PCM Helper to add macros for stuff like Reactions, Traits and the like? ( If so, then I'm in DM heaven. :D )  Also, can the PCM Helper be set up to show Token names instead of the character names? Reactions, Traits, etc - Definitely on the to-do list. This is really just a matter of getting the time to go in and do it, as there isn't really anything different about these items. Token Names : I'll need to check this... it is probably just a matter of editing the macros.
Hey Guys. I am having trouble with the  titlefontsize as it overflow the title box. Does someone know how can i Fix this? Help please
1557592540
The Aaron
Roll20 Production Team
API Scripter
Hey Kurt, I posted a little post-processing change that will cause links to take on the color of their containing element (the short hand [title](url) version of links).&nbsp; It's here if you want to roll it into the main line:&nbsp;<a href="https://app.roll20.net/forum/permalink/7444716/" rel="nofollow">https://app.roll20.net/forum/permalink/7444716/</a>
1557592626
The Aaron
Roll20 Production Team
API Scripter
Danny C. said: Hey Guys. I am having trouble with the&nbsp; titlefontsize as it overflow the title box. Does someone know how can i Fix this? Help please How are you specifying titlefontsize?&nbsp; Specifying line-height along with it should fix that.
1557592789
The Aaron
Roll20 Production Team
API Scripter
For example (using 1em makes it match the specified font-size, but you could use the same size, or a larger one to make it double spaced, etc): !power {{ --titlefontshadow|none --titlefontsize|36pt; line-height: 1em --titlefont|Times New Roman --corners|10 --format|Spell --name|[Protection from Rain](<a href="http://journal.roll20.net/handout/-LMnIC0j2IyWCLPyGFtN" rel="nofollow">http://journal.roll20.net/handout/-LMnIC0j2IyWCLPyGFtN</a>) --leftsub|CN: 0 --rightsub|Duration: [[ [TXT] 23 + 0d0 ]] hours }}
1557611314

Edited 1557636371
Hello!&nbsp; I'm doing my best to self-teach, but after a few days of puzzlement I wanted to reach out.&nbsp; I'm trying to create fairly robust, interactive NPC sheets much the ones you have that are easy enough to make for DnD, but for Infinity RPG instead.&nbsp; My understanding is that the scripting is pretty flexible and can handle a ton of different things, but stuff like&nbsp; --npc_attribute_summary and other super handy tools are keyed to the DnD sheet.&nbsp; Obviously, since the tag doesn't know to call the attribute "Brawn," I can't do that without&nbsp; employing a few tricks. How do I get started manipulating helpful tags like this for use in other systems?&nbsp; Is this a job for Replacements, or do I just need to start from scratch?&nbsp; Can the various npc tags be edited ? Sorry.&nbsp; I tried to do my research on this one but there are just so many PowerCard threads and it's tough to wade through. EDIT:&nbsp; I'm trying to make use of the repeating section replacements, but I can't figure out what the "entryname" would be.&nbsp; If I'm trying to call info for various weapons for one character, this is what I need, correct?&nbsp; In the Infinity&nbsp; sheets, it's pretty clear that the "repeating_weapons" is the proper "sectionname," but they don't come under any other header. EDIT 2: Feeling confounded right now.&nbsp; I couldn't get Templates to work and assumed it was a sheet problem, so I decided to test it in a DnD&nbsp; game.&nbsp; I just copied the basic examples from the wiki, created a "PowerCard Templates" Handout, and used the suggested macro, and&nbsp; nothing prints.&nbsp; Here's what I'm talking about: The template... weapon:--name|~0! --leftsub|~1! --rightsub|~2! --Attack:|[[ [$Atk] ~3! ]] vs AC ~4! --Damage:|[[ [$Dmg] ~5! ]] And the macro... !power {{ --template|weapon|Longsword;Melee Attack; 5 ft. Reach;2d20kh1;@{target|AC};1d8+@{selected|strength_mod} }} Other macros I've created work just fine on the selected tokens, but the test template prints a blank.&nbsp; What am I missing?
Kurt J. said: Sorry all... I've been away for a few weeks :) Busy with non-gaming stuff (the horror!) Anyway... Ravenknight said: Would it be possible to edit&nbsp; PCM Helper to add macros for stuff like Reactions, Traits and the like? ( If so, then I'm in DM heaven. :D )&nbsp; Also, can the PCM Helper be set up to show Token names instead of the character names? Reactions, Traits, etc - Definitely on the to-do list. This is really just a matter of getting the time to go in and do it, as there isn't really anything different about these items. Token Names : I'll need to check this... it is probably just a matter of editing the macros. Sweet! :D
Can anyone tell me why some of my Power Card titles come out looking like this? Something to do with text shadows or such.&nbsp;&nbsp;
1557785636
Kurt J.
Pro
API Scripter
Dave T said: Can anyone tell me why some of my Power Card titles come out looking like this? Something to do with text shadows or such.&nbsp;&nbsp; If you are using the default macros that come with PCMHelper, they look for a --format in the PowerCards Formats handout that corresponds to the name of the character running the card. If there isn't a format with that name, the defaults (which, admittedly aren't ideal) gets used. You can specify formatting in-line in you cards using the tags listed here : <a href="https://wiki.roll20.net/Script:PowerCards#Formatting_and_Configuration_Tags" rel="nofollow">https://wiki.roll20.net/Script:PowerCards#Formatting_and_Configuration_Tags</a> However, creating a format for each character allows you do to things like specifying a different title background color for each player (I use the same color that Roll20 assigns to the player when they join).
1557873817

Edited 1557873881
One more issue. All NPC attacks that use the PCMHelper Macro yield the following error:&nbsp; PowerCards: &nbsp;"Could not determine result type of: [{\"type\":\"M\",\"expr\":1},{\"type\":\"C\",\"text\":\"d20$ + 4 [Attack Bonus] \"}]"
1557879804
Kurt J.
Pro
API Scripter
Dave T said: One more issue. All NPC attacks that use the PCMHelper Macro yield the following error:&nbsp; PowerCards: &nbsp;"Could not determine result type of: [{\"type\":\"M\",\"expr\":1},{\"type\":\"C\",\"text\":\"d20$ + 4 [Attack Bonus] \"}]" Very often, that error indicates that the NPC is not set to use Advantage Toggle.
Continuing my work on the custom dice, I tried to add a checker for 6s after copying the exact PowerCard script to a custom script.&nbsp; I tried to exactly replicate the language it uses to check for tens and ones, but I ended up getting this long error statement: TypeError: Cannot read property 'sixes' of undefined &nbsp; &nbsp; at apiscript.js:3055:56 &nbsp; &nbsp; at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:186:9) &nbsp; &nbsp; at doInlineFormatting (apiscript.js:3036:6) &nbsp; &nbsp; at apiscript.js:2673:15 &nbsp; &nbsp; at Array.forEach (native) &nbsp; &nbsp; at apiscript.js:2671:9 &nbsp; &nbsp; at checkFinishedOps (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:155:1), &lt;anonymous&gt;:751:7) &nbsp; &nbsp; at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:155:1), &lt;anonymous&gt;:831:8) &nbsp; &nbsp; at Timeout._onTimeout (/home/node/d20-api-server/node_modules/underscore/underscore.js:829:19) &nbsp; &nbsp; at ontimeout (timers.js:386:14) Here's the inline roll script I've experimented - the only change is the addition of the Roll.sixes ID.&nbsp; What am I missing? // GET LIST OF ROLL ID'S FOR CONDITIONAL STATEMENTS... var RollText = ""; var RollID = ""; var RollResults = ""; var RollBase = 0; var RollOnes = 0; var RollSixes = 0; var RollTens = 0; var RollTotal = 0; var RollSuccesses = 0; var Rolls = {}; Object.keys(x[0].inlinerolls).forEach(function(Roll) { var RollCount = 0; while (x[0].inlinerolls[Roll].results.rolls[RollCount] !== undefined) { if (x[0].inlinerolls[Roll].results.rolls[RollCount].type === "L" &amp;&amp; x[0].inlinerolls[Roll].results.rolls[RollCount].text.indexOf("$") !== -1) { RollText = x[0].inlinerolls[Roll].results.rolls[RollCount].text.split("|"); var t = 0; while (RollText[t] !== undefined) { if (RollText[t].charAt(0) === "$") RollID = RollText[t]; t++; } // Roll Base RollResults = x[0].inlinerolls[Roll].results.rolls[RollCount + 1].results; if (RollResults === undefined) { RollBase = x[0].inlinerolls[Roll].results.total; } else { t = 0; RollBase = 0; RollOnes = 0; RollSixes = 0; RollTens = 0; while (RollResults[t] !== undefined) { if ("table" in x[0].inlinerolls[Roll].results.rolls[RollCount + 1]) { if (RollResults[t].tableidx) RollBase = RollBase + RollResults[t].tableidx; } else { if (!RollResults[t].d) RollBase = RollBase + RollResults[t].v; } RollOnes = (RollResults[t].v === 1) ? RollOnes += 1 : RollOnes; RollSixes = (RollResults[t].v === 6) ? RollSixes += 1: RollSixes; RollTens = (RollResults[t].v === 10) ? RollTens += 1 : RollTens; t++; } } // Roll Total RollTotal = x[0].inlinerolls[Roll].results.total; // Roll Successes if ("mods" in x[0].inlinerolls[Roll].results.rolls[RollCount + 1]) { if ("success" in x[0].inlinerolls[Roll].results.rolls[RollCount + 1].mods) { var rCount = 0; RollSuccesses = 0; RollSuccesses = 0; while (rCount &lt;= x[0].inlinerolls[Roll].results.rolls[RollCount + 1].results.length-1) { if (x[0].inlinerolls[Roll].results.rolls[RollCount + 1].mods.success.comp == "&gt;=") { if (x[0].inlinerolls[Roll].results.rolls[RollCount + 1].results[rCount].v &gt;= x[0].inlinerolls[Roll].results.rolls[RollCount + 1].mods.success.point) RollSuccesses += 1; } if (x[0].inlinerolls[Roll].results.rolls[RollCount + 1].mods.success.comp == "==") { if (x[0].inlinerolls[Roll].results.rolls[RollCount + 1].results[rCount].v == x[0].inlinerolls[Roll].results.rolls[RollCount + 1].mods.success.point) RollSuccesses += 1; } if (x[0].inlinerolls[Roll].results.rolls[RollCount + 1].mods.success.comp == "&lt;=") { if (x[0].inlinerolls[Roll].results.rolls[RollCount + 1].results[rCount].v &lt;= x[0].inlinerolls[Roll].results.rolls[RollCount + 1].mods.success.point) RollSuccesses += 1; } rCount++; } } } // Create RollID in Rolls with the following values... Rolls[RollID] = { "base": RollBase, "total": RollTotal, "successes": RollSuccesses, "ones": RollOnes, "sixes": RollSixes, "tens": RollTens, "halfbase": Math.floor(RollBase/2), "halftotal": Math.floor(RollTotal/2) }; } RollCount++; } });
I'm attempting my own templates using PCM Helper. I like the "Basics" template provided, so I thought I could just copy it, put my own formats in and cross my fingers. FORMATS:&nbsp; .Adjusted Templates: . This lasts for about one roll each. Then this occurs: Any help, of course, will be greatly appreciated.
1561804290
Kurt J.
Pro
API Scripter
Dave T said: I'm attempting my own templates using PCM Helper. I like the "Basics" template provided, so I thought I could just copy it, put my own formats in and cross my fingers. FORMATS:&nbsp; .Adjusted Templates: . This lasts for about one roll each. Then this occurs: Any help, of course, will be greatly appreciated. That usually happens if your API goes down for some reason (and it is just displaying the text of the macro). I know there were recently problems with the API server causing it to shutdown, which might be the issue. On a different note, the Basics template will do what you are trying to do already... the "--format|~S-CN$" means that it will use the character's name to locate a format in the formats handout and use that, though the match between the format name and the character name need to be exact.
is there a powercard function to call PC traits similar to the way it does NPC Traits?
1562614460
Kurt J.
Pro
API Scripter
Anthony V. said: is there a powercard function to call PC traits similar to the way it does NPC Traits? There isn't at the moment, but I'll put it on the list.
1562614627
Kurt J.
Pro
API Scripter
Dave T said: I do not know how I got the format handout to work. I don't recall doing anything other than to almost unconsciously try an attack roll and suddenly it worked. The frustration evaporated and I was so happy to show my players that they'll have some cool templates to work with. They're far from beauties, but its a start. “What worked yesterday doesn't always work today.”&nbsp; ―&nbsp; Elizabeth Gilbert,&nbsp; Eat, Pray, Love Like the lady says, that was yesterday. And by the same manner by which I got the format handout to work, I got it to not work. Meaning I wasn't even paying attention to it as I worked on other things. I just decided to check up on the attack roll. Had the rogue attack a gator like yesterday, and suddenly I'm right back to the standard format. Gone are the dwarven runes in gold, as is the Captain's blood red banner.&nbsp; ^Yesterday&nbsp; ^Today Renamed a Bandit "atwill". Seems to have worked for him. So there's something with the PC's and the Format handout. Damned if I know what that is because I was not working with Character sheets or the handout when the issue showed up. So when Roll20 switched to their "new" editor a few months ago, it caused all kinds of problems for PowerCards because it messes with the format of what you have it you go back in to edit a handout. I generally do the following: - Open the handout in roll20 - Hilight all of the text and copy it - Paste it into an external, text-only editor (Notepad++ or even just Notepad) - Make my edits - Copy everything and past it back into the handout window and hit save Generally that solves the issue for me (the same thing happens with templates and replacements, so I keep all of my handout text in an external editor and just paste it to Roll20 any time I make a change.
@Everyone I ran across this tip early in this thread, or another previous PC thread.. Cant tell you how it saved my struggles. @Kurt J...... THANKS a ton .... Even when I moved the handout between games, issues would arise. Just followed the tip, and everything was resolved again....
Thats awesome. I'm going to give it a shot.I had a suspicion that going the Notepad ++, etc, route was a possible solution.(Not that I put that together on my own, rather I think that I've heard it in regards to macros and HTML before somewhere lol). Thanks again,.
Oh, and Kurt, I should add that my issue was shutting the API down when I would hit the queue (it seemed stuck) or when I initiated "!pcmeverybody". IT would produce the "Possible infinite loop detected". I had a thought to try PC and PCMH on a bare bones campaign with a minimum drain on resources, thinking that would help, but I received the same error.&nbsp;&nbsp;
Kurt J Could we get an interface to change the toggle variables for the 'one shot', something like what the Status FX script does? With the one shot we can not see the script or edit the code directly. as an example:
1563013226
Kurt J.
Pro
API Scripter
Dave T said: When an attack is made, I notice that the following error is produced: "Error: No attribute or sheet field found for character_id -Kt-VNEg1XRIxk5iAFQk named 0*" "Error: No attribute or sheet field found for character_id -Lj9ItORIrhqJ8IccGjn named 0*" I take it that the script is trying to find an attribute for the two combatants. Is "0*" a parameter/replacement? Yea, looking up character sheet attributes is a bit wonky in the API... These message are a side-effect of the way I have to work around that weirdness, and should be safe to ignore. They are returned directly by the API, so I haven't found a way to suppress them so far :(
1563013353
Kurt J.
Pro
API Scripter
Axecleft said: Kurt J Could we get an interface to change the toggle variables for the 'one shot', something like what the Status FX script does? With the one shot we can not see the script or edit the code directly. as an example: The one-shot script needs a major overhaul, I agree. It fails if there are too many characters in the game because the API thinks it timed out. I put the beginnings of a processing queue in the system but never got it fully implemented. I'll need to revisit it and add options as well when I get the opportunity to get some development time back in.
Hi, - I'm new to using powercards, and I love them! Tweaking previous macro's, I've been able to make the following powercard show up: This uses the following code: /emas The @{selected|token_name} attacks @{target|token_name}! (AC @{target|ac}) !power {{ --whisper|GM --tokenid|@{selected|token_id} --npc_action_list|@{selected|character_id} --spell_list|@{selected|character_id} --npc_trait_list|@{selected|character_id} --Spell Save DC: **@{selected|spell_save_dc}** --Shout Traits: [1](~traitman|trait1) [2](~traitman|trait2) [3](~traitman|trait3) --What happened? [Hit?](~macroman|itsahit) [Miss?](~macroman|itsamiss) }} It all works well, except for the bit here: --Shout Traits: [1](~traitman|trait1) [2](~traitman|trait2) [3](~traitman|trait3) --What happened? [Hit?](~macroman|itsahit) [Miss?](~macroman|itsamiss) When I click on the pink 1 or the ' Hit? ' it comes up with an error: " TypeError: Cannot read property 'substring' of undefined" ...But if I click the number 2, or the 'Miss?' - It works fine. One thing I did notice, was the links were a bit weird, which I'm sure is causing an issue: A good link: The bad link: It looks like the bold formatting is getting in there, and confusing things.... - Anyone got any ideas?
So I was recommend Powercards from a request thread I had made. I'll repeat my question from there to see if it's applicable with Powercards. "Is there a script or would it be possible to make a script so that when you use say an attack macro it will ask you to pick a target then when you do it will check against the target's AC/Spell Saving through and then apply damage if necessary to the selected target? Is this something that is possible with Powercards? Just trying to find a way to streamline combat within Roll20 for me and my players. If this type of question isn't allowed in this thread please just delete thank you for your time.
1568274833

Edited 1568274877
West1778 said: So I was recommend Powercards from a request thread I had made. I'll repeat my question from there to see if it's applicable with Powercards. "Is there a script or would it be possible to make a script so that when you use say an attack macro it will ask you to pick a target then when you do it will check against the target's AC/Spell Saving through and then apply damage if necessary to the selected target? Is this something that is possible with Powercards? Just trying to find a way to streamline combat within Roll20 for me and my players. If this type of question isn't allowed in this thread please just delete thank you for your time. Yes, you can do what you're aiming to do with Power Cards. What I use to automatically deduct health/HPs from the token bar/bubble is an API called "Alterbars". Currently I am using it with Power Cards on a single attack basis. This isn't really ideal because it doesn't take full advantage of what the Power Cards (and the companion API called 'Power Cards Macro Helper) can achieve.&nbsp; Basically, PC (power cards) uses a template for any attack by a PC or NPC without having to write macros for very single PC and NPC and monsters, etc. You select your character's token, hit the 'Attack' macro then it looks at the character sheet for very attack the character can make and puts them in a query, or drop down menu. Select which attack/weapon/spell you wish to use, then select your target. Advantage query asks one final question, then the attack is made. Its a little confusing at first, and I still havent gotten alterbars to work with the template for Power Cards, but I'll get there. The alternative to using alter bars with PC is 'TokenMod" and 'ChatSetAttr' APIs. I cannot for the life of me understand how to use either but they are wildly popular with the folks who know what they're doing lol. If you want some examples in action, hit me up and I''l invite you to a test campaign just to show you first hand what you can do with this script.
1568325465

Edited 1568683549
Just wanted to share my most recent pet project.&nbsp; Running 5E, and my players wanted a way to roll a Perception, Stealth, etc, and have en emote post to the chat, but have only the GM see the roll. Through some help from others, I figured out the following: !power {{ &nbsp; --whisper|gm &nbsp; --name | Secret roll to GM &nbsp; --hroll| [[ [$Skyll] 1d0 + ?{Skill?|Perception, 0 |&nbsp; Insight, 1 |&nbsp; Investigation, 2 | Stealth, 3 | Survival, 4 } ]] &nbsp; --?? $Skyll == 0 ?? emote|@{selected|token_name} peers around for hidden things. &nbsp; --?? $Skyll == 0 ?? Perception:|[[1d20+ @{selected|perception_bonus}]]+@{selected|global_skill_mod} &nbsp; --?? $Skyll == 1 ?? emote|@{selected|token_name} ponders hidden motives. &nbsp; --?? $Skyll == 1 ?? Insight:|[[1d20+ @{selected|insight_bonus}]]+@{selected|global_skill_mod} &nbsp; --?? $Skyll == 2 ?? emote|@{selected|token_name} searches for secret clues. &nbsp; --?? $Skyll == 2 ?? Investigation:|[[1d20+ @{selected|investigation_bonus}]]+@{selected|global_skill_mod} &nbsp; --?? $Skyll == 3 ?? emote|@{selected|token_name} sneaks around. &nbsp; --?? $Skyll == 3 ?? Stealth:|[[1d20+ @{selected|stealth_bonus}]]+@{selected|global_skill_mod} &nbsp; --?? $Skyll == 4 ?? emote|@{selected|token_name} examines the surroundings for natural signs. &nbsp; --?? $Skyll == 4 ?? Survival:|[[1d20+ @{selected|survival_bonus}]]+@{selected|global_skill_mod} }} And, of course, I checked share with players and Show as Token Action.&nbsp; I hope that helps someone.&nbsp;
1568595405

Edited 1568595568
Howdy, again! Currently trying to cram a bunch of Power Card macros into a query, which by itself is tiring since Roll20 nesting has poor support. Everything appears to work fine, except for one small detail: I can't change the color of the Power Card's text. Here's what I mean: As you can see, everything works well, except the bloody color format refuses to be interpreted. Here is the macro code: ?{Check|ST,!power {{ --bgcolor&amp;#124;#2e8b57 --erowbg&amp;#124;#fff --orowbg&amp;#124;#e5e5e5 --name&amp;#124;Strength Check --leftsub&amp;#124;@{selected|character_name} --hroll&amp;#124;[[ [$st] @{selected|strength} + (?{ST Modifier&amp;#124;0&amp;#125;) + 0d0]] [[ [$roll] 3d6]] --?? $roll.total &lt;= $st.total ?? !Saved&amp;#124;~C**$$#007f0e&amp;#124;Success$$** ([^roll.total] vs. [^st.total])~C --?? $roll.total &gt; $st.total ?? !Saved&amp;#124;~C**$$#ff0000&amp;#124;Failure$$** ([^roll.total] vs. [^st.total])~C &amp;#125;&amp;#125; |DX,1|IQ,2|HT,3|Per,4| Will,5} If you'll notice, it appears that the first set of '$' vanishes into thin air; I have tried replacing other characters, but to no avail. Am I missing something, or is this an actual limitation?
Re4XN said: Howdy, again! Currently trying to cram a bunch of Power Card macros into a query, which by itself is tiring since Roll20 nesting has poor support. Everything appears to work fine, except for one small detail: I can't change the color of the Power Card's text. Here's what I mean: As you can see, everything works well, except the bloody color format refuses to be interpreted. Here is the macro code: ?{Check|ST,!power {{ --bgcolor&amp;#124;#2e8b57 --erowbg&amp;#124;#fff --orowbg&amp;#124;#e5e5e5 --name&amp;#124;Strength Check --leftsub&amp;#124;@{selected|character_name} --hroll&amp;#124;[[ [$st] @{selected|strength} + (?{ST Modifier&amp;#124;0&amp;#125;) + 0d0]] [[ [$roll] 3d6]] --?? $roll.total &lt;= $st.total ?? !Saved&amp;#124;~C**$$#007f0e&amp;#124;Success$$** ([^roll.total] vs. [^st.total])~C --?? $roll.total &gt; $st.total ?? !Saved&amp;#124;~C**$$#ff0000&amp;#124;Failure$$** ([^roll.total] vs. [^st.total])~C &amp;#125;&amp;#125; |DX,1|IQ,2|HT,3|Per,4| Will,5} If you'll notice, it appears that the first set of '$' vanishes into thin air; I have tried replacing other characters, but to no avail. Am I missing something, or is this an actual limitation? You have to use the "|" after 'bgcolor', etc., maybe? Here's one of my attack cards: Keeghan: --titlefont|hamletornot --titlefontsize|1.3em --titlebackground|linear-gradient ( #ffffff4d , #fff0 ) --titlefontshadow|1px 4px 0px #000000, 0px 0px 0px, -1px 2px 0px #000000, -1px 0px 0px --subtitlefont|hamletornot --subtitlefontsize|.6em --bodyfont|hamletornot&nbsp; --txcolor|#ccc7b4 --bgcolor|#291e04 --leftsub|Requires --rightsub|Finesse or Ranged Weapon
1568634836

Edited 1568634920
Dave T said: Re4XN said: Howdy, again! Currently trying to cram a bunch of Power Card macros into a query, which by itself is tiring since Roll20 nesting has poor support. Everything appears to work fine, except for one small detail: I can't change the color of the Power Card's text. Here's what I mean: As you can see, everything works well, except the bloody color format refuses to be interpreted. Here is the macro code: ?{Check|ST,!power {{ --bgcolor&amp;#124;#2e8b57 --erowbg&amp;#124;#fff --orowbg&amp;#124;#e5e5e5 --name&amp;#124;Strength Check --leftsub&amp;#124;@{selected|character_name} --hroll&amp;#124;[[ [$st] @{selected|strength} + (?{ST Modifier&amp;#124;0&amp;#125;) + 0d0]] [[ [$roll] 3d6]] --?? $roll.total &lt;= $st.total ?? !Saved&amp;#124;~C**$$#007f0e&amp;#124;Success$$** ([^roll.total] vs. [^st.total])~C --?? $roll.total &gt; $st.total ?? !Saved&amp;#124;~C**$$#ff0000&amp;#124;Failure$$** ([^roll.total] vs. [^st.total])~C &amp;#125;&amp;#125; |DX,1|IQ,2|HT,3|Per,4| Will,5} If you'll notice, it appears that the first set of '$' vanishes into thin air; I have tried replacing other characters, but to no avail. Am I missing something, or is this an actual limitation? You have to use the "|" after 'bgcolor', etc., maybe? Here's one of my attack cards: Keeghan: --titlefont|hamletornot --titlefontsize|1.3em --titlebackground|linear-gradient ( #ffffff4d , #fff0 ) --titlefontshadow|1px 4px 0px #000000, 0px 0px 0px, -1px 2px 0px #000000, -1px 0px 0px --subtitlefont|hamletornot --subtitlefontsize|.6em --bodyfont|hamletornot&nbsp; --txcolor|#ccc7b4 --bgcolor|#291e04 --leftsub|Requires --rightsub|Finesse or Ranged Weapon Correct, but the problem is that the Power Card is nested within a query. For instance, if you try to do the following in Roll20, it won't work: ?{Choose|Choice_1, ?{Choose again|Nested_Choice_1, 1|Nested_Choice_2, 2}|Choice_2, 2} In the example above, you have a query within a query, which is a problem, because Roll20 has difficulties parsing it, so you have to do some black magic to get it to work, namely, replacing every '|', ',' and '}' in your nested macros. It would look like this: ?{Choose|Choice_1, ?{Choose again&amp;#124;Nested_Choice_1&amp;#44; 1&amp;#124;Nested_Choice_2&amp;#44; 2&amp;#125;|Choice_2, 2} If you look at my screenshot again, you can see that the background color is not the problem; the Power Card is green. The problem is the 'Success' text, which should also be green but isn't. I am unsure whether this is just a limitation or if there is a way around it.
Luke H. said: Just wanted to share my most recent pet project.&nbsp; Running 5E, and my players wanted a way to roll a Perception, Stealth, etc, and have en emote post to the chat, but have only the GM see the roll. Through some help from others, I figured out the following: !power {{ &nbsp; --whisper|gm &nbsp; --name | Secret roll to GM &nbsp; --hroll| [[ [$Skyll] 1d0 + ?{Skill?|Perception, 0 |&nbsp; Insight, 1 |&nbsp; Investigation, 2 | Stealth, 3 | Survival, 4 } ]] &nbsp; --?? $Skyll == 0 ?? emote|@{selected|token_name} peers around for hidden things. &nbsp; --?? $Skyll == 0 ?? Perception:|[[1d20+ @{selected|perception_bonus}]]+@{selected|global_skill_mod} &nbsp; --?? $Skyll == 1 ?? emote|@{selected|token_name} ponders hidden motives. &nbsp; --?? $Skyll == 1 ?? Insight:|[[1d20+ @{selected|insight_bonus}]]+@{selected|global_skill_mod} &nbsp; --?? $Skyll == 2 ?? emote|@{selected|token_name} searches for secret clues. &nbsp; --?? $Skyll == 2 ?? Investigation:|[[1d20+ @{selected|investigation_bonus}]]+@{selected|global_skill_mod} &nbsp; --?? $Skyll == 3 ?? emote|@{selected|token_name} sneaks around. &nbsp; --?? $Skyll == 3 ?? Stealth:|[[1d20+ @{selected|stealth_bonus}]]+@{selected|global_skill_mod} &nbsp; --?? $Skyll == 4 ?? emote|@{selected|token_name} examines the surroundings for natural signs. &nbsp; --?? $Skyll == 4 ?? Survival:|[[1d20+ @{selected|survival_bonus}]]+@{selected|global_skill_mod} }} I hope that helps someone.&nbsp; That's great Luke! My players thanks you. :)