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 .
×

Pulling character name from sheet in attack macro

I'm trying to work a generic macro for the D&D 5e character sheet that uses the atk template.  I use the repeating_attack capability and the RowID. I pull the name of the weapon from the sheet for that space. If I hardcode the character's name it works fine...But I'm trying to make it pull the character's name from the sheet and it never works properly.  I tried lots of variations and can't find a solution.   @{selected|character_name|wtype}&{template:atk} {{mod=@{selected|strength_mod} + @{selected|PB}}} {{rname=[@{selected|repeating_attack_$0_atkname}](~$0|repeating_attack_$0_attack_dmg)}}{{rnamec=[@{selected|repeating_attack_$0_atkname}](~$0|repeating_attack_$0_attack_crit)}} {{r1=[[@{Stedd Amblecrown|d20}cs>20 + 2[STR] + 2[PROF]]]}} @{Stedd Amblecrown|rtype}cs>20 + 2[STR] + 2[PROF]]]}} {{range=}} {{desc=}} {{spelllevel=}} {{innate=}} @{Stedd Amblecrown|global_attack_mod} ammo= @{Stedd Amblecrown|charname_output} Any suggestions?
1525142191

Edited 1525142306
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
This is your problem right here (bolded): @{selected|character_name|wtype} &{template:atk} {{mod=@{selected|strength_mod} + @{selected|PB}}} {{rname=[@{selected|repeating_attack_$0_atkname}](~$0|repeating_attack_$0_attack_dmg)}}{{rnamec=[@{selected|repeating_attack_$0_atkname}](~$0|repeating_attack_$0_attack_crit)}} {{r1=[[@{Stedd Amblecrown|d20}cs>20 + 2[STR] + 2[PROF]]]}} @{Stedd Amblecrown|rtype}cs>20 + 2[STR] + 2[PROF]]]}} {{range=}} {{desc=}} {{spelllevel=}} {{innate=}} @{Stedd Amblecrown|global_attack_mod} ammo= @{Stedd Amblecrown|charname_output Should be @{selected|wtype} My question is why are you doing this as a custom macro? I don't see anything that couldn't be done via the sheet's created roll.
1525147455

Edited 1525147509
I'm trying to make a macro that I can just copy into the character sheet and set as a token action.  I'm trying to remove the hard reference to Stedd Amblecrown.  
1525147859
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ah, then you can just do this in the ability that you're going to make a token action: %{selected|repeating_attack_$0_attack}
Scott C.  I maybe thick and it took me awhile, but I understand what you are saying. Thanks.  Here is the corrected code. @{selected|character_name|wtype}&{template:atk} {{mod=@{selected|strength_mod} + @{selected|PB}}} {{rname=[@{selected|repeating_attack_$0_atkname}](~selected|repeating_attack_$0_attack_dmg)}}{{rnamec=[@{selected|repeating_attack_$0_atkname}](~selected|repeating_attack_$0_attack_crit)}} {{r1=[[@{selected|d20}cs>20 + 2[STR] + 2[PROF]]]}} @{selected|rtype}cs>20 + 2[STR] + 2[PROF]]]}} {{range=}} {{desc=}} {{spelllevel=}} {{innate=}} @{selected|global_attack_mod} ammo= @{selected|charname_output}
I'm soooo thick.  I thought you (Scott) where just showing me the the part to ADD to my long macro.  However, you where showing what the WHOLE macro should be.  Everything else that is needed (i.e. Character name, range, crits) are all handled by the ATK template. Thanks again