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 .
×
Advertisement Create a free account

Scriptcards: Repeating Section Access for Spells

1632088912
What is the field in the Repeating Section for the ActionID of the spell? In Will M's Spellbook ( link ), I see a reference to [*R:xxxActionIDxxxx] But that doesn't seem to work for me.&nbsp; When I try to build a link to "Cast" for each spell in a Repeating Section loop using&nbsp; [sheetbutton] Cast ::@{selected|character_name}::repeating_spell-[&amp;Lvl]_[*R:xxxActionIDxxxx]_spell[/sheetbutton] The section where the unique ID for casting the spell is blank, making the Cast link something like <a href="https://app.roll20.net/editor/~-MZeOq8NO3Oorgh6u1di%7Crepeating_spell-cantrip_spell" rel="nofollow">https://app.roll20.net/editor/~-MZeOq8NO3Oorgh6u1di%7Crepeating_spell-cantrip_spell</a> &nbsp;(which obviously doesn't work) instead of&nbsp; <a href="https://app.roll20.net/editor/~-MZeOq8NO3Oorgh6u1di%7Crepeating_spell-cantrip_-MZ2GVwN6fG7YnFvpTOD_spell" rel="nofollow">https://app.roll20.net/editor/~-MZeOq8NO3Oorgh6u1di%7Crepeating_spell-cantrip_-MZ2GVwN6fG7YnFvpTOD_spell</a> &nbsp;(which does work) The [*R:spellattackID] is close, but only works for spells that are set up as Attacks, and is blank for Spells set to Spellcard Output.
1632155463
Kurt J.
Pro
API Scripter
Matt M. said: What is the field in the Repeating Section for the ActionID of the spell? In Will M's Spellbook ( link ), I see a reference to [*R:xxxActionIDxxxx] But that doesn't seem to work for me.&nbsp; When I try to build a link to "Cast" for each spell in a Repeating Section loop using&nbsp; [sheetbutton] Cast ::@{selected|character_name}::repeating_spell-[&amp;Lvl]_[*R:xxxActionIDxxxx]_spell[/sheetbutton] The section where the unique ID for casting the spell is blank, making the Cast link something like <a href="https://app.roll20.net/editor/~-MZeOq8NO3Oorgh6u1di%7Crepeating_spell-cantrip_spell" rel="nofollow">https://app.roll20.net/editor/~-MZeOq8NO3Oorgh6u1di%7Crepeating_spell-cantrip_spell</a> &nbsp;(which obviously doesn't work) instead of&nbsp; <a href="https://app.roll20.net/editor/~-MZeOq8NO3Oorgh6u1di%7Crepeating_spell-cantrip_-MZ2GVwN6fG7YnFvpTOD_spell" rel="nofollow">https://app.roll20.net/editor/~-MZeOq8NO3Oorgh6u1di%7Crepeating_spell-cantrip_-MZ2GVwN6fG7YnFvpTOD_spell</a> &nbsp;(which does work) The [*R:spellattackID] is close, but only works for spells that are set up as Attacks, and is blank for Spells set to Spellcard Output. There are two variations on *R. The "normal" one [*R:spellname] retrieves the value of the property on the repeating item. The pointer version [*R&gt;spellname] retrieves the internal ID name of the item. In this case, "spell" is the item you are looking for in the repeating section, but you need its id an not its value: [sheetbutton] Cast ::@{selected|character_name}::[*R&gt;spell][/sheetbutton] Should produce a functional button
1632231858
Thanks Kurt!&nbsp; That was exactly what I needed.&nbsp; Works like a charm. Kurt J. said: There are two variations on *R. The "normal" one [*R:spellname] retrieves the value of the property on the repeating item. The pointer version [*R&gt;spellname] retrieves the internal ID name of the item. In this case, "spell" is the item you are looking for in the repeating section, but you need its id an not its value: [sheetbutton] Cast ::@{selected|character_name}::[*R&gt;spell][/sheetbutton] Should produce a functional button