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)

First of all, hello everyone and thanks to Kurt for all the work thats being put into this API! I'm attempting to puzzle through some of the more advanced options for the API integration with the 5e sheet. Is there a way within that sheet of setting a custom macro to be called when a spell is cast from the sheet? My idea was to provide the casters in the party with a spellbook powercard macro (pictured below) that would trigger something other than the base function of clicking on the spell name. Player Report of Available Spells !power {{ --format|bigbad --orowbg|#CEC7B6 --erowbg|#CEC7B6 --name|Spell List --tokenid|@{selected|token_id} --emote|@{selected|character_name} --leftsub|Atk Bonus: @{selected|spell_attack_bonus} --rightsub|Save DC: @{selected|spell_save_dc} --spell_slots|@{selected|character_id} --spell_list|@{selected|character_id} }} I know there is potential to manually create buttons within the powercard but the card above reads prepared spell markers from the sheet and populates buttons based on the red identifier dots, so if i could alter the sheet to run a custom macro on a spell click it may be much less labor intensive. apologies if that was a little confusing, and thanks in advance!
1608262786

Edited 1608265581
Tons of great programming help in here! I have loosely skimmed the thread and have not found anything on the topic so I figured I'd post my question. I'm trying to automate applying resistance/immunity/vulnerable in such a way that, based on the damage type (e.g., bludgeoning) and any relevant damage modifiers of the creature (e.g. vulnerable), the value outputs correctly. So, something like: !power {{ --name|Basic Attack --leftsub|Longsword --rightsub|Range Melee --Attack:|[[ [$Atk] 1d20 + 3 [Str Mod] + 2 [Proficiency] ]] vs AC --?? $Atk.base == 1 OR $Atk.total < @{target|AC}?? !Miss:|You missed. --?? $Atk.total >= @{target|npc_ac} AND $Atk.base <> 1 AND $Atk.base <> 20 ?? Hit:|[[ [$Dmg] 1d8 + 3]] bludgeoning damage --?? $Atk.base == 20 ?? Critical Hit:|[[2d8 + 3]] bludgeoning damage --?? $Atk.base == 20 ?? soundfx:|_play|HeadShot --?! @{target|npcd_resistances} includes the string "bludgeoning" !? hroll|[[ [$RDmg] ^Dmg/2]] --?! @{target|npcd_resistances} includes the string "bludgeoning" !? api_token-mod|_ids @{target|token_id} _set bar1_value|-[^RDmg] }} I know very, very little java, and I was essentially trying to incorporate something like this to do the heavy lifting for me: var str = "necrotic, psychic, bludgeoning"; var find = "bludgeoning" var res = str.slice(str.search(find), find.length + str.search(find)); document.getElementById("demo").innerHTML = res; Hoping that I could have "str" derive from @{target|npcd_resistances}; "find" derive from damage type (which can come from a replacement/template combination). So I could then compare "damage type" with "res" to determine which damage roll to apply. Is it possible to include that in PowerCards?
1608319771

Edited 1608322403
Is there a way to have the attack rolls in powercards to take the critical range in to consideration? For example, I have a fighter that as the Improved Critical feat so his crit range is 19 or 20 instead of just 20. To clarify, I know how to look at @{selected|default_critical_range} to determine if the roll was with in the range but the roll itself does not highlight as green if I roll a 19. !power {{  --name|Attack  --hroll|[[ [$ac] 1d6+10 ]] [[ [$dmgBase] 1d8 + 5 ]] [[ [$dmgCrit] 2d8 + 5 ]]  --Attack|You attack, rolling [[ [$atk] 1d20 + 5 [STR] + 3 [PROF] ]] vs AC [! [^ac] !]  --?? $atk.base == 19 ?? Critical Hit!|You strike a vital spot for [! [^dmgCrit] !] damage!  --?+ $atk.base == 1 +? Miss *1|Your attack missed, and if you play with fumbles, you fumbled!  --?+ $atk.total >= $ac +? Hit|Your blow lands for [! [^dmgBase] !] damage!  --?+ 1 == 1 +? Miss *2|Your attack missed }}
hello, i'm trying to add an api call inside a chat menu, is it possible? this is my macros. the bold text is the one that i can't make to work. !power {{    --name|Attacco Nemico   --emote|@{selected|token_name} attacca @{target|token_name}   --tokenid|@{selected|token_id}   --target_list|@{target|token_id}   --format|master   --Attack Roll|@{selected|token_name} Rolls [[ [$atkn] 1d20 + @{selected|hit} ]] vs SWIFT [! @{target|Swift} !]   --?? $atkn.base == 20 ?? skipto*1|Critico   --?? $atkn.base == 1 ?? skipto*2|Mancato   --?? $atkn.total >= @{target|Swift} ?? skipto*3|Hit      --:Miss|   --Intercettato|L’attacco di @{selected|token_name} viene bloccato dalle difese di @{target|token_name}.   --skipto*4|EndOfCard   --:Mancato|   --Mancato|**@{selected|token_name}** manca clamorosamente **@{target|token_name}** e lascia un’apertura per un [contrattacco](~@{target|token_name}|Atk)   --skipto*5|EndOfCard   --:Hit|   --Hit!|**@{selected|token_name}** colpisce **@{target|token_name}** infliggendogli [[ {0d0 , 0d0 + (@{Selected|BAR3}/2)d4 - ({0, @{target|DIFESA}}kh1) }kh1 ]] danni!   --Avoid|[@{target|token_name} Prova ad evitare il danno](~@{target|token_name}|Evita) --Applica Danni|[Applica Danni] (!token-mod _set bar1_value|-?{Damage Amount}! _ids @{target|token_id})   --skipto*6|EndOfCard   --:Critico|   --Colpo Critico!|**@{selected|token_name}** infligge un colpo decisivo su **@{target|token_name}**, causandogli [[ {0d0 , 0d0 + (@{Selected|BAR3})d4 - ({0, @{target|DIFESA}}kh1) }kh1 ]] danni!    --Extra Crit Stuff|Extra stuff that might happen on a crit!   --:EndOfCard| }} +
Andrea d., try api_token-mod instead of !token-mod
Eric R. said: Andrea d., try api_token-mod instead of !token-mod Thanks! i tried but sadly the chat menu button doesn't work :( instead of a button it becomes a simple link :(  also i was wondering, is it possivle to have some part of the card to be whispered only to the master? like, the "damages" to everyone, but the conditions only to the master?
I'm still learning myself so unfortunately I will not be able to answer that. Based on the wiki I would say yes, but how to do it is a different matter.
I think  you can build out a separate macro with the token-mod information in the macro, and use the button to call the macro. PowerCards, as far as I understand it, does not allow you to call an API from the content side, only from the tag side: !power {{ --api_token-mod|content of API call }} Works. !power {{ --TagName|!token-mod etc. }} Does not work. andrea d. said: Eric R. said: Andrea d., try api_token-mod instead of !token-mod Thanks! i tried but sadly the chat menu button doesn't work :( instead of a button it becomes a simple link :(  also i was wondering, is it possivle to have some part of the card to be whispered only to the master? like, the "damages" to everyone, but the conditions only to the master?
1608332484

Edited 1608334974
New question: Is there a way to evaluate an attribute for a null or empty value? For example, @{selected|repeating_attack_$0_atkrange}, for melee weapons it is empty but for ranged weapons it has a value. I would like to have logic to change the text I display based on if it has a value or not. Something along the lines of the following. !power {{ --titlefontshadow|none --name|@{selected|repeating_attack_$4_atkname} --?? @{selected|repeating_attack_$4_atkrange} == "" ?? Range:|5' Reach --?+ 1 == 1 +? Range:|@{selected|repeating_attack_$4_atkrange} }} Also, is there a way other than by name to determine if an attack is a melee, ranged or spell? Like some hidden attribute?
power cards api was working great for me and now it crashes after 2-3 uses  i have trien clearing chat, restarting api etc.  Can anybody help me? The only Api im running are 5e ogl dnd 5e sheet, Group Initiative,  AlterBars.js, Power Cards, Power card macro helper, and TokenMod Im also running Vtt enhancment suite.  I have spend days and days trying to fix this and it was extremly helpfull for the multiple games i run.    Thanks again hope someone can help me.
Its driving me nuts.....
So, I don't understand all the coding and can't be bothered learning it all. Gives me a headache. Is there anywhere where we can access a list of useful powercards that I could just implement into my game. I just installed the script for it and macro helper and it's added all these macros that don't work at all. Any help would be appreciated. Thanks.
1609135681

Edited 1609230864
So I am doing something wrong with my macro. I'm trying to apply extra damage to the spell being cast based on spell level, but it is not working. Any help would be appreciated. # Thunderwave !power {{ --titlefontshadow|none --title|School: Evocation ^^ Level: 1 ^^ Components: V,S ^^ Duration: Instantaneous ^^ When you cast this spell using a spell slot of 2nd level or higher, the damage increases by 1d8 for each slot level above 1st. --name|@{selected|repeating_attack_$5_atkname} --leftsub|Spell Attack --rightsub|Range: @{selected|repeating_attack_$5_atkrange} --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|character_name} focuses dark energies into a beam of death --Critical Range:|@{selected|default_critical_range}+ --hroll|[[ [$SpellLvl] ?{Spell Level|Level 1, 1|Level 2, 2|Level 3, 3|Level 4, 4|Level 5, 5|Level 6, 6|Level 7, 7|Level 8, 8|Level 9, 9} + 0d0 ]] --?? $SpellLvl == 9 ?? hroll|[[ [$extraDmg] 8d8 ]] --?+ $SpellLvl == 8 +? hroll|[[ [$extraDmg] 7d8 ]] --?+ $SpellLvl == 7 +? hroll|[[ [$extraDmg] 6d8 ]] --?+ $SpellLvl == 6 +? hroll|[[ [$extraDmg] 5d8 ]] --?+ $SpellLvl == 5 +? hroll|[[ [$extraDmg] 4d8 ]] --?+ $SpellLvl == 4 +? hroll|[[ [$extraDmg] 3d8 ]] --?+ $SpellLvl == 3 +? hroll|[[ [$extraDmg] 2d8 ]] --?+ $SpellLvl == 2 +? hroll|[[ [$extraDmg] 1d8 ]] --?+ $SpellLvl == 1 +? hroll|[[ [$extraDmg] 0d0 ]] --hroll|[[ [$Hexed] ?{Apply Hex?|No, 0|Yes, 1} + 0d0 ]] --vfx_opt|@{selected|token_id} @{target|token_id} breath-death --!hrule1|~~~ --Extra Damage:| [$extraDmg] --Attack:|DC@{selected|spell_save_dc} vs @{selected|repeating_spell-1_$5_spellsave} --?? $Hexed == 1 ?? Damage:|[[ [$Dmg] @{selected|repeating_spell-1_$5_spelldamage} + [$extraDmg] ]] points of //@{selected|repeating_spell-1_$5_spelldamagetype}// damage and [[ [$HexDmg] @{selected|repeating_damagemod_$0_global_damage_damage}[Hex] ]] points of //@{selected|repeating_damagemod_$0_global_damage_type}// damage! --?+ 1 == 1 +? Damage:|[[ [$Dmg] @{selected|repeating_spell-1_$5_spelldamage} + [$extraDmg] ]] points of //@{selected|repeating_spell-1_$5_spelldamagetype}// damage! --:EndOfCard| --!hrule5|~~~ --!desc|**Description:** A wave of thunderous force sweeps out from you. Each creature in a 15-foot cube originating from you must make a Constitution saving throw. On a failed save, a creature takes 2d8 thunder damage and is pushed 10 feet away from you. On a successful save, the creature takes half as much damage and isn’t pushed. In addition, unsecured objects that are completely within the area of effect are automatically pushed 10 feet away from you by the spell’s effect, and the spell emits a thunderous boom audible out to 300 feet. }}
1609315621

Edited 1609316914
I'm trying a different approach that I saw in someone else scripts, but it does not seem to work for me. I'm trying to dynamically build the spell damage to be rolled based on the spell level chosen. I'm not able to get the syntax correct to make it work, --hroll|[[ [$lvl] ?{Cast at|Level 1, 1|Level 2, 2|Level 3, 3|Level 4, 4|Level 5, 5|Level 6, 6|Level 7, 7|Level 8, 8|Level 9, 9} + 0d0 ]] --Spell Lvl:|[^lvl] --Dmg:|[[ ([^lvl])d8 ]] The level value gets assigned to the $lvl, but the roll block does not want to use it to define how many D8 to roll. If I take the parentheses away, only 1d8 is rolled, no matter the level selected.
Hello to everyone! Thanks for ur work! I have a problem when I run a macro with Powercards. I want to creates buttons if the repectively spell was used (to remembered with Item Bond from Wizard in PF 1e). The problem is when i run the botton, the chat tell me TypeError: d is undefined That is cuz run, for example, %{selected HeroismB}, without the |. Why the "|" dispear? I will apreciate ur answers. Here is the code I use: !power {{ --emote|** @{selected|token_name} canaliza su magia en su bastón ** --tokenid|@{selected|token_id} --titlebackground|#000000 --titlefontshadow|#000000 --whisper|GM, @{selected|character_name} --corners|15 --txcolor|#e0d6ff --bgcolor|#846b8a --erowbg|#4a3452 --erowtx|#e0d6ff --orowbg|#5e4069 --orowtx|#e0d6ff --name|^^Recuperar Hechizo con Objeto Vinculado --leftsub|@{selected|character_name} --rightsub|Level @{selected|level} @{selected|class-0-name}^^ ~~~ --^^ ~C **Hechizos Gastados** ~C ^^ --Hechizos:| --?? @{repeating_spells_$0_cast} == 1 ?? [@{selected|repeating_spells_$0_name}](~selected|HeroismB) --?? @{repeating_spells_$1_cast} == 1 ?? [@{selected|repeating_spells_$1_name}](~selected|MCvsEvilB) --?? @{repeating_spells_$2_cast} == 1 ?? [@{selected|repeating_spells_$2_name}](~selected|SummonMonsterIIIB) --?? @{repeating_spells_$3_cast} == 1 ?? [@{selected|repeating_spells_$3_name}](~selected|AcidArrowB) --?? @{repeating_spells_$4_cast} == 1 ?? [@{selected|repeating_spells_$4_name}](~selected|LevitateB) --?? @{repeating_spells_$5_cast} == 1 ?? [@{selected|repeating_spells_$5_name}](~selected|ResistEnergyB) --?? @{repeating_spells_$6_cast} == 1 ?? [@{selected|repeating_spells_$6_name}](~selected|SummonMonsterIIB) --?? @{repeating_spells_$7_cast} == 1 ?? [@{selected|repeating_spells_$7_name}](~selected|MageArmorB) --?? @{repeating_spells_$8_cast} == 1 ?? [@{selected|repeating_spells_$8_name}](~selected|ShieldB) --?? @{repeating_spells_$9_cast} == 1 ?? [@{selected|repeating_spells_$9_name}](~selected|SleepB) --?? @{repeating_spells_$10_cast} == 1 ?? [@{selected|repeating_spells_$10_name}](~selected|SummonMonsterIB) --?? @{repeating_spells_$15_cast} == 1 ?? [@{selected|repeating_spells_$15_name}](~selected|TrueStrikeB) }}
1609614659

Edited 1609614689
I am running power cards and it works great execpt for some spells especially like Healing Spirit i get a this.............. {"name":"SyntaxError","expected":["\"(\"","\".\"","\"[\"","\"abs(\"","\"ceil(\"","\"d\"","\"floor(\"","\"round(\"","\"t\"","\"{\"","[ |\\t]","[+|\\-]","[0-9]"],"found":")","message":"Expected \"(\", \".\", \"[\", \"abs(\", \"ceil(\", \"d\", \"floor(\", \"round(\", \"t\", \"{\", [ |\\t], [+|\\-] or [0-9] but \")\" found.","offset":9,"line":1,"column":10} does anybody have any ideas? SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but ")" found. undefined
brunojongh said: So, I don't understand all the coding and can't be bothered learning it all. Gives me a headache. Is there anywhere where we can access a list of useful powercards that I could just implement into my game. I just installed the script for it and macro helper and it's added all these macros that don't work at all. Any help would be appreciated. Thanks. I'm a bit of a dunce when it comes to coding myself, and I found myself scratching my head when it came to the macros that suddenly appeared when I ran !pcmsetup having installed pcmhelper, only to find hardly any of them seemed to work. I subsequently found out that all character/npc sheets needed to NOT be set to roll advantage by default, which seems to break several of the macros. Instead, I needed to set them to either query or toggle advantage instead, after which they worked like a charm.
Has anyone seen this before.  I have been trying to get my powercards formatting working for some time (they were working previously then all the sudden this started happening).  This was the same macro ran three times in a row.  Only the last run (with the white background) actually applied the formatting from the PowerCard Formats handout.  Any thoughts?
I have not experienced that as of yet but it looks like the underlying CSS is buggered up.
Is there a way to add comments to the macro code?
is there no --replace.. so pull PC Traits? I would think that if it can be done for attacks and spells then it could be done for Traits as well. I know I can get them via @{selected|repeating_traits_$0_name} but I cannot be sure that the same trait will be in the same location for each character.
Why is it that certain attacks such as Claws or Vicious Spear causes PowerCards to crash and burn when using "--replacesection|@{selected|character_id}|Vicious Spear|attack|atkname|PCA-" ? This happens every single time is requires me to restart the script and subsequently I have to write different macro code specifically for these. Below is the error I get. For reference, the error message generated was: TypeError: z.get(...).replace is not a function TypeError: z.get(...).replace is not a function     at apiscript.js:5294:108     at Array.forEach (<anonymous>)     at getSectionAttrs (apiscript.js:5292:18)     at Object.PowerCard.Process (apiscript.js:3083:6)     at apiscript.js:2884:15     at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:154:1), <anonymous>:65:16)     at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:154:1), <anonymous>:70:8)     at /home/node/d20-api-server/api.js:1662: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)
Subatoiwolf said: I am running power cards and it works great execpt for some spells especially like Healing Spirit i get a this.............. {"name":"SyntaxError","expected":["\"(\"","\".\"","\"[\"","\"abs(\"","\"ceil(\"","\"d\"","\"floor(\"","\"round(\"","\"t\"","\"{\"","[ |\\t]","[+|\\-]","[0-9]"],"found":")","message":"Expected \"(\", \".\", \"[\", \"abs(\", \"ceil(\", \"d\", \"floor(\", \"round(\", \"t\", \"{\", [ |\\t], [+|\\-] or [0-9] but \")\" found.","offset":9,"line":1,"column":10} does anybody have any ideas? SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but ")" found. undefined Example script?
Why is there not a way to use stored rolls in a later roll? Or is there a way to do this that I am not aware? Seems like it would allow for SO MANY possibilities and uses. For example I can store a d20 roll as --Apply Medicine:|[[ [ $medicine ] ?{Situation|Standard,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1} + @{selected|medicine_bonus} + @{selected|pb} ]]  BUT I can't use it later: --Doctoring:|Heal [[ [$doctor] 2d4 + [ ^medicine ] - 15 ]] hp of @{target|token_name} Is there a way around this?
1610222166
Kurt J.
Pro
API Scripter
Rye T. said: Why is there not a way to use stored rolls in a later roll? Or is there a way to do this that I am not aware? Seems like it would allow for SO MANY possibilities and uses. For example I can store a d20 roll as --Apply Medicine:|[[ [ $medicine ] ?{Situation|Standard,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1} + @{selected|medicine_bonus} + @{selected|pb} ]]  BUT I can't use it later: --Doctoring:|Heal [[ [$doctor] 2d4 + [ ^medicine ] - 15 ]] hp of @{target|token_name} Is there a way around this? This is because PowerCards doesn't process the rolls. Inline rolls are handled by the chat server before the result is made available to the API script. This means that by the time PowerCards get anything to process, all of the dice have already been rolled.  PowerCards processes the results in order to garner information about the roll and create RollIDs for use but other parts of the card. As a more detailed example, for your "Apply Medicine" line above, PowerCards doesn't see any of the "code". If you pick "standard" and have 3 points ni medicine and a PB of 2, the chat server converts this to: --Apply Medicine [[ [$medicine] 1d20 + 3 + 2 ]] it converts Doctoring to: --Doctoring| Heal [[ [$doctor] 2d4 + [ ^medicine ] - 15 ]] hp of Fred but [^medicine] doesn't mean anything to the roll server (neither does [$doctor], so it just ignores it. PowerCards gets something like: --Apply Medicine|[[^0]] --Doctoring|Heal [[^1]] hp of Fred The API also get passed a list of the rolls [[^0]], [[^1]], etc. which has a couple of properties like the total result, the results for each die, and any text information ([$medicine] for example) that were part of what was processed by the roll server. The important point, though, is that ALL of the rolling happens long before the macro text is sent to PowerCards to process.
Kurt J. "The API also get passed a list of the rolls [[^0]], [[^1]], etc. which has a couple of properties like the total result, the results for each die, and any text information ([$medicine] for example) that were part of what was processed by the roll server. The important point, though, is that ALL of the rolling happens long before the macro text is sent to PowerCards to process." Understood. Thanks for the info about the order in which the system process things. Do you have a suggestion of how to work around it?
1610492168

Edited 1610492198
Kurt J.
Pro
API Scripter
Rye T. said: Kurt J. "The API also get passed a list of the rolls [[^0]], [[^1]], etc. which has a couple of properties like the total result, the results for each die, and any text information ([$medicine] for example) that were part of what was processed by the roll server. The important point, though, is that ALL of the rolling happens long before the macro text is sent to PowerCards to process." Understood. Thanks for the info about the order in which the system process things. Do you have a suggestion of how to work around it? It really depends upon how critical it is to have medicine as a separate roll. The relevant lines could be rewritten as: --Doctoring:|Heal [[ [$doctor] 2d4 + (?{Situation|Standard,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1} + @{selected|medicine_bonus} + @{selected|pb}) [medicine] -15 ]] hp of @{target|token_name}  [^doctor] is then available for alterbars, etc.
Kurt J. said: It really depends upon how critical it is to have medicine as a separate roll. The relevant lines could be rewritten as: --Doctoring:|Heal [[ [$doctor] 2d4 + (?{Situation|Standard,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1} + @{selected|medicine_bonus} + @{selected|pb}) [medicine] -15 ]] hp of @{target|token_name}  [^doctor] is then available for alterbars, etc. Yeah, it does matter, as it would change the way it would work (I wanted the value in between criteria to have merit) but I appreciate you showing me what you might do. I didn't show you the whole macro, so I get that you don't entirely understand the intent. It wasn't just a question for this specific case, but a topic that could be used for many other situations that I was wondering about. Is there such a way to store a role in a location if it was important in a macro to use later? I thought I might have read about people storing it in turn actions and things like that but I don't know how to call on those.
1610494915
Kurt J.
Pro
API Scripter
PowerCards 3.8.16 on Dev GIST and Headed to OneClick I've just updated the development GIST and my repo with a pull request to update OneClick on the next cycle with PowerCards 3.8.16. In this version: Updated the npc_trait_list special tag to use _description instead of _desc for trait descriptions due to changes in the 5E Sheet. Added a new comparison operator for standard conditionals : @@ (contains). This can be used along the lines of:     --?? Hello @@ el ??Yep|It sure does... "Hello" contains "el" This can be read as "If Hello contains el". Note that all of the standard rules for normal conditionals apply. Each part of the conditional must be separated by spaces, meaning that the text on either side of the @@ cannot contain a space.
So, I'm not sure if this has anything to do with the update, but all of a sudden none of the fx are working with ANY of my power cards now. I have refreshed, cleared old chat, but none of it is helping. Regular fx commands work, but not in Power Cards. I'll post an example here, but again, none of them work, and they were working earlier today. See the last 3 lines of the macro. This has been very frustrating as I've been trying to figure out what's wrong but everything else seems fine. It's just with powercards. %{selected|image} !power {{     --emote|@{selected|token_name} wreaths their weapon in green flame and attacks their opponent, allowing the flame to burst past them to another nearby enemy! --bgcolor|#9BBCD8     --erowbg|#CFC7B5     --orowbg|#FFF8EA     --name|Green Flame Blade     --rightsub|Action     --leftsub|5ft with 5ft leap     --Attack:|[[ [$atk] ?{Attack Type|Standard Attack,1d20|Advantage Attack,2d20kh1|Disadvantage Attack,2d20kl1} + @{selected|spell_attack_bonus} ]]     --?? $atk >= @{target|Melee Attack|ac} AND $atk.base <> 20 AND @{selected|hit_dice} < 5 ?? Damage:|[[ [$dmg1] 1d8 + @{selected|spell_mod} ]] fire damage damage     --?? $atk >= @{target|Melee Attack|ac} AND $atk.base <> 20 AND @{selected|hit_dice} < 5 ?? alterbar1|_target|@{target|Melee Attack|token_id} _bar|1 _amount|-[^dmg1] _show|all     --?? $atk.base == 20 AND @{selected|hit_dice} < 5 ?? Damage:|[[ [$dmg2] 2d8 + @{selected|spell_mod} ]] fire damage damage     --?? $atk.base == 20 AND @{selected|hit_dice} < 5 ?? alterbar2|_target|@{target|Melee Attack|token_id} _bar|1 _amount|-[^dmg2] _show|all --?? $atk >= @{target|Melee Attack|ac} AND $atk.base <> 20 AND @{selected|hit_dice} >= 5 AND @{selected|hit_dice} < 11 ?? Damage:|[[ [$dmg3] 2d8 + @{selected|spell_mod} ]] fire damage damage --?? $atk >= @{target|Melee Attack|ac} AND $atk.base <> 20 AND @{selected|hit_dice} >= 5 AND @{selected|hit_dice} < 11 ?? alterbar3|_target|@{target|Melee Attack|token_id} _bar|1 _amount|-[^dmg3] _show|all     --?? $atk.base == 20 AND @{selected|hit_dice} >= 5 AND @{selected|hit_dice} < 11 ?? Damage:|[[ [$dmg4] 4d8 + @{selected|spell_mod} ]] fire damage damage     --?? $atk.base == 20 AND @{selected|hit_dice} >= 5 AND @{selected|hit_dice} < 11 ?? alterbar4|_target|@{target|Melee Attack|token_id} _bar|1 _amount|-[^dmg4] _show|all --?? $atk >= @{target|Melee Attack|ac} AND $atk.base <> 20 AND @{selected|hit_dice} >= 11 AND @{selected|hit_dice} < 17 ?? Damage:|[[ [$dmg5] 3d8 + @{selected|spell_mod} ]] fire damage damage --?? $atk >= @{target|Melee Attack|ac} AND $atk.base <> 20 AND @{selected|hit_dice} >= 11 AND @{selected|hit_dice} < 17 ?? alterbar5|_target|@{target|Melee Attack|token_id} _bar|1 _amount|-[^dmg5] _show|all     --?? $atk.base == 20 AND @{selected|hit_dice} >= 11 AND @{selected|hit_dice} < 17 ?? Damage:|[[ [$dmg6] 6d8 + @{selected|spell_mod} ]] fire damage     --?? $atk.base == 20 AND @{selected|hit_dice} >= 11 AND @{selected|hit_dice} < 17 ?? alterbar6|_target|@{target|Melee Attack|token_id} _bar|1 _amount|-[^dmg6] _show|all     --?? $atk >= @{target|Melee Attack|ac} AND $atk.base <> 20 AND @{selected|hit_dice} >= 17 ?? Damage:|[[ [$dmg7] 4d8 + @{selected|spell_mod} ]] fire damage damage --?? $atk >= @{target|Melee Attack|ac} AND $atk.base <> 20 AND AND @{selected|hit_dice} >= 17 ?? alterbar7|_target|@{target|Melee Attack|token_id} _bar|1 _amount|-[^dmg7] _show|all     --?? $atk.base == 20 AND @{selected|hit_dice} >= 17 ?? Damage:|[[ [$dmg8] 8d8 + @{selected|spell_mod} ]] fire damage     --?? $atk.base == 20 AND @{selected|hit_dice} >= 17 ?? alterbar8|_target|@{target|Melee Attack|token_id} _bar|1 _amount|-[^dmg8] _show|all     --?? $atk >= @{target|Melee Attack|ac} AND @{selected|hit_dice} < 5 ?? Flame Leap Damage:|[[ [$dmg9] 0d8 + @{selected|spell_mod} ]] fire damage --?? $atk >= @{target|Melee Attack|ac} AND @{selected|hit_dice} < 5 ?? alterbar9|_target|@{target|Fire Leap (5ft)|token_id} _bar|1 _amount|-[^dmg9] _show|all     --?? $atk >= @{target|Melee Attack|ac} AND @{selected|hit_dice} >= 5 AND @{selected|hit_dice} < 11 ?? Flame Leap Damage:|[[ [$dmg10] 1d8 + @{selected|spell_mod} ]] fire damage --?? $atk >= @{target|Melee Attack|ac} AND @{selected|hit_dice} >= 5 AND @{selected|hit_dice} < 11 ?? alterbar10|_target|@{target|Fire Leap (5ft)|token_id} _bar|1 _amount|-[^dmg10] _show|all     --?? $atk >= @{target|Melee Attack|ac} AND @{selected|hit_dice} >= 11 AND @{selected|hit_dice} < 17 ?? Flame Leap Damage:|[[ [$dmg11] 2d8 + @{selected|spell_mod} ]] fire damage --?? $atk >= @{target|Melee Attack|ac} AND @{selected|hit_dice} >= 11 AND @{selected|hit_dice} < 17 ?? alterbar11|_target|@{target|Fire Leap (5ft)|token_id} _bar|1 _amount|-[^dmg11] _show|all --?? $atk >= @{target|Melee Attack|ac} AND @{selected|hit_dice} >= 17 ?? Flame Leap Damage:|[[ [$dmg12] 3d8 + @{selected|spell_mod} ]] fire damage --?? $atk >= @{target|Melee Attack|ac} AND @{selected|hit_dice} >= 17 ?? alterbar12|_target|@{target|Fire Leap (5ft)|token_id} _bar|1 _amount|-[^dmg12] _show|all     --?? $atk < @{target|Melee Attack|ac} ?? soundfx|_audio,play,nomenu|Shortsword Strikes Wood Shield by Stuart Duffield     --?? $atk >= @{target|Melee Attack|ac} ?? soundfx|_audio,play,nomenu|saber     --?? $atk >= @{target|Melee Attack|ac} ?? vfx_opt|@{target|Fire Leap (5ft)|token_id} explosion-fire     --?? $atk >= @{target|Melee Attack|ac} AND $atk.base <> 20 ?? vfx_opt|@{target|Melee Attack|token_id} bubbling-blood     --?? $atk.base == 20 ?? vfx_opt|@{target|Melee Attack|token_id} bomb-blood }}
1610523958
Kurt J.
Pro
API Scripter
Rye T. said: So, I'm not sure if this has anything to do with the update, but all of a sudden none of the fx are working with ANY of my power cards now. I have refreshed, cleared old chat, but none of it is helping. Regular fx commands work, but not in Power Cards. I'll post an example here, but again, none of them work, and they were working earlier today. See the last 3 lines of the macro. This has been very frustrating as I've been trying to figure out what's wrong but everything else seems fine. It's just with powercards. %{selected|image} !power {{     --emote|@{selected|token_name} wreaths their weapon in green flame and attacks their opponent, allowing the flame to burst past them to another nearby enemy! --bgcolor|#9BBCD8     --erowbg|#CFC7B5     --orowbg|#FFF8EA     --name|Green Flame Blade     --rightsub|Action     --leftsub|5ft with 5ft leap     --Attack:|[[ [$atk] ?{Attack Type|Standard Attack,1d20|Advantage Attack,2d20kh1|Disadvantage Attack,2d20kl1} + @{selected|spell_attack_bonus} ]]     --?? $atk >= @{target|Melee Attack|ac} AND $atk.base <> 20 AND @{selected|hit_dice} < 5 ?? Damage:|[[ [$dmg1] 1d8 + @{selected|spell_mod} ]] fire damage damage     --?? $atk >= @{target|Melee Attack|ac} AND $atk.base <> 20 AND @{selected|hit_dice} < 5 ?? alterbar1|_target|@{target|Melee Attack|token_id} _bar|1 _amount|-[^dmg1] _show|all     --?? $atk.base == 20 AND @{selected|hit_dice} < 5 ?? Damage:|[[ [$dmg2] 2d8 + @{selected|spell_mod} ]] fire damage damage     --?? $atk.base == 20 AND @{selected|hit_dice} < 5 ?? alterbar2|_target|@{target|Melee Attack|token_id} _bar|1 _amount|-[^dmg2] _show|all --?? $atk >= @{target|Melee Attack|ac} AND $atk.base <> 20 AND @{selected|hit_dice} >= 5 AND @{selected|hit_dice} < 11 ?? Damage:|[[ [$dmg3] 2d8 + @{selected|spell_mod} ]] fire damage damage --?? $atk >= @{target|Melee Attack|ac} AND $atk.base <> 20 AND @{selected|hit_dice} >= 5 AND @{selected|hit_dice} < 11 ?? alterbar3|_target|@{target|Melee Attack|token_id} _bar|1 _amount|-[^dmg3] _show|all     --?? $atk.base == 20 AND @{selected|hit_dice} >= 5 AND @{selected|hit_dice} < 11 ?? Damage:|[[ [$dmg4] 4d8 + @{selected|spell_mod} ]] fire damage damage     --?? $atk.base == 20 AND @{selected|hit_dice} >= 5 AND @{selected|hit_dice} < 11 ?? alterbar4|_target|@{target|Melee Attack|token_id} _bar|1 _amount|-[^dmg4] _show|all --?? $atk >= @{target|Melee Attack|ac} AND $atk.base <> 20 AND @{selected|hit_dice} >= 11 AND @{selected|hit_dice} < 17 ?? Damage:|[[ [$dmg5] 3d8 + @{selected|spell_mod} ]] fire damage damage --?? $atk >= @{target|Melee Attack|ac} AND $atk.base <> 20 AND @{selected|hit_dice} >= 11 AND @{selected|hit_dice} < 17 ?? alterbar5|_target|@{target|Melee Attack|token_id} _bar|1 _amount|-[^dmg5] _show|all     --?? $atk.base == 20 AND @{selected|hit_dice} >= 11 AND @{selected|hit_dice} < 17 ?? Damage:|[[ [$dmg6] 6d8 + @{selected|spell_mod} ]] fire damage     --?? $atk.base == 20 AND @{selected|hit_dice} >= 11 AND @{selected|hit_dice} < 17 ?? alterbar6|_target|@{target|Melee Attack|token_id} _bar|1 _amount|-[^dmg6] _show|all     --?? $atk >= @{target|Melee Attack|ac} AND $atk.base <> 20 AND @{selected|hit_dice} >= 17 ?? Damage:|[[ [$dmg7] 4d8 + @{selected|spell_mod} ]] fire damage damage --?? $atk >= @{target|Melee Attack|ac} AND $atk.base <> 20 AND AND @{selected|hit_dice} >= 17 ?? alterbar7|_target|@{target|Melee Attack|token_id} _bar|1 _amount|-[^dmg7] _show|all     --?? $atk.base == 20 AND @{selected|hit_dice} >= 17 ?? Damage:|[[ [$dmg8] 8d8 + @{selected|spell_mod} ]] fire damage     --?? $atk.base == 20 AND @{selected|hit_dice} >= 17 ?? alterbar8|_target|@{target|Melee Attack|token_id} _bar|1 _amount|-[^dmg8] _show|all     --?? $atk >= @{target|Melee Attack|ac} AND @{selected|hit_dice} < 5 ?? Flame Leap Damage:|[[ [$dmg9] 0d8 + @{selected|spell_mod} ]] fire damage --?? $atk >= @{target|Melee Attack|ac} AND @{selected|hit_dice} < 5 ?? alterbar9|_target|@{target|Fire Leap (5ft)|token_id} _bar|1 _amount|-[^dmg9] _show|all     --?? $atk >= @{target|Melee Attack|ac} AND @{selected|hit_dice} >= 5 AND @{selected|hit_dice} < 11 ?? Flame Leap Damage:|[[ [$dmg10] 1d8 + @{selected|spell_mod} ]] fire damage --?? $atk >= @{target|Melee Attack|ac} AND @{selected|hit_dice} >= 5 AND @{selected|hit_dice} < 11 ?? alterbar10|_target|@{target|Fire Leap (5ft)|token_id} _bar|1 _amount|-[^dmg10] _show|all     --?? $atk >= @{target|Melee Attack|ac} AND @{selected|hit_dice} >= 11 AND @{selected|hit_dice} < 17 ?? Flame Leap Damage:|[[ [$dmg11] 2d8 + @{selected|spell_mod} ]] fire damage --?? $atk >= @{target|Melee Attack|ac} AND @{selected|hit_dice} >= 11 AND @{selected|hit_dice} < 17 ?? alterbar11|_target|@{target|Fire Leap (5ft)|token_id} _bar|1 _amount|-[^dmg11] _show|all --?? $atk >= @{target|Melee Attack|ac} AND @{selected|hit_dice} >= 17 ?? Flame Leap Damage:|[[ [$dmg12] 3d8 + @{selected|spell_mod} ]] fire damage --?? $atk >= @{target|Melee Attack|ac} AND @{selected|hit_dice} >= 17 ?? alterbar12|_target|@{target|Fire Leap (5ft)|token_id} _bar|1 _amount|-[^dmg12] _show|all     --?? $atk < @{target|Melee Attack|ac} ?? soundfx|_audio,play,nomenu|Shortsword Strikes Wood Shield by Stuart Duffield     --?? $atk >= @{target|Melee Attack|ac} ?? soundfx|_audio,play,nomenu|saber     --?? $atk >= @{target|Melee Attack|ac} ?? vfx_opt|@{target|Fire Leap (5ft)|token_id} explosion-fire     --?? $atk >= @{target|Melee Attack|ac} AND $atk.base <> 20 ?? vfx_opt|@{target|Melee Attack|token_id} bubbling-blood     --?? $atk.base == 20 ?? vfx_opt|@{target|Melee Attack|token_id} bomb-blood }} Unless you installed the update manually from the GIST, it hasn't been promoted to OneClick yet. Most likely, though, your player ribbon isn't on the page you are viewing. Visual Effects only play on the player ribbon page.
Also,  --?? $atk >= @{target|Melee Attack|ac} AND $atk.base <> 20 ?? vfx_opt|@{target|Melee Attack|token_id} bubbling-blood     --?? $atk.base == 20 ?? vfx_opt|@{target|Melee Attack|token_id} bomb-blood Should be:  --?? $atk >= @{target|Melee Attack|ac} AND $atk.base <> 20 ?? vfx_opt *1|@{target|Melee Attack|token_id} bubbling-blood     --?? $atk.base == 20 ?? vfx_opt *2|@{target|Melee Attack|token_id} bomb-blood So the two tags don't conflict
Well, any tag with that has the same wording (vfx_opt) can have *1, *2, *3...
Thanks to these forums, wiki and Kurt J, I have been able to build some pretty crazy powercards. This is a custom powercard for an attack I made, complete with audio/video effects for a hit; miss, natural one and natural 20. The picture in the emote is a Gif:
Kyle M. said: Well, any tag with that has the same wording (vfx_opt) can have *1, *2, *3... Thanks for the tip. I haven't had a conflict yet with that in particular, but it's definitely best to avoid them! Thanks. And THANKS Kurt J.! I was going nuts trying to understand what was wrong. Because the typical fx macro command was working but not the powercard one. I didn't realize I had to be on the ribbon page to see fx embedded in power cards. Still learning but having a good time of it!
Kurt J. said: Added a new comparison operator for standard conditionals : @@ (contains). This can be used along the lines of:     --?? Hello @@ el ??Yep|It sure does... "Hello" contains "el" This can be read as "If Hello contains el". Awesome! I've been looking for a way to check an attribute to see if it contains particular content to apply damage resistance/immunity/vulnerability, etc. Would also work conditions as well! While you're at it, I would love to see if you could add content to the  --replacesection functionality. What I'm trying to do is apply a modifier to a weapon. This tag allows me to identify the itemid, which is tied to the weapon from the inventory section, so I can use ChatSetAttr to modify the content of the item based on its itemid. But I need to be able to identify the rowID for the weapon in the attacks section, which is either the rowID from that section, or the itemattackid from the inventory section. Unless I'm missing something, I have no way to access that value without using the "inspect" function in my browser. That's all well and good, if the ability I'm trying to define applied to a single weapon. But I'm trying to create an ability that would allow the user to select a weapon from a query, and then have the appropriate changes apply to that weapon. Something like: !power {{ --?? @{selected|repeating_resource_$1_resource_right} < 1 ?? skipto*1|Fail --replacesection|@{selected|character_id}|?{What weapon?|@{selected|attacklist}}|attack|atkname|SW- --api_setattr|_name @{selected|character_name} _repeating_attack_ ~SW-rowid$ _atkmod|%%charisma_mod%% --api_modbattr|_name @{selected|character_name} _silent _repeating_resource_$1_resource_right|-1 --!CD|You have [[  @{selected|repeating_resource_$1_resource_right} - 1 ]] Channel Divinity left --api_token-mod|_ids @{selected|token_id} _ignore-selected _set bright_vision|on bright_distance|20 low_distance|40 --skipto*2|End --:Fail| --!Fail|You have no Channel Divinity left --:End| }} It would likewise be useful to be able to identify the rowID of the resource this way as well, since different characters might have Channel Divinity in a different place on their character sheet. For reference, this is from the Channel Divinity: Sacred Weapon ability, which says: As an action, you can imbue one weapon that you are holding with positive energy, using your  Channel Divinity . For 1 minute, you add your  Charisma  modifier to  Attack Rolls  made with that weapon (with a minimum bonus of +1). The weapon also emits bright light in a 20-foot radius and dim light 20 feet beyond that. If the weapon is not already magical, it becomes magical for the  Duration . You can end this  Effect  on  Your Turn  as part of any other action. If you are no longer holding or carrying this weapon, or if you fall  Unconscious , this  Effect  ends. Greatly appreciate the work you've put into this!
Hello, I am having a familiar issue which I have nonetheless been unable to personally resolve. I am attempting to build a PowerCard for DnD 5E status conditions from a list of Marketplace token markers. However, the marker icons themselves don't seem to show up in the powercard. 1.) I have a PowerCards Status List handout setup with access to All Players. 2.) I run the following in chat: !power {{      --name|Condition Info      --Blinded:|[+Blinded] Test }} 3.) My powercard looks like this: 4.) I'm certain the icon should be available as other API scripts seem to harness it (such as token mod, see below for the blinded icon from the token mod help api handout). Note these icons are from the marketplace. I'm a bit stumped at this point as I've exhausted all of my available options. Can anyone help?
1610983249
Kurt J.
Pro
API Scripter
PlasticMohawk said: Hello, I am having a familiar issue which I have nonetheless been unable to personally resolve. I am attempting to build a PowerCard for DnD 5E status conditions from a list of Marketplace token markers. However, the marker icons themselves don't seem to show up in the powercard. 1.) I have a PowerCards Status List handout setup with access to All Players. 2.) I run the following in chat: !power {{      --name|Condition Info      --Blinded:|[+Blinded] Test }} 3.) My powercard looks like this: 4.) I'm certain the icon should be available as other API scripts seem to harness it (such as token mod, see below for the blinded icon from the token mod help api handout). Note these icons are from the marketplace. I'm a bit stumped at this point as I've exhausted all of my available options. Can anyone help? I can't say for SURE what the issue is because I don't use custom status effects (and I've never used the PowerCards status effects so I'm not too familiar with it - I didn't write that part :)) BUT, I can say the the handout name should be "PowerCard Status List" (singular instead of PowerCards" because that is what the script will look for.
Thanks for replying - I tried it that way actually, and I got the same unintended result.
Be aware that the means by which API's access the custom markers is not by default (it is only default through the Roll20 VTT standard uses) - it is through coding.  TheAaron may have already incorporated this code into token-mod .  But other scripts are going to need to incorporate libTokenMarkers (Available in the drop down menu) to assist with that.  If Powercards has not been integrated with libTokenMarkers , it may not be able to use the custom statusmarkers functionality.  See if your code works with standard markers (blue, archery-target, rolling-bomb - for examples).  If it works with standard, not custom, I'd say we need the Powercards team to integrate libTokenMarkers in order for the API to understand what/ where they are. I'm sure TheAaron could walk Kurt and others through the steps to incorporate libTokenMarkers into Powercards to get around this issue.
1611086507

Edited 1611086534
Makes sense. I should have also added earlier that I did attempt this with the stock markers and got the same result (the marker silently doesn't show with no error). One detail about that is that prior to this I had removed the stock markers from the campaign using the settings page, so i added them back,reloaded the API sandbox, verified TokenMod's help handout was reading them again, and tried my powercards script, which seemed to deliver the same no-show result with no visible error.
1611090752

Edited 1611091250
Kurt J.
Pro
API Scripter
PowerCards 3.8.17 and PCMHelper 1.0.11a Development Versions NOTE: Not yet on oneclick. See the first post in the thread for links to the development GISTs. Some pretty big changes for PCMHelper, and updates to PowerCards to support them. Here is what's new on the Development GIST: PowerCards 3.8.17 Changes The --soundfx now expands table rolls in order to support playing Roll20AM sounds by selecting them from a rollable table. The --replaceattrs tag now supports an optional 3rd parameter (separated by a |). If specified, it will attempt to find a token with the matching ID and create replacement values specifying token attributes for:     TN – token name      TID – Token ID      B1, B1M, B2, B2M, B3, B3M – bar# value and bar# max      A1R, A1C, A2R, A2C, A3R, A3C – aura # radius and color           TOP, LEFT, WIDTH, HEIGHT - Positional information      ROT – Current rotation           SM – Status Markers The --replacespell tag will now check for two new handouts lists : PowerCard Sounds and PowerCard Visual Effects for lines matching the spell name. If found, ~SPELLSOUND$ and/or ~SPELLVFX$ will be set the --replacepcattack, --replacenpcaction, and --replacenpclegendaryaction similarly will create ~ATTACKSOUND$ and ~ATTACKVFX$ if they have matching entries in the same handouts Replacement variables receive an additional processing pass to account for nested replacement sets (like in SPELLVFX) One final pass for each tag strips out any blank (not replaced) replacement variables PCMHelper 1.0.11a Changes Uses the new Token attribute extraction in PowerCards 3.8.17 to use Token Names instead of Character Names. Normally this won’t make a difference but if you have renamed individual tokens that represent the same underlying character this will provide a better experience. Spellcasting macros updated to remove (for now) automatic damage calculations based on saving throws. These were causing sandbox crashes in some instances, so I pulled them from the macros for now. Spellcasting, PC Attack, NPC Action, and NPC Legendary actions supports automatic inclusion of Sound Effects based on the PowerCard Sounds handout and visual effects b ased on the PowerCard Visual Effects handout REQUIRES POWERCARDS 3.8.17, and DON'T FORGET TO RUN !PCMSETUP to generate new macros Using the new handouts for PCMHelper Create a pair of handouts, one called “ PowerCard Sounds ” and one called “ PowerCard Visual Effects ”. Open Notepad on your computer (or another plain text editor) and create entries for any spells you wish the PCMHelper macros to play sounds or visual effects for. PowerCard Sounds sample: Magic Missile:Pew Pew! Fireball:Explosion Note – The sounds must be the names of the sounds in your jukebox and you must have them imported into Roll20AM. PowerCard Visual Effects sample: Magic Missile:~S-TID$ ~T-TID$ beam-magic Fireball:~T-TID$ burst-fire The location specifiers are ~S-TID$ for the source token and ~T-TID$ for the target token. Specify both for a directional effect. If you don’t specify any the effect will play on the source token. If you specify one token, the effect will play there. AS ALWAYS, THE PLAYER RIBBON MUST BE ON THE PAGE THE EFFECT PLAYS ON. As with all of the PowerCard handouts, editing is always best done by copying, pasting into notepad, editing, and pasting back into the handout replacing everything that is there. You can also create multiple handouts of each type as long as they start with "PowerCard Sounds" and "PowerCard Visual Effects" (for example, "PowerCard Sounds My Spells") and they will all be processed together for a final result set.
1611183402
Kurt J.
Pro
API Scripter
PCMHelper version 1.0.11b on Dev Server Another update for PCMHelper today. This time: Added a new ! command : !pcmformats. Running this command will generate a "PowerCard Formats PCMHelper" handout with a few standard entries used by the PCMHelper Templates as well as a format for each of your Player-Controlled characters. These named formats will select from an array of background colors to make each character's cards unique. Running this command is optional. Cleaned up some of the code so that all of the event handlers are part of the on ready event.
Hello, first of all, thank you for the script and sorry for my english  So my goal was to make a fonction with an armor reduction on the dmg and a armor reduc based on the attack (not a stat then)  And i came to a bunch of wacky thing :  -1 If the armor of the target is too high : the target will regen (instead of just taking 0 dmg)  -2 If the armor of the tarfet is too low to the reduction of the armor of the attack : It does nothing and the console says : ''{"who":"error","type":"error","content":"There was an error with your formula. Please try again."}'' And when i attempt to make a fix by adding some condition like a ''if loop'' (dunow how to says in english), it did not work either and i really don't know why :/  I know that i'm just a beginner but still... i don't understand why this ligne did not even work or being ''seen'' by the code --?? $pene >= @{target|Armure} ?? armure total|[[ [$armuretotal] 1d0 +0 ]] --?? $pene < @{target|Armure} ?? armure total|[[ [$armuretotal] 1d0 + @{target|Armure} - 3 ]] Here's my full of junk code :  !power {{    --name|Coup de lance    --tokenid|@{selected|token_id}    --target_list|@{target|token_id}    --emote|@{selected|character_name} pique     --vfx_opt|@{target|token_id} @{selected|token_id} splatter-fire    --Inflige|[[ [$dmg] 1D6+3 ]] perçant    --Porté|CAC - moyenne    --!Info|    --Ignore|[[ [$pene] 1d0 +3 ]] d'armure --?? $pene >= @{target|Armure} ?? armure total|[[ [$armuretotal] 1d0 +0 ]] --?? $pene < @{target|Armure} ?? armure total|[[ [$armuretotal] 1d0 + @{target|Armure} - 3 ]] --alterbar*1| alterbar1|_target|@{target|token_id} _bar|1 _amount|-([^dmg] - [^armuretotal] ) --alterbar*2| alterbar2|_target|@{selected|token_id} _bar|2 _amount|-3 --soundfx|_audio,play,nomenu|strike }} So far it works unless for the two condition mentionned above.  Can anyone help ? (i use alterbar and powercard with the lateste upgrades)
1611614783
Kurt J.
Pro
API Scripter
Glacio said: Hello, first of all, thank you for the script and sorry for my english  So my goal was to make a fonction with an armor reduction on the dmg and a armor reduc based on the attack (not a stat then)  And i came to a bunch of wacky thing :  -1 If the armor of the target is too high : the target will regen (instead of just taking 0 dmg)  -2 If the armor of the tarfet is too low to the reduction of the armor of the attack : It does nothing and the console says : ''{"who":"error","type":"error","content":"There was an error with your formula. Please try again."}'' And when i attempt to make a fix by adding some condition like a ''if loop'' (dunow how to says in english), it did not work either and i really don't know why :/  I know that i'm just a beginner but still... i don't understand why this ligne did not even work or being ''seen'' by the code --?? $pene >= @{target|Armure} ?? armure total|[[ [$armuretotal] 1d0 +0 ]] --?? $pene < @{target|Armure} ?? armure total|[[ [$armuretotal] 1d0 + @{target|Armure} - 3 ]] Here's my full of junk code :  !power {{    --name|Coup de lance    --tokenid|@{selected|token_id}    --target_list|@{target|token_id}    --emote|@{selected|character_name} pique     --vfx_opt|@{target|token_id} @{selected|token_id} splatter-fire    --Inflige|[[ [$dmg] 1D6+3 ]] perçant    --Porté|CAC - moyenne    --!Info|    --Ignore|[[ [$pene] 1d0 +3 ]] d'armure --?? $pene >= @{target|Armure} ?? armure total|[[ [$armuretotal] 1d0 +0 ]] --?? $pene < @{target|Armure} ?? armure total|[[ [$armuretotal] 1d0 + @{target|Armure} - 3 ]] --alterbar*1| alterbar1|_target|@{target|token_id} _bar|1 _amount|-([^dmg] - [^armuretotal] ) --alterbar*2| alterbar2|_target|@{selected|token_id} _bar|2 _amount|-3 --soundfx|_audio,play,nomenu|strike }} So far it works unless for the two condition mentionned above.  Can anyone help ? (i use alterbar and powercard with the lateste upgrades) There are two problems I see right away : First, you have two lines with the "armure total" tag, so only one of them will actually get included in the card. The second is that all of the rolls and roll id assignments in a powercard happen before the card is processed (at chat time). This means that you will only ever have the second value for [^armuretotal]. Both of these can be resolved by adding * modifiers to the conditionals, changing the name of the roll ids to separate names, and adding two more conditional lines. I can't test this, but the following should be close: !power {{    --name|Coup de lance    --tokenid|@{selected|token_id}    --target_list|@{target|token_id}    --emote|@{selected|character_name} pique     --vfx_opt|@{target|token_id} @{selected|token_id} splatter-fire    --Inflige|[[ [$dmg] 1D6+3 ]] perçant    --Porté|CAC - moyenne    --!Info|    --Ignore|[[ [$pene] 1d0 +3 ]] d'armure --?? $pene >= @{target|Armure} ?? armure total*1|[[ [$at] 1d0 +0 ]] --?? $pene < @{target|Armure} ?? armure total*2|[[ [$art] 1d0 + @{target|Armure} - 3 ]] --?? $pene >= @{target|Armure} ?? alterbar*1| alterbar1|_target|@{target|token_id} _bar|1 _amount|-([^dmg] - [^at] ) --?? $pene < @{target|Armure} ?? alterbar*2| alterbar1|_target|@{target|token_id} _bar|1 _amount|-([^dmg] - [^art] ) --alterbar*3| alterbar2|_target|@{selected|token_id} _bar|2 _amount|-3 --soundfx|_audio,play,nomenu|strike }}
Installed PowerCards & PowerCards Macro Made the advantage to toggle from game settings Launched new game and entered !pcmsetup Created a character & monster  Made sure that both character and monster had the toggle for advantage Tried to cast a L3 Fireball or Lightning Bolt from Character targeting the monster and received the following (tried many different monsters and other spells all resulting in similar or same outputs.) 
1611620927
Kurt J.
Pro
API Scripter
Atemi said: Installed PowerCards & PowerCards Macro Made the advantage to toggle from game settings Launched new game and entered !pcmsetup Created a character & monster  Made sure that both character and monster had the toggle for advantage Tried to cast a L3 Fireball or Lightning Bolt from Character targeting the monster and received the following (tried many different monsters and other spells all resulting in similar or same outputs.)  I found some issues with the Level 1-9 casting macros (Cantrips were ok) in version 1.0.10 of PCMHelper, so a new version will be coming to OneClick that cleans up these issues (see the post about 4 above this one). The new version is available on the Development GIST right now, and I've submitted a pull request to update OneClick which usually happens on Tuesdays.
hello to all those great helpers and inventers! My basic question is, how to call a macro form a power card as per condition. I have: /me @{selected|token_name} is firing a pistol ![[@{selected|Firing_pistol}+@{selected|Speed}&{tracker:+}]] !power {{   --name|Pistol   --Attack|[[ [$Atk] 1d20+@{selected|Accuracy}+?{modifier|0} ]] vs AC  --?? $Atk < @{target||ac} ?? !Missed|**You missed!** --?? $Atk >= @{target||ac} AND $Atk < 20 ?? Damage: |[[ [$Dmg] @{selected|weapon_damage} ]] gun wound --?? $Atk >= @{target||ac} AND $Atk < 20 ?? alterbar1|_target|@{target||token_id} _bar|1 _amount|-[^Dmg] --?? $Atk >= 20 ?? Damage: |[[ [$Dmg2] @{selected|weapon_damage}+@{selected|weapon_damage} ]] double Damage! --?? $Atk >= 20 ?? alterbar2|_target|@{target||token_id} _bar|1 _amount|-[^Dmg2] }} which works fine. It applies damage directly to bar1. What I still not get is a conditional like: IF damage of target is <= 0 then call !token-mod and set statusmarkers|dead. I tried quite much but didn´t succeed :-( Thanks, Hendrick
1611650224

Edited 1611656631
Kurt J. said: There are two problems I see right away : First, you have two lines with the "armure total" tag, so only one of them will actually get included in the card. The second is that all of the rolls and roll id assignments in a powercard happen before the card is processed (at chat time). This means that you will only ever have the second value for [^armuretotal]. Both of these can be resolved by adding * modifiers to the conditionals, changing the name of the roll ids to separate names, and adding two more conditional lines. I can't test this, but the following should be close: !power {{    --name|Coup de lance    --tokenid|@{selected|token_id}    --target_list|@{target|token_id}    --emote|@{selected|character_name} pique     --vfx_opt|@{target|token_id} @{selected|token_id} splatter-fire    --Inflige|[[ [$dmg] 1D6+3 ]] perçant    --Porté|CAC - moyenne    --!Info|    --Ignore|[[ [$pene] 1d0 +3 ]] d'armure --?? $pene >= @{target|Armure} ?? armure total*1|[[ [$at] 1d0 +0 ]] --?? $pene < @{target|Armure} ?? armure total*2|[[ [$art] 1d0 + @{target|Armure} - 3 ]] --?? $pene >= @{target|Armure} ?? alterbar*1| alterbar1|_target|@{target|token_id} _bar|1 _amount|-([^dmg] - [^at] ) --?? $pene < @{target|Armure} ?? alterbar*2| alterbar1|_target|@{target|token_id} _bar|1 _amount|-([^dmg] - [^art] ) --alterbar*3| alterbar2|_target|@{selected|token_id} _bar|2 _amount|-3 --soundfx|_audio,play,nomenu|strike }} That worked, thank you !  And i try to make another condition to remove the problem with ''When the dmg is below the total armor it's heal the target'' so i do this :  !power {{ --name|Coup de lance --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|character_name} pique --vfx_opt|@{target|token_id} @{selected|token_id} splatter-fire --Inflige|[[ [$dmg] 1D6+3 ]] perçant --Porté|CAC - moyenne --!Info| --Ignore|[[ [$pene] 1d0 +3 ]] d'armure --?? $pene >= @{target|Armure} ?? armure total*1|[[ [$at] 1d0 +0 ]] --?? $pene < @{target|Armure} ?? armure total*2|[[ [$art] 1d0 + @{target|Armure} - 3 ]] --?? $pene >= @{target|Armure} ?? alterbar*1| alterbar1|_target|@{target|token_id} _bar|1 _amount|-([^dmg] - [^at] ) --?? $pene < @{target|Armure} AND $dmg > @{target|Armure} ?? alterbar*2| alterbar1|_target|@{target|token_id} _bar|1 _amount|-([^dmg] - [^art] ) --?? $pene < @{target|Armure} AND $dmg <= @{target|Armure} ?? alterbar*2| alterbar1|_target|@{target|token_id} _bar|1 _amount|-(0) -- ?? $pene + $dmg < @{target|Armure} ?? alterbar*2| alterbar1|_target|@{target|token_id} _bar|1 _amount|-([^dmg] - [^art] ) --alterbar*3| alterbar2|_target|@{selected|token_id} _bar|2 _amount|-3 --soundfx|audio,play,nomenu|strike }} It works but when it come to this :  Dmg = 8 or 7, armor is 8, armor reduc is 3 : the target take 0 dmg (he should take 5dmg instead)  I get why it does this and i get the solution (make a variable with ''tdmg = [^dmg] + [^pene]'' but since we can't call a rollid to make a rollid...  So i try to get past that problem with the bold line in different version but didn't work either :/  Is there a way to add the valor of a rollid inside a new rollid or to addition the result of two different rollid ?