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 .
×
May your rolls be chill this holiday season!
Create a free account

Using Character sheet templates in non character sheet macros

so  I have a character using the new PF character sheet for which a weapons roll macro is:  &{template:PFAttack} {{name=@{character_name}'s @{name}}} {{subtags=@{type}}} {{attack=[[1d20cs>@{crit-target}+@{total-attack}]]}} {{damage=[[@{damage-dice-num}d@{damage-die}+@{total-damage}]]}} {{confirm=[[1d20+@{total-attack}]]}} {{dmgcrit=[[(@{damage-dice-num} * (@{crit-multiplier} - 1))d@{damage-die} + (@{total-damage} * (@{crit-multiplier} - 1))]]}} {{notes=@{notes}}} {{attk-notes=@{attack-notes}}} Great, I need to tweak it,m but I think I can handle that. .. I'm trying to find a way to call it from a regular macro.  Obviously  this won't quite work as outside the character sheet the weapon variables don't exist as those names..  I thought the solution was:  &{template:PFAttack} {{name=@{character_name}'s @{repeating_weapon_0_name}}} {{subtags=@{repeating_weapon_0_type}}} {{attack=[[1d20cs>@{repeating_weapon_0_crit-target}+@{repeating_weapon_0_total-attack}]]}} {{damage=[[@{repeating_weapon_0_damage-dice-num}d@{repeating_weapon_0_damage-die}+@{repeating_weapon_0_total-damage}]]}} {{confirm=[[1d20+@{repeating_weapon_0_total-attack}]]}} {{dmgcrit=[[(@{repeating_weapon_0_damage-dice-num} * (@{repeating_weapon_0_crit-multiplier} - 1))d@{repeating_weapon_0_damage-die} + (@{repeating_weapon_0_total-damage} * (@{repeating_weapon_0_crit-multiplier} - 1))]]}} {{notes=@{repeating_weapon_0_notes}}} {{attk-notes=@{attack-notes}}}   But that still simply returns the error: TypeError: Cannot read property 'substring' of undefined What am I missing? do I  need a {selected|Character_Name} or something?
I found it.. sort of.. work in progress answer I needed to add 'selected|' in fron ot character_name and in front  of every instance of 'repeating_weapon_0'.. but it's still slightly broken.  I think I know the fix but must test.
1502853687

Edited 1502853781
vÍnce
Pro
Sheet Author
Try adding a "$" before each row number on your repeating attributes.  ie  "repeating_weapon_ $ 0..."
heh.. GMs API went wahwah it all works now