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

API Error - Help need : "Error: No attribute or sheet field found for character_id..."

Hi. Using Powercards / Powercards Macro helper on a game.  When using a macro (for example : pc-attack) with a monster's target : "Error: No attribute or sheet field found for character_id -MCli1pjQFY2aEv32S1M named 0*" I suppose a missing attribute, but which ? thx for ur help !
1605878740
Oosh
Sheet Author
API Scripter
It looks like some bad syntax in the PC macro, like it's trying to find an Attribute called "0". Do you have the code the helper generated for you?
Macro  !power {{    --replacepcattack|@{selected|character_id}|?{Select attack to use|@{selected|attacklist}}    --replacement|Advantage    --replaceattrs|S-|@{selected|character_id}    --replaceattrs|T-|@{target|character_id}    --template|Basics|@{selected|token_id};@{target|token_id};uses ~PCA-NAME$;~PCA-NAME$;~PCA-ATYPE$;~PCA-RANGE$;@{selected|whispertoggle}   --template|PCAttack|~@{selected|rtype}$;@{selected|whispertoggle};@{selected|global_attack_mod};@{selected|global_damage_mod_roll};@{selected|global_damage_mod_type};@{selected|global_damage_mod_crit} }} with handout Advantage:{{query=1}} {{normal=1}} {{r2=[[0d20|1d20;{{query=1}} {{advantage=1}} {{r2=[[1d20|2d20kh1;{{query=1}} {{disadvantage=1}} {{r2=[[1d20|2d20kl1 Basics:  --tokenid|~0!  --target_list|~1!  --['~6!' -ne '/w gm ']emote|~S-CN$ ~2! against ~T-CN$  --format|~S-CN$  --name|~3!  --leftsub|~4!  --rightsub|~5! PCAttack:  --['~1!' -eq '/w gm ']whisper|gm  --['~2!' -eq '']Attack *1|[#[ [$Atk] ~0! + ~PCA-ATKBONUS$ [Attack Bonus] ]#] vs **AC** [#[~T-AC$]#]  --['~2!' -ne '']Attack *2|[#[ [$Atk] ~0! + ~PCA-ATKBONUS$ [Attack Bonus] + ~2! [Bless] ]#] vs **AC** [#[~T-AC$]#]  --?? $Atk.base == 1 ?? Fumble|The attack went horribly wrong!  --?? $Atk.base <> 1 AND $Atk.base <> 20 AND $Atk.total < ~T-AC$ ?? Miss *1|~S-CN$ missed.  --["~PCA-DMG2DICE$" -eq "none" -and "~3!" -eq "0"]?? $Atk.base <> 20 AND $Atk.total >= ~T-AC$ ?? Hit|~S-CN$ hits ~T-CN$ for [#[ [$Dmg] ~PCA-DMG1DICE$ ]] ~PCA-DMG1TYPE$ damage  --["~PCA-DMG2DICE$" -ne "none" -and "~3!" -eq "0"]?? $Atk.base <> 20 AND $Atk.total >= ~T-AC$ ?? Hit|~S-CN$ hits ~T-CN$ for [#[ [$Dmg] ~PCA-DMG1DICE$ ]] ~PCA-DMG1TYPE$ damage and [[ [$Dmg2] ~PCA-DMG2DICE$ ]] ~PCA-DMG2TYPE$ damage  --["~PCA-DMG2DICE$" -eq "none" -and "~3!" -ne "0"]?? $Atk.base <> 20 AND $Atk.total >= ~T-AC$ ?? Hit|~S-CN$ hits ~T-CN$ for [#[ [$Dmg] ~PCA-DMG1DICE$ ]] ~PCA-DMG1TYPE$ damage and [[ [$GDmg] ~3! ]] ~4! damage  --["~PCA-DMG2DICE$" -ne "none" -and "~3!" -ne "0"]?? $Atk.base <> 20 AND $Atk.total >= ~T-AC$ ?? Hit|~S-CN$ hits ~T-CN$ for [#[ [$Dmg] ~PCA-DMG1DICE$ ]] ~PCA-DMG1TYPE$ damage, [[ [$GDmg] ~3! ]] ~4! damage and [[ [$Dmg2] ~PCA-DMG2DICE$ ]] ~PCA-DMG2TYPE$ damage  --["~PCA-DMG2DICE$" -eq "none" -and "~3!" -eq "0"]?? $Atk.base == 20 AND $Atk.total >= ~T-AC$ ?? Critical Hit|~S-CN$ hits ~T-CN$ for [#[ [$Dmg] ~PCA-DMG1CRIT$ ]] ~PCA-DMG1TYPE$ damage  --["~PCA-DMG2DICE$" -ne "none" -and "~3!" -eq "0"]?? $Atk.base == 20 AND $Atk.total >= ~T-AC$ ?? Critical Hit|~S-CN$ hits ~T-CN$ for [#[ [$Dmg] ~PCA-DMG1CRIT$ ]] ~PCA-DMG1TYPE$ damage and [[ [$Dmg2] ~PCA-DMG2CRIT$ ]] ~PCA-DMG2TYPE$ damage  --["~PCA-DMG2DICE$" -eq "none" -and "~3!" -ne "0"]?? $Atk.base == 20 AND $Atk.total >= ~T-AC$ ?? Critical Hit|~S-CN$ hits ~T-CN$ for [#[ [$Dmg] ~PCA-DMG1CRIT$ ]] ~PCA-DMG1TYPE$ damage and [[ [$GDmg] ~5! ]] ~4! damage  --["~PCA-DMG2DICE$" -ne "none" -and "~3!" -ne "0"]?? $Atk.base == 20 AND $Atk.total >= ~T-AC$ ?? Critical Hit|~S-CN$ hits ~T-CN$ for [#[ [$Dmg] ~PCA-DMG1CRIT$ ]] ~PCA-DMG1TYPE$ damage [[ [$GDmg] ~5! ]] ~4! damage and [[ [$Dmg2] ~PCA-DMG2CRIT$ ]] ~PCA-DMG2TYPE$ damage  --["~PCA-SAVE$" -eq "true"]?? $Atk.base == 20 OR $Atk.total >= ~T-AC$ ?? Save|~T-CN$ can attempt a **DC ~PCA-SAVEDC$** ~PCA-SAVEATTR$ saving throw for ~PCA-SAVEEFFECT$  --["~PCA-SAVE$" -eq "true"]?? $Atk.base == 20 OR $Atk.total >= ~T-AC$ ?? Save|~T-CN$ can attempt a **DC ~PCA-SAVEDC$** ~PCA-SAVEATTR$ saving throw for ~PCA-SAVEEFFECT$  --["~PCA-DESC$" -ne "none"]Description|~PCA-DESC$
1605918205

Edited 1605927373
Oosh
Sheet Author
API Scripter
Hmmm, have you tried removing the handouts and running !pcmsetup again? I can see that error in the API console even when the powercard is outputting correctly. Also, is the handout called "PowerCard Templates" ? It is (bizzarely) case sensitive, even on that middle C. Other characters can come after it, but it must start with that exact string.
Tried deleting handouts and macros + !pcmsetup => Same error. Error only when i attack a NPC, no error on a PC. The Handout called : PowerCard Templates PCMHelper
1605949855
Oosh
Sheet Author
API Scripter
Where is the error appearing? In the API console? Is anything at all being output to chat from the PC macro? a grey bar or anything?
Yep in the API console. The macro's results are in the chat.
1605956188
Oosh
Sheet Author
API Scripter
Wait... so the output in the chat bar is OK?
Yep
1605966404

Edited 1605966451
Oosh
Sheet Author
API Scripter
Ah.... I probably wouldn't worry about the message in the console then. Turns out it's from the @{spellcasting_ability} Attribute. On NPCs with no spellcasting ability, this is set to 0*, and PC is complaining about this not being a valid Attribute call. You can change it to reference an ability if you want to get rid of that console message, you can point it towards a random Attribute. @{caster_level} would do the trick, should always be 0 on anything with the spellcasting_ability set to 0*. I can't find the error message anywhere in the PC or PCM code. Maybe it's coming from R20? I'm not sure, someone else probably knows more about it.
Ok :) Thx !!!
I get a similar error in the API Console, but also have an issue in the chat.  (see image) I have created a new game in Roll20. Installed Powercards and Powercards Macro helper. I launched the game, and ran !pcmsetup. When I am testing macros I get this kind of output. Code in the the attack rather than formatted outpu. Any idea what I am doing wrong, or what I can do to fix?
1606693506

Edited 1606693728
Ooof.  The creature was not set to Advantage Toggle.  Once I set it to that, I was fine.