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

[Script] ScriptCards - My "Spiritual Successor" to PowerCards

Kurt J. said: Mongo said: Greetings, Has anyone worked out a simple Initiative Tracker like this one from Power Cards? !power {{ --tokenid|@{selected|token_id} --emote|@{selected|character_name} readies --format|default --name|Initiative --!Initiative|~C@{selected|character_name}: [[ [nh|trkr] 1d20 + @{selected|dexterity_mod} ]]~C }} Asking for a friend  Again, the "many ways" caveat :) Here is an example translating the PowerCard above to a Script. I included comments (which start with --/|) to explain what each line is doing. They are ignored by the parser and can be removed to shorten things up. !script {{ --/|Setting the "sourcetoken" parameter does several things, including putting the token's graphic in the left side of the emote area. --#sourcetoken|@{selected|token_id} --/|Setting the "emotetext" setting is the same as the PowerCards emote line --#emotetext|@{selected|token_name} readies --/|The "title" setting is the equivalent of "name" in PowerCards and sets the title of the card --#title|Initiative --/|All rolling in ScriptCards is done on "=" lines and assigned to variables that can be used and reused anywhere in the script. Here, we roll 1d20 and add the token's initiative_bonus value. This is preferrable to using the dexterity modifier because some characters will have other bonuses that impact their initiative. --=InitRoll|1d20 + @{selected|initiative_bonus} --/|Manipulation of the turn tracker is done through the function (~) statement with the turnorder command. Here we use the replacetoken subcommand to set the token's initiative in the tracker to the value we rolled. If we used "addtoken" we could potentially add multiple entries for the same token. --~|turnorder;replacetoken;@{selected|token_id};[$InitRoll] --/|Unlike PowerCards, tags are not always required and don't need to be unique. Here, we omit the tag from the output line and use [c]...[/c] to center the ouptut text --+|[c]@{selected|token_name}: [$InitRoll.Total][/c] }} @Kurt, I greatly appreciate the time and help that you give us with these things. I am really enjoying this new language and gettin my feet wet again.
Woombak said: Kurt J. said: ScriptCards v 1.3.1 - Some Rewrites and Tweaks Version 1.3.1 of ScriptCards is now available on the Development GIST . If all goes well with this version, I'm going to take a pause in making new changes and move this version forward to OneClick. Theoretically the changes in this version should go unnoticed unless you were trying to nest references - which should work as logically expected now. I've tested 1.3.1 with my most complicated cards and they seem to function normally, but please let me know if you run into issues. Here are the updates: Behavior Change:  Rewrote all content substitution code as a single function that works from the innermost set of references outward, so something like  &wow[$count[&suffix]]] will process [&suffix] first, then [$countX] where X is the result of [&suffix] and finally [&wow1] where 1 is the result of [$countX]. This makes the language more logical and variable resolution more deterministic. It is also a huge performance improvement, since the way variables were replaced previously was highly non-optimal. NOTE : as a side effect of this change, some of the uncommonly used settings ( disablerollvariableexpansion and similar) will not function at this time. They were primarily for debugging purposes and will return in a future update, but won't have an effect at this time. Array Referencing : It is now possible to reference array items directly with the [@arrayName(index)] syntax. The first element of the array is index 0, etc. Additional Roll Variable Suffix : You can now use ".Raw" suffix when referencing a roll variable to skip formatting the result as a roll. This shouldn't normally be necessary, as roll formatting is only done on --+ and --* lines, but it is available, especially given the special note in the previous item. Behavior Change: When generating tooltips (and only  when generating tooltips) for roll variable display, the "~" character will be removed. This makes it easier to hide what look like rolls from the chat server when referencing nested values (ie, [~[&shortSaveNameUpper]~]) when you just want the value of the variable in square brackets as an explanation, since using [[&shortSaveNameUpper]] would look like an inline roll to the chat server. Feature Update:  Added support for new token properties added to Roll20 on 2021-06-03 ( bar_location , compact_bar , light_sensitivity_multiplier , and night_vision_effect ). As with all token references, these are made with the "t-" prefix. Hi Kurt, i was running my game with 1.2.8 and I tried to upgrade to your las version..... Before I cloned my game to be safe ^^ In surface nothing seemed to have change....But when it gets to my complex re-entrant dice rollers (for Shaan RPG - a few pages before) it alle screwed up.... trying to figure out by myself but meanwhile, reverted to 1.2.8! Hi Kurt, Haven't been able t figure out why but 1.3.1 scramble my cards while it's OK in 1.2.8! My context : A lot of reentrant buttons and --I tags but the rest is pretty usual ! Any idea ?
1624018499
Kurt J.
Pro
API Scripter
Woombak said: Woombak said: Kurt J. said: ScriptCards v 1.3.1 - Some Rewrites and Tweaks Version 1.3.1 of ScriptCards is now available on the Development GIST . If all goes well with this version, I'm going to take a pause in making new changes and move this version forward to OneClick. Theoretically the changes in this version should go unnoticed unless you were trying to nest references - which should work as logically expected now. I've tested 1.3.1 with my most complicated cards and they seem to function normally, but please let me know if you run into issues. Here are the updates: Behavior Change:  Rewrote all content substitution code as a single function that works from the innermost set of references outward, so something like  &wow[$count[&suffix]]] will process [&suffix] first, then [$countX] where X is the result of [&suffix] and finally [&wow1] where 1 is the result of [$countX]. This makes the language more logical and variable resolution more deterministic. It is also a huge performance improvement, since the way variables were replaced previously was highly non-optimal. NOTE : as a side effect of this change, some of the uncommonly used settings ( disablerollvariableexpansion and similar) will not function at this time. They were primarily for debugging purposes and will return in a future update, but won't have an effect at this time. Array Referencing : It is now possible to reference array items directly with the [@arrayName(index)] syntax. The first element of the array is index 0, etc. Additional Roll Variable Suffix : You can now use ".Raw" suffix when referencing a roll variable to skip formatting the result as a roll. This shouldn't normally be necessary, as roll formatting is only done on --+ and --* lines, but it is available, especially given the special note in the previous item. Behavior Change: When generating tooltips (and only  when generating tooltips) for roll variable display, the "~" character will be removed. This makes it easier to hide what look like rolls from the chat server when referencing nested values (ie, [~[&shortSaveNameUpper]~]) when you just want the value of the variable in square brackets as an explanation, since using [[&shortSaveNameUpper]] would look like an inline roll to the chat server. Feature Update:  Added support for new token properties added to Roll20 on 2021-06-03 ( bar_location , compact_bar , light_sensitivity_multiplier , and night_vision_effect ). As with all token references, these are made with the "t-" prefix. Hi Kurt, i was running my game with 1.2.8 and I tried to upgrade to your las version..... Before I cloned my game to be safe ^^ In surface nothing seemed to have change....But when it gets to my complex re-entrant dice rollers (for Shaan RPG - a few pages before) it alle screwed up.... trying to figure out by myself but meanwhile, reverted to 1.2.8! Hi Kurt, Haven't been able t figure out why but 1.3.1 scramble my cards while it's OK in 1.2.8! My context : A lot of reentrant buttons and --I tags but the rest is pretty usual ! Any idea ? Can you post a sample script with the expected (1.2.8) output and what happens in 1.3.1?
1624025599

Edited 1624026463
@Kurt - Is there syntax within Scriptcards to read the various parameter settings.  For example, for parameter TitleCardBackground, how would one determine what the current value is set to? The reason:  I'm working on a utility scriptcard that would allow the scriptcard developer to change any of the visual elements of a card.  Upon changing a specific parameter, the card would reload with that setting.  Then when satisfied with the look and feel, they could name and save the settings for their own cards.  Visual elements like colors, font sizes and faces for titles, body, rows, table, dice, buttons and emotes.  It would be handy if I could refer to their setting and display it in my utility card.  If I get it working, I'll post here for everyone to benefit from. I know there is a scriptcards command "!sc-liststoredsettings", which dumps the settings which I also plan to incorporate into my final utility. If there isn't a way today, maybe adding a new "System" function?       --~ReturnValue|system;parameter;<Parameter Name>
1624039194
Kurt J.
Pro
API Scripter
ScriptCards v 1.3.5 Now Available This is mostly adding suggested features from the forum, so v1.3.5 is up on the GIST . Here are the changes: Bug Fix: Restored functionality to the "nominmaxhilight" setting. New readsetting sub-function: This function is part of the "system" function group, and allows you to retrieve the current value of a ScriptCards setting as a string: --~title|system;readsetting;title Would return the current value of the title setting to the string variable "title" New findtoken Sub-function : Added the "findtoken" subfunction to turn order, which will return the initiative tracker value of the indicated token: --~init|turnorder;findtoken;@{selected|token_id} The return value is a string, because the tracker value can be non-numeric New Settings: Added two new settings to support the date functions below:     "locale": allows you to specify the locale used to display dates. Defaults to "en-US". NOTE:  Roll20's javascript implementation seems to always use "en-us" as the locale, no matter what I specify to the toLocaleString commands, making this setting not very effective right now, but if this is changed in the future support will already be in place.     "timezone": Specifies the timezone you wish to use with the date commands. These must be from the list of IANA timezone strings ( List of tz database time zones - Wikipedia ) and are case sensitive  since they are passed right to the javascript functions. Default is "America/New_York". New Date Sub-functions: Added the "date" sub-function category with three options: "getdatetime", "getdate" and "gettime". These functions utilize the "timezone" and "locale" settings to return localized time. Note that the locale setting currently has no effect, as this does not appear to be active/enabled in the Roll20 javascript engine - but timezone does work properly.     --~datetime|system;date;getdatetime     --~date|system;date;getdate     --~time|system;date;gettime   Example: !script {{ --#timezone|America/New_York --+[c]Eastern Time[/c]| --~datetime|system;date;getdatetime --~date|system;date;getdate --~time|system;date;gettime --+DateTime|[&datetime] --+Date|[&date] --+Time|[&time] --+|[c]- - -[/c] --+[c]Pacific Time[/c]| --#timezone|America/Los_Angeles --~datetime|system;date;getdatetime --~date|system;date;getdate --~time|system;date;gettime --+DateTime|[&datetime] --+Date|[&date] --+Time|[&time] }} Results in:
1624039939

Edited 1624109667
Kurt - This is sweet - and FAST!!!!!!!!&nbsp; &nbsp; I'll post my Scriptcards Formatting Utility later today (DONE).&nbsp;&nbsp; Update: I've updated the script to incorporate some of Scriptcards 1.3.5 functionality.&nbsp; This recent update and future updates can be found on the Sharing forum. Here is a quick script I wrote today that enables you to play around interactively with scriptcard formatting (Colors, Fonts, Dice, Buttons, Alternating Rows, ...).&nbsp; As you make changes, the current scriptcard is updated with the new settings.&nbsp; Just hit the Reset button if things get a little out of whack.&nbsp; It leverages scriptcards Save and Load settings functions (--SSettings, --LSetttings) which means you can easily incorporate a configuration into your own scriptcards.&nbsp; It works with version 1.3.1 of ScriptCards. I plan to incorporate some of the new 1.3.5 capabilities in the next version. Enjoy! &nbsp;&nbsp; !script {{ --/|This is a utility script for Scriptcard Writers to quickly --/|test out various color and font configurations. There is also a --/|feature to save a settings that can be used so that it can --/|be loaded in other scriptcards with the Lsettings scriptcard --/|command. --/| --/|SC Format Utility 0.1 - Updated 6.18.2021 --/| Compatible with version ScriptCards 1.3.1 --#reentrant|SCFormatUtil --:RESET| --#title|SC Format Utility 0.1 --#leftSub|Ttl BG:#932729 --#rightSub|Ttl Font:Contrail One --#titleCardBackground|#932729 --#titleFontSize|2.0em --#titleFontLineHeight|1.5em --#titleFontFace|Contrail One --#bodyFontSize|12px --#bodyFontFace|Helvetica --#oddRowBackground|#LightBlue --#oddRowFontColor|#000000 --#evenRowBackground|#FFFFFF --#evenRowFontColor|#000000 --#buttonBackGround|Gainsboro --#buttonTextColor|#0905f2 --#buttonBorderColor|#0905f2 --#buttonFontSize|12px --#buttonFontFace|Tahoma --#diceFontColor|#1C6EA4 --#dicefontsize|3.0em --#usehollowdice|0 --#emoteBackground|#f5f5ba --#emoteText|This is emote text --#emoteState|visible --#tableBorderRadius|6px; --#tableShadow|5px 3px 3px 0px #aaa; --#debug|1 --#whisper| --Ssettings|SCFU --:TOP| --+|[b][c]Title Settings[/c][/b] --+|[c][rbutton]TitleCardBackground(Name)::CHANGE_PARAM;TitleCardBackground_ByName[/rbutton] [rbutton](Hex)::CHANGE_PARAM;TitleCardBackground_ByHex[/rbutton][/c] --+|[c][rbutton]titleFontSize::CHANGE_PARAM;titleFontSize[/rbutton] [rbutton]titleFontLineHeight::CHANGE_PARAM;titleFontLineHeight[/rbutton] [rbutton]titleFontFace::CHANGE_PARAM;titleFontFace[/rbutton] [/c] --+|[b][c]Table Settings[/c][/b] --+|[c][rbutton]tableBorderRadius::CHANGE_PARAM;tableBorderRadius[/rbutton] [rbutton]tableShadow::CHANGE_PARAM;tableShadow[/rbutton][/c] --+|[b][c]Body and Row Settings[/c][/b] --+|[c][rbutton]bodyFontSize::CHANGE_PARAM;bodyFontSize[/rbutton] [rbutton]bodyFontFace::CHANGE_PARAM;bodyFontFace[/rbutton][/c] --+|[c][rbutton]oddRowBackground(Name)::CHANGE_PARAM;oddRowBackground_ByName[/rbutton] [rbutton](Hex)::CHANGE_PARAM;oddRowBackground_ByHex[/rbutton][/c] --+|[c][rbutton]oddRowFontColor(Name)::CHANGE_PARAM;oddRowFontColor_ByName[/rbutton] [rbutton](Hex)::CHANGE_PARAM;oddRowFontColor_ByHex[/rbutton][/c] --+|[c][rbutton]evenRowBackground(Name)::CHANGE_PARAM;evenRowBackground_ByName[/rbutton] [rbutton](Hex)::CHANGE_PARAM;evenRowBackground_ByHex[/rbutton][/c] --+|[c][rbutton]evenRowFontColor(Name)::CHANGE_PARAM;evenRowFontColor_ByName[/rbutton] [rbutton](Hex)::CHANGE_PARAM;evenRowFontColor_ByHex[/rbutton][/c] --=Roll1|1d20 --=Roll2|1d20 --=Roll3|1d20 --=Roll4|1d20 --+Row 1|Alternating rows and roll vars [$Roll1] --+Row 2|Alternating rows and roll vars [$Roll2] --+Row 3|Alternating rows and roll vars [$Roll3] --+Row 4|Alternating rows and roll vars [$Roll4] --+|[b][c]Button Settings[/c][/b] --+|[c][rbutton]buttonBackGround(Name)::CHANGE_PARAM;buttonBackGround_ByName[/rbutton] [rbutton](Hex)::CHANGE_PARAM;buttonBackGround_ByHex[/rbutton][/c] --+|[c][rbutton]buttonTextColor(Name)::CHANGE_PARAM;buttonTextColor_ByName[/rbutton] [rbutton](Hex)::CHANGE_PARAM;buttonTextColor_ByHex[/rbutton][/c] --+|[c][rbutton]buttonBorderColor(Name)::CHANGE_PARAM;buttonBorderColor_ByName[/rbutton] [rbutton](Hex)::CHANGE_PARAM;buttonBorderColor_ByHex[/rbutton][/c] --+|[c][rbutton]buttonFontSize::CHANGE_PARAM;buttonFontSize[/rbutton] [rbutton]buttonFontFace::CHANGE_PARAM;buttonFontFace[/rbutton][/c] --+|[b][c]Dice Settings[/c][/b] --+|[c][rbutton]diceFontColor(Name)::CHANGE_PARAM;diceFontColor_ByName[/rbutton] [rbutton](Hex)::CHANGE_PARAM;diceFontColor_ByHex[/rbutton][/c] --+|[c][rbutton]dicefontsize::CHANGE_PARAM;dicefontsize[/rbutton] [rbutton]usehollowdice::CHANGE_PARAM;usehollowdice[/rbutton][/c] --+|[c][d4]4[/d4][d6]6[/d6][d8]8[/d8][d10]10[/d10][d12]12[/d12][d20]20[/d20][/c] --+|[b][c]Emote Settings[/c][/b] --+|[c][rbutton]emoteBackground(Name)::CHANGE_PARAM;emoteBackground_ByName[/rbutton] [rbutton](Hex)::CHANGE_PARAM;emoteBackground_ByHex[/rbutton][/c] --+|[c][rbutton]emoteState::CHANGE_PARAM;emoteState[/rbutton][/c] --+|[b][c]Load/Save Settings[/c][/b] --+|[c][rbutton]Save::SAVE_CURRENT_SETTINGS[/rbutton] [rbutton]Load::LOAD_SAVED_SETTINGS[/rbutton] [rbutton]List::SHOW_SAVED_SETTINGS[/rbutton] [rbutton]&amp;#x1F504;Reset::RESET[/rbutton][/c] --+|[b][c]Helpful Links[/c][/b] --&gt;WEB_LINK|Hex Colors;<a href="https://htmlcolorcodes.com/color-picker/" rel="nofollow">https://htmlcolorcodes.com/color-picker/</a> --&amp;HexColorLink|[&amp;LINK] --&gt;WEB_LINK|Named Colors;<a href="https://htmlcolorcodes.com/color-names/" rel="nofollow">https://htmlcolorcodes.com/color-names/</a> --&amp;NamedColorLink|[&amp;LINK] --&gt;WEB_LINK|Web Fonts;<a href="https://www.w3schools.com/cssref/css_websafe_fonts.asp" rel="nofollow">https://www.w3schools.com/cssref/css_websafe_fonts.asp</a> --&amp;FontLink|[&amp;LINK] --&gt;WEB_LINK|EMOJI-Finder;<a href="https://emojifinder.com/" rel="nofollow">https://emojifinder.com/</a> --&amp;EmojiLink|[&amp;LINK] --+|[c][&amp;HexColorLink]&amp;nbsp;[&amp;NamedColorLink]&amp;nbsp;[&amp;FontLink]&amp;nbsp;[&amp;EmojiLink][/c] --X| --:CHANGE_PARAM|PName --&amp;PName|[&amp;reentryval] --~PName|string;tolowercase;[&amp;PName] --/|*PName|[&amp;PName] --?[&amp;PName] -eq titlecardbackground_byname|TCBG_N --?[&amp;PName] -eq titlecardbackground_byhex|TCBG_H --?[&amp;PName] -eq titlefontsize|TFS --?[&amp;PName] -eq titlefontlineheight|TFLH --?[&amp;PName] -eq titlefontface|TFF --?[&amp;PName] -eq bodyfontsize|BFS --?[&amp;PName] -eq bodyfontface|BFF --?[&amp;PName] -eq oddrowbackground_byname|ORBG_N --?[&amp;PName] -eq oddrowfontcolor_byname|ORFC_N --?[&amp;PName] -eq evenrowbackground_byname|ERBG_N --?[&amp;PName] -eq evenrowfontcolor_byname|ERFC_N --?[&amp;PName] -eq oddrowbackground_byhex|ORBG_H --?[&amp;PName] -eq oddrowfontcolor_byhex|ORFC_N --?[&amp;PName] -eq evenrowbackground_byhex|ERBG_N --?[&amp;PName] -eq evenrowfontcolor_byhex|ERFC_N --?[&amp;PName] -eq buttonbackground_byname|BTNBG_N --?[&amp;PName] -eq buttontextcolor_byname|BTNTC_N --?[&amp;PName] -eq buttonbordercolor_byname|BTNBC_N --?[&amp;PName] -eq buttonbackground_byhex|BTNBG_H --?[&amp;PName] -eq buttontextcolor_byhex|BTNTC_H --?[&amp;PName] -eq buttonbordercolor_byhex|BTNBC_H --?[&amp;PName] -eq buttonfontsize|BTNFS --?[&amp;PName] -eq buttonfontface|BTNFF --?[&amp;PName] -eq dicefontcolor_byname|DFC_N --?[&amp;PName] -eq dicefontcolor_byhex|DFC_H --?[&amp;PName] -eq dicefontsize|DFS --?[&amp;PName] -eq usehollowdice|UHD --?[&amp;PName] -eq emotebackground_byname|EBG_N --?[&amp;PName] -eq emotebackground_byhex|EBG_H --?[&amp;PName] -eq emotestate|ES --?[&amp;PName] -eq tableborderradius|TBR --?[&amp;PName] -eq tableshadow|TS --+ERROR|Parmeter [&amp;PName] not found --^TOP| --:TCBG_N| --&gt;SET_COLOR_BY_NAME|Red;titlecardbackground --^TOP| --:TCBG_H| --I;Set Title Card Background Color|q;Param;Title Card Background Color (fmt: #123456)? --~Param|string;replaceall;#;;[&amp;Param] --#TitleCardBackground|#[&amp;Param] --+TitleCardBackground set to:|[&amp;Param] --+|[HR] --^TOP| --:TFS| --I;Set Title Card Font Size|q;Param;Title Card Font Size?|12px|13px|15px|16px|18px|20px|24px|28px|30px|35px|40px --#titlefontsize|[&amp;Param] --+TitleFontSize set to:|[&amp;Param] --+|[HR] --^TOP| --:TFLH| --I;Set Title Card Line Height|q;Param;Title Card Line Height?|12px|13px|15px|16px|18px|20px|24px|28px|30px|35px|40px --#titlefontlineheight|[&amp;Param] --+TitleFontLineHeight set to:|[&amp;Param] --+|[HR] --^TOP| --:TFF| --I;Set Title Card Font Face|q;Param;Title Card Font Face (fmt: Font name)?|Arial|Candal|Contrail One|Patrick Hand|Shadows Into Light|Brush Script MT|Courier New|Garamond|Georgia|Helvetica|Tahoma|Times New Roman|Trebuchet MS|Verdana --#titlefontface|[&amp;Param] --+TitleFontFace set to:|[&amp;Param] --+|[HR] --^TOP| --:BFS| --I;Set Body Font Size|q;Param;Body Font Size?|6px|7px|8px|9px|10px|11px|12px|13px|14px|15px|16px|18px|20px|24px|28px|30px --#bodyfontsize|[&amp;Param] --+BodyFontSize set to:|[&amp;Param] --+|[HR] --^TOP| --:BFF| --I;Set Body Font Face|q;Param;Body Font Face?|Arial|Candal|Contrail One|Patrick Hand|Shadows Into Light|Brush Script MT|Courier New|Garamond|Georgia|Helvetica|Tahoma|Times New Roman|Trebuchet MS|Verdana --#bodyfontface|[&amp;Param] --+BodyFontFace set to:|[&amp;Param] --+|[HR] --^TOP| --:ORBG_N| --&gt;SET_COLOR_BY_NAME|Red;oddrowbackground --^TOP| --:ORBG_H| --I;Set Odd Row Background Color|q;Param;Odd Row Background Color (#123456)? --~Param|string;replaceall;#;;[&amp;Param] --#oddrowbackground|#[&amp;Param] --+OddRowBackground set to:|[&amp;Param] --+|[HR] --^TOP| --:ORFC_N| --&gt;SET_COLOR_BY_NAME|Red;oddrowfontcolor --^TOP| --:ORFC_H| --I;Set Odd Row Font Color|q;Param;Odd Row Font Color (#123456)? --~Param|string;replaceall;#;;[&amp;Param] --#oddrowfontcolor|#[&amp;Param] --+OddRowFontColor set to:|[&amp;Param] --+|[HR] --^TOP| --:ERBG_N| --&gt;SET_COLOR_BY_NAME|Red;evenrowbackground --^TOP| --:ERBG_H| --I;Set Even Row Background Color|q;Param;Even Row Background Color (#123456)? --~Param|string;replaceall;#;;[&amp;Param] --#evenrowbackground|#[&amp;Param] --+EvenRowBackground set to:|[&amp;Param] --+|[HR] --^TOP| --:ERFC_N| --&gt;SET_COLOR_BY_NAME|Red;evenrowfontcolor --^TOP| --:ERFC_H| --I;Set Even Row Font Color|q;Param;Even Row Font Color (#123456)? --~Param|string;replaceall;#;;[&amp;Param] --#evenrowfontcolor|#[&amp;Param] --+EvenRowFontColor set to:|[&amp;Param] --+|[HR] --^TOP| --:BTNBG_N| --&gt;SET_COLOR_BY_NAME|Red;buttonbackground --^TOP| --:BTNBG_H| --I;Set Button Background Color|q;Param;Button Background Color (#123456)? --~Param|string;replaceall;#;;[&amp;Param] --#buttonbackground|#[&amp;Param] --+ButtonBackground set to:|[&amp;Param] --+|[HR] --^TOP| --:BTNTC_N| --&gt;SET_COLOR_BY_NAME|Red;buttontextcolor --^TOP| --:BTNTC_H| --I;Set Button Text Color|q;Param;Button Text Color (#123456)? --~Param|string;replaceall;#;;[&amp;Param] --#buttontextcolor|#[&amp;Param] --+ButtonTextColor set to:|[&amp;Param] --+|[HR] --^TOP| --:BTNBC_N| --&gt;SET_COLOR_BY_NAME|Red;buttonbordercolor --^TOP| --:BTNBC_H| --I;Set Button Border Color|q;Param;Button Border Color (#123456)? --~Param|string;replaceall;#;;[&amp;Param] --#buttonbordercolor|#[&amp;Param] --+ButtonBorderColor set to:|[&amp;Param] --+|[HR] --^TOP| --:BTNFS| --I;Set Button Font Size|q;Param;Button Font Size (fmt: 11px or 1.2em)?|6px|7px|8px|9px|10px|11px|12px|13px|14px|15px|16px|18px|20px|24px|28px|30px --#buttonfontsize|[&amp;Param] --+ButtonFontSize set to:|[&amp;Param] --+|[HR] --^TOP| --:BTNFF| --I;Set Button Font Face|q;Param;Button Font Face (fmt: Font name)?|Arial|Candal|Contrail One|Patrick Hand|Shadows Into Light|Brush Script MT|Courier New|Garamond|Georgia|Helvetica|Tahoma|Times New Roman|Trebuchet MS|Verdana --#buttonfontface|[&amp;Param] --+ButtonFontFace set to:|[&amp;Param] --+|[HR] --^TOP| --:DFC_N| --&gt;SET_COLOR_BY_NAME|Red;dicefontcolor --^TOP| --:DFC_H| --I;Set Dice Font Color|q;Param;Dice Font Color (#123456)? --~Param|string;replaceall;#;;[&amp;Param] --#dicefontcolor|#[&amp;Param] --+DiceFontColor set to:|[&amp;Param] --+|[HR] --^TOP| --:DFS| --I;Set Dice Font Size|q;Param;Dice Font Size?|6px|7px|8px|9px|10px|11px|12px|13px|14px|15px|16px|18px|20px|24px|28px|30px --#dicefontsize|[&amp;Param] --+DiceFontSize set to:|[&amp;Param] --+|[HR] --^TOP| --:UHD| --I;Use Hollow Dice?|q;Param;Use Hollow Dice (Yes-1/No-0)?|1|0 --#usehollowdice|[&amp;Param] --+UseHollowDice set to:|[&amp;Param] --+|[HR] --^TOP| --:EBG_N| --&gt;SET_COLOR_BY_NAME|Red;emotebackground --^TOP| --:EBG_H| --I;Set Emote Background Color|q;Param;Emote Background Color (#123456)? --~Param|string;replaceall;#;;[&amp;Param] --#emotebackground|#[&amp;Param] --+EmoteBackground set to:|[&amp;Param] --+|[HR] --^TOP| --:ES| --I;Set Emote State?|q;Param;Set Emote State (Visible/No)?|visible|off --#emotestate|[&amp;Param] --+EmoteState set to:|[&amp;Param] --+|[HR] --^TOP| --:TBR| --I;Set Table Border Radius|q;Param;Table Border Radius?|0px|1px|2px|3px|4px|5px|6px|7px|8px|10px|12px|15px|18px|20px|24px|30px --#tableborderradius|[&amp;Param] --+TableBorderRadius set to:|[&amp;Param] --+|[HR] --^TOP| --:TS| --I;Set Table Shadow|q;Param;Table Shadow (fmt: 5px 3px 3px 0px #aaa; or h-offset v-offset blur spread #Color)? --#tableshadow|[&amp;Param] --+TableShadow set to:|[&amp;Param] --+|[HR] --^TOP| --:OTHER| --^TOP| Return to the top of the list --X| --:SHOW_SAVED_SETTINGS| --@sc-liststoredsettings| --^TOP| --:SAVE_CURRENT_SETTINGS| --I;Save Current Settings Name?|q;SName;Saved settings name? --?X[&amp;SName] -eq X|INVALID_NAME --Ssettings|[&amp;SName] --^TOP| --:INVALID_NAME| --+ERROR|Invalid Setting Name --+|[HR] --^TOP| --X| --:LOAD_SAVED_SETTINGS| --I;Load Saved Settings?|q;SName;Saved settings name to load? --?X[&amp;SName] -eq X|INVALID_NAME --Lsettings|[&amp;SName] --^TOP| --:INVALID_NAME| --+ERROR|Invalid Setting Name --+|[HR] --^TOP| --:WEB_LINK|Name; Ref --&amp;LINK|[button][%1%]::[%2%][/button] --&lt;| --:SET_COLOR_BY_NAME_REENTRY| --~Arg|string;split;\;[&amp;reentryval] --&amp;ColorFam|[&amp;Arg1] --&amp;Param|[&amp;Arg2] --&gt;SET_COLOR_BY_NAME|[&amp;ColorFam];[&amp;Param] --X| --:SET_COLOR_BY_NAME|Color_Family; Parameter being set --~Arg|string;split;\;[&amp;reentryval] --&amp;ColorFam|[%1%] --&amp;Param|[%2%] --#Title|Select Color --#leftSub|[&amp;Param] --#RightSub|[&amp;ColorFam] --~|array;define;aryRed;IndianRed;LightCoral;Salmon;DarkSalmon;LightSalmon;Crimson;Red;FireBrick;DarkRed --~|array;define;aryPink;Pink;LightPink;HotPink;DeepPink;MediumVioletRed;PaleVioletRed --~|array;define;aryOrange;LightSalmon;Coral;Tomato;OrangeRed;DarkOrange;Orange --~|array;define;aryYellow;Gold;Yellow;LightYellow;LemonChiffon;LightGoldenrodYellow;PapayaWhip;Moccasin;PeachPuff;PaleGoldenrod;Khaki;DarkKhaki --~|array;define;aryPurple;Lavender;Thistle;Plum;Violet;Orchid;Fuchsia;Magenta;MediumOrchid;MediumPurple;RebeccaPurple;BlueViolet;DarkViolet;DarkOrchid;DarkMagenta;Purple;Indigo;SlateBlue;DarkSlateBlue;MediumSlateBlue --~|array;define;aryGreen;GreenYellow;Chartreuse;LawnGreen;Lime;LimeGreen;PaleGreen;LightGreen;MediumSpringGreen;SpringGreen;MediumSeaGreen;SeaGreen;ForestGreen;Green;DarkGreen;YellowGreen;OliveDrab;Olive;DarkOliveGreen;MediumAquamarine;DarkSeaGreen;LightSeaGreen;DarkCyan;Teal --~|array;define;aryBlue;Aqua;Cyan;LightCyan;PaleTurquoise;Aquamarine;Turquoise;MediumTurquoise;DarkTurquoise;CadetBlue;SteelBlue;LightSteelBlue;PowderBlue;LightBlue;SkyBlue;LightSkyBlue;DeepSkyBlue;DodgerBlue;CornflowerBlue;MediumSlateBlue;RoyalBlue;Blue;MediumBlue;DarkBlue;Navy;MidnightBlue --~|array;define;aryBrown;Cornsilk;BlanchedAlmond;Bisque;NavajoWhite;Wheat;BurlyWood;Tan;RosyBrown;SandyBrown;Goldenrod;DarkGoldenrod;Peru;Chocolate;SaddleBrown;Sienna;Brown;Maroon --~|array;define;aryWhite;White;Snow;HoneyDew;MintCream;Azure;AliceBlue;GhostWhite;WhiteSmoke;SeaShell;Beige;OldLace;FloralWhite;Ivory;AntiqueWhite;Linen;LavenderBlush;MistyRose --~|array;define;aryGray;Gainsboro;LightGray;Silver;DarkGray;Gray;DimGray;LightSlateGray;SlateGray;DarkSlateGray;Black --&amp;tStyle|style = "width:100%;padding:1px;border-spacing:0px;border-collapse:collapse;text-shadow: 0px 0px 0px black;border:0px dashed black;" --&amp;trStyle1|style="border-top:0px dashed black;text-align:center;" --+|[c][t [&amp;tStyle]][tr [&amp;trStyle1]][td][rbutton]Red::SET_COLOR_BY_NAME;Red\[&amp;Param][/rbutton][/td] [td][rbutton]Pink::SET_COLOR_BY_NAME_REENTRY;Pink\[&amp;Param][/rbutton][/td] [td][rbutton]Orange::SET_COLOR_BY_NAME_REENTRY;Orange\[&amp;Param][/rbutton][/td] [td][rbutton]Yellow::SET_COLOR_BY_NAME_REENTRY;Yellow\[&amp;Param][/rbutton][/td] [td][rbutton]Purple::SET_COLOR_BY_NAME_REENTRY;Purple\[&amp;Param][/rbutton][/td] [/tr][tr [&amp;trStyle1]] [td][rbutton]Green::SET_COLOR_BY_NAME_REENTRY;Green\[&amp;Param][/rbutton][/td] [td][rbutton]Blue::SET_COLOR_BY_NAME_REENTRY;Blue\[&amp;Param][/rbutton][/td] [td][rbutton]Brown::SET_COLOR_BY_NAME_REENTRY;Brown\[&amp;Param][/rbutton][/td] [td][rbutton]White::SET_COLOR_BY_NAME_REENTRY;White\[&amp;Param][/rbutton][/td] [td][rbutton]Gray::SET_COLOR_BY_NAME_REENTRY;Gray\[&amp;Param][/rbutton][/td] [/tr][/t][/c] --&amp;tStyle|style = "width:100%;padding:1px;border-spacing:0px;border-collapse:collapse;text-shadow: 0px 0px 0px black;border:0px dashed black;" --&amp;trStyle1|style="border-top:2px dashed black;font-size:150%" --&amp;trStyle2|style="border-top:0px dashed black;font-size:100%" --&amp;Tbl|[t [&amp;tStyle]][tr [&amp;trStyle1]][td Colspan=3][c][&amp;ColorFam] Family of Colors[/c][/td][/tr] --~Clr|array;getfirst;ary[&amp;ColorFam] --:COLOR_LOOP_START| --?[&amp;Clr] -eq ArrayError|COLOR_LOOP_END --&amp;Tbl|+ [tr [&amp;trStyle2]][td style="text-align:center;background-color:[&amp;Clr];"][rbutton]Set::SET_PARAM_COLOR;[&amp;Clr]\[&amp;Param][/rbutton] [td style="color:black;background-color:[&amp;Clr];"][c][b][&amp;Clr][/b][/c][/td] [td style="color:yellow;background-color:[&amp;Clr];"][c][b][&amp;Clr][/b][/c][/td][/tr] --~Clr|array;getnext;ary[&amp;ColorFam] --^COLOR_LOOP_START| --:COLOR_LOOP_END| --&amp;Tbl|+ [/t] --+|[&amp;Tbl] --+|[hr][c][rbutton]Return::TOP[/rbutton][/c] --X| --:SET_PARAM_COLOR| --~Arg|string;split;\;[&amp;reentryval] --&amp;ColorName|[&amp;Arg1] --&amp;ParamName|[&amp;Arg2] --#[&amp;ParamName]|[&amp;ColorName] --+[&amp;ParamName] set to:|[&amp;ColorName] --+|[HR] --^TOP| }}
Greetings again. Trying to make a Fun Healing Potion button for my players !scriptcard {{ --#title|Health Potions --#titleCardBackground|#932729 --+|[c][button]Healing::hpot1[/button] [button]Greater::ghpot1[/button][/c] --+|[c][button]Superior::supheal1[/button] [button]Supreme::superheal2[/button][/c] !scriptcard {{ --&amp;DL|hport1 --#title|Healing Potion --#titleCardBackground|#932729 --#leftsub|Healing Potion --#rightsub|2d4+2 --=R|2d4+2 --+Healing:|@{seleected|character_name} heals for [$R] --X| !scriptcard {{ --&amp;DL|ghport1 --#title|Potion of Greater Healing --#titleCardBackground|#932729 --#leftsub|Greater Healing Potion --#rightsub|4d4+2 --=R|4d4+2 --+Healing:|@{seleected|character_name} heals for [$R] --X| !scriptcard {{ --&amp;DL|supheal1 --#title|Potion of Superior Healing --#titleCardBackground|#932729 --#leftsub|Healing Potion --#rightsub|8d4+8 --=R|8d4+8 --+Healing:|@{seleected|character_name} heals for [$R] --X| !scriptcard {{ --&amp;DL|superheal2 --#title|Potion of Supreme Healing --#titleCardBackground|#932729 --#leftsub|Healing Potion --#rightsub|10d4+20 --=R|10d4+20 --+Healing:|@{seleected|character_name} heals for [$R] --X| }} This is what I was coming up with so far but it results in a crash and then this I just want them to hit the macro and have the card with the four buttons appear and then when they click the correct button, it gives them a total. Thank you all
1624072381

Edited 1624072847
I think you should look at the reentry functionality ([rbutton]Caption::RentryLabel;Param[/rbutton] rather than the [button] syntax to achieve your user selection and branching logic.&nbsp;&nbsp; I also don't think you can imbed scriptcards like that.&nbsp; You've got multiple !scriptcard{{ ....&nbsp; !scriptcard{{ .... !scriptcard{{ .... }}.&nbsp; That's why you are getting the "!scriptcard{{" in your card.&nbsp;&nbsp; Take a look at the SC Format Utility Script posted in the entry before yours for an example as it has multiple examples of using the reentry logic.&nbsp; Update:&nbsp; I took a stab at correcting and got this to work: !scriptcard {{ --#title|Health Potions --#titleCardBackground|#932729 --#reentrant|HealingPotion --+|[c][rbutton]Healing::HEALING_POTION[/rbutton] [rbutton]Greater::GREATER_HEALING_POTION[/rbutton][/c] --+|[c][rbutton]Superior::SUPERIOR_HEALING_POTION[/rbutton] [rbutton]Supreme::SUPREME_HEALING_POTION[/rbutton][/c] --x| --:HEALING_POTION| --&amp;DL|hport1 --#title|Healing Potion --#titleCardBackground|#932729 --#leftsub|Healing Potion --#rightsub|2d4+2 --=R|2d4+2 --+Healing:|@{selected|character_name} heals for [$R] --X| --:GREATER_HEALING_POTION| --&amp;DL|ghport1 --#title|Potion of Greater Healing --#titleCardBackground|#932729 --#leftsub|Greater Healing Potion --#rightsub|4d4+2 --=R|4d4+2 --+Healing:|@{selected|character_name} heals for [$R] --X| --:SUPERIOR_HEALING_POTION| --&amp;DL|supheal1 --#title|Potion of Superior Healing --#titleCardBackground|#932729 --#leftsub|Healing Potion --#rightsub|8d4+8 --=R|8d4+8 --+Healing:|@{selected|character_name} heals for [$R] --X| --:SUPREME_HEALING_POTION| --&amp;DL|superheal2 --#title|Potion of Supreme Healing --#titleCardBackground|#932729 --#leftsub|Healing Potion --#rightsub|10d4+20 --=R|10d4+20 --+Healing:|@{selected|character_name} heals for [$R] --X| }}
Will M. said: I think you should look at the reentry functionality ([rbutton]Caption::RentryLabel;Param[/rbutton] rather than the [button] syntax to achieve your user selection and branching logic.&nbsp;&nbsp; I also don't think you can imbed scriptcards like that.&nbsp; You've got multiple !scriptcard{{ ....&nbsp; !scriptcard{{ .... !scriptcard{{ .... }}.&nbsp; That's why you are getting the "!scriptcard{{" in your card.&nbsp;&nbsp; Take a look at the SC Format Utility Script posted in the entry before yours for an example as it has multiple examples of using the reentry logic.&nbsp; Update:&nbsp; I took a stab at correcting and got this to work: !scriptcard {{ --#title|Health Potions --#titleCardBackground|#932729 --#reentrant|HealingPotion --+|[c][rbutton]Healing::HEALING_POTION[/rbutton] [rbutton]Greater::GREATER_HEALING_POTION[/rbutton][/c] --+|[c][rbutton]Superior::SUPERIOR_HEALING_POTION[/rbutton] [rbutton]Supreme::SUPREME_HEALING_POTION[/rbutton][/c] --x| --:HEALING_POTION| --&amp;DL|hport1 --#title|Healing Potion --#titleCardBackground|#932729 --#leftsub|Healing Potion --#rightsub|2d4+2 --=R|2d4+2 --+Healing:|@{selected|character_name} heals for [$R] --X| --:GREATER_HEALING_POTION| --&amp;DL|ghport1 --#title|Potion of Greater Healing --#titleCardBackground|#932729 --#leftsub|Greater Healing Potion --#rightsub|4d4+2 --=R|4d4+2 --+Healing:|@{selected|character_name} heals for [$R] --X| --:SUPERIOR_HEALING_POTION| --&amp;DL|supheal1 --#title|Potion of Superior Healing --#titleCardBackground|#932729 --#leftsub|Healing Potion --#rightsub|8d4+8 --=R|8d4+8 --+Healing:|@{selected|character_name} heals for [$R] --X| --:SUPREME_HEALING_POTION| --&amp;DL|superheal2 --#title|Potion of Supreme Healing --#titleCardBackground|#932729 --#leftsub|Healing Potion --#rightsub|10d4+20 --=R|10d4+20 --+Healing:|@{selected|character_name} heals for [$R] --X| }} Thank you tons Will. You all are a great group of thinkers. This is some fun script
I am using Script Cards to automatically pickup damage from the first weapon in a character sheet and roll it, then add Strength bonus. This is using the Deathwatch character sheet and a typical damage result might be 3d10kh1+6 or 3d10kh2+5. Carrying this out is fairly straightforward and it works, however when I can't seem to get the next bit working. One option the player has is to substitute the degrees of success in their attack roll for one of the dice results, which isn't always desirable. I have a macro for the attack roll and it will pass the degrees of success to the damage macro when complete. However, I can't figure out how to work the degrees of success into the damage calculation. I tried entering the following in the character sheet damage box&nbsp; {[$DOS], d10, d10, d10}kh1+6 and the DOS value does substitute in, however the script card doesn't seem to recognise the dice and the whole {} section comes out as zero. I've also tried [$DOS] * d1 in the construction and various types of spacing, but to no avail. Does anyone have any thoughts on how I can make this work?
Quick question, coz i'm probably just using the wrong syntax somewhere: In the below example i'm using scriptcards for a multiattack, and the problem I have is when the attack misses and i want to show exactly who it is that escaped the ungodly wrath of my players (using Aaron's %%NUMBERED%% trick to name tokens sequentially). I think I have to replace the [*[%1%]:character_name] with somethingsomething token_name, but it's not as simple as that (coz the%1% already refers to @{target|token_id}). Anyone know the answer? !scriptcard&nbsp; {{ &nbsp; --Lsettings|Quarion &nbsp; --#title|Burning Spray &nbsp; --#leftsub|Sorcerer &nbsp; --#rightsub|Attack 1 &nbsp; --#sourceToken|@{selected|token_id} &nbsp; --#emoteText|I fling my arm in a wide arc, casting liquid fire at my foes. &nbsp; --=Targets|?{Number of targets?|1|2|3|4|5|6|7|8|9} &nbsp; --=DisplayCount|0 &nbsp; --=HitMod|?{Modifier to hit?|0} &nbsp; --=Damage|1d8 + 4 [Cha] + 3 [Draconic] + 1 [Implement] + 1 [Staff of Ruin] + ?{Modifier to dam?|0} [Mod] &nbsp; --+At-Will ♦|Arcane, Fire, Implement &nbsp; --+Standard Action|Close blast 3 &nbsp; --+Target:|Each creature in blast &nbsp; --&gt;Attack|@{target|1|token_id} &nbsp; --=DisplayCount|[$DisplayCount] + 1 &nbsp; --?[$DisplayCount] -eq [$Targets]|Final &nbsp; --&gt;Attack|@{target|2|token_id} &nbsp;--=DisplayCount|[$DisplayCount] + 1 &nbsp; --?[$DisplayCount] -eq [$Targets]|Final &nbsp; --&gt;Attack|@{target|3|token_id} &nbsp;--=DisplayCount|[$DisplayCount] + 1 &nbsp; --?[$DisplayCount] -eq [$Targets]|Final &nbsp; --&gt;Attack|@{target|4|token_id} &nbsp;--=DisplayCount|[$DisplayCount] + 1 &nbsp; --?[$DisplayCount] -eq [$Targets]|Final &nbsp; --&gt;Attack|@{target|5|token_id} &nbsp;--=DisplayCount|[$DisplayCount] + 1 &nbsp; --?[$DisplayCount] -eq [$Targets]|Final &nbsp; --&gt;Attack|@{target|6|token_id} &nbsp;--=DisplayCount|[$DisplayCount] + 1 &nbsp; --?[$DisplayCount] -eq [$Targets]|Final &nbsp; --&gt;Attack|@{target|7|token_id} &nbsp;--=DisplayCount|[$DisplayCount] + 1 &nbsp; --?[$DisplayCount] -eq [$Targets]|Final &nbsp; --&gt;Attack|@{target|8|token_id} &nbsp;--=DisplayCount|[$DisplayCount] + 1 &nbsp; --?[$DisplayCount] -eq [$Targets]|Final &nbsp; --&gt;Attack|@{target|9|token_id} &nbsp; --^Final| &nbsp; --:Attack| &nbsp; --=TargetRef|[*[%1%]:ref] &nbsp; --=AttackRoll|1d20 + 7 [Cha+LVL] + 1 [Implement] + 1 [Versatile Expertise] + [$HitMod] [Mod] &nbsp; --+Attack|[$AttackRoll] vs Reflex. &nbsp; --?[$AttackRoll.Base] -eq 20|Crit &nbsp; --?[$AttackRoll.Base] -eq 1|Fumble &nbsp; --?[$AttackRoll.Total] -ge [$TargetRef.Total]|Hit &nbsp; --+Miss|The attack missed [*[%1%]:character_name]. &nbsp; --&lt;| &nbsp; --:Fumble| &nbsp; --+Fumble!|The attack went horribly wrong. &nbsp; --&lt;| &nbsp; --:Hit| &nbsp; --+Hit!|The attack hit [*[%1%]:character_name] for [$Damage] damage. &nbsp; --&lt;| &nbsp; --:Crit| &nbsp; --=CritDamage|8 + 1d10 [Crit Bonus] + 4 [STR] + ?{Modifier to dam?|0} &nbsp; --+Critical Hit!|The attack hit [*[%1%]:character_name] for [$CritDamage] damage. &nbsp; --&lt;| &nbsp; --:Final| &nbsp; --+Dragon Magic:|The next enemy that hits you with a melee attack before the end of your next turn takes fire damage equal to your Strength modifier ([b]3[/b]). }} /fx breath-fire
You might try&nbsp;[*[%1%]:t-name]. Alztar said: Quick question, coz i'm probably just using the wrong syntax somewhere: In the below example i'm using scriptcards for a multiattack, and the problem I have is when the attack misses and i want to show exactly who it is that escaped the ungodly wrath of my players (using Aaron's %%NUMBERED%% trick to name tokens sequentially). I think I have to replace the [*[%1%]:character_name] with somethingsomething token_name, but it's not as simple as that (coz the%1% already refers to @{target|token_id}). Anyone know the answer?
1624124972

Edited 1624124996
Kurt J.
Pro
API Scripter
Will, the settings script is pretty amazing... It doesn't mean my color sense is any better, but it sure makes it easier to design a color scheme :) I'm contemplating creating a "defaults" setting that would automatically be loaded (if it exists) for each card. It could, of course, be overridden by --lsettings, but it might make establishing a baseline for how you want all of your cards to look a bit easier. I'm also adding a couple of settings to spruce up the title bar area as well (gradient and image background).
1624127447

Edited 1624127628
Thanks Kurt, my color sense is awful as well, that's why I included links at the bottom of the script that take you to a website that provides complimentary colors and their associated Hex Codes.&nbsp; On the Defaults Settings functionality, I assume it would it be associated with a campaign and not a global default?&nbsp; I could see there being another button named "Set as Default" on the dialog from your !sc-liststoredsettings command.&nbsp; It would then create a new named setting called "Default" if it didn't already exist.&nbsp; If it "Defaults" already existed, it would just update it with the new desired settings.&nbsp; Then when you run a ScriptCard, it would use this "Default" setting as the baseline, allowing the user to override settings with --#Param commands or by using the --LSettings command.&nbsp;&nbsp; Concerning the User Information Request (--I) command. &nbsp; Is it possible to add an option to not pause execution and to wait for the user to select the button in the chat window to pop up a dialog?&nbsp; I can see how that extra chat button request can be useful for some applications, but I find it's just a superfluous extra click.&nbsp;&nbsp; My current workflow when asking for user input looks like this (with 3 user interactions): [1]User selects an option ([rbutton])&nbsp;&nbsp; -&gt; execution continues to a reentry subroutine -&gt; ask user for info (--I) -&gt; [2]user clicks info button in chat -&gt; Info request dialog is displayed -&gt; [3]User enters information -&gt; execution continues Would like to go to 2 user interactions with this workflow: [1]User selects an option ([rbutton]&nbsp; -&gt; execution continues to a reentry subroutine -&gt; ask user for info (--I) -&gt; user clicks info button in chat -&gt; Info request dialog is displayed -&gt; [2] User enters information -&gt; execution continues&nbsp;
1624128344

Edited 1624131326
Kurt J.
Pro
API Scripter
Will M. said: Thanks Kurt, my color sense is awful as well, that's why I included links at the bottom of the script that take you to a website that provides complimentary colors and their associated Hex Codes.&nbsp; On the Defaults Settings functionality, I assume it would it be associated with a campaign and not a global default?&nbsp; I could see there being another button named "Set as Default" on the dialog from your !sc-liststoredsettings command.&nbsp; It would then create a new named setting called "Default" if it didn't already exist.&nbsp; If it "Defaults" already existed, it would just update it with the new desired settings.&nbsp; Then when you run a ScriptCard, it would use this "Default" setting as the baseline, allowing the user to override settings with --#Param commands or by using the --LSettings command.&nbsp;&nbsp; Concerning the User Information Request (--I) command. &nbsp; Is it possible to add an option to not pause execution and to wait for the user to select the button in the chat window to pop up a dialog?&nbsp; I can see how that extra chat button request can be useful for some applications, but I find it's just a superfluous extra click.&nbsp;&nbsp; My current workflow when asking for user input looks like this (with 3 user interactions): [1]User selects an option ([rbutton])&nbsp;&nbsp; -&gt; execution continues to a reentry subroutine -&gt; ask user for info (--I) -&gt; [2]user clicks info button in chat -&gt; Info request dialog is displayed -&gt; [3]User enters information -&gt; execution continues Would like to go to 2 user interactions with this workflow: [1]User selects an option ([rbutton]&nbsp; -&gt; execution continues to a reentry subroutine -&gt; ask user for info (--I) -&gt; user clicks info button in chat -&gt; Info request dialog is displayed -&gt; [2] User enters information -&gt; execution continues&nbsp; Unfortunately, the API can't send any UI information to the players, so it can't pop up the box asking for input on its own. The buttons are a workaround to "trick" the chat server into popping them up on the user's screen, since they are the ones that clicked the button. You can ask multiple questions in a --i command, but they can't be dependent upon each other since it has to be backed into the text of the button, which happens before the first input is accepted. Edit: for the defaults, yes it would work exactly as stored settings groups do now. The settings group "Default" would just be a named setting group like any others that would be loaded if it exists when a card is run. Because setting groups are stored in the campaign state object, they are campaign-specific.
Kurt J. said: Will, the settings script is pretty amazing... It doesn't mean my color sense is any better, but it sure makes it easier to design a color scheme :) I'm contemplating creating a "defaults" setting that would automatically be loaded (if it exists) for each card. It could, of course, be overridden by --lsettings, but it might make establishing a baseline for how you want all of your cards to look a bit easier. I'm also adding a couple of settings to spruce up the title bar area as well (gradient and image background). WOOT! Thank you!
Will M. said: You might try&nbsp;[*[%1%]:t-name]. &nbsp;Thanks for the tip, it sorta works, but it still doesn't show the number monster that he missed: &nbsp;Should say Harpy 2 and Harpy 3 on the misses (this is with :t-name). Perhaps it's a problem because the actual/original token name is Harpy %%NUMBERED%% ? I'll experiment with some monsters that i number manually, see if it works then...
1624214531
Kurt J.
Pro
API Scripter
ScriptCards 1.3.6 Now Available I've released a small update to ScriptCards on the GIST with the following changes: Bug Fix: The nominmaxhighlight "fix" from 1.3.5 broke roll highlighting completely. It is repaired now :) New Setting : norollhighlight. If set to a value other than the default ("0"), will not place any highlight box around rolls generated while the setting is active. This will still add a tooltop, and can be used when you wish to pass the roll to something else without the yellow/green/blue/red box around the roll. New Setting : titlecardbackgroundimage. Default is empty. If set, the value will be applied to the&nbsp;css "background-image" tag for the title card. See titlecardgradient below. This should be a full CSS specifier, like "url(<a href="https://mywebsite.domain/path/to/image.png" rel="nofollow">https://mywebsite.domain/path/to/image.png</a>)". New Setting : titlecardgradient. If not "0", will apply a gradient overlay to the title card&nbsp;background color. Default is no gradient. NOTE: This setting actually overrides the titlecardbackground setting, and the two cannot be used together. You can either have a gradient or have a background image.
1624220217

Edited 1624222118
Update: I figured it out.&nbsp; Looking at your code, you override the image setting even if setting the&nbsp; titlecardgradient&nbsp; to 0.&nbsp; So, don't even mess with&nbsp; titlecardgradient&nbsp; if you plan to use an imagebackground in your title card. The format in my code area below worked for me once I commented out setting the gradient to 0.&nbsp; Also just figured out that it works if you set the background image in your script after you set your gradient.&nbsp;&nbsp; I've tested out and added the titlecardgradient and norollhighlight &nbsp;settings.&nbsp; I can't seem to get the titlecardbackgroundimage to work.&nbsp; I'm adding all three new settings to my SC Format Utility, and will upload a new version when I figure the issue I'm having with the background image.&nbsp;&nbsp; I uploaded a background image into my library, grabbed its URL and pasted in like this.&nbsp; What am I doing wrong?&nbsp; I also commented out setting the color and made sure the gradient option was set to 0. &nbsp; --#titlecardbackgroundimage|url(<a href="https://s3.amazonaws.com/files.d20.io/images/229696022/F-Y9c_wIGMCeFB-nTmiaWA/original.png?16242197495" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/229696022/F-Y9c_wIGMCeFB-nTmiaWA/original.png?16242197495</a>)
@Kurt - good job.&nbsp; I am still monkeying around with it and haven't quite figured it out yet.&nbsp; Is it:&nbsp; --#titlecardbackgroundimage|url( <a href="https://mywebsite.domain/path/to/image.png" rel="nofollow">https://mywebsite.domain/path/to/image.png</a> )&nbsp; &nbsp;or --#titlecardbackgroundimage|#( <a href="https://mywebsite.domain/path/to/image.png" rel="nofollow">https://mywebsite.domain/path/to/image.png</a> )&nbsp; &nbsp; &nbsp;or...?
The first one worked for me.&nbsp;&nbsp; Michael C. said: @Kurt - good job.&nbsp; I am still monkeying around with it and haven't quite figured it out yet.&nbsp; Is it:&nbsp; --#titlecardbackgroundimage|url( <a href="https://mywebsite.domain/path/to/image.png" rel="nofollow">https://mywebsite.domain/path/to/image.png</a> )&nbsp; &nbsp;or --#titlecardbackgroundimage|#( <a href="https://mywebsite.domain/path/to/image.png" rel="nofollow">https://mywebsite.domain/path/to/image.png</a> )&nbsp; &nbsp; &nbsp;or...?
1624222182

Edited 1624230227
@Kurt - You must have known this question was coming.&nbsp; How do I set my background image size if I want to scale it down for script cards?&nbsp;&nbsp; Update :&nbsp; Here's what I've figured out - You can use the CSS style settings inline like this: --#titlecardbackgroundimage|url(https://website/file.png);background-size: cover;background-repeat: no-repeat; where background-size can be:&nbsp; auto - Default value. The background image is displayed in its original size cover - Resize the background image to cover the entire container, even if it has to stretch the image or cut a little bit off one of the edges contain - Resize the background image to make sure the image is fully visible ###px ###px - where the first ###px is width (for example; 300px) and the second is height(for example; 100px).&nbsp; Sets the width and height of the background image. The first value sets the width, the second value sets the height. If only one value is given, the second is set to "auto".&nbsp; ###% ###%&nbsp; - Where the ###% is percentage.&nbsp; &nbsp; Sets the width and height of the background image in percent of the parent element. The first value sets the width, the second value sets the height. If only one value is given, the second is set to "auto" And background-repeat can be: repeat - The background image is repeated both vertically and horizontally.&nbsp; The last image will be clipped if it does not fit. This is default repeat-x - The background image is repeated only horizontally repeat-y - The background image is repeated only vertically no-repeat - The background-image is not repeated. The image will only be shown once space - The background-image is repeated as much as possible without clipping. The first and last images are pinned to either side of the element, and whitespace is distributed evenly between the images round - The background-image is repeated and squished or stretched to fill the space (no gaps) See:&nbsp; <a href="https://www.w3schools.com/cssref/css3_pr_background-size.asp" rel="nofollow">https://www.w3schools.com/cssref/css3_pr_background-size.asp</a> &nbsp;for details on the syntax.&nbsp;&nbsp; Update 2: It appears the settings that work best for me (stretching and resizing the image to fill the titlecard space) is: &nbsp; &nbsp; ;background-size: auto;background-repeat: round; Also, specifying gradients syntax seems to work: --#titlecardbackgroundimage|linear-gradient(black, white); --#titlecardbackgroundimage|radial-gradient(circle, black, white); --#titlecardbackgroundimage|radial-gradient(circle at top right, black, red, yellow); See&nbsp; <a href="https://css-tricks.com/a-complete-guide-to-css-gradients/" rel="nofollow">https://css-tricks.com/a-complete-guide-to-css-gradients/</a> &nbsp;for more settings. Warning: Make sure your image URL doesn't contain two dashes (--).&nbsp; Scriptcards will choke on this.&nbsp;&nbsp; Examples: &nbsp; --#titlecardbackgroundimage|linear-gradient(90deg, rgba(0,0,0,1) 0%, rgba(245,74,9,1) 59%, rgba(251,255,0,0.9262079831932774) 100%);
Hi Kurt, Haven't been able t figure out why but 1.3.1 scramble my cards while it's OK in 1.2.8! My context : A lot of reentrant buttons and --I tags but the rest is pretty usual ! Any idea ? Can you post a sample script with the expected (1.2.8) output and what happens in 1.3.1? I ha ve a first car that list the 11 social skills. One of them, "Commerce" (Trading) fetches a dice value on each of the 3 tables ([T#Ame],&nbsp;[T#Corps] and&nbsp;[T#Esprit])&nbsp;. Then the card is meant to call upon the sub called&nbsp; LibShaan_CompareJE with or without a Situational bonus that user type through an --I section. LibShaan_CompareJE is where all the logic of Dice manipulation of the Shaan RPG stands. When Dice are done then it returns and calls Commerce_DISPLAY. With scriptcard 1.2.8 everything runs smooth! With scriptcard 1.3.x, somehow, soething goes weird in&nbsp; LibShaan_CompareJE that makes the sub believe it is in the case of wot we call a symbiosis (the 3 dices are strictly equal to each other) here's the original Commerce script : --:Commerce|&nbsp; &nbsp; &nbsp; --=DéAme|[T#Ame] --=DéCorps|[T#Corps] --=DéEsprit|[T#Esprit] --&amp;Domaine|social --&amp;Spécialisation|Commerce --IY-a t'il un bonus?;Montant du bonus de situation|q;Bonus;Quel est la valeur du Bonus? --&gt;LibShaan_CompareJE|[$DéEsprit.tableEntryValue];[$DéAme.tableEntryValue];[$DéCorps.tableEntryValue];[*[&amp;testvar]:[&amp;Domaine]];[&amp;Domaine];[*[&amp;testvar]:t-id];[&amp;Spécialisation];"" --X| Here's its Commerce_DISPLAY counterpart : --:Commerce_DISPLAY| --#sourceToken|@{selected|token_id} --#whisper|0 --#emoteText|[*S:character_name] utilise Commerce --&amp;Rouge|990000 --&amp;Vert|007700 --&amp;Spécialisation|Commerce --?[$HitScore] -le 0|CommerceRR --IScriptCards a besoin de connaître votre choix;Cliquez pour choisir|q;Choix;Quel usage?|Test|Epreuve :Mise en Réserve|Epreuve :Utiliser la Réserve --?"[&amp;Choix]" -inc "Epreuve :Mise en Réserve"|CommerceR --?"[&amp;Choix]" -inc "Epreuve :Utiliser la Réserve"|CommerceU --=HitScore|[%1%][Jet] + [*S:[&amp;Spécialisation]PJ_Bonus][Spécialisation] + [*S:[&amp;Spécialisation]PJ_Acquis][Acquis] + [&amp;Bonus][Bonus] - [*S:fooEncMalusPJ][Enc] --=calcul1|[$HitScore]*5 --~FinalHS1|math;ceil;[$calcul1] --&amp;Desc1a|[b][*S:character_name][/b] fait appel à ses connaissances en Commerce et obtient un score de [$HitScore]. --+|[&amp;Desc1a] --^CommerceEnd| --:CommerceR| --?[*S:rname] -ne [&amp;Spécialisation]|NSCommerce --=HitScore|[%1%][Jet] + [*S:[&amp;Spécialisation]PJ_Bonus][Spécialisation] + [*S:[&amp;Spécialisation]PJ_Acquis][Acquis] + [&amp;Bonus][Bonus] - [*S:fooEncMalusPJ][Enc] --+|[*S:character_name] met [$HitScore] points en réserve! --=newval|[*S:foo_rval] + [$HitScore] --@setattr|_silent _charid [*S:character_id] _rname|[&amp;Spécialisation] --@setattr|_silent _charid [*S:character_id] _foo_rval|[$newval] --^CommerceEnd| --:NSCommerce| --=HitScore|[%1%][Jet] + [*S:[&amp;Spécialisation]PJ_Bonus][Spécialisation] + [*S:[&amp;Spécialisation]PJ_Acquis][Acquis] + [&amp;Bonus][Bonus] - [*S:fooEncMalusPJ][Enc] --+|[*S:character_name] met [$HitScore] points en réserve! --=newval|[$HitScore] --@setattr|_silent _charid [*S:character_id] _rname|[&amp;Spécialisation] --@setattr|_silent _charid [*S:character_id] _foo_rval|[$newval] --^CommerceEnd| --:CommerceU| --=newval|[*S:foo_rval] + [%1%] --=HitScore|[$newval][Jet] + [*S:[&amp;Spécialisation]PJ_Bonus][Spécialisation] + [*S:[&amp;Spécialisation]PJ_Acquis][Acquis] + [&amp;Bonus][Bonus] - [*S:fooEncMalusPJ][Enc] --+|[*S:character_name] utilise sa réserve et totalise un score de [$HitScore] à son épreuve de Commerce! --@setattr|_silent _charid [*S:character_id] _rname|"" --@setattr|_silent _charid [*S:character_id] _foo_rval|0 --^CommerceEnd| --:CommerceRR| --@setattr|_silent _charid [*S:character_id] _foo_rval|0 --^CommerceEnd| --:CommerceEnd| --X| Here's the sub&nbsp; LibShaan_CompareJE&nbsp; that simulates dice handling : --:LibShaan_CompareJE|DéEsprit;DéAme;DéCorps;target;domaine;tokenid;power;Draw &nbsp; --#evenRowBackground|#E8E89F &nbsp; --#oddRowBackground|#FBFBBE &nbsp; --#buttonbackground|#DCC21E &nbsp;&nbsp; &nbsp; --#buttonTextColor|#000000 &nbsp; --#sourceToken|@{selected|token_id} &nbsp; --#whisper|0 &nbsp; --&amp;Rouge|990000 &nbsp; --&amp;Vert|007700 &nbsp; --=HitScore|0 &nbsp; --=E|[%1%] &nbsp; --=A|[%2%] &nbsp; --=C|[%3%] &nbsp; --=EA|[%1%]+[%2%] &nbsp; --=EC|[%1%]+[%3%] &nbsp; --=AC|[%2%]+[%3%]&nbsp; &nbsp; --=EAC|[%1%]+[%2%]+[%3%] &nbsp; --=target|[%4%] &nbsp; --&amp;domaine|[%5%] &nbsp; --=Tid|[%6%] &nbsp; --&amp;pouvoir|[%7%] &nbsp; --&amp;Draw|[%8%] &nbsp;&nbsp; --+|[img][$DéEsprit.tableEntryImgURL][/img] - [img width=40 height=40][$DéAme.tableEntryImgURL][/img]- [img width=40 height=40][$DéCorps.tableEntryImgURL][/img] --?[$E] -eq [$A] -and [$A] -eq [$C]|JES1|JEB1 --:JES1|Symbiose de 0 ou pas --?[$E] -eq 10|JESymb0|JESymb --:JESymb0|Symbiose de 0 --=NewDomValue|[*S:[&amp;domaine]_base]+1 --/ +|[c][#[&amp;Rouge]][b][$E] = [$A] = [$C][/b][/#][/c] --+|[c][#[&amp;Rouge]][b]~Symbiose de 0 - Echec critique !~[/b][/#][/c] --+|[c][#[&amp;Rouge]][b]~[&amp;domaine] passe désormais à [$NewDomValue] !~[/b][/#][/c] --+|[c][#[&amp;Rouge]][b]~ Pensez à prendre 1 pouvoir !~[/b][/#][/c] --@setattr|_charid [*S:character_id] _[&amp;domaine]_base|[$NewDomValue] _silent --=HitScore|-10 --&gt;[&amp;pouvoir]_DISPLAY|[$HitScore] --/ Score final|[$HitScore] --X| --:JESymb| --?[$E] -le [%4%]|JESymbp|JESymbn --:JESymbp|parameter is domaine&nbsp; --=NewDomValue2|[*S:[&amp;domaine]_base]+1 --/ +|[c][#[&amp;Rouge]][b][$E] = [$A] = [$C][/b][/#][/c] --+|[c][#[&amp;Vert]][b]~~~Symbiose parfaite!~~~[/b][/#][/c] --+|[c][#[&amp;Vert]][b]~[&amp;domaine] passe désormais à [$NewDomValue2] !~[/b][/#][/c] --+|[c][#[&amp;Vert]][b]~ Pensez à prendre 1 pouvoir !~[/b][/#][/c] --@setattr|_charid [*S:character_id] _[&amp;domaine]_base|[$NewDomValue2] _silent --=HitScore|[$E][Jet] +10 --&gt;[&amp;pouvoir]_DISPLAY|[$HitScore] --X| --:JESymbn|Symbiose&nbsp; ou Belle Réussite&nbsp;&nbsp; --=NewDomValue3|[*S:[&amp;domaine]_base]+1 --/ +|[c][#[&amp;Rouge]][b][$E] = [$A] = [$C][/b][/#][/c] --+|[c][#[&amp;Vert]][b]~~~Symbiose !~~~[/b][/#][/c] --+|[c][#[&amp;Vert]][b]~[&amp;domaine] passe désormais à [$NewDomValue3] !~[/b][/#][/c] --+|[c][#[&amp;Vert]][b]~ Pensez à prendre 1 pouvoir !~[/b][/#][/c] --@setattr|_charid [*S:character_id] _[&amp;domaine]_base|[$NewDomValue3] _silent --=HitScore|10 --&gt;[&amp;pouvoir]_DISPLAY|[$HitScore] --/ Score final|[$HitScore] --X| --^JEEnd| --:JEB1|maitrise ou non --?[$target] -ge 10|JEMastery|JENormal --:JEMastery|&nbsp; --+|[c][i]Mastery - [&amp;domaine]=[b][$target.Total][/b][/i][/c] --?[$E] -ne 10|ENot0|E0 --:ENot0| --?[$E] -lt [$target]|ENot0E|ENot0NotE --:ENot0E| --#buttonbackground|#F9E986 --#buttonTextColor|#000000 --+|[l][rbutton]Garder dé d'Action [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img]-&gt; Jet =[$E]::JEUESPRIT[/rbutton][/l] --#buttonbackground|#DCC21E --/ #buttonTextColor|#FFFFFF --?[$A] -ne 10|ENot0EANot0|ENot0EA0 --:ENot0EANot0| --?[$A] -le [$target]|ENot0EANot0A|ENot0EANot0NotA --:ENot0EANot0A| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéAme.tableEntryImgURL][/img]-&gt; Jet =[$A]::JEPRAME[/rbutton][/l] --?[$EA] -le [$target]|ENot0EANot0AEA|ENot0EANot0ANotEA --:ENot0EANot0AEA| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img] + [img width=20 height=20][$DéAme.tableEntryImgURL][/img]-&gt; Jet =[$EA]::JEPCAME[/rbutton][/l] --?[$C] -ne 10|ENot0EANot0AEACNot0|ENot0EANot0AEAC0 --:ENot0EANot0AEACNot0| --?[$C] -le [$target]|ENot0EANot0AEACNot0C|ENot0EANot0AEACNot0NotC --:ENot0EANot0AEACNot0C| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$C]::JEPRCORPS[/rbutton][/l] --?[$EC] -le [$target]|ENot0EANot0AEACNot0CEC|ENot0EANot0AEACNot0CNotEC --:ENot0EANot0AEACNot0CEC| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$EC]::JEPCCORPS[/rbutton][/l] --?[$AC] -le [$target]|ENot0EANot0AEACNot0CECAC|ENot0EANot0AEACNot0CECNotAC --:ENot0EANot0AEACNot0CECAC| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéAme.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$AC]::JEPRAMECORPS[/rbutton][/l] --?[$EAC] -le [$target]|ENot0EANot0AEACNot0CECACEAC|ENot0EANot0AEACNot0CECACNotEAC --:ENot0EANot0AEACNot0CECACEAC| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img] + [img width=20 height=20][$DéAme.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$EAC]::JEPCAMECORPS[/rbutton][/l] --:ENot0EANot0AEACNot0CECACNotEAC| --^JEEnd| --:ENot0EANot0AEACNot0CECNotAC| --^JEEnd| --:ENot0EANot0AEACNot0CNotEC| --?[$AC] -le [$target]|ENot0EANot0AEACNot0CNotECAC|ENot0EANot0AEACNot0CNotECNotAC --:ENot0EANot0AEACNot0CNotECAC| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéAme.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$AC]::JEPRAMECORPS[/rbutton][/l] --^JEEnd| --:ENot0EANot0AEACNot0CNotECNotAC| --^JEEnd| --:ENot0EANot0AEACNot0NotC| --^JEEnd| --:ENot0EANot0AEAC0| --^JEEnd| --:ENot0EANot0ANotEA| --?[$C] -ne 10|ENot0EANot0ANotEACNot0|ENot0EANot0ANotEAC0 --:ENot0EANot0ANotEACNot0| --?[$C] -le [$target]|ENot0EANot0ANotEACNot0C|ENot0EANot0ANotEACNot0NotC --:ENot0EANot0ANotEACNot0C| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$C]::JEPRCORPS[/rbutton][/l] --?[$EC] -le [$target]|ENot0EANot0ANotEACNot0CEC|ENot0EANot0ANotEACNot0CNotEC --:ENot0EANot0ANotEACNot0CEC| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$EC]::JEPCCORPS[/rbutton][/l] --?[$AC] -le [$target]|ENot0EANot0ANotEACNot0CECAC|ENot0EANot0ANotEACNot0CECNotAC --:ENot0EANot0ANotEACNot0CECAC| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéAme.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$AC]::JEPRAMECORPS[/rbutton][/l] --?[$EAC] -le [$target]|ENot0EANot0ANotEACNot0CECACEAC|ENot0EANot0ANotEACNot0CECACNotEAC --:ENot0EANot0ANotEACNot0CECACEAC| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img] + [img width=20 height=20][$DéAme.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$EAC]::JEPCAMECORPS[/rbutton][/l] --:ENot0EANot0ANotEACNot0CECACNotEAC| --^JEEnd| --:ENot0EANot0ANotEACNot0CECNotAC| --^JEEnd| --:ENot0EANot0ANotEACNot0CNotEC| --?[$AC] -le [$target]|ENot0EANot0ANotEACNot0NotCAC|ENot0EANot0ANotEACNot0NotCNotAC --:ENot0EANot0ANotEACNot0NotCAC| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéAme.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$AC]::JEPRAMECORPS[/rbutton][/l] --^JEEnd| --:ENot0EANot0ANotEACNot0NotCNotAC| --^JEEnd| --:ENot0EANot0ANotEACNot0NotC| --^JEEnd| --:ENot0EANot0ANotEAC0| --^JEEnd| --:ENot0EANot0NotA| --?[$C] -ne 10|ENot0EANot0NotACNot0|ENot0EANot0NotAC0 --:ENot0EANot0NotACNot0| --?[$C] -le [$target]|ENot0EANot0NotACNot0C|ENot0EANot0NotACNot0NotC --:ENot0EANot0NotACNot0C| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$C]::JEPRCORPS[/rbutton][/l] --?[$EC] -le [$target]|ENot0EANot0NotACNot0CEC|ENot0EANot0NotACNot0CNotEC --:ENot0EANot0NotACNot0CEC| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$EC]::JEPCCORPS[/rbutton][/l] --:ENot0EANot0NotACNot0CNotEC| --^JEEnd| --:ENot0EANot0NotACNot0NotC| --^JEEnd| --:ENot0EANot0NotAC0| --^JEEnd| --:ENot0EA0| --+|[l][rbutton]Echec - Puiser [img width=20 height=20][$DéAme.tableEntryImgURL][/img]-&gt; Jet =0::JEPE[/rbutton][/l] --?[$C] -ne 10|ENot0EA0CNot0|ENot0EA0C0 --:ENot0EA0CNot0| --?[$C] -le [$target]|ENot0EA0CNot0C|ENot0EA0CNot0NotC --:ENot0EA0CNot0C| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$C]::JEPRCORPS[/rbutton][/l] --?[$EC] -le [$target]|ENot0EA0CNot0CEC|ENot0EA0CNot0CNotEC --:ENot0EA0CNot0CEC| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$EC]::JEPCCORPS[/rbutton][/l] --:ENot0EA0CNot0CNotEC| --^JEEnd| --:ENot0EA0CNot0NotC| --^JEEnd| --:ENot0EA0C0| --+|[l][rbutton]Echec - Puiser [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =0::JEPE[/rbutton][/l] --^JEEnd| --:E0| --+|[l][rbutton]Echec - Puiser [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img]-&gt; Jet =0::JEPE[/rbutton][/l] --?[$A] -ne 10|E0ANot0|E0A0 --:E0ANot0| --?[$A] -le [$target]E0ANot0A|E0ANot0NotA --:E0ANot0A| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéAme.tableEntryImgURL][/img]-&gt; Jet =[$A]::JEPRAME[/rbutton][/l] --?[$C] -ne 10|E0ANot0ACNot0|E0ANot0AC0 --:E0ANot0ACNot0| --?[$C] -le [$target]|E0ANot0ACNot0C|E0ANot0ACNot0NotC --:E0ANot0ACNot0C| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$C]::JEPRCORPS[/rbutton][/l] --?[$AC] -le [$target]|E0ANot0ACNot0CAC|E0ANot0ACNot0CNotAC --:E0ANot0ACNot0CAC| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéAme.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$AC]::JEPRAMECORPS[/rbutton][/l] --:E0ANot0ACNot0CNotAC| --^JEEnd| --:E0ANot0ACNot0NotC| --^JEEnd| --:E0ANot0AC0| --+|[l][rbutton]Echec - Puiser [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =0::JEPE[/rbutton][/l] --^JEEnd| --:E0ANot0NotA| --?[$C] -ne 10|E0ANot0NotACNot0|E0ANot0NotAC0 --:E0ANot0NotACNot0| --?[$C] -le [$target]|E0ANot0NotACNot0C|E0ANot0NotACNot0NotC --:E0ANot0NotACNot0C| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$C]::JEPRCORPS[/rbutton][/l] --^JEEnd| --:E0ANot0NotACNot0NotC| --^JEEnd| --:E0ANot0NotAC0| --^JEEnd| --:E0A0| --+|[l][rbutton]Echec - Puiser [img width=20 height=20][$DéAme.tableEntryImgURL][/img]-&gt; Jet =0::JEPE[/rbutton][/l] --?[$C] -ne 10|E0A0CNot0|E0A0C0 --:E0A0CNot0| --?[$C] -le [$target]|E0A0CNot0C|E0A0CNot0NotC --:E0A0CNot0C| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$C]::JEPRCORPS[/rbutton][/l] --^JEEnd| --:E0A0CNot0NotC| --^JEEnd| --:E0A0C0| --+|[l][rbutton]Echec - Puiser [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =0::JEPE[/rbutton][/l] --^JESymb0| --:JENormal|&nbsp;&nbsp; --+|[c][i]Normal - [&amp;domaine]=[b][$target.Total][/b][/i][/c] --?[$E] -ne 10|2ENot0|2E0 --:2ENot0| --?[$E] -le [$target]|2ENot0E|2ENot0NotE --:2ENot0E| --#buttonbackground|#F9E986 --#buttonTextColor|#000000 --+|[l][rbutton]Garder dé d'Action[img width=20 height=20][$DéEsprit.tableEntryImgURL][/img]-&gt; Jet =[$E]::JEUESPRIT[/rbutton][/l] --#buttonbackground|#DCC21E --/ #buttonTextColor|#FFFFFF --?[$A] -ne 10|2ENot0EANot0|2ENot0EA0 --:2ENot0EANot0| --?[$A] -le [$target]|2ENot0EANot0A|2ENot0EANot0NotA --:2ENot0EANot0A| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéAme.tableEntryImgURL][/img]-&gt; Jet =[$A]::JEPRAME[/rbutton][/l] --?[$EA] -le [$target]|2ENot0EANot0AEA|2ENot0EANot0ANotEA --:2ENot0EANot0AEA| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img] + [img width=20 height=20][$DéAme.tableEntryImgURL][/img]-&gt; Jet =[$EA]::JEPCAME[/rbutton][/l] --?[$C] -ne 10|2ENot0EANot0AEACNot0|2ENot0EANot0AEAC0 --:2ENot0EANot0AEACNot0| --?[$C] -le [$target]|2ENot0EANot0AEACNot0C|2ENot0EANot0AEACNot0NotC --:2ENot0EANot0AEACNot0C| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$C]::JEPRCORPS[/rbutton][/l] --?[$EC] -le [$target]|2ENot0EANot0AEACNot0CEC|2ENot0EANot0AEACNot0CNotEC --:2ENot0EANot0AEACNot0CEC| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$EC]::JEPCCORPS[/rbutton][/l] --^JEEnd| --:2ENot0EANot0AEACNot0CNotEC| --^JEEnd| --:2ENot0EANot0AEACNot0NotC| --^JEEnd| --:2ENot0EANot0AEAC0| --+|[l][rbutton]Echec - Puiser [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =0::JEPE[/rbutton][/l] --^JEEnd| --:2ENot0EANot0ANotEA| --?[$C] -ne 10|2ENot0EANot0ANotEACNot0|2ENot0EANot0ANotEAC0 --:2ENot0EANot0ANotEACNot0| --?[$C] -le [$target]|2ENot0EANot0ANotEACNot0C|2ENot0EANot0ANotEACNot0NotC --:2ENot0EANot0ANotEACNot0C| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$C]::JEPRCORPS[/rbutton][/l] --?[$EC] -le [$target]|2ENot0EANot0ANotEACNot0CEC|2ENot0EANot0ANotEACNot0CNotEC --:2ENot0EANot0ANotEACNot0CEC| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$EC]::JEPCCORPS[/rbutton][/l] --^JEEnd| --:2ENot0EANot0ANotEACNot0CNotEC| --^JEEnd| --:2ENot0EANot0ANotEACNot0NotC| --^JEEnd| --:2ENot0EANot0ANotEAC0| --^JEEnd| --:2ENot0EANot0NotA| --?[$C] -ne 10|2ENot0EANot0NotACNot0|2ENot0EANot0NotAC0 --:2ENot0EANot0NotACNot0| --?[$C] -le [$target]|2ENot0EANot0NotACNot0C|2ENot0EANot0NotACNot0NotC --:2ENot0EANot0NotACNot0C| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$C]::JEPRCORPS[/rbutton][/l] --?[$EC] -le [$target]|2ENot0EANot0NotACNot0CEC|2ENot0EANot0NotACNot0CNotEC --:2ENot0EANot0NotACNot0CEC| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$EC]::JEPCCORPS[/rbutton][/l] --^JEEnd| --:2ENot0EANot0NotACNot0CNotEC| --^JEEnd| --:2ENot0EANot0NotACNot0NotC| --^JEEnd| --:2ENot0EANot0NotAC0| --+|[l][rbutton]Echec - Puiser [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =0::JEPE[/rbutton][/l] --^JEEnd| --:2ENot0EA0| --+|[l][rbutton]Echec - Puiser [img width=20 height=20][$DéAme.tableEntryImgURL][/img]-&gt; Jet =0::JEPE[/rbutton][/l] --?[$C] -ne 10|2ENot0EA0CNot0|2ENot0EA0C0 --:2ENot0EA0CNot0| --?[$C] -le [$target]|2ENot0EA0CNot0C|2ENot0EA0CNot0NotC --:2ENot0EA0CNot0C| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$C]::JEPRCORPS[/rbutton][/l] --?[$EC] -le [$target]|2ENot0EA0CNot0CEC|2ENot0EA0CNot0CNotEC --:2ENot0EA0CNot0CEC| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$EC]::JEPCCORPS[/rbutton][/l] --^JEEnd| --:2ENot0EA0CNot0CNotEC| --^JEEnd| --:2ENot0EA0CNot0NotC| --^JEEnd| --:2ENot0EA0C0| --+|[l][rbutton]Echec - Puiser [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =0::JEPE[/rbutton][/l] --^JEEnd| --:2ENot0NotE| --?[$A] -ne 10|2ENot0NotEANot0|2ENot0NotEA0 --:2ENot0NotEANot0| --?[$A] -le [$target]|2ENot0NotEANot0A|2ENot0NotEANot0NotA --:2ENot0NotEANot0A| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéAme.tableEntryImgURL][/img]-&gt; Jet =[$A]::JEPRAME[/rbutton][/l] --?[$C] -ne 10|2ENot0NotEANot0ACNot0|2ENot0NotEANot0AC0 --:2ENot0NotEANot0ACNot0| --?[$C] -le [$target]|2ENot0NotEANot0ACNot0C|2ENot0NotEANot0ACNot0NotC --:2ENot0NotEANot0ACNot0C| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$C]::JEPRCORPS[/rbutton][/l] --:2ENot0NotEANot0ACNot0NotC| --^JEEnd| --:2ENot0NotEANot0AC0| --^JEEnd| --:2ENot0NotEANot0NotA| --?[$C] -ne 10|2ENot0NotEANot0NotACNot0|2ENot0NotEANot0NotAC0 --:2ENot0NotEANot0NotACNot0| --?[$C] -le [$target]|2ENot0NotEANot0NotACNot0C|2ENot0NotEANot0NotACNot0NotC --:2ENot0NotEANot0NotACNot0C| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$C]::JEPRCORPS[/rbutton][/l] --^JEEnd| --:2ENot0NotEANot0NotACNot0NotC| --+|[l][rbutton]Echec sur dé d'Action[img width=20 height=20][$DéEsprit.tableEntryImgURL][/img]-&gt; Jet =0::JEEchec[/rbutton][/l] --^JEEnd| --:2ENot0NotEANot0NotAC0| --^JEEnd| --:2ENot0NotEA0| --+|[l][rbutton]Echec - Puiser [img width=20 height=20][$DéAme.tableEntryImgURL][/img]-&gt; Jet =0::JEPE[/rbutton][/l] --?[$C] -ne 10|2ENot0NotEA0CNot0|2ENot0NotEA0C0 --:2ENot0NotEA0CNot0| --?[$C] -le [$target]|2ENot0NotEA0CNot0C|2ENot0NotEA0CNot0NotC --:2ENot0NotEA0CNot0C| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$C]::JEPRCORPS[/rbutton][/l] --^JEEnd| --:2ENot0NotEA0CNot0NotC| --+|[l][rbutton]Echec sur dé d'Action [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img]-&gt; Jet =0::JEEchec[/rbutton][/l] --^JEEnd| --:2ENot0NotEA0C0| --+|[l][rbutton]Echec - Puiser [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =0::JEPE[/rbutton][/l] --^JEEnd| --:2E0| --+|[l][rbutton]Echec - Puiser [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img]-&gt; Jet =0::JEPE[/rbutton][/l] --?[$A] -ne 10|2E0ANot0|2E0A0 --:2E0ANot0| --?[$A] -le [$target]|2E0ANot0A|2E0ANot0NotA --:2E0ANot0A| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéAme.tableEntryImgURL][/img]-&gt; Jet =[$A]::JEPRAME[/rbutton][/l] --?[$C] -ne 10|2E0ANot0ACNot0|2E0ANot0AC0 --:2E0ANot0ACNot0| --?[$C] -le [$target]|2E0ANot0ACNot0C|2E0ANot0ACNot0NotC --:2E0ANot0ACNot0C| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$C]::JEPRCORPS[/rbutton][/l] --^JEEnd| --:2E0ANot0ACNot0NotC| --^JEEnd| --:2E0ANot0AC0| --^JEEnd| --:2E0ANot0NotA| --?[$C] -ne 10|2E0ANot0NotACNot0|2E0ANot0NotAC0 --:2E0ANot0NotACNot0| --?[$C] -le [$target]|2E0ANot0NotACNot0C|2E0ANot0NotACNot0NotC --:2E0ANot0NotACNot0C| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$C]::JEPRCORPS[/rbutton][/l] --^JEEnd| --:2E0ANot0NotACNot0NotC| --^JEEnd| --:2E0ANot0NotAC0| --^JEEnd| --:2E0A0| --+|[l][rbutton]Echec - Puiser [img width=20 height=20][$DéAme.tableEntryImgURL][/img]-&gt; Jet =0::JEPE[/rbutton][/l] --?[$C] -ne 10|2E0A0CNot0|2E0A0C0 --:2E0A0CNot0| --?[$C] -le [$target]|2E0A0CNot0C|2E0A0CNot0NotC --:2E0A0CNot0C| --+|[l][rbutton]Remplacer par [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]-&gt; Jet =[$C]::JEPRCORPS[/rbutton][/l] --^JEEnd| --:2E0A0CNot0NotC| --^JEEnd| --:2E0A0C0| --^JESymb0| --:JEEnd| --&lt;| --:JEUESPRIT| Keep the Yellow dice (Spirit)&nbsp; --#sourceToken|@{selected|token_id} --#emotestate|visible --#emoteText|[*S:character_name] utilise [&amp;Pouvoir] --=HitScore|[$E][Jet] --&gt;[&amp;pouvoir]_DISPLAY|[$HitScore] --X| --:JEPRAME| replace the yellow dice (spirit) by the blue one (Soul) &amp; Draw 1 in Soul --#sourceToken|@{selected|token_id} --#emotestate|visible --#emoteText|[*S:character_name] utilise [&amp;Pouvoir] --=HitScore|[$A][Jet] --?[&amp;Draw] -inc NoDraw|SuiteJEPRAME --&gt;LibShaan_Draw|[*S:t-id];2;-1 --:SuiteJEPRAME| --&gt;[&amp;pouvoir]_DISPLAY|[$HitScore] --X| --:JEPCAME| Replace the yellow dice (Spirit) by (yellow dice (spirit) + blue dice (Soul))&amp; Draw 1 in Soul --#sourceToken|@{selected|token_id} --#emotestate|visible --#emoteText|[*S:character_name] utilise [&amp;Pouvoir] --=HitScore|[$EA][Jet] --?[&amp;Draw] -inc NoDraw|SuiteJEPCAME --&gt;LibShaan_Draw|[*S:t-id];2;-1 --:SuiteJEPCAME| --&gt;[&amp;pouvoir]_DISPLAY|[$HitScore] --X| --:JEPRCORPS| replace the yellow dice (spirit) by the red one (Body)&amp; Draw 1 in Body --#sourceToken|@{selected|token_id} --#emotestate|visible --#emoteText|[*S:character_name] utilise [&amp;Pouvoir] --=HitScore|[$C][Jet]&nbsp; --?[&amp;Draw] -inc NoDraw|SuiteJEPRCORPS --&gt;LibShaan_Draw|[*S:t-id];3;-1 --:SuiteJEPRCORPS| --&gt;[&amp;pouvoir]_DISPLAY|[$HitScore] --X| --:JEPCCORPS| Replace the yellow dice (Spirit) by (yellow dice (spirit) + red dice (Body))&amp; Draw 1 in Body --#sourceToken|@{selected|token_id} --#emotestate|visible --#emoteText|[*S:character_name] utilise [&amp;Pouvoir] --=HitScore|[$EC][Jet]&nbsp; --?[&amp;Draw] -inc NoDraw|SuiteJEPCCORPS --&gt;LibShaan_Draw|[*S:t-id];3;-1 --:SuiteJEPCCORPS| --&gt;[&amp;pouvoir]_DISPLAY|[$HitScore] --X| --:JEPRAMECORPS| Replace the yellow dice (Spirit) by (red dice (Body) + blue dice (Soul))&amp; Draw 1 in Soul &amp; Draw 1 in Body --#sourceToken|@{selected|token_id} --#emotestate|visible --#emoteText|[*S:character_name] utilise [&amp;Pouvoir] --=HitScore|[$AC][Jet] --?[&amp;Draw] -inc NoDraw|SuiteJEPRAMECORPS --&gt;LibShaan_Draw|[*S:t-id];2;-1 --&gt;LibShaan_Draw|[*S:t-id];3;-1 --:SuiteJEPRAMECORPS| --&gt;[&amp;pouvoir]_DISPLAY|[$HitScore] --X| --:JEPCAMECORPS| Replace the yellow dice (Spirit) by (SUM of 3 dices)&amp; Draw 1 in Soul &amp; Draw 1 in Body --#sourceToken|@{selected|token_id} --#emotestate|visible --#emoteText|[*S:character_name] utilise [&amp;Pouvoir] --=HitScore|[$EAC][Jet] --?[&amp;Draw] -inc NoDraw|SuiteJEPCAMECORPS --&gt;LibShaan_Draw|[*S:t-id];2;-1 --&gt;LibShaan_Draw|[*S:t-id];3;-1 --:SuiteJEPCAMECORPS| --&gt;[&amp;pouvoir]_DISPLAY|[$HitScore] --X| --:JEPE| Fumble on Action dice - Draw 1 in Spirit --#sourceToken|@{selected|token_id} --#emotestate|visible --#emoteText|Le pouvoir de [*S:character_name] échoue de manière spectaculaire. --?[&amp;Draw] -inc NoDraw|SuiteJEPE --&gt;LibShaan_Draw|[*S:t-id];1;-1 --:SuiteJEPE| --=HitScore|0&nbsp; --+|[c][#[&amp;Rouge]][b]~~~Echec spectaculaire!~~~[/b][/#][/c] --&gt;[&amp;pouvoir]_DISPLAY|[$HitScore] --X| --:JEEchec| Fail --#sourceToken|@{selected|token_id} --#emotestate|visible --#emoteText|Le pouvoir de [*S:character_name] échoue. --=HitScore|0&nbsp; --+|[c][#[&amp;Rouge]][b]~~~Echec!~~~[/b][/#][/c] --&gt;[&amp;pouvoir]_DISPLAY|[$HitScore] --X| --:LibShaan_Draw|Parameters are tokenid;bar#;amount --@token-mod|_ignore-selected _ids [%1%] _set bar[%2%]_value|[%3%] --&lt;| --:LibShaan_Marker|Parameters are tokenid;statusmaker_label;nbround --@token-mod|_ignore-selected _ids [%1%] _set statusmarkers|[%2%]:+[%3%] --&lt;| --:PlayEffects|Parameters are : sourcetoken; targettoken; source effect; target effect; line effect; sound effect &nbsp; --vtoken|[%1%] [%3%] &nbsp; --vtoken|[%2%] [%4%] &nbsp; --vbetweentokens|[%1%] [%2%] [%5%] &nbsp; --@roll20AM|_audio,play,nomenu|[%6%] --&lt;|
1624231975

Edited 1624232984
Kurt J.
Pro
API Scripter
Woombak said: I'll need to do some more looking, but I do have a few questions: 1 - Are the values that come back from the table lookups numeric or something else? 2 - I notice you prompt for Bonus, but never use it in the call to the Lib routine. Is that intentional? 3 - Do you get any output to the API console? specifically anything complaining about conditionals failing? I know what is happening... I just am not yet sure how to fix it. The new substitution code uses a regex string to find variables and replacement text. The regex code doesn't know what to do with the "é" character and is therefore not matching the names of your variables. Let me see what I can find about supporting extended characters in Regex, as I certainly want to do so :)
1624233609

Edited 1624312566
Kurt J.
Pro
API Scripter
ScriptCards 1.3.6a - The Woombak Update :) I've got a version of 1.3.6 on the GIST with a tweaked regex expression for variable substitution that supports extended characters (accented, etc.). I believe it will work for everyone (I've tested it with all of my big card scripts) but please let me know if you install it and run into trouble. @Woombak - thank you for brining this issue to light :) Supporting non-English languages is important to me, and I overlooked that when I rewrote the variable substitution code. Updated: I forgot to mention in the 1.3.6a update notes that if you save a card setting list (with --ssettings) and name it "Default" (case sensitive) it will be loaded at the start of every script. You can always load another set (which will be merged with Default) or remove the "Default" set to alter this behavior.
1624234024

Edited 1624234237
Kurt J.
Pro
API Scripter
Will M. said: @Kurt - You must have known this question was coming.&nbsp; How do I set my background image size if I want to scale it down for script cards?&nbsp;&nbsp; Update :&nbsp; Here's what I've figured out - You can use the CSS style settings inline like this: Lots of stuff snipped... :) &nbsp; --#titlecardbackgroundimage|linear-gradient(90deg, rgba(0,0,0,1) 0%, rgba(245,74,9,1) 59%, rgba(251,255,0,0.9262079831932774) 100%); Yea, I left the background-image stuff wide open so you could potentially do anything you wanted to with the CSS specifier. The default gradient setting should duplicate the look of PowerCards for those trying to integrate the two as seamlessly as possible, but you can get as creative as you want :) I needed the background-image in order to do the gradient (since as you pointed out it is just an image specifier with the gradient syntax) so I figured I would "document" the setting for people to play with. And I'll probably "borrow" your text above for the Wiki when I update it for title card backgrouds... Good info :)
1624244521

Edited 1624254551
While at Father's Day dinner with the relatives, I've been thinking about how to add some of the gradient options to the Format Utility.&nbsp; Something that would act like an old fashioned dialog wizard that would walk people through the most common settings.&nbsp;&nbsp; Update: I got the wizard working for gradient-linear backgrounds that walks you through the steps to build a linear gradient with just clicks.&nbsp; Now that I've figured out how to do the wizards functionality, Circular and Conic gradients should be easy and I hope to tackle them tomorrow.&nbsp; Once I've completed, I'll post my new version in the sharing forum.&nbsp;&nbsp;
@Kurt - came up with an oddity all of a sudden.&nbsp; I have been using a modified version of your magic missile script which has been working perfectly.&nbsp; Recently, the macro now only applies damage with the last missile.&nbsp;&nbsp; In the case below, all 4 missiles were pointed at the same token but, despite the alterbars script being called each time, only the last 2 points were actually applied to the token. [Note: I added a display line to make sure that the parameters ("Gnoll Hunter 1 -5") being passed to the alterbars subroutine were correct.]&nbsp; I don't think that this is a macro error as all of the calls are to the same gosub (" --&gt;ApplyDamageAlterbars|[&amp;ThisTarget];1;-[$ThisMissile.Total] ") and with the same parameters except damage amount.&nbsp; Do you know what is happening? Liriel uses a level 2 spell slot to fire 4 missiles of magical force! &nbsp; Magic Missile Slot level 2 ♦ Level 2 Left: 0 Missile &nbsp;<span class="userscript-showtip userscript-tipsy" original-title="Roll: 1 Result: 1 " style="box-sizing: content-box; min-width: 1.75em; font-family: undefined; text-align: center; display: inline-block; font-weight: bold; height: 1em; margin-top: -1px; margin-bottom: 1px; padding: 0px 2px; border: 1px solid rgb(135, 133, 10); border-radius: 3px; background-color: rgb(255, 254, 162); color: rgb(0, 0, 0);">1 &nbsp;Hits Gnoll Hunter for&nbsp;<span class="userscript-showtip userscript-tipsy" original-title="Roll: 1d4 + 1 Result: 1d4 (4) + 1 " style="box-sizing: content-box; min-width: 1.75em; font-family: undefined; text-align: center; display: inline-block; font-weight: bold; height: 1em; margin-top: -1px; margin-bottom: 1px; padding: 0px 2px; border: 1px solid rgb(0, 68, 0); border-radius: 3px; background-color: rgb(136, 204, 136); color: rgb(0, 68, 0);">5 &nbsp; force &nbsp;damage Gnoll Hunter 1 -5 Missile &nbsp;<span class="userscript-showtip userscript-tipsy" original-title="Roll: 1 + 1 Result: 1 + 1 " style="box-sizing: content-box; min-width: 1.75em; font-family: undefined; text-align: center; display: inline-block; font-weight: bold; height: 1em; margin-top: -1px; margin-bottom: 1px; padding: 0px 2px; border: 1px solid rgb(135, 133, 10); border-radius: 3px; background-color: rgb(255, 254, 162); color: rgb(0, 0, 0);">2 &nbsp;Hits Gnoll Hunter for&nbsp;<span class="userscript-showtip userscript-tipsy" title="Roll: 1d4 + 1 Result: 1d4 (4) + 1 " style="box-sizing: content-box; min-width: 1.75em; font-family: undefined; text-align: center; display: inline-block; font-weight: bold; height: 1em; margin-top: -1px; margin-bottom: 1px; padding: 0px 2px; border: 1px solid rgb(0, 68, 0); border-radius: 3px; background-color: rgb(136, 204, 136); color: rgb(0, 68, 0);">5 &nbsp; force &nbsp;damage Gnoll Hunter 1 -5 Missile &nbsp;<span class="userscript-showtip userscript-tipsy" original-title="Roll: 2 + 1 Result: 2 + 1 " style="box-sizing: content-box; min-width: 1.75em; font-family: undefined; text-align: center; display: inline-block; font-weight: bold; height: 1em; margin-top: -1px; margin-bottom: 1px; padding: 0px 2px; border: 1px solid rgb(135, 133, 10); border-radius: 3px; background-color: rgb(255, 254, 162); color: rgb(0, 0, 0);">3 &nbsp;Hits Gnoll Hunter for&nbsp;<span class="userscript-showtip userscript-tipsy" original-title="Roll: 1d4 + 1 Result: 1d4 (3) + 1 " style="box-sizing: content-box; min-width: 1.75em; font-family: undefined; text-align: center; display: inline-block; font-weight: bold; height: 1em; margin-top: -1px; margin-bottom: 1px; padding: 0px 2px; border: 1px solid rgb(135, 133, 10); border-radius: 3px; background-color: rgb(255, 254, 162); color: rgb(0, 0, 0);">4 &nbsp; force &nbsp;damage Gnoll Hunter 1 -4 Missile &nbsp;<span class="userscript-showtip userscript-tipsy" original-title="Roll: 3 + 1 Result: 3 + 1 " style="box-sizing: content-box; min-width: 1.75em; font-family: undefined; text-align: center; display: inline-block; font-weight: bold; height: 1em; margin-top: -1px; margin-bottom: 1px; padding: 0px 2px; border: 1px solid rgb(135, 133, 10); border-radius: 3px; background-color: rgb(255, 254, 162); color: rgb(0, 0, 0);">4 &nbsp;Hits Gnoll Hunter for&nbsp;<span class="userscript-showtip userscript-tipsy" original-title="Roll: 1d4 + 1 Result: 1d4 (1) + 1 " style="box-sizing: content-box; min-width: 1.75em; font-family: undefined; text-align: center; display: inline-block; font-weight: bold; height: 1em; margin-top: -1px; margin-bottom: 1px; padding: 0px 2px; border: 1px solid rgb(102, 0, 0); border-radius: 3px; background-color: rgb(255, 170, 170); color: rgb(102, 0, 0);">2 &nbsp; force &nbsp;damage Gnoll Hunter 1 -2 Total &nbsp;Total damage is&nbsp;<span class="userscript-showtip userscript-tipsy" title="Roll: 14 + 2 Result: 14 + 2 " style="box-sizing: content-box; min-width: 1.75em; font-family: undefined; text-align: center; display: inline-block; font-weight: bold; height: 1em; margin-top: -1px; margin-bottom: 1px; padding: 0px 2px; border: 1px solid rgb(135, 133, 10); border-radius: 3px; background-color: rgb(255, 254, 162); color: rgb(0, 0, 0);">16 NPC takes 5 damage. NPC takes 5 damage. NPC takes 4 damage. NPC takes 2 damage.
1624279175
David M.
Pro
API Scripter
Michael, I wonder if it is a timing issue. With multiple alterbars commands on the same token, it's possible that some of the commands are being "lost" if they are fired while the previous command is still processing? Kind of a drinking out of a firehose scenario. I'm wondering if it would be better to add a per-token damage accumulator, then have a single call to alterbars for each token? Just thinking out loud. It's possible that something else is going on.&nbsp;&nbsp;
Kurt J. said: ScriptCards 1.3.6a - The Woombak Update :) I've got a version of 1.3.6 on the GIST with a tweaked regex expression for variable substitution that supports extended characters (accented, etc.). I believe it will work for everyone (I've tested it with all of my big card scripts) but please let me know if you install it and run into trouble. @Woombak - thank you for brining this issue to light :) Supporting non-English languages is important to me, and I overlooked that when I rewrote the variable substitution code. WOOOW so proud&nbsp; to have an update dedicated to me ! I'm gonna frame it ^^ More seriously, thanks again for everything you do mate !
I've posted the latest version (0.7) of Scriptcards Format Utility in the Sharing Forum. Now supports ScriptCards 1.3.6 parameters and I've added wizards for building titlecard gradients (linear, radial and conic).&nbsp;
1624312686
Kurt J.
Pro
API Scripter
I updated the 1.3.6a update notes to include information on the "Default" settings set. I had forgot I had that implemented in the code before I modified the regex for extended characters. If you use Will's settings script and "Save" with the name "Default", it will become the default setting for all of your scripts.
1624313000

Edited 1624314875
@ Kurt - Can you take a look at line 131 of scriptcards 1.3.6. var buttonStyle = 'background-color:!{buttonbackground}; color: #!{buttontextcolor}; text-align: center; vertical-align:middle; border-radius: 5px; border-color:!{buttonbordercolor}; font-family: !{buttonfontface}; font-size:!{buttonfontsize};'; The '#' symbol you are placing before !{buttontextcolor} is preventing the use of named colors (red, yellow, black) for setting button text color.&nbsp; Any chance you can remove the # or is it there for a specific case.&nbsp; In my environment, I removed and was able to set the color with hex or named colors.&nbsp;&nbsp; I tested the "Default" setting logic and it worked great.&nbsp;&nbsp;
1624356831
Kurt J.
Pro
API Scripter
David M. said: Michael, I wonder if it is a timing issue. With multiple alterbars commands on the same token, it's possible that some of the commands are being "lost" if they are fired while the previous command is still processing? Kind of a drinking out of a firehose scenario. I'm wondering if it would be better to add a per-token damage accumulator, then have a single call to alterbars for each token? Just thinking out loud. It's possible that something else is going on.&nbsp;&nbsp; That would be my guess as well. I'll modify the Magic Missile damage routines to build a total damage for each token so that alterbars is just run once for each token.
1624362776
Kurt J.
Pro
API Scripter
ScriptCards Version 1.3.6b Now Available I've made a minor update and put it up on the GIST : Enhancement: Per Will's suggestion, the buttontextcolor has been modified to accept either hex color codes or named colors. In order to not break existing cards, there is some additional code to insert a "#" automatically if a hex color code is specified without one. Bug Fix: In very rare circumstances, setting the "activepage" setting could produce some weird behavior.
I'm having trouble with retrieving token properties, specifically: [*[&amp;tokenid]:t-controlledby] with &amp;tokenid defined properly, yields nothing. What I'm trying to do is sort out whether a given token is controlled by a player or not, and returning information about the token only if it is controlled by a player. So, if [*[&amp;tokenid]:t-controlledby] is blank, it's effectively an NPC, whereas if it is not blank, it's a PC.
@Kurt/David - odd but ok.&nbsp; Since each token - regardless of the same or different token - is processed through the same subroutine that ends with the alterbars code, why would separate tokens not&nbsp;have the same problem?&nbsp; Oh well, "'tis not for me to reason why..." :-)&nbsp; I leave it to the Brainiacs. As David suggested, I am thinking that the recoding would have to include a test to see if the same token is being selected or a different token.&nbsp; How this can be accomplished while it is moving through the token list in the string variable will be taxing as a player might select token1 then token2 then token1 again.&nbsp; Build an array of the tokens that collects the information at each pass through the string? Then process the result through an imbedded array such as in Kurt's fireball macro?&nbsp; Must cogitate on that...
1624380084
David M.
Pro
API Scripter
Michael, it's not that the alterbars script is not firing. The thought is that it could be because the changes to the token happen asynchronously, so the token itself could be "busy" (in the middle of a change which takes some non-zero time) when the next attempt to change it fires off, and that attempt might be either heard or ignored depending on timing. Might not be the issue, but it's a possibility. To your other question: yes, the idea would be to store the per-token info somewhere (like an array or set of indexed variables) and perform a lookup&amp;increment damage in a function, then at the end go through that new array or set of indexed variables and do all the alterbar-ing. Btw, I think Kurt volunteered himself to take a crack at it :)&nbsp;
1624381793
Kurt J.
Pro
API Scripter
Colin C. said: I'm having trouble with retrieving token properties, specifically: [*[&amp;tokenid]:t-controlledby] with &amp;tokenid defined properly, yields nothing. What I'm trying to do is sort out whether a given token is controlled by a player or not, and returning information about the token only if it is controlled by a player. So, if [*[&amp;tokenid]:t-controlledby] is blank, it's effectively an NPC, whereas if it is not blank, it's a PC. It isn't you :) A token that represents a character won't have anything in it's t-controlledby, but should have someething in controlledby (that is coming from the character) if someone has control of that character. This will be the Player's ID. A token that doesn't represent a character could have something in t-controlledby, but the way that code is written right now it won't be retrieved because the code is only looking at&nbsp; tokens that represent characters. I've modified that to allow retrieval of token properties from non-representing tokens and it will be in the next release.
1624396888

Edited 1624396946
Kurt J.
Pro
API Scripter
Michael C. said: @Kurt/David - odd but ok.&nbsp; Since each token - regardless of the same or different token - is processed through the same subroutine that ends with the alterbars code, why would separate tokens not&nbsp;have the same problem?&nbsp; Oh well, "'tis not for me to reason why..." :-)&nbsp; I leave it to the Brainiacs. As David suggested, I am thinking that the recoding would have to include a test to see if the same token is being selected or a different token.&nbsp; How this can be accomplished while it is moving through the token list in the string variable will be taxing as a player might select token1 then token2 then token1 again.&nbsp; Build an array of the tokens that collects the information at each pass through the string? Then process the result through an imbedded array such as in Kurt's fireball macro?&nbsp; Must cogitate on that... I've put together a modified version of Magic Missile that should avoid the problem entirely. I've pasted the code below, but here is what I've done: Near the top of the code, I've declared and array (targetarray) and a roll variable (uniquetargetcount). I use both of these in the new "AccumulateDamage" function. It gets the target token id and the amount of damage. It will then create a roll variable called "damage-tokenid" (or really add to that roll variable - but since the first time around it doesn't exist, it will create it. I then check for "indexof" the tokenid in the targetarray. If it doesn't exist, I add it to the array and add 1 to the uniquetargetcount. Each missile gets processed this way. All of the effects play the same way they did before, but damage isn't actually applied to tokens on each missle. Once all of the missiles have been prcessed, we will have an array with items for each target (with their tokenid, starting at index 1 since index 0 is the dummy item created when the array is defined), and a variable with the number of unique targets - which will also be the number of items in the array discounting the dummy item 0. Now can call the new function ApplyCumulativeDamage, which runs a for...next loop from 1 to the uniquetargetcount and grab the token ID from the array (using the new array referencing notation) and the damage amount that has been accumulated in "damage-tokenid" and call the function to apply the damage via alterbars. !script {{ --#title|Magic Missile --#sourceToken|@{selected|token_id} --~|array;define;targetarray; --=uniquetargetcount|0 --&gt;GetAndCheckSlotInformation| --=MissileCount|[$SlotLevel] + 2 --&gt;BuildAndAskTargets|[$MissileCount.Total] --=DisplayCount|1 --=MissileDamage|0 --#leftsub|Slot level [$SlotLevel] --#rightsub|Ranged Attack --#emoteText|@{selected|character_name} uses a level [$SlotLevel.Total] spell slot to fire [$MissileCount.Total] missiles of magical force! --:MissileLoop| --&gt;FireMissile|[$DisplayCount.Total] --=DisplayCount|[$DisplayCount] + 1 --?[$DisplayCount] -le [$MissileCount]|MissileLoop --+Total|Total damage is [$MissileDamage] --&gt;DeductSpellSlot| --#rightsub|Level [$SlotLevel] Left: [$SlotsRemaining] --&gt;ApplyCumulativeDamage|3 --X| --:FireMissile| --&amp;ThisTarget|[&amp;target[%1%]] --=ThisMissile|1d4 + 1 --=MissileDamage|[$MissileDamage] + [$ThisMissile] --+Missile|[$DisplayCount.Raw] Hits [*[&amp;ThisTarget]:character_name] for [$ThisMissile] [b]force[/b] damage --&gt;PlayEffects|@{selected|token_id};[&amp;ThisTarget];none;burst-smoke;beam-magic;spell_01 --&gt;AccumulateDamage|[&amp;ThisTarget];[$ThisMissile] --&lt;| --:GetAndCheckSlotInformation| --=SlotLevel|?{Spell Slot Level?|1|2|3|4|5|6|7|8|9} --=SlotsTotal|[*S:lvl[$SlotLevel]_slots_total] --=SlotsExpended|[*S:lvl[$SlotLevel]_slots_expended] --?[$SlotsExpended.Total] -ge [$SlotsTotal.Total]|NoSlotsLeft --&lt;| --:NoSlotsLeft| --+|[*S:character_name] has no level [$SlotLevel.Total] spell slots available. --X| --:DeductSpellSlot| --=SlotsExpended|[$SlotsExpended] + 1 --@setattr|_charid [*S:character_id] _lvl[$SlotLevel]_slots_expended|[$SlotsExpended] _silent --=SlotsRemaining|[$SlotsTotal] - [$SlotsExpended] --&lt;| --:PlayEffects|Parameters are : sourcetoken; targettoken; source effect; target effect; line effect; sound effect --vtoken|[%1%] [%3%] --vtoken|[%2%] [%4%] --vbetweentokens|[%1%] [%2%] [%5%] --@roll20AM|_audio,play,nomenu|[%6%] --&lt;| --:AccumulateDamage|tokenid;amount --=damage[%1%]|[$damage[%1%]] + [%2%] --~index|array;indexof;targetarray;[%1%] --?[&amp;index] -eq "ArrayError"|[ --~|array;add;targetarray;[%1%] --=uniquetargetcount|[$uniquetargetcount] + 1 --]| --&lt;| --:ApplyCumulativeDamage|bar --%loop|1;[$uniquetargetcount] --&amp;thisTarget|[@targetarray([&amp;loop])] --=thisDamage|[$damage[&amp;thisTarget]] --&gt;ApplyDamageAlterbars|[&amp;thisTarget];[%1%];-[$thisDamage] --%| --&lt;| --:ApplyDamageTokenmod|Parameters are tokenid;bar#;amount --@token-mod|_ignore-selected _ids [%1%] _set bar[%2%]_value|[%3%] --&lt;| --:ApplyDamageAlterbars| --@alter|_target|[%1%] _bar|[%2%] _amount|[%3%] --&lt;| --:BuildAndAskTargets| --&amp;TargetString| --=targetCount|1 --:TargetLoop| --&amp;TargetString|+t;target[$targetCount.Total];Missile [$targetCount.Total] Target --=targetCount|[$targetCount.Total] + 1 --?[$targetCount.Total] -le [%1%]|&gt;AddSeparator --?[$targetCount.Total] -le [%1%]|TargetLoop --iPlease click the button below to select magic missile targets. The same target can be selected multiple times;Select [%1%] Targets|[&amp;TargetString] --/| --&lt;| --:AddSeparator| --&amp;TargetString|+|| --&lt;| }}
1624471025

Edited 1624471056
@Kurt - Ooops, thought I posted a response but looks like I didn't.&nbsp; Double thanks!&nbsp; This works like a charm and I will use it to modify my Scorching Ray macro as well.&nbsp; (A quick note to others - you will need to make a slight modification of the macro if you use any token barX_value to reflect hit points other than bar3 or it will error out.)&nbsp;&nbsp; @David - I must admit that creating macros on Roll20 is an eye-opener.&nbsp; There are many intricacies to the program that one only learns when coding them.&nbsp; I probably would be better able to grasp things if I understood the construction of the system better.&nbsp; Your insights do help.&nbsp;&nbsp;
1624492050

Edited 1624495052
Kurt J.
Pro
API Scripter
ScriptCards 1.3.7 is Now Available New Background Image Settings : In an effort to keep Will on his toes, I've added the following settings: "bodybackgroundimage", "evenrowbackgroundimage", "oddrowbackgroundimage" and "buttonbackgroundimage". Each is a CSS specifier just like titlecardbackgroundimage. Setting body, even, or odd to anything will result in the colors for those items (both for body, odd for odd, and even for even) being set to #00000000 (transparent) automatically, so if you want some color to overlay the background image, you'll need to set the appropriate color after setting the background image. Modified Behavior: The buttontextcolor setting can how accept named colors instead of just hex codes. If you have any cards that specify a buttontextcolor without the # in front, this will likely break the colorization. The setting needs to be updated to include the hex marker (#). New debugging system function : dumpvariables, with subfunctions of "roll", "string", and "array" will output the name/content of each variable of that type to the API console log for debugging purposes. Bug Fix:&nbsp; Corrected a bug that could (in very rare circumstances) cause unespected behavior when&nbsp; setting the activepage setting. Bug Fix: &nbsp;Tokens that don't represent characters can now have their properties retrieved with t- notation. --- This image has the same fire image for the odd and even row backgrounds (hence the seam) and one of the buttons. The other button has a mostly transparent white map marker as a background.
I'm going to have to tap dance this week to get this included in my Format utility.&nbsp; Good stuff here.&nbsp;&nbsp; Kurt J. said: ScriptCards 1.3.7 is Now Available New Background Image Settings : In an effort to keep Will on his toes, I've added the following settings: "bodybackgroundimage", "evenrowbackgroundimage", "oddrowbackgroundimage" and "buttonbackgroundimage". Each is a CSS specifier just like titlecardbackgroundimage. Setting body, even, or odd to anything will result in the colors for those items (both for body, odd for odd, and even for even) being set to #00000000 (transparent) automatically, so if you want some color to overlay the background image, you'll need to set the appropriate color after setting the background image. Modified Behavior: The buttontextcolor setting can how accept named colors instead of just hex codes. If you have any cards that specify a buttontextcolor without the # in front, this will likely break the colorization. The setting needs to be updated to include the hex marker (#). New debugging system function : dumpvariables, with subfunctions of "roll", "string", and "array" will output the name/content of each variable of that type to the API console log for debugging purposes. Bug Fix:&nbsp; Corrected a bug that could (in very rare circumstances) cause unespected behavior when&nbsp; setting the activepage setting. Bug Fix: &nbsp;Tokens that don't represent characters can now have their properties retrieved with t- notation. --- This image has the same fire image for the odd and even row backgrounds (hence the seam) and one of the buttons. The other button has a mostly transparent white map marker as a background.
Hi, I'm trying to make a script for a spider bite that prompts a Con save if it hits and deals extra damage based on whether it passes or not. It works fine until you enter whether you passed or failed the Con save. It just says you passed it whatever you select.&nbsp; I'm very new to scripting of any sort so any advice you can offer to tidy it up and sort this problem out would be very much appreciated! !script {{ &nbsp;--#title|Bite &nbsp;--#leftsub|Melee Attack &nbsp; --#sourceToken|@{selected|token_id} &nbsp; --#targetToken|@{target|token_id} &nbsp; --#emoteText|@{selected|token_name} attacks @{target|token_name} &nbsp; --=TargetAC|@{target|AC} &nbsp; --=AttackRoll|1d20 + @{selected|strength_mod} [STR] + @{selected|pb} [PROF] &nbsp; --+Attack|@{selected|token_name} rolls [$AttackRoll] vs AC. &nbsp; --?[$AttackRoll.Base] -eq 20|Crit &nbsp; --?[$AttackRoll.Base] -eq 1|Fumble &nbsp; --?[$AttackRoll.Total] -ge [$TargetAC.Total]|Hit &nbsp; --+Miss|The attack missed. &nbsp; --^Final| &nbsp; --:Fumble| &nbsp; --+Miss|The attack missed. &nbsp; --^Final| &nbsp; --:Hit| &nbsp; --=Damage|1d8 + @{selected|strength_mod} [STR] &nbsp; --+Hit!|The attack hit @{target|token_name} for [$Damage] piercing damage.&nbsp; &nbsp;--@alter|_target|@{target|token_id} _bar|1 _amount|-[$Damage] --IMake a ;Constitution Save|q;PassFail;Pass or Fail|Pass|Fail --=ToxinP|[[round(4d8/2)]] --=ToxinF|4d8 --?[PassFail] -eq Pass|&gt;Passed! &nbsp; --:Passed!| --+Passed!|@{target|token_name} takes [$ToxinP] poison damage.&nbsp; &nbsp;--@alter|_target|@{target|token_id} _bar|1 _amount|-[$ToxinP] &nbsp; --^Final| --?[PassFail] -eq Fail|&gt;Failed! &nbsp; --:Failed!| --+Failed!|@{target|token_name} takes [$ToxinF] poison damage.&nbsp; &nbsp;--@alter|_target|@{target|token_id} _bar|1 _amount|-[$ToxinF] &nbsp; --^Final| &nbsp; --:Crit| &nbsp; --=Damage|1d8 + @{selected|strength_mod} [STR] + 1d8 [CRIT] &nbsp; --+Critical Hit!|The attack hit @{target|token_name} for [$Damage] slashing damage. &nbsp; --@alter|_target|@{target|token_id} _bar|1 _amount|-[$Damage] --IMake a ;Constitution Save|q;PassFail;Pass or Fail|Pass|Fail --=ToxinP|[[round(4d8/2)]] --=ToxinF|4d8 --?[PassFail] -eq Pass|&gt;Passed! &nbsp; --:Passed!| --+Passed!|@{target|token_name} takes [$ToxinP] poison damage.&nbsp; &nbsp;--@alter|_target|@{target|token_id} _bar|1 _amount|-[$ToxinP] &nbsp; --^Final| --?[PassFail] -eq Fail|&gt;Failed! &nbsp; --:Failed!| --+Failed!|@{target|token_name} takes [$ToxinF] poison damage.&nbsp; &nbsp;--@alter|_target|@{target|token_id} _bar|1 _amount|-[$ToxinF] &nbsp; --^Final| &nbsp; --:Final| }}
1624533116

Edited 1624533133
David M.
Pro
API Scripter
Henry, I haven't tried running your scriptcard, but a quick look at the code makes me think the problem is that you are referencing the result from the information request (the --I button) incorrectly. From the wiki: " The result of each information request will be stored in a string variable matching the “VariableName” parameter for that request." &nbsp; You have a bunch of conditionals for the PassFail variable, but are referencing the variable as [PassFail], when it should be [&amp;PassFail] . The ampersand denotes it is a variable of type "string" and tells the parser how to process the variable.
I tried replacing [PassFail] with [&amp;PassFail] and still got the same result. I replaced the Pass and Fail with [&amp;Pass] or just &amp;Pass but those aren't working either. Is there something I'm missing?
1624536424

Edited 1624536514
Henry,&nbsp; looking at the middle block of code - I don't see a logic path for a failed save.&nbsp; You test for Pass, and if true, jump to the next line.&nbsp; If false, it continues to the next line anyways.&nbsp; You might want something like: --?[&amp;PassFail] -eq Pass|Passed!|Failed! Also, the exclamation points in your labels (Passed!/Failed!) bothers me for some reason. I'm sure it works in ScriptCards, but generally when coding, I keep special characters out of my variables, labels and function names.&nbsp;&nbsp; --IMake a ;Constitution Save|q;PassFail;Pass or Fail|Pass|Fail --=ToxinP|[[round(4d8/2)]] --=ToxinF|4d8 --?[PassFail] -eq Pass|&gt;Passed! &nbsp; --:Passed!| --+Passed!|@{target|token_name} takes [$ToxinP] poison damage.&nbsp; &nbsp;--@alter|_target|@{target|token_id} _bar|1 _amount|-[$ToxinP] &nbsp; --^Final|
That's sorted it, thanks!
1624551382
Chad
Plus
Sheet Author
Is there any known issue with ScriptCard that is making calling of TokenMod behave differently than intended? I'm using this code as a test: --@token-mod|_set rotation#180 _ids [%1%] _report gm|TestCheck-NPC_[%1%] and the script is running but the _ids are completely ignored and only the selected token is impacted. The report comes out and whatever is selected rotates. When I try to use this code: --@token-mod|_ignore-selected _set rotation#180 _ids [%1%] _report gm|TestCheck-NPC_[%1%] TokenMod isn't called at all, nothing is rotated, and the report doesn't come out. So two issues: ignore-selected - The hyphen causes the command to not run at all ids - ids seems to be ignored when called from scriptcards Thanks!&nbsp;&nbsp; Current Version:&nbsp; "-=&gt; ScriptCards - 1.3.1 by Kurt Jaegers Ready &lt;=- Meta Offset : 7426" Full code if you need it: !script {{ --#bodyFontSize|11px --#whisper|gm --#debug|0 --~|array;pagetokens;PageTokens;@{selected|token_id} --~tokenid|array;getfirst;PageTokens --:PCorNPC| --C[*[&amp;tokenid]:npc]|1:&gt;NPC;[&amp;tokenid]|0:&gt;PC;[&amp;tokenid] --~tokenid|array;getnext;PageTokens --?[&amp;tokenid] -ne ArrayError|PCorNPC --X|End of Execution --:PC| --+PC|Setting [*[%1%]:character_name] as a PC ([%1%]) --@token-mod|_set rotation#180 _ids [%1%] _report gm|TestCheck-PC_[%1%] --&lt;|3 --:NPC| --+NPC|Setting [*[%1%]:character_name] as a NPC ([%1%]) --@token-mod|_set rotation#180 _ids [%1%] _report gm|TestCheck-NPC_[%1%] --&lt;| }} Original Post in TokenMod:&nbsp;<a href="https://app.roll20.net/forum/permalink/10187042/" rel="nofollow">https://app.roll20.net/forum/permalink/10187042/</a>
1624552242

Edited 1624552309
David M.
Pro
API Scripter
When troubleshooting dynamically-generated api calls in a scriptcard, I often will output the dynamic text to chat to make sure it is doing what I think it is doing. Take this line for example: --@token-mod|_set rotation#180 _ids [%1%] _report gm|TestCheck-PC_[%1%] Try replacing it with this --+|token-mod _set rotation#180 _ids [%1%] _report gm|TestCheck-PC_[%1%] then copy the chat output into a new macro, add the leading exclamation, and replace the underscores with double dashes. Does the new macro work as expected? Another thing to check is to make sure you have " Players can use --ids" checked in the token-mod settings.