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

[5e OGL] problem with repeating_attack

Hi, I've got a problem with referencing weapons and spells in the attack-block of the 5e OGL Charactersheet 1.6. I try to build macros for attacks, but the macros fail, if the referenced attack is a weapon attack. If it is a spell everything is fine. Here's what I do: @{selected|repeating_attack_$0_atkflag} If the selected character token has a spell equipped in the first slot this returns "0", which is fine, but if its a weapon it returns "{{attack=1}}" and it breaks the macro I use it in.

Edited 1505742708
How are you trying to use this in your macro? That is the intended behavior for that flag
I am trying to use this in the PowerCards 3 script (v3.5) in a condition to create a macro which executes different rolls and displays different information depending on wether this is a weapon or a spell attack. But if it behaves like it should, then the problem probably lies within PowerCards. The (simplified) example I posted below works fine if slot 0 is a spell but crashes if it's a weapon. !power {{ --charid|@{selected|character_id} --target_list|@{target|Ziel|token_id} --?? @{selected|repeating_attack_$0_atkflag} == 0 ?? Spell:|@{selected|repeating_attack_$0_atkname_base} --?? @{selected|repeating_attack_$0_atkflag} <> 0 ?? Weapon:|@{selected|repeating_attack_$0_atkname_base} }} The output is Spell: Poison Spray but for a weapon it shows Lavaeolus (GM): --?? {{attack=1}} <> 0 ?? Weapon:|Martial Arts Schlag }}
I haven't used powercards myself so I don't know if this is possible, but could you not use the _spellid attribute for the attack to be able to distinguish instead of the atkflag. This attribute will be empty if it is for an attack, but for a spell it will have the SPELLLEVEL_ROWID for the linked spell.
Thanks a lot for the quick solution, that did the trickl I was thinking about replacing atkflag with something else to differentiate between spells and weapons but I did not have _spellid on my screen. And mentioning the spelllevel_rowid in your answer gave me a good clue where and how to find additional information for spells, for example the spell description.
That's awesome! Glad it worked out for you