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

Scriptcards: Call Character Ability

1697400111
Essen
Pro
Marketplace Creator
Any way to call a character ability? I want to use two script cards in one ability, and it won’t. So I’m making two and want to trigger the second after the first one completes.
1697421017
Andrew R.
Pro
Sheet Author
This might be where ScriptCard Libraries might help.  You refactor the 2 scripts into Library procedures and then call them from a single script attached to the ability.  I haven’t done this myself yet, none of my 13th Age scripts are that complex. 
Why do you want to use 2 scriptcards in 1 ability? Can you describe a bit more about what you are wanting to do? Why not just combine them into a single ScriptCard?
1697448937
Essen
Pro
Marketplace Creator
My player has a bite attack. If the bite hits, they can then spend a charge to inject venom.  Because I'm not comparing the attack rolls against a target, it's rolling a 'success' every time. The prompt to ask if they want to inject always comes up before the card displays even if it's the last line --X|, so they effectively have to say yes or no and trigger the line to spend a charge before they know if they hit.  I want Bite card > See results > Choose to inject > Show inject results. I'll look into libraries when I get off work and see if it's feasible.
1697453690
Andrew R.
Pro
Sheet Author
It sounds like you should have a button that runs the envenomation script. The script that runs the bite attack would always show the button, and the player can decide to press it if they hit.  I haven't done this, but I've seen examples show up in the ScriptCards thread. 
In this particular case, I don't think you need a library for this. You could run this as two different abilities and have the Bite ScriptCard send a sheetbutton  to the player at the end. [sheetbutton]caption::character::ability[/sheetbutton] Another option would be to use a re-entrant script, like if the Inject Venom is not a wholly separate ability and is only allowed after the bite attack, you could make the Bite ScriptCard have the InjectVenom code: **Bite Code** --#reentrant|BiteVenom @{selected|character_id} --#whisper|self --+Inject Venom|[rbutton]Use charge::InjectVenom;1[/rbutton] --X| --:InjectVenom| --#whisper|0 **Venom Code** --X| That way the player is prompted if they want to use a charge to inject the venom. Alternatively, if you wanted you could also add a condition to check if the attack roll beats the target's AC before you even supply that button.
1697471923
Essen
Pro
Marketplace Creator
Thank you! A reentrant button is perfect. I didn't know what that was before now.