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

ScriptCard - Waffles & Bacon Help

1756140332

Edited 1756140565
Beau
Pro
So I’ve made a silly lil script i call Waffles & Bacon. It’s mainly just a throw away script I’ve made to help me get a feel for ScriptCard. Problem is, I’ve hit a brick wall and I’m not entirely sure what I’ve done wrong. for the script, ideally it will give a drop down menu of choices between Waffles 1-4 and Bacon 1-2. After you’ve picked one, a statement including that choice will be spat out i.e. “Boy oh boy, i sure do love Waffles 3” Afterwards, it should be going through conditional statements to see which choice you’ve made to spit out a secondary statement confirming your love for the choice. i.e “Yup, Waffles 3 is the best” the first half works like a charm, but when it comes time to output a secondary output based on your choice, it just defaults to the first option of “Yup. Waffle 1 is the best.” !scriptcard {{ --#title|Waffle Bacon Test --#titlecardbackground|#1220b5 --#emoteBackground|#0e1996 --#emoteFontSize|11px --#emoteFontColor|#1ff8ff --#emoteText|the options are Waffle 1-4 and Bacon 1-2. --&BWChoice|?{Bacon or Waffles?|Waffle 1|Waffle 2|Waffle 3|Waffle 4|Bacon 1|Bacon 2} --+|Boy oh boy, i sure do love [&BWChoice]. --?[&BWChoice] -inc Waffle 1|W1 --?[&BWChoice] -inc Waffle 2|W2 --?[&BWChoice] -inc Waffle 3|W3 --?[&BWChoice] -inc Waffle 4|W4 --?[&BWChoice] -inc Bacon 1|B1 --?[&BWChoice] -inc Bacon 2|B2 --:W1|[W1] --+|Yup, Waffle 1 is the best. --^StirFried| --:W2|[W2] --+|Yup, Waffle 2 is the best. --^StirFried| --:W3|[W3] --+|Yup, Waffle 3 is the best. --^StirFried| --:W4|[W4] --+|Yup, Waffle 4 is the best. --^StirFried| --:B1|[B1] --+|Yup, Bacon 1 is the best. --^StirFried| --:B2|[B2] --+|Yup, Bacon 2 is the best. --^StirFried| --:StirFried| --X| }}
1756165504
Andrew R.
Pro
Sheet Author
You need to put double quotes around the strings in your comparisons, to start with.  --?[&BWChoice] -inc "Waffle 1"|W1
Ohhhh, i had no idea
1756170388
Andrew R.
Pro
Sheet Author
You’ll want to follow the official ScriptCards thread for updates, examples, etc.,&nbsp; <a href="https://app.roll20.net/forum/permalink/11175456/" rel="nofollow">https://app.roll20.net/forum/permalink/11175456/</a>
Hey Beau, So here are a few&nbsp; ScriptCards tutorials &nbsp;that go step by step through various parts of ScriptCards to build some examples. Each part of the tutorial that introduces something new includes links to the&nbsp; ScriptCards wiki The wiki also has a link to Kurt's ScriptCards discord where you can get help from folks that are pretty knowledgeable about ScriptCards including Kurt, the author.
1756192547
Andrew R.
Pro
Sheet Author
Here's a version that works. It needed double quotes on both sides of the comparator because there's spaces in both sides. Note that I used subroutine calls instead of goto jumps because I default to Structured Programming for ScriptCards. !scriptcard {{ --#emoteBackground|#0e1996 --#emoteFontColor|#1ff8ff --#emoteFontSize|11px --#emoteText|the options are Waffle 1-4 and Bacon 1-2. --#titlecardbackground|#1220b5 --#title|Waffle Bacon Test --&amp;BWChoice|?{Bacon or Waffles?|Waffle 1|Waffle 2|Waffle 3|Waffle 4|Bacon 1|Bacon 2} --+|Boy oh boy, i sure do love [&amp;BWChoice]. --?"[&amp;BWChoice]" -eqi "Waffle 1"|&gt;W1 --?"[&amp;BWChoice]" -eqi "Waffle 2"|&gt;W2 --?"[&amp;BWChoice]" -eqi "Waffle 3"|&gt;W3 --?"[&amp;BWChoice]" -eqi "Waffle 4"|&gt;W4 --?"[&amp;BWChoice]" -eqi "Bacon 1"|&gt;B1 --?"[&amp;BWChoice]" -eqi "Bacon 2"|&gt;B2 --X|Exit --:W1|[W1] --+|Yup, Waffle 1 is the best. --&lt;|W1 --:W2|[W2] --+|Yup, Waffle 2 is the best. --&lt;|W2 --:W3|[W3] --+|Yup, Waffle 3 is the best. --&lt;|W3 --:W4|[W4] --+|Yup, Waffle 4 is the best. --&lt;|W4 --:B1|[B1] --+|Yup, Bacon 1 is the best. --&lt;|B1 --:B2|[B2] --+|Yup, Bacon 2 is the best. --&lt;|B2 }}
1756202679

Edited 1756204433
Beau
Pro
Thanks guys yall have been super helpful. Looking through everything, it honestly seems like a miracle my Ability Check script worked at all lmao. !scriptcard {{ --#title|Ability/Skill Check --#titlecardbackground|#1220b5 --#sourceToken|@{selected|token_id} --#targetToken|@{selected|token_id} --#emoteBackground|#0e1996 --#emoteFontSize|11px --#emoteFontColor|#1ff8ff --#emoteText|@{selected|token_name} is rolling a Check! --&amp;DC|?{Difficulty|} --&gt;abCheck| --+|@{selected|token_name} must make a DC [&amp;DC] [&amp;abType] Check. --:abCheck| --&amp;abType|?{what kind of Check?|Strength|Dexterity|Constitution|Intelligence|Wisdom|Charisma} --&lt;| --?[&amp;abType] -csinc Strength|STR --?[&amp;abType] -csinc Dexterity|DEX --?[&amp;abType] -csinc Constitution|CON --?[&amp;abType] -csinc Intelligence|INT --?[&amp;abType] -csinc Wisdom|WIS --?[&amp;abType] -csinc Charisma|CHA --:DEX|[DEX] --=DexCheck|1d20 + @{selected|dexterity_bonus} [Dex] + @{selected|dexterity_flat} [BONUS] --+|@{selected|token_name} rolled a [$DexCheck] for Dexterity. --?[$DexCheck.base] -eq 20|Crit --?[$DexCheck] -ge [&amp;DC]|Success --?[$DexCheck.base] -eq 1|Fumble --?[$DexCheck] -lt [&amp;DC]|Fail --:STR|[STR] --=StrCheck|1d20 [D20] + @{selected|strength_bonus} [Str] + @{selected|strength_flat} [BONUS] --+|@{selected|token_name} rolled a [$StrCheck] for Strength. --?[$StrCheck.base] -eq 20|Crit --?[$StrCheck.total] -ge [&amp;DC]|Success --?[$StrCheck.base] -eq 1|Fumble --?[$StrCheck.total] -lt [&amp;DC]|Fail --:CON|[CON] --=ConCheck|1d20 [D20] + @{selected|constitution_bonus} [Con] + @{selected|constitution_flat} [BONUS] --+|@{selected|token_name} rolled a [$ConCheck] for Constitution. --?[$ConCheck.base] -eq 20|Crit --?[$ConCheck.total] -ge [&amp;DC]|Success --?[$ConCheck.base] -eq 1|Fumble --?[$ConCheck.total] -lt [&amp;DC]|Fail --:INT|[INT] --=IntCheck|1d20 [D20] + @{selected|intelligence_bonus} [Int] + @{selected|intelligence_flat} [BONUS] --+|@{selected|token_name} rolled a [$IntCheck] for Intelligence. --?[$IntCheck.base] -eq 20|Crit --?[$IntCheck.total] -ge [&amp;DC]|Success --?[$IntCheck.base] -eq 1|Fumble --?[$IntCheck.total] -lt [&amp;DC]|Fail --:WIS|[WIS] --=WisCheck|1d20 [d20] + @{selected|wisdom_bonus} [Wis] + @{selected|wisdom_flat} [BONUS] --+|@{selected|token_name} rolled a [$WisCheck] for Wisdom. --?[$WisCheck.base] -eq 20|Crit --?[$WisCheck.total] -ge [&amp;DC]|Success --?[$WisCheck.base] -eq 1|Fumble --?[$WisCheck.total] -lt [&amp;DC]|Fail --:CHA|[CHA] --=ChaCheck|1d20 + @{selected|charisma_bonus} [Cha] + @{selected|charisma_flat} [BONUS] --+|@{selected|token_name} rolled a [$ChaCheck] for their Charisma Saving Throw... --?[$ChaCheck.base] -eq 20|Crit --?[$ChaCheck.total] -ge [&amp;DC]|Success --?[$ChaCheck.base] -eq 1|Fumble --?[$ChaCheck.total] -lt [&amp;DC]|Fail --:Fail| --+Failure.| --^Done| --:Success| --+Success.| --^Done| --:Crit| --+Critical Success.| --^Done| --:Fumble| --+Critical Fail.| --^Done| --:Done| --X| }}
Also keep in mind that all Roll20 features like roll queries `?{}`, attribute references `@{}`, and ability calls `%{}` are done before ScriptCards ever runs so those will always run regardless of if you want to run them only under certain conditions. I mention this because I see a fair number of those in your Scriptcards and it's a pretty common gotcha for folks that are new.
Joshua N. said: Hey Beau, So here are a few&nbsp; ScriptCards tutorials &nbsp;that go step by step through various parts of ScriptCards to build some examples. Each part of the tutorial that introduces something new includes links to the&nbsp; ScriptCards wiki The wiki also has a link to Kurt's ScriptCards discord where you can get help from folks that are pretty knowledgeable about ScriptCards including Kurt, the author. First time I have seen those Tutorials, thank you very much