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

Well I have found a way around this, a way to create a "RollTable" without using the RollTable which allows for creating multi-segment roll tables that has multiple data values for each element.  In the example below, it has the FLAVOR of the Imperial Divination (Warhammer Dark Heresy 1e) as well as the Mechanical Effect.  In theory, I suppose it could be multiple levels deep.  Although, the conditionals, get complicated the deeper it goes, especially since I've found that nesting IF....ELSE statements in script cards is quite a nuisance and becomes very difficult to manage. !scriptcard {{ --/| === ScriptCard Layout for Attack Rolls === |\-- --/| === Version 1.0                        === |\-- --/| === Date: 10/15/2022                   === |\-- --/| ===== Roll Queries / Information Lookup =========== |\     --/| Set source token (for avatar image and *S references)      --#sourceToken|@{selected|token_id}     --/| ===== Strings ===========      --/| ===== Numbers ===========     --=DivinationRoll|1d100     --/| ===== Functions ========= --?[$DivinationRoll] -eq 1 |01 --?[$DivinationRoll] -ge 2 -and [$DivinationRoll] -lt 3 |02_03 --?[$DivinationRoll] -ge 4 -and [$DivinationRoll] -lt 7 |04_07 --?[$DivinationRoll] -eq 8 |08 --?[$DivinationRoll] -ge 9 -and [$DivinationRoll] -lt 11 |09_11 --?[$DivinationRoll] -ge 12 -and [$DivinationRoll] -lt 15 |12_15 --?[$DivinationRoll] -ge 16 -and [$DivinationRoll] -lt 18 |16_18 --?[$DivinationRoll] -ge 19 -and [$DivinationRoll] -lt 21 |19_21 --?[$DivinationRoll] -ge 22 -and [$DivinationRoll] -lt 26 |22_26 --?[$DivinationRoll] -ge 27 -and [$DivinationRoll] -lt 30 |27_30 --?[$DivinationRoll] -ge 31 -and [$DivinationRoll] -lt 33 |31_33 --?[$DivinationRoll] -ge 34 -and [$DivinationRoll] -lt 38 |34_38 --?[$DivinationRoll] -ge 39 -and [$DivinationRoll] -lt 42 |39_42 --?[$DivinationRoll] -ge 43 -and [$DivinationRoll] -lt 46 |43_46 --?[$DivinationRoll] -ge 47 -and [$DivinationRoll] -lt 50 |47_50 --?[$DivinationRoll] -ge 51 -and [$DivinationRoll] -lt 54 |51_54 --?[$DivinationRoll] -ge 55 -and [$DivinationRoll] -lt 58 |55_58 --?[$DivinationRoll] -ge 59 -and [$DivinationRoll] -lt 62 |59_62 --?[$DivinationRoll] -ge 63 -and [$DivinationRoll] -lt 66 |63_66 --?[$DivinationRoll] -ge 67 -and [$DivinationRoll] -lt 70 |67_70 --?[$DivinationRoll] -ge 71 -and [$DivinationRoll] -lt 74 |71_74 --?[$DivinationRoll] -ge 75 -and [$DivinationRoll] -lt 79 |75_79 --?[$DivinationRoll] -ge 80 -and [$DivinationRoll] -lt 85 |80_85 --?[$DivinationRoll] -ge 86 -and [$DivinationRoll] -lt 90 |86_90 --?[$DivinationRoll] -ge 91 -and [$DivinationRoll] -lt 94 |91_94 --?[$DivinationRoll] -ge 95 -and [$DivinationRoll] -lt 97 |95_97 --?[$DivinationRoll] -ge 98 -and [$DivinationRoll] -lt 99 |98_99 --?[$DivinationRoll] -eq 100 |100 --:01| --&DisplayFlavor|Mutation without, corruption within. --&DisplayEffect|Begin play with one minor mutation (see p. 334). --=DisplayRoll|0 --^DivinationDone| --:02_03| --&DisplayFlavor|Only the insane have strength enough to prosper. Only those who prosper may judge what is sane. --&DisplayEffect|Begin play with 2 insanity points. --=DisplayRoll|1 --^DivinationDone| --:04_07| --&DisplayFlavor|Sins hidden in the heart turn all to decay. --&DisplayEffect|Begin play with 3 Corruption Points. --=DisplayRoll|1 --^DivinationDone| --:8| --&DisplayFlavor|Innocence is an illusion. --&DisplayEffect| Begin play with 1 Insanity Point and 1 Corruption Point. --=DisplayRoll|1 --^DivinationDone| --:09_11| --&DisplayFlavor|Dark dreams lie upon the heart. --&DisplayEffect|Begin play with 2 Corruption Points. --=DisplayRoll|1 --^DivinationDone| --:12_15| --&DisplayFlavor|The pain of the bullet is ecstasy compared to damnation. --&DisplayEffect|Increase Toughness by +1. --=DisplayRoll|1 --^DivinationDone| --:16_18| --&DisplayFlavor|Kill the alien before it can speak its lies. --&DisplayEffect|Increase Agility by +2. --=DisplayRoll|1 --^DivinationDone| --:19_21| --&DisplayFlavor|Truth is subjective. --&DisplayEffect|Increase Intelligence by +3. Begin play with 3 Corruption Points. --=DisplayRoll|1 --^DivinationDone| --:22_26| --&DisplayFlavor|Know the mutant; kill the mutant. --&DisplayEffect|Increase Perception by +2. --=DisplayRoll|1 --^DivinationDone| --:27_30| --&DisplayFlavor|Even a man who has nothing can still offer his life. --&DisplayEffect|Increase Strength by +2 --=DisplayRoll|1 --^DivinationDone| --:31_33| --&DisplayFlavor|If a job is worth doing it is worth dying for. --&DisplayEffect|Gain the Frenzy talent. --=DisplayRoll|1 --^DivinationDone| --:34_38| --&DisplayFlavor|Only in death does duty end. --&DisplayEffect|Gain 1 Wound. --=DisplayRoll|1 --^DivinationDone| --:39_42| --&DisplayFlavor|A mind without purpose will wander in dark places. --&DisplayEffect|Gain 1 Fate Point. --=DisplayRoll|1 --^DivinationDone| --:43_46| --&DisplayFlavor|There are no civilians in the battle for survival. --&DisplayEffect|Increase Toughness by +2 and gain 1 Wound. --=DisplayRoll|1 --^DivinationDone| --:47_50| --&DisplayFlavor|Violence solves everything. --&DisplayEffect|Increase Weapon Skill by +3. --=DisplayRoll|1 --^DivinationDone| --:51_54| --&DisplayFlavor|To war is human. --&DisplayEffect|Increase Agility by +3. --=DisplayRoll|1 --^DivinationDone| --:55_58| --&DisplayFlavor|Die if you must, but not with your spirit broken. --&DisplayEffect|Increase Willpower by +3. --=DisplayRoll|1 --^DivinationDone| --:59_62| --&DisplayFlavor|The gun is mightier than the sword. --&DisplayEffect|Increase Ballistic Skill by +3. --=DisplayRoll|1 --^DivinationDone| --:63_66| --&DisplayFlavor|Be a boon to your brothers and bane to your enemies. --&DisplayEffect| Increase Fellowship by +3. --=DisplayRoll|1 --^DivinationDone| --:67_70| --&DisplayFlavor|Men must die so that Man endures. --&DisplayEffect|Increase Toughness by +3. --=DisplayRoll|1 --^DivinationDone| --:71_74| --&DisplayFlavor|In the darkness, follow the light of Terra. --&DisplayEffect|Increase Willpower by +3. --=DisplayRoll|1 --^DivinationDone| --:75_79| --&DisplayFlavor|The only true fear is of dying with your duty not done. --&DisplayEffect|Gain 2 Wounds. --=DisplayRoll|1 --^DivinationDone| --:80_85| --&DisplayFlavor|Thought begets Heresy; Heresy begets Retribution. --&DisplayEffect| Increase Strength by +3. --=DisplayRoll|1 --^DivinationDone| --:86_90| --&DisplayFlavor|The wise man learns from the deaths of others. --&DisplayEffect|Increase Intelligence by +3. --=DisplayRoll|1 --^DivinationDone| --:91_94| --&DisplayFlavor|A suspicious mind is a healthy mind. --&DisplayEffect|Increase Perception by +3. --=DisplayRoll|1 --^DivinationDone| --:95_97| --&DisplayFlavor|Trust in your fear. --&DisplayEffect| Increase Agility by +2 and gain 1 Fate Point. --=DisplayRoll|1 --^DivinationDone| --:98_99| --&DisplayFlavor|There is no substitute for zeal. --&DisplayEffect|Increase Toughness and Willpower each by +2. --=DisplayRoll|1 --^DivinationDone| --:100| --&DisplayFlavor|Do not ask why you serve. Only ask how. --&DisplayEffect| Increase Weapon Skill and Ballistic Skill each by +2. --=DisplayRoll|1 --^DivinationDone| --:DivinationDone| --/| TITLE and FORMATTING     --#title|Roll Table :: Divination     --#titlecardbackground|#993333     --#leftsub|1d10     --#rightsub|[$DivinationRoll] --+Flavor:|[&DisplayFlavor] --+Effect:|[&DisplayEffect] }} I wonder if there is a way to have a "template" for the rolltable, and use handouts to store the roll table as a function.  I'll have to play around with it.  The rolltable mechanic in r20 is one of the most neglected feature on this site.  It has the potential to be so much more, but it has no ability to store multiple variables per table row (Array, I guess).  I know a number of attempts have been made to accomplish such.  In any event, this is a great way to create variable, buff tables, stores or handle "randomized" encounter tables and so on. I hope others may find other uses for this.
I'm having immense difficulty figuring things out due to the lack of examples.  I can't wrap my head around queries for example. If I want to ask for input, then display that input as part of a string, should my text look like this: --iInformation|q;variable;question? If I want to use variable  in a string of text, should I put --+You take $variable damage The wiki has a lot of information, but few examples to reverse-engineer to really understand it. 
1666094590

Edited 1666094671
David M.
Pro
API Scripter
Queries are written just like in standard macros, for example ?{prompt|option1,returnValue1|option2,returnValue2} In order to reference a variable, use the following syntax for String variables: [&varName] for Roll variables [$varName] Roll variables have some extra options, called modifiers, which have the form [$varName.modifier] and are described in the wiki here . These modifiers are case-sensitive. Examples:   --=roll|1d20 + 5   --+Total roll inside yellow box formatting|[$roll]   --+Total roll without yellow box formatting|[$roll.Raw]   --+Just the number rolled on the d20 without the plus 5|[$roll.Base] Also, in your example direct output statement I noticed that you are missing the vertical pipe character (  |  ). This character tells the scriptcard parser how to display the text. Text to the left of the pipe (the "tag") is bolded, while text to the right of the pipe (the "content") is not unless specified explicitly using inline formatting . --+TagText|You take [$variable] damage --+|You take [$variable] damage --+You take [$variable] damage| Since I mentioned it, here are a couple examples with inline formatting. In first line below, the format of the "content" portion of the direct output is overwritten to be bold. In the second line, it is bold and uses a red font color. Only the text in between the formatting tags are affected. So in the third line the last word uses regular black unbolded text. Also note how the roll variable text will look different (no yellow box). Inline formatting can be used on either side of the pipe, as in the last example, which turns the TagText into a bright lime green color --+TagText|[b]You take [$variable] damage[/b] --+TagText|[b][#FF0000]You take [$variable] damage[/#] [/b] --+TagText|[b][#FF0000]You take [$variable] damage.[/#] [/b] Ouch! --+ [#AAF845] TagText[/#]|[b][#FF0000]You take [$variable.Raw] damage.[/#] [/b] Ouch!
1666099671
Andrew R.
Pro
Sheet Author
Here's an example from a 13th Age monster: --IScriptCards needs additional information to continue;Click to provide information|q;Nearby;How Many Nearby? It's a String variable, so I use it like this:  --+Targets|Each nearby non-Chaotic creature --%LoopCount|1;[&Nearby];1 -->Nearby| --%|LoopCount I prefer to avoid the usual Macro queries because I can't make them conditional. 
1666101576

Edited 1666101594
David M.
Pro
API Scripter
Good info Andrew. This points out that there are a multiple ways to query for information. Andrews example uses the Information Request  method (which after re-reading your post seems more to what you were asking). The advantage of this as Andrew mentioned is that you can have that query be optional (i.e. only ask the question if certain conditions apply, as shown here ). You can always use a standard query, but note that this will fire off before scriptcards even starts up due to Roll20's order of operations , where queries are processed before the message is sent to chat (and scriptcards starts parsing).  Here's a specific example of the standard query method with variable assignment. A little easier syntax than Information Requests IMO  if you know that you always want to query for information. Otherwise, Andrew's example has you covered :) !script {{ --#title|Standard query example --/QUERY FOR INFO| --=qty|?{How many things?|1|2|3|4|5} --&type|?{What type?|Apple|Orange|Banana} --/CHECK FOR QTY TO CONDITIONALLY PLURALIZE| --?[$qty] -gt 1|&type;+s --/PRINT RESULTS| --+You selected|[$qty] [&type] }}
Okay, I think I probably confused myself, as I was trying to think of scriptcards as a completely different from the standard macro syntax.  I got my scriptcard to work, so thanks to both David M. and Andrew R.! I've only just begun experimenting with scriptcards, so I haven't even scratched the surface of what it can do...  Can't wait to try some other new things!
Already having another problem.  Here's the issue: !scriptcards {{ --#title|Button Example --#leftsub|Thingy --#rightsub|Not Working --/THIS SHOULD PRESENT TWO BUTTONS --+Select A Button|[button:#FFFFFF:#000000]It Worked::DoOnClick[/button] [button:#FF0000:#000000]It Didn't Work::DoOnTwoClick[/button] --X --/THIS IS ONLY SUPPOSED TO OCCUR IF SOMEONE CLICKS THE FIRST BUTTON| --:DoOnClick --+It Worked!| --X --/THIS IS ONLY SUPPOSED TO OCCUR IF SOMEONE CLICKS THE SECOND BUTTON| --:DoOnTwoClick --+|It Didn't Work? --X }} The output is everything, as though the --Xs didn't exist.  How do I display only  the information requested by the button?
1666126874

Edited 1666126903
Kurt J.
Pro
API Scripter
@Jador - You are very close :) A couple of things: All statements must  include a vertical bar character (|), so where you have --X, you need --X|, and the same with the labels: --:DoOnClick| and --:DoOnTwoClick. The only other thing here is that you'll need to user reentrant buttons ([rbutton]...[/rbutton]) instead of normal buttons because you want to resume the same script based on the click. In order to do that, you need to set --#reentrant to a unique value for the execution of the script. Here is the whole thing: !scriptcards {{ --#reentrant|MyReentrantScript[&SendingPlayerID] --#title|Button Example --#leftsub|Thingy --#rightsub|Not Working --/THIS SHOULD PRESENT TWO BUTTONS --+Select A Button|[rbutton:#FFFFFF:#000000]It Worked::DoOnClick[/rbutton] [rbutton:#FF0000:#000000]It Didn't Work::DoOnTwoClick[/rbutton] --X| --/THIS IS ONLY SUPPOSED TO OCCUR IF SOMEONE CLICKS THE FIRST BUTTON| --:DoOnClick| --+It Worked!| --X| --/THIS IS ONLY SUPPOSED TO OCCUR IF SOMEONE CLICKS THE SECOND BUTTON| --:DoOnTwoClick| --+|It Didn't Work? --X| }} Note that in this case, I'm setting #reentrant to "MyReentrantScript" followed by the player ID of the player running it. This is important because technically anyone can run a copy of a script and you don't want them interfering with each other if more than one person is doing it.
Thanks!  I didn't realize the vertical bar was necessary in all statements.  Also, the reentrant buttons are exactly what I was looking for. Ultimately, I want to set up a menu of options so I can display selected information by clicking one button or another, though I think I still have a bit to learn before implementing it in-game. Also, is there a way to put line feeds or carriage returns between buttons so they appear in a column instead of a row?  
1666130705
Kurt J.
Pro
API Scripter
Jador said: Thanks!  I didn't realize the vertical bar was necessary in all statements.  Also, the reentrant buttons are exactly what I was looking for. Ultimately, I want to set up a menu of options so I can display selected information by clicking one button or another, though I think I still have a bit to learn before implementing it in-game. Also, is there a way to put line feeds or carriage returns between buttons so they appear in a column instead of a row?   You can use [BR] in an output line to start a new line.
Heya, I've kinda run into a bit of an issue ScriptCards not displaying information in the chat window correctly (or at all) with the most recent update to my character sheet. I have updated the repeating weapons section of my sheet to include quick attack/damage buttons.  Which allow me to make TEMPLATE character sheets with WEAPON ONE (ATK)/(DMG) buttons that are identical across the duplicated character sheets.  Its the only way I can have character sheet and npc creation not take like 4 hours per npc. (I have OCD). The code for the above section is: <span class="sheet-tdcs"><button type="roll" name="roll_repeating_" title="@{selected|repeating_weapon_$0_wHitRoll}" class="sheet-dice" value="@{selected|repeating_weapon_$0_wHitRoll}">t</button></span> The problem is, when using these quick buttons none of the rolls from the script cards is properly parsed or handled.  I was wondering if I am doing this incorrectly.  The button directly links to the text field where the scriptcards is stored within each of the repeating section rows.  I have tried linking to the buttons individually I've tried using % instead of @... I've tried everything else I can think of.  My next game is on NEXT Tuesday (24th).  And while, I could revert the character sheet back to my previous save, I'd rather not if I can avoid it.
One further question involving calling Roll20 macros from within a scriptcard:  I want to have the aforementioned buttons associated with specific macros which will run when the buttons are clicked, but I can't figure out how to call a macro from the scriptcard. I have a macro called LightningDamage (all it does is query for an amount of damage due to a lightning strike), which I want to call from a button.  What I thought  I should have done was this: !scriptcards {{ --#reentrant|MyReentrantScript[&SendingPlayerID] --#title|Environmental Effect --/THIS SHOULD PRESENT BUTTONS IN A COLUMN --+Select|[BR][c][rbutton:#ffffff:#000000]Lightning::lightning[/rbutton][/c][BR] --X| --/LIGHTNING DAMAGE| --:lightning| --@LightningDamage| --X| }} However, I'm pretty certain that the @LightningDamage (the name of the macro) isn't correct.  I'm just at a loss of how to use the --@ tag to call a macro from my macro list. I also can't find any examples of macro calls from scriptcards.  Am I going about this all wrong?
1666212109

Edited 1666212311
Andrew R.
Pro
Sheet Author
The --@ command calls a Mod , not a Macro. Here's another example from a 13th Age Glorantha monster, the Crimson Bat: --IScriptCards needs additional information to continue;Click to provide information|q;Highest;What is the highest initiative? --=Turn|[&Highest] + 1 --%LoopCount|0;3;1 --=Less|[&LoopCount] * 5 --&Formula|0 --=Initial|[$Turn] - [$Less] --@act|[&Formula] [$Initial] _Crimson Bat --%|LoopCount It calls the act Mod to add custom turns to the Turn Tracker for a monster that has many turns in a round. 
1666212672

Edited 1666292368
Jador
KS Backer
Andrew R. said: The --@ command calls a Mod , not a Macro. Ah.  Then I'm on completely the wrong track.  How do  I call a macro from a scriptcard? Specifically, what I'm trying to do is have a master scriptcard from which I can call other scriptcards.  One issue I've been having is the fact that if there is a query in the scriptcard, the query pops up first.  I want to list a menu for damage types, then once I've chosen a type, enter the amount of damage. Sorry if I'm not understanding something.  I think there's a lot of stuff that I don't know that I don't know. (nested "don't knows" intentional).
Original Post: &nbsp;<a href="https://app.roll20.net/forum/post/9752053/script-scriptcards-my-spiritual-successor-to-powercards/?pageforid=11150596#post-11150596" rel="nofollow">https://app.roll20.net/forum/post/9752053/script-scriptcards-my-spiritual-successor-to-powercards/?pageforid=11150596#post-11150596</a> I want to point out that the code I have works very different on the LIVE version of the game and the Custom Sandbox/Testing Game.&nbsp; Using the buttons works 100% of the time on the Sandbox game and doesnt work at all in the live game.&nbsp; Which is kinda frustrating.&nbsp; Again, advice on what I am doing wrong would be very much appreciated. Thank you again for all the help!&nbsp; This is an AMAZING mod, it completely indulges my OCD and need to have the output be well formatted, as well as removing alot of the rollplay so the party can spend more time roleplaying.&nbsp; Totally Awsome!&nbsp;
1666321049
David M.
Pro
API Scripter
When you say Custom Sandbox game, do you mean over on the Dev server, or just a separate test game on the live server? If the former, know that the Dev server unfortunately doesn't always accurately reflect how things will work on the live server.
The latter, the one that you use to build and test character sheets.&nbsp; I can upload a copy of my sheet files on googledocs so you can see what I mean if you like.&nbsp; I'll do so shortly.
The Link to the flies is found here: <a href="https://drive.google.com/drive/folders/1gG_fZbVpDrhNSPAcXlDJxDiHXXKq4ZPf?usp=sharing" rel="nofollow">https://drive.google.com/drive/folders/1gG_fZbVpDrhNSPAcXlDJxDiHXXKq4ZPf?usp=sharing</a> .&nbsp; I am not using github cause, I have alot of trouble using it.
I'm still having difficulty with calling a scriptcard from another scriptcard.&nbsp; I can't find a way to link one card to a button on another card.&nbsp; In addition, i can't find a way to open a handout from Scriptcards. Is it simply impossible to do these?&nbsp;&nbsp;
1666827614
Kurt J.
Pro
API Scripter
Jador said: I'm still having difficulty with calling a scriptcard from another scriptcard.&nbsp; I can't find a way to link one card to a button on another card.&nbsp; In addition, i can't find a way to open a handout from Scriptcards. Is it simply impossible to do these?&nbsp;&nbsp; The second script would need to be on a macro mule character, and you would use a sheetbutton to call the second script.&nbsp; There is no way for an API to actually open a handout. You can create a button that can be clicked to open a handout (or other object types) but you'll need to know the object ID of the item you want the button to open. See&nbsp; this thread.
1666828430
Andrew R.
Pro
Sheet Author
Jador said: I'm still having difficulty with calling a scriptcard from another scriptcard.&nbsp; I can't find a way to link one card to a button on another card. &nbsp; Can you explain why you would want to do this? If you want to reuse ScriptCards code in multiple places, that’s what a Library is used for, IIRC. I haven’t had to do it myself yet for my 13th Age monsters.&nbsp;
1666895443

Edited 1666895476
Jador
KS Backer
The second script would need to be on a macro mule character, and you would use a sheetbutton to call the second script.&nbsp; There is no way for an API to actually open a handout. You can create a button that can be clicked to open a handout (or other object types) but you'll need to know the object ID of the item you want the button to open. See&nbsp; this thread. Ah.&nbsp; This is pretty much what I feared.&nbsp; I have a list of talents a character can take displayed in a scriptcard, and wanted to link to the handout in which the talents were described.&nbsp; However, it sounds like that's not going to happen. I set up a landing page using Nick Olivo's tutorial ( <a href="https://www.youtube.com/watch?v=et1UOfVE1LA" rel="nofollow">https://www.youtube.com/watch?v=et1UOfVE1LA</a> ) that links to handouts which describe locations.&nbsp; I was hoping I could do that with scriptcards, as the default template is a little klunky and not very attractive. As far as calling a second script, I was unable to write a script which would list a number of damage types, and then ask for information depending on the type of damage.&nbsp; Lightning, for instance, does immediate damage, but fire and acid do damage over time.&nbsp; Since there's no need to ask for lightning duration, I was hoping to have separate scripts for each damage type, each script to be called from a master script which lists damage types as clickable buttons. I tried doing it all in one script, but unfortunately, the query always comes before the rest of the scriptcard is run, and thus I would have to enter values before selecting the damage type, duration, special effects, etcetera. This is of course doable, but it feels like a kludge.
Jador said: The second script would need to be on a macro mule character, and you would use a sheetbutton to call the second script.&nbsp; There is no way for an API to actually open a handout. You can create a button that can be clicked to open a handout (or other object types) but you'll need to know the object ID of the item you want the button to open. See&nbsp; this thread. Ah.&nbsp; This is pretty much what I feared.&nbsp; I have a list of talents a character can take displayed in a scriptcard, and wanted to link to the handout in which the talents were described.&nbsp; However, it sounds like that's not going to happen. I set up a landing page using Nick Olivo's tutorial ( <a href="https://www.youtube.com/watch?v=et1UOfVE1LA" rel="nofollow">https://www.youtube.com/watch?v=et1UOfVE1LA</a> ) that links to handouts which describe locations.&nbsp; I was hoping I could do that with scriptcards, as the default template is a little klunky and not very attractive. As far as calling a second script, I was unable to write a script which would list a number of damage types, and then ask for information depending on the type of damage.&nbsp; Lightning, for instance, does immediate damage, but fire and acid do damage over time.&nbsp; Since there's no need to ask for lightning duration, I was hoping to have separate scripts for each damage type, each script to be called from a master script which lists damage types as clickable buttons. I tried doing it all in one script, but unfortunately, the query always comes before the rest of the scriptcard is run, and thus I would have to enter values before selecting the damage type, duration, special effects, etcetera. This is of course doable, but it feels like a kludge. I believe you can create a button within ScriptCards that, when clicked in the chat interface, would open the Handout. As for running a second-level ScriptCard--you can accomplish this in a couple ways: Create a button with a named label for damage types, and have the button execute a macro, which can be one on a Mule character or specific to the individual PC. Make use of reentry buttons.
I believe you can create a button within ScriptCards that, when clicked in the chat interface, would open the Handout. As for running a second-level ScriptCard--you can accomplish this in a couple ways: Create a button with a named label for damage types, and have the button execute a macro, which can be one on a Mule character or specific to the individual PC. Make use of reentry buttons. I thought it was possible, but there is no command to open a handout.&nbsp; I might be able to do something with object ids, but aside from that, I think it's going to be a bizarre workaround. Not sure what mule characters are, though I'm taking a closer look at reentry buttons.
1666912643
David M.
Pro
API Scripter
A mule character (often called a macro mule ) is a character sheet whose only purpose is to store abilities. Advantages of these are (1) they are portable to other games, (2) since they are abilities and not collections macros, they will not suffer from reversion of html replacement characters on re-opening like collections macros do.&nbsp;
Jador said: I thought it was possible, but there is no command to open a handout.&nbsp; I might be able to do something with object ids, but aside from that, I think it's going to be a bizarre workaround. --+|[button]Click Here to Open Metamagic Lists::<a href="http://journal.roll20.net/handout/-NFQ60Dgplvl_ZLzKd6s[/button]" rel="nofollow">http://journal.roll20.net/handout/-NFQ60Dgplvl_ZLzKd6s[/button]</a> That right there creates a button for me that opens the handout for Metamagic.&nbsp; &nbsp;It's pretty easy to do.
Create a button with a named label for damage types, and have the button execute a macro, which can be one on a Mule character or specific to the individual PC Tried creating a macro mule character sheet, with Abilities containing scriptcards which each display a different kind of damage, each with a query for the appropriate amount of damage, duration, or whatever other factor is involved. However, even if they are in completely separate scriptcards, way down at the bottom of the card, even after several --+ display lines and [rbuttons], the query pops up immediately &nbsp;upon running the scriptcard. Is there a way to make the scriptcard wait until I have chosen a damage type before &nbsp;asking for the amount of damage and duration of damage over time, or is it impossible to make a script that waits for a button click before asking for information?
--+|[button]Click Here to Open Metamagic Lists::<a href="http://journal.roll20.net/handout/-NFQ60Dgplvl_ZLzKd6s[/button]" rel="nofollow">http://journal.roll20.net/handout/-NFQ60Dgplvl_ZLzKd6s[/button]</a> That right there creates a button for me that opens the handout for Metamagic.&nbsp; &nbsp;It's pretty easy to do. I got this to work by copy/pasting the exact text above and replacing your text and link with my own.&nbsp; It wouldn't work with an [rbutton], so I'm assuming [rbutton]s can't do links. This isn't the first time I've had this difficulty.&nbsp; I've typed scriptcards in, and they don't work (yes, I triple-check the syntax), but if I copy and paste another scriptcard, then change the parameters, it works fine.&nbsp; I'm assuming this is roll20, and not scriptcards, as it's a really weird thing.
1667078872
Andrew R.
Pro
Sheet Author
Jador said: Is there a way to make the scriptcard wait until I have chosen a damage type before &nbsp;asking for the amount of damage and duration of damage over time, or is it impossible to make a script that waits for a button click before asking for information? Yes, use the --i command instead of the roll query.&nbsp;
Here's the script I'm having difficulty with: !scriptcards {{ --#whisper|self --#title|Damage Types --#rightsub|Select Damage Type --#leftsub|Please --/THIS IS WHERE THE BUTTONS SHOULD BE DISPLAYED --+[c]Select A Topic[/c]|[BR][c][rbutton:#FFFFFF:#bb0000]Acid Damage::acid[/rbutton] [BR][rbutton:#000000:#00CDFF]Lightning Damage::lightning[/rbutton][BR][rbutton:#000000:#FE8B01]Fire Damage::fire[/rbutton][BR][rbutton:#000000:#3DAD02]Sonic Damage::sonic[/rbutton][br][rbutton:#000000:#aaaaaa]Radiant Damage::radiant[/rbutton][BR][rbutton:#000000:#cccccc]Unholy Damage::unholy[/rbutton][BR][rbutton:#000000:#eeeeee]Other Damage Type::other[/rbutton][/c] --X| --/THIS SHOULD RUN IF ACID DAMAGE IS CHOSEN --:|acid --[sheetbutton]Acid Damage::MacroMule::AcidDamage[/sheetbutton] --X| --/THIS SHOULD RUN IF LIGHTNING DAMAGE IS CHOSEN --:|lightning --[sheetbutton]Lightning Damage::MacroMule::LightningDamage[/sheetbutton[ --X| }} I've tried all manner of combinations, but I can't get it to work.&nbsp; I'm obviously doing something wrong, but I don't know what. I've also tried this: !scriptcards {{ --#whisper|self --#title|Damage Types --#rightsub|Select Damage Type --#leftsub|Please --/THIS IS WHERE THE BUTTONS SHOULD BE DISPLAYED --+[c]Select A Topic[/c]|[BR][c][rbutton:#FFFFFF:#bb0000]Acid Damage::acid[/rbutton] [BR][rbutton:#000000:#00CDFF]Lightning Damage::lightning[/rbutton][BR][rbutton:#000000:#FE8B01]Fire Damage::fire[/rbutton][BR][rbutton:#000000:#3DAD02]Sonic Damage::sonic[/rbutton][br][rbutton:#000000:#aaaaaa]Radiant Damage::radiant[/rbutton][BR][rbutton:#000000:#cccccc]Unholy Damage::unholy[/rbutton][BR][rbutton:#000000:#eeeeee]Other Damage Type::other[/rbutton][/c] --X| --:|acid --iAcid Damage;Click for Damage|q;aciddamage;How Much Damage? --+Characters take [$aciddamage] Acid Damage --X| --:|lightning --iLightning Damage;Click for Damage|q;lightningdamage;How Much Damage? --+Characters take [$lightningdamage] Lightning Damage --X| }} Neither works.
1667143903

Edited 1667144075
@Jador - just at first glance, in your first version: 1) you must have the command at top (I usually put it first) --#reentrant|SOMETHING (I use @{selected|token_id}) to use reentrant buttons; 2) your last sheetbutton has two left brackets instead of being enclosed; 3) in both versions the procedures require the name of the procedure to be between the : and the | or it won't be recognized. (e.g.&nbsp; --:Procedure|&nbsp; )&nbsp;
Aha!&nbsp; Other than my stupid user errors (the --:|label and [ which should have been ]), I got it working! Thank you all for your patience!&nbsp; This has been rather frustrating, and despite my lack of experience in coding, you've all helped me immensely!&nbsp;&nbsp; Incidentally, here's the final version of my script, which both works, and allows me to expand upon it using my MacroMule character sheet actions. !scriptcards {{ --#reentrant|@{selected|token_id} --#whisper|self --#title|Damage Types --#rightsub|Select Damage Type --#leftsub|Please --/BUTTON MENU - Acid, Cold, Fire, Force, Lightning, Necrotic, Poison, Psychic, Sonic, Radiant, etc (TBA) --+[c]Select A Topic[/c]|[c][sheetbutton:#000000:#2ECC71]Acid Damage::MacroMule::AcidDamage[/sheetbutton][br][sheetbutton:#FFFFFF:#85C1E9]Lightning Damage::MacroMule::LightningDamage[/sheetbutton][br][sheetbutton:#FFFFFF:#BA4A00]Fire Damage::MacroMule::FireDamage[/sheetbutton][/c] --X| }} Again, thank you all!
I have several questions small questions, First, I have code that is using r20's roll queries and want to switch to using script cards version.&nbsp; Is it as straight forward as just swapping the code?&nbsp; Or would it require an entire rebuild? Second, I'm running into issues with fairly complex logic, Nested if statements.&nbsp; The only way I can see to build them is having combersome multipart conditionals like isRanged = true AND isBasicWeapon = true AND isACCURATE = true AND isAimAction &gt;= y THEN do x and proceed with all of the other options.&nbsp; Problem is when I try building it like that... nothing happens.&nbsp; Which is party of the reason why I want to switch to the script card's query so I can simply not prompt the player for aiming.. cause... well you don't aim melee weapons. Third, I've been reading this thread when talking about linking to handouts and my question is, does the URL of the handouts change if imported to the game through the transmog. Finally, I didn't really get much of an answer to my last question regarding using the script cards code directly from a token action by means of an intermediary button bar.&nbsp; It works on the sheet creator sandbox (not dev server).&nbsp; But it doesn't work in the live game.&nbsp; I mean maybe this is something that I should bring up in a more generalize forum if the two aren't working identically, then its not a good tool to create character sheets, right?&nbsp; So, thoughts or advice on this would be appreciated.&nbsp; While it may not seem like much, its actually kinda huge.&nbsp; I mean, as the person running the game opening and closing all the character sheets every time i want to make a roll is a bit silly--at least for my rather extreme OCD. Real final... I positive this hasnt been said enough cause well, enough isn't possible with a mod like this...&nbsp; This is hands down one of the best API I've ever used, it builds in elements that should honestly be part of the core for making roll templates.&nbsp; In short, this is what roll templates should be.&nbsp; Infinfinately customizable, able to build and make custom rolls, dynamically alter those rolls based on whatever condition you desire, manipulate the roll rolls, modifiers, variables and everything!&nbsp; If I had spare money I would contribute, and when I do have some spare I 100% will be doing so.&nbsp; Please, keep it up.&nbsp; As someone with rather impressive ocd and wants my rolls to look all nice and pretty AND who likes to hard pass on the Roll Play so we can focus on the RolePlay of a game... Just yes!
@Jador - we have all gone through the oops stage and some (especially me) still make such mistakes.&nbsp; Part of the learning process. @Toby - I know of no way to switch to scriptcards without at least a partial rewrite.&nbsp; I went from roll20 to powercards to scriptcards and did several rewrites in the process as scriptcards has added more features.&nbsp; Each time though there was some crossover so a total rewrite wasn't always necessary. Nested statements are no longer an issue with scriptcards given the case statement, the conditional statement along with the [ | ] multiple inclusion instructions and other features of scriptcards.&nbsp;&nbsp; I am not sure about the url of handouts and defer that to others.&nbsp;&nbsp; As to the token action, I use scriptcards with spell and ability mules for the players and myself.&nbsp; Rarely does a player have to make more than a keystroke or two to activate a spell or ability. &nbsp;(In addition to the fantastic programming of scriptcards Kurt (author) and many experienced users are available to help with design which is as invaluable as the program itself.)&nbsp;
Michael C. said: As to the token action, I use scriptcards with spell and ability mules for the players and myself.&nbsp; Rarely does a player have to make more than a keystroke or two to activate a spell or ability. I'm not sure what you mean here?&nbsp; Ability mules?&nbsp; What I am trying to do is be able to create templates of npcs which have the token buttons pre-set up, and all i need to do is click the check box to show or hide what abilities such as skill tests, weapon atk/dam, pskyer powers or even just straight ability rolls.&nbsp; This includes having actions set for weapon repeating_$number_dam[or atk].&nbsp; The last one being what isnt working at all.
1667228072
Kraynic
Pro
Sheet Author
Toby said: Third, I've been reading this thread when talking about linking to handouts and my question is, does the URL of the handouts change if imported to the game through the transmog. No.&nbsp; The unique ID of a journal entry stays the same when you use the transmogrifier to move things from one game to another.&nbsp; That is why it will ask if you want to overwrite the original if you are attempting to move a journal entry into a game where it already exists.&nbsp; However, if you use the duplicate function, that creates a new one with a different unique ID, and the copy will have a different url.
Kurt, in my game yesterday.... my shop script cards caused and error and did not work.... the only thing that changed from my last session was that I updated my scriptcard api to the latest and greatest from the github.... I'm not sure if something in the new script that changed causing my card not to work or if I need to change my card to reflect the changes that were made.... Below is the error that roll20 showed me and below that is the code of the script card I was using.... Hopefully, It won't be to complicated to resolve on my end... !scriptcard {{ &nbsp; --#debug|1 &nbsp; --#title|?{Name of Shop?|} &nbsp; --#titlecardbackground|#606c9b &nbsp; --#leftsub|Adventurer Shop &nbsp; --#bodyFontSize|11px &nbsp; &nbsp; --DISPLAY IMAGE| &nbsp; --+|[&amp;Image] &nbsp; --+|[img]<a href="https://i.pinimg.com/originals/48/e9/51/48e951aeca534599fb39d8fdc02519b6.jpg[/img]" rel="nofollow">https://i.pinimg.com/originals/48/e9/51/48e951aeca534599fb39d8fdc02519b6.jpg[/img]</a> &nbsp; &nbsp; &nbsp; --/| BASED ON SELECTED SETTLEMENT WILL DETERMINE WHICH TABLES TO ROLL &nbsp; --/Determine Settlement| &nbsp;&nbsp;&nbsp; --&amp;Settlement|?{What Size Settlement?|Thorp|Hamlet|Village|Small Town|Large Town|Small City|Large City} &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=&amp;Population;20-80|Hamlet:=&amp;Population;81-400|Village:=&amp;Population;401-900|Small Town:=&amp;Population;901-2K|Large Town:=&amp;Population;2k-5K|Small City:=&amp;Population;5k-12K|Large City:=&amp;Population;12k-25K &nbsp; &nbsp; --:Population| &nbsp;&nbsp;&nbsp; --PopSize|[&amp;Settlement] &nbsp;&nbsp;&nbsp; --=PopSize|[%1%] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Thorp"|&amp;Pop;(20-80) &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Hamlet"|&amp;Pop;(81-400) &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Village"|&amp;Pop;(401-900) &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Small Town"|&amp;Pop;(901-2K) &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Large Town"|&amp;Pop;(2k-5K) &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Small City"|&amp;Pop;(5k-12K) &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Large City"|&amp;Pop;(12k-25K) &nbsp; --:EndPopulation| &nbsp; &nbsp; --DISCRIPTION &amp; SETTLEMENT SIZE| &nbsp; &nbsp; --&amp;Discription|A typical adventurer shop, usually located near monster infested areas and dungeons. They carry the standard supplies, including rations, torches, oil, sacks, useful tools and some basic weapons and armor. &nbsp; --+|[i][b][&amp;Discription][/b][/i] &nbsp; --+Settlement|[&amp;Settlement] [r][b]Population[/b] [&amp;Pop][/r] &nbsp; &nbsp; --:Adventure Shop|======================================================================================================= &nbsp;&nbsp;&nbsp; --Goods&amp;Services| &nbsp;&nbsp;&nbsp; --Buy|[&amp;Settlement] &nbsp;&nbsp;&nbsp; --=Buy|[%1%] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Thorp"|&amp;Buy;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]1 cp[/i], [b]Salt (1lb.)[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Hamlet"|&amp;Buy;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]1 cp[/i], [b]Salt (1lb.)[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Village"|&amp;Buy;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]1 cp[/i], [b]Salt (1lb.)[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Small Town"|&amp;Buy;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]1 cp[/i], [b]Salt (1lb.)[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Large Town"|&amp;Buy;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]1 cp[/i], [b]Salt (1lb.)[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Small City"|&amp;Buy;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]1 cp[/i], [b]Salt (1lb.)[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Large City"|&amp;Buy;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]1 cp[/i], [b]Salt (1lb.)[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --:EndGoods&amp;Services| &nbsp;&nbsp;&nbsp; --Sell|[&amp;Settlement] &nbsp;&nbsp;&nbsp; --=Sell|[%1%] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Thorp"|&amp;Sell;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]2 cp[/i], [b]Salt (1lb.)[/b] [i]5 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Hamlet"|&amp;Sell;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]2 cp[/i], [b]Salt (1lb.)[/b] [i]5 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Village"|&amp;Sell;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]2 cp[/i], [b]Salt (1lb.)[/b] [i]5 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Small Town"|&amp;Sell;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]2 cp[/i], [b]Salt (1lb.)[/b] [i]5 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Large Town"|&amp;Sell;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]2 cp[/i], [b]Salt (1lb.)[/b] [i]5 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Small City"|&amp;Sell;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]2 cp[/i], [b]Salt (1lb.)[/b] [i]5 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Large City"|&amp;Sell;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]2 cp[/i], [b]Salt (1lb.)[/b] [i]5 cp[/i] &nbsp;&nbsp;&nbsp; --:EndGoods&amp;Services| &nbsp;&nbsp;&nbsp; --Service|[&amp;Settlement] &nbsp;&nbsp;&nbsp; --=Service|[%1%] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Thorp"|&amp;Service;[b]Laundry[/b] [i]1 sp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Hamlet"|&amp;Service;[b]Laundry[/b] [i]1 sp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Village"|&amp;Service;[b]Laundry[/b] [i]1 sp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Small Town"|&amp;Service;[b]Laundry[/b] [i]1 sp[/i], [b]Messenger[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Large Town"|&amp;Service;[b]Laundry[/b] [i]1 sp[/i], [b]Messenger[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Small City"|&amp;Service;[b]Laundry[/b] [i]1 sp[/i], [b]Messenger[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Large City"|&amp;Service;[b]Laundry[/b] [i]1 sp[/i], [b]Messenger[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --:EndGoods&amp;Services| &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; --AlwaysAvailable|[&amp;Settlement] &nbsp; --=AlwaysAvailable|[%1%] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Thorp"|&amp;AlwaysAvailable;[b]([=1d4])[/b] Bedrolls [b]1 gp[/b], [b]([=2d4])[/b] Blankets [b]5 sp[/b], [b]([=1d4]) doz.[/b] Candles [b]1 cp[/b], [b]([=2d4])[/b] Mess Kits [b]2 sp[/b], [b]([=3d6])[/b] Sacks [b]1 cp[/b], [b]([=4d6])[/b] Tinderbox [b]5 sp[/b], [b]([=2d4])[/b] Waterskins [b]2 sp[/b] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Hamlet"|&amp;AlwaysAvailable;[b]([=1d4])[/b] Bedrolls [b]1 gp[/b], [b]([=2d4])[/b] Blankets [b]5 sp[/b], [b]([=1d4]) doz.[/b] Candles [b]1 cp[/b], [b]([=2d4])[/b] Mess Kits [b]2 sp[/b], [b]([=3d6])[/b] Sacks [b]1 cp[/b], [b]([=4d6])[/b] Tinderbox [b]5 sp[/b], [b]([=2d4])[/b] Waterskins [b]2 sp[/b] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Village"|&amp;AlwaysAvailable;[b]([=1d4])[/b] Bedrolls [b]1 gp[/b], [b]([=2d4])[/b] Blankets [b]5 sp[/b], [b]([=1d4]) doz.[/b] Candles [b]1 cp[/b], [b]([=2d4])[/b] Mess Kits [b]2 sp[/b], [b]([=3d6])[/b] Sacks [b]1 cp[/b], [b]([=4d6])[/b] Tinderbox [b]5 sp[/b], [b]([=2d4])[/b] Waterskins [b]2 sp[/b] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Small Town"|&amp;AlwaysAvailable;[b]([=1d4])[/b] Bedrolls [b]1 gp[/b], [b]([=2d4])[/b] Blankets [b]5 sp[/b], [b]([=1d4]) doz.[/b] Candles [b]1 cp[/b], [b]([=2d4])[/b] Mess Kits [b]2 sp[/b], [b]([=3d6])[/b] Sacks [b]1 cp[/b], [b]([=4d6])[/b] Tinderbox [b]5 sp[/b], [b]([=2d4])[/b] Waterskins [b]2 sp[/b] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Large Town"|&amp;AlwaysAvailable;[b]([=1d4])[/b] Bedrolls [b]1 gp[/b], [b]([=2d4])[/b] Blankets [b]5 sp[/b], [b]([=1d4]) doz.[/b] Candles [b]1 cp[/b], [b]([=2d4])[/b] Mess Kits [b]2 sp[/b], [b]([=3d6])[/b] Sacks [b]1 cp[/b], [b]([=4d6])[/b] Tinderbox [b]5 sp[/b], [b]([=2d4])[/b] Waterskins [b]2 sp[/b] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Small City"|&amp;AlwaysAvailable;[b]([=1d4])[/b] Bedrolls [b]1 gp[/b], [b]([=2d4])[/b] Blankets [b]5 sp[/b], [b]([=1d4]) doz.[/b] Candles [b]1 cp[/b], [b]([=2d4])[/b] Mess Kits [b]2 sp[/b], [b]([=3d6])[/b] Sacks [b]1 cp[/b], [b]([=4d6])[/b] Tinderbox [b]5 sp[/b], [b]([=2d4])[/b] Waterskins [b]2 sp[/b] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Large City"|&amp;AlwaysAvailable;[b]([=1d4])[/b] Bedrolls [b]1 gp[/b], [b]([=2d4])[/b] Blankets [b]5 sp[/b], [b]([=1d4]) doz.[/b] Candles [b]1 cp[/b], [b]([=2d4])[/b] Mess Kits [b]2 sp[/b], [b]([=3d6])[/b] Sacks [b]1 cp[/b], [b]([=4d6])[/b] Tinderbox [b]5 sp[/b], [b]([=2d4])[/b] Waterskins [b]2 sp[/b] &nbsp; --:EndAlwaysAvailable| &nbsp; &nbsp; &nbsp; --/| SHOP OUTPUT DATA FOR BLACKSMITH. GOODS, SERVICES &amp; ALWAYS AVAILABLE &nbsp; --:SHOPOUTPUT| &nbsp;&nbsp;&nbsp; --+|[c]💰 [b] Buy Trade Goods[/b] 💰[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;Buy] &nbsp;&nbsp;&nbsp; --+|[c]💰 [b] Sell Trade Goods[/b] 💰[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;Sell] &nbsp;&nbsp;&nbsp; --+|[c]🛎️ [b]Services[/b] 🛎️[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;Service] &nbsp;&nbsp;&nbsp; --+|[c]‼️ [b]Always Available[/b] ‼️[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;AlwaysAvailable] &nbsp; --/| BEGIN TOOLS, WEAPONS, ARMOR, GEAR SECTION &nbsp; --:ENUMERATE TOOL DESCRIPTIONS1|=============================================================================================== &nbsp;&nbsp;&nbsp; --&amp;item1|Playing card set [b]5 sp[/b] &nbsp;&nbsp;&nbsp; --&amp;item2|Cook’s utensils [b]2 gp[/b] &nbsp;&nbsp;&nbsp; --&amp;item3|Leatherworker’s tools&nbsp;&nbsp;&nbsp; [b]5 gp[/b] &nbsp;&nbsp;&nbsp; --&amp;item4|Carpenter’s tools [b]10 gp[/b] &nbsp;&nbsp;&nbsp; --&amp;item5|Woodcarver’s tools [b]2 gp[/b] &nbsp;&nbsp;&nbsp; --&amp;item6|Weaver’s tools[b]2 gp[/b] &nbsp;&nbsp;&nbsp; --&amp;item7|Cobbler’s tools [b]8 gp[/b] &nbsp;&nbsp;&nbsp; --&amp;item8|Glassblower’s tools [b]30 gp[/b]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item9|Herbalism kit[b]8 gp[/b]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item10|Brewer’s supplies [b]20 gp[/b] &nbsp;&nbsp;&nbsp; --&amp;item11|Mason’s tools [b]10 gp[/b]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item12|Painter’s supplies [b]10 gp[/b]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item13|Potter’s tools [b]10 gp[/b]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item14|Smith’s tools [b]20 gp[/b]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item15|Calligrapher's supplies [b]10 gp[/b] &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item16|Alchemist’s supplies [b]50 gp[/b]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item17|Cartographer’s tools [b]20 gp[/b]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item18|Dice set[b]2 sp[/b] &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item19|Jeweler’s tools [b]25 gp[/b]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item20|Tinker’s tools [b]50 gp[/b] &nbsp;&nbsp;&nbsp; &nbsp; --=numUniqueTypes|20 &nbsp; --:INITIALIZE TOOL COUNTS| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[&amp;LoopCounter]|0 &nbsp; --%| &nbsp; --:LOOP THROUGH numRolls TO START ADDING ITEMS &nbsp; --=numRolls1|2 &nbsp; --=numRolls2|2 &nbsp; --=numRolls3|3 &nbsp; --=numRolls4|3 &nbsp; --=numRolls5|4 &nbsp; --=numRolls6|5 &nbsp; --=numRolls7|6 &nbsp; --=numRolls|0 &nbsp; --C[&amp;Settlement]|Thorp:=numRolls;[$numRolls1.Raw]|Hamlet:=numRolls;[$numRolls2.Raw]|Village:=numRolls;[$numRolls3.Raw]|Small Town:=numRolls;[$numRolls4.Raw]|Large Town:=numRolls;[$numRolls5.Raw]|Small City:=numRolls;[$numRolls6.Raw]|Large City:=numRolls;[$numRolls7.Raw] &nbsp; --%LoopCounter|1;[$numRolls.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R1|1d1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R2|1d2 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R3|1d3 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R4|1d4 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R5|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll1|1d7 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll2|1d12 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll3|1d20 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --:NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=MatRoll;[$MatRoll1.Raw]|Hamlet:=MatRoll;[$MatRoll1.Raw]|Village:=MatRoll;[$MatRoll1.Raw]|Small Town:=MatRoll;[$MatRoll2.Raw]|Large Town:=MatRoll;[$MatRoll2.Raw]|Small City:=MatRoll;[$MatRoll3.Raw]|Large City:=MatRoll;[$MatRoll3.Raw] &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=R5;[$R1.Raw]|Hamlet:=R5;[$R1.Raw]|Village:=R5;[$R2.Raw]|Small Town:=R5;[$R2.Raw]|Large Town:=R5;[$R2.Raw]|Small City:=R5;[$R2.Raw]|Large City:=R5;[$R2.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;AddTools|[$MatRoll.Raw];[$R5.Raw] &nbsp;&nbsp;&nbsp; --%| &nbsp; &nbsp; --:BUILD COMMA-SEPARATED LIST| &nbsp; --&amp;displayToolString| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --?[$count[&amp;LoopCounter]] -gt 0|[ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&amp;displayToolString|+&nbsp; [b]([$count[&amp;LoopCounter].Raw])[/b] [&amp;item[&amp;LoopCounter]], &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --]| &nbsp; --%| &nbsp; --:CLEANUP TRAILING COMMA IN THE LIST STRING &nbsp; --~stringLength|string;length;[&amp;displayToolString] &nbsp; --=numCharsToKeep|[$stringLength] - 1 &nbsp; --~displayToolString|string;substring;1;[$numCharsToKeep];[&amp;displayToolString] &nbsp; --:ENUMERATE WEAPON DESCRIPTIONS1|==================================================================================================&nbsp;&nbsp;&nbsp; &nbsp; --&amp;item1|Club [b]1 sp[/b] &nbsp; --&amp;item2|Sling [b]1 sp[/b] &nbsp; --&amp;item3|Dagger [b]2 gp[/b] &nbsp; --&amp;item4|Shortbow [b]25 gp[/b] &nbsp; --&amp;item5|Spear [b]1 gp[/b] &nbsp; --&amp;item6|Longsword [b]15 gp[/b] &nbsp; --&amp;item7|Shortsword [b]10 gp[/b] &nbsp; --&amp;item8|Sickle [b]1 gp[/b] &nbsp; --&amp;item9|Blowgun [b]10 gp[/b] &nbsp; --&amp;item10|Handaxe [b]5 gp[/b] &nbsp; --&amp;item11|Longbow [b]50 gp[/b] &nbsp; --&amp;item12|Maul [b]10 gp[/b] &nbsp; --&amp;item13|Javelin [b]5 sp[/b] &nbsp; --&amp;item14|Net [b]1 gp[/b] &nbsp; --&amp;item15|Crossbow, heavy [b]50 gp[/b] &nbsp; --&amp;item16|Scimitar [b]25 gp[/b] &nbsp; --&amp;item17|Flail [b]10 gp[/b] &nbsp; --&amp;item18|Trident [b]5 gp[/b] &nbsp; --&amp;item19|War pick [b]5 gp[/b] &nbsp; --&amp;item20|Glaive [b]20 gp[/b] &nbsp; --&amp;item21|Whip [b]2 gp[/b] &nbsp; --&amp;item22|Rapier [b]25 gp[/b] &nbsp; --&amp;item23|Crossbow, hand [b]75 gp[/b] &nbsp; --&amp;item24|Battleaxe [b]10 gp[/b] &nbsp; --&amp;item25|Halberd [b]20 gp[/b] &nbsp; --&amp;item26|Broad Sword [b]20 gp[/b] &nbsp; --&amp;item27|Mace [b]5 gp[/b] &nbsp; --&amp;item28|Warhammer [b]15 gp[/b] &nbsp; --&amp;item29|Pike [b]5 gp[/b] &nbsp; --&amp;item30|Greatclub [b]2 sp[/b] &nbsp; --&amp;item31|Morningstar [b]15 gp[/b] &nbsp; --&amp;item32|Bastard Sword [b]15 gp[/b] &nbsp; --&amp;item33|Crossbow, Light Repeating [b]125 gp[/b] &nbsp; --&amp;item34|Quarterstaff [b]2 sp[/b] &nbsp; --&amp;item35|Dagger, boot-toe [b]15 gp[/b] &nbsp; --&amp;item36|Greataxe [b]30 gp[/b] &nbsp; --&amp;item37|Gauntlet [b]6 gp[/b] &nbsp; --&amp;item38|Great Bow [b]100 gp[/b] &nbsp; --&amp;item39|Lance [b]10 gp[/b] &nbsp; --=numUniqueTypes|39 &nbsp; --^INITIALIZE WEAPON COUNTS| &nbsp; &nbsp; --:INITIALIZE WEAPON COUNTS| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[&amp;LoopCounter]|0 &nbsp; --%| &nbsp; --:LOOP THROUGH numRolls TO START ADDING ITEMS &nbsp; --=numRolls1|3 &nbsp; --=numRolls2|4 &nbsp; --=numRolls3|6 &nbsp; --=numRolls4|8 &nbsp; --=numRolls5|9 &nbsp; --=numRolls6|10 &nbsp; --=numRolls7|12 &nbsp; --=numRolls|0 &nbsp; --C[&amp;Settlement]|Thorp:=numRolls;[$numRolls1.Raw]|Hamlet:=numRolls;[$numRolls2.Raw]|Village:=numRolls;[$numRolls3.Raw]|Small Town:=numRolls;[$numRolls4.Raw]|Large Town:=numRolls;[$numRolls5.Raw]|Small City:=numRolls;[$numRolls6.Raw]|Large City:=numRolls;[$numRolls7.Raw] &nbsp; --%LoopCounter|1;[$numRolls.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R1|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R2|1d6 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R3|1d8 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R4|1d8 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R5|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll1|1d15 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll2|1d20 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll3|1d39 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --:NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=MatRoll;[$MatRoll1.Raw]|Hamlet:=MatRoll;[$MatRoll1.Raw]|Village:=MatRoll;[$MatRoll1.Raw]|Small Town:=MatRoll;[$MatRoll2.Raw]|Large Town:=MatRoll;[$MatRoll2.Raw]|Small City:=MatRoll;[$MatRoll3.Raw]|Large City:=MatRoll;[$MatRoll3.Raw] &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=R5;[$R1.Raw]|Hamlet:=R5;[$R1.Raw]|Village:=R5;[$R2.Raw]|Small Town:=R5;[$R2.Raw]|Large Town:=R5;[$R2.Raw]|Small City:=R5;[$R2.Raw]|Large City:=R5;[$R2.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;AddWeapons|[$MatRoll.Raw];[$R5.Raw] &nbsp;&nbsp;&nbsp; --%| &nbsp; &nbsp; --:BUILD COMMA-SEPARATED LIST| &nbsp; --&amp;displayWeaponString| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --?[$count[&amp;LoopCounter]] -gt 0|[ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&amp;displayWeaponString|+&nbsp; [b]([$count[&amp;LoopCounter].Raw])[/b] [&amp;item[&amp;LoopCounter]], &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --]| &nbsp; --%| &nbsp; --:CLEANUP TRAILING COMMA IN THE LIST STRING &nbsp; --~stringLength|string;length;[&amp;displayWeaponString] &nbsp; --=numCharsToKeep|[$stringLength] - 1 &nbsp; --~displayWeaponString|string;substring;1;[$numCharsToKeep];[&amp;displayWeaponString] &nbsp; &nbsp; --:ENUMERATE AMMO DESCRIPTIONS|=================================================================================================== &nbsp; --&amp;item1|Bullets, Sling Stone (20) [b]4 cp[/b] &nbsp; --&amp;item2|Dart [b]5 cp[/b] each &nbsp; --&amp;item3|Bolts, Heavy Crossbow single [b]8 cp[/b] &nbsp; --&amp;item4|Bolts, Heavy Crossbow bundle (20) 1 [b]gp[/b] &nbsp; --&amp;item5|Arrows, single [b]8 cp[/b] &nbsp; --&amp;item6|Arrows, bundle (20) [b]1 gp[/b] &nbsp; --&amp;item7|Bolts, Hand Crossbow single [b]8 cp[/b] &nbsp; --&amp;item8|Arrows, Silvered singe [b]15 gp[/b] &nbsp; --&amp;item9|Bolts, Light Crossbow single [b]8 cp[/b] &nbsp; --&amp;item10|Bolts, Light Crossbow bundle (20) [b]1 gp[/b] &nbsp; --&amp;item11|Arrows, Silvered bundle (10) [b]100 gp[/b] &nbsp; --&amp;item12|Bolts, Hand Crossbow bundle (20) 1 [b]gp[/b] &nbsp; --&amp;item13|Bolts, Light Repeating single [b]12 cp[/b] &nbsp; --&amp;item14|Bolts, Light Repeating bundle (10) [b]1 gp[/b] &nbsp; --=numUniqueTypes|14 &nbsp; --^INITIALIZE AMMO COUNTS| &nbsp; --:INITIALIZE AMMO COUNTS| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[&amp;LoopCounter]|0 &nbsp; --%| &nbsp; &nbsp; --:LOOP THROUGH numRolls TO START ADDING ITEMS &nbsp; --=numRolls1|3 &nbsp; --=numRolls2|3 &nbsp; --=numRolls3|4 &nbsp; --=numRolls4|4 &nbsp; --=numRolls5|5 &nbsp; --=numRolls6|6 &nbsp; --=numRolls7|7 &nbsp; --=numRolls|0 &nbsp; --C[&amp;Settlement]|Thorp:=numRolls;[$numRolls1.Raw]|Hamlet:=numRolls;[$numRolls2.Raw]|Village:=numRolls;[$numRolls3.Raw]|Small Town:=numRolls;[$numRolls4.Raw]|Large Town:=numRolls;[$numRolls5.Raw]|Small City:=numRolls;[$numRolls6.Raw]|Large City:=numRolls;[$numRolls7.Raw] &nbsp; --%LoopCounter|1;[$numRolls.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R1|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R2|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R3|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R4|1d4 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R5|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll1|1d6 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll2|1d8 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll3|1d14 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --:NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=MatRoll;[$MatRoll1.Raw]|Hamlet:=MatRoll;[$MatRoll1.Raw]|Village:=MatRoll;[$MatRoll1.Raw]|Small Town:=MatRoll;[$MatRoll2.Raw]|Large Town:=MatRoll;[$MatRoll2.Raw]|Small City:=MatRoll;[$MatRoll3.Raw]|Large City:=MatRoll;[$MatRoll3.Raw] &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=R5;[$R1.Raw]|Hamlet:=R5;[$R1.Raw]|Village:=R5;[$R2.Raw]|Small Town:=R5;[$R2.Raw]|Large Town:=R5;[$R2.Raw]|Small City:=R5;[$R2.Raw]|Large City:=R5;[$R2.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;AddAmmo|[$MatRoll.Raw];[$R5.Raw] &nbsp;&nbsp;&nbsp; --%| &nbsp; &nbsp; --:BUILD COMMA-SEPARATED LIST| &nbsp; --&amp;displayAmmoString| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --?[$count[&amp;LoopCounter]] -gt 0|[ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&amp;displayAmmoString|+&nbsp; [b]([$count[&amp;LoopCounter].Raw])[/b] [&amp;item[&amp;LoopCounter]], &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --]| &nbsp; --%| &nbsp; --:CLEANUP TRAILING COMMA IN THE LIST STRING &nbsp; --~stringLength|string;length;[&amp;displayAmmoString] &nbsp; --=numCharsToKeep|[$stringLength] - 1 &nbsp; --~displayAmmoString|string;substring;1;[$numCharsToKeep];[&amp;displayAmmoString] &nbsp; &nbsp; --:ENUMERATE ARMOR DESCRIPTIONS1|================================================================================================== &nbsp; --&amp;item1|Padded [b]5 gp[/b] &nbsp; --&amp;item2|Leather [b]10 gp[/b] &nbsp; --&amp;item3|Studded leather [b]45 gp[/b] &nbsp; --&amp;item4|Hide [b]10 gp[/b] &nbsp; --&amp;item5|Chain shirt [b]50 gp[/b] &nbsp; --&amp;item6|Shield [b]10 gp[/b] &nbsp; --&amp;item7|Ring mail [b]30 gp[/b] &nbsp; --&amp;item8|Scale mail [b]50 gp[/b] &nbsp; --&amp;item9|Chain mail [b]75 gp[/b] &nbsp; --&amp;item10|Splint [b]200 gp[/b] &nbsp; --&amp;item11|Breastplate [b]400 gp[/b] &nbsp; --&amp;item12|Half plate [b]750 gp[/b] &nbsp; --&amp;item13|Plate [b]1,500 gp[/b] &nbsp; --=numUniqueTypes|13 &nbsp; --^INITIALIZE ARMOR COUNTS| &nbsp; --:INITIALIZE ARMOR COUNTS| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[&amp;LoopCounter]|0 &nbsp; --%| &nbsp; &nbsp; &nbsp; --:LOOP THROUGH numRolls TO START ADDING ITEMS &nbsp; --=numRolls1|2 &nbsp; --=numRolls2|4 &nbsp; --=numRolls3|4 &nbsp; --=numRolls4|6 &nbsp; --=numRolls5|6 &nbsp; --=numRolls6|8 &nbsp; --=numRolls7|8 &nbsp; --=numRolls|0 &nbsp; --C[&amp;Settlement]|Thorp:=numRolls;[$numRolls1.Raw]|Hamlet:=numRolls;[$numRolls2.Raw]|Village:=numRolls;[$numRolls3.Raw]|Small Town:=numRolls;[$numRolls4.Raw]|Large Town:=numRolls;[$numRolls5.Raw]|Small City:=numRolls;[$numRolls6.Raw]|Large City:=numRolls;[$numRolls7.Raw] &nbsp; --%LoopCounter|1;[$numRolls.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R1|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R2|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R3|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R4|1d4 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R5|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll1|1d6 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll2|1d9 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll3|1d13 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --:NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=MatRoll;[$MatRoll1.Raw]|Hamlet:=MatRoll;[$MatRoll1.Raw]|Village:=MatRoll;[$MatRoll1.Raw]|Small Town:=MatRoll;[$MatRoll2.Raw]|Large Town:=MatRoll;[$MatRoll2.Raw]|Small City:=MatRoll;[$MatRoll3.Raw]|Large City:=MatRoll;[$MatRoll3.Raw] &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=R5;[$R1.Raw]|Hamlet:=R5;[$R1.Raw]|Village:=R5;[$R2.Raw]|Small Town:=R5;[$R2.Raw]|Large Town:=R5;[$R2.Raw]|Small City:=R5;[$R2.Raw]|Large City:=R5;[$R2.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;AddArmor|[$MatRoll.Raw];[$R5.Raw] &nbsp;&nbsp;&nbsp; --%| &nbsp; &nbsp; --:BUILD COMMA-SEPARATED LIST| &nbsp; --&amp;displayArmorString| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --?[$count[&amp;LoopCounter]] -gt 0|[ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&amp;displayArmorString|+&nbsp; [b]([$count[&amp;LoopCounter].Raw])[/b] [&amp;item[&amp;LoopCounter]], &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --]| &nbsp; --%| &nbsp; --:CLEANUP TRAILING COMMA IN THE LIST STRING &nbsp; --~stringLength|string;length;[&amp;displayArmorString] &nbsp; --=numCharsToKeep|[$stringLength] - 1 &nbsp; --~displayArmorString|string;substring;1;[$numCharsToKeep];[&amp;displayArmorString] &nbsp; &nbsp; &nbsp; --:ENUMERATE COMMON GEAR DESCRIPTIONS1|================================================================================================== &nbsp; &nbsp; --&amp;item1|Fishing hook [b]1 cp[/b] &nbsp; --&amp;item2|Backpack [b]2 gp[/b] &nbsp; --&amp;item3|Bag of ball bearings (bag o f 1,000) [b]1 gp[/b] &nbsp; --&amp;item4|Barrel [b]2 gp[/b] &nbsp; --&amp;item5|Basket [b]4 sp[/b] &nbsp; --&amp;item6|Healer’s kit [b]5 gp[/b] &nbsp; --&amp;item7|Wooden staff [b]5 gp[/b] &nbsp; --&amp;item8|Bottle, glass [b]2 gp[/b] &nbsp; --&amp;item9|Bucket [b]5 cp[/b] &nbsp; --&amp;item10|Bag of Caltrops (bag of 20) [b]1 gp[/b] &nbsp; --&amp;item11|Whetstone [b]1 cp[/b] &nbsp; --&amp;item12|Case, map or scroll [b]1 gp[/b] &nbsp; --&amp;item13|Chain (10 feet) [b]5 gp[/b] &nbsp; --&amp;item14|Chalk (1 piece) [b]1 cp[/b] &nbsp; --&amp;item15|Component pouch [b]25 gp[/b] &nbsp; --&amp;item16|Crowbar [b]2 gp[/b] &nbsp; --&amp;item17|Fishing tackle [b]1 gp[/b] &nbsp; --&amp;item18|Flask or tankard [b]2 cp[/b] &nbsp; --&amp;item19|Grappling hook [b]2 gp[/b] &nbsp; --&amp;item20|Hacksaw, common [b]5 gp[/b] &nbsp; --&amp;item21|Hammer [b]1 gp[/b] &nbsp; --&amp;item22|Hammock [b]5 gp[/b] &nbsp; --&amp;item23|Twine, roll (50 ft.) [b]1 sp[/b] &nbsp; --&amp;item24|Hoe, farming tool [b]3 gp[/b] &nbsp; --&amp;item25|Hunting trap [b]5 gp[/b] &nbsp; --&amp;item26|Jug or pitcher [b]2 cp[/b] &nbsp; --&amp;item27|Keg, hand [b]5 sp[/b] &nbsp; --&amp;item28|Lamp [b]5 sp[/b] &nbsp; --&amp;item29|Bag of marbles (10) [b]2 sp[/b] &nbsp; --&amp;item30|Torch [b]1 cp[/b] &nbsp; --&amp;item31|Oil (flask) [b]1 sp[/b] &nbsp; --&amp;item32|Parchment [b]1 sp[/b] &nbsp; --&amp;item33|Pick, miner’s [b]2 gp[/b] &nbsp; --&amp;item34|Pipe, wood [b]1 cp[/b] &nbsp; --&amp;item35|Pole (10-foot) [b]5 cp[/b] &nbsp; --&amp;item36|Pot, iron [b]2 gp[/b] &nbsp; --&amp;item37|Pouch [b]5 sp[/b] &nbsp; --&amp;item38|Quiver [b]1 gp[/b] &nbsp; --&amp;item39|Rake, farming tool [b]1 gp[/b] &nbsp; --&amp;item40|Shovel [b]2 gp[/b] &nbsp; --&amp;item41|Rope, hempen (50 feet) [b]1 gp[/b] &nbsp; --&amp;item42|Lock [b]10 gp[/b] &nbsp; --&amp;item43|Saw, folding 2 gp[/b] &nbsp; --&amp;item44|Bag of Spikes, iron (10) [b]1 gp[/b] &nbsp; --&amp;item45|Signal whistle [b]5 cp[/b] &nbsp; --&amp;item46|Soap [b]2 cp[/b] &nbsp; --&amp;item47|Tarp [b]5 gp[/b] &nbsp; --&amp;item48|Staff [b]5 gp[/b] &nbsp; --&amp;item49|Tongs, metal [b]3 gp[/b] &nbsp; --&amp;item50|Vial [b]1 gp[/b] &nbsp; --&amp;item51|Wood box, large [b]15 gp[/b] &nbsp; --&amp;item52|Goblet [b]5 gp[/b] &nbsp; --&amp;item53|Saddle bag [b]4 gp[/b] &nbsp; --&amp;item54|Shoulder purse [b]3 gp[/b] &nbsp; --&amp;item55|Tobacco pouch, leather [b]1 gp[/b] &nbsp; --&amp;item56|Wood box, medium [b]10 gp[/b] &nbsp; --&amp;item57|Wood box, small [b]5 gp[/b] &nbsp; --&amp;item58|Animal Call [b]20 gp[/b] &nbsp; --&amp;item59|Armor Maintenance kit [b]1 gp[/b] &nbsp; --&amp;item60|Bell [b]1 [b[/b] &nbsp; --&amp;item61|Billhook, farming tool [b]5 gp[/b] &nbsp; --&amp;item62|Block and tackle [b]1 gp[/b] &nbsp; --&amp;item63|Book [b]25 gp[/b] &nbsp; --&amp;item64|Brewmaker, dwarven [b]40 gp[/b] &nbsp; --&amp;item65|Candle mold [b]12 sp[/b] &nbsp; --&amp;item66|Candle, insectbane [b]1 sp[/b] &nbsp; --&amp;item67|Case, crossbow bolt [b]1 gp[/b] &nbsp; --&amp;item68|Chest [b]5 gp[/b] &nbsp; --&amp;item69|Climber's kit [b]25 gp[/b] &nbsp; --&amp;item70|Crystal [b]10 gp[/b] &nbsp; --&amp;item71|Earplugs (pair) [b]3 sp[/b] &nbsp; --&amp;item72|Game board, portable [b]2 gp[/b] &nbsp; --&amp;item73|Hacksaw, superior [b]20 gp[/b] &nbsp; --&amp;item74|Ink (1 ounce bottle) [b]10 gp[/b] &nbsp; --&amp;item75|Ink pen [b]2 cp[/b] &nbsp; --&amp;item76|Keg, cask [b]1 gp[/b] &nbsp; --&amp;item77|Lantern, hooded [b]5 gp[/b] &nbsp; --&amp;item78|Leash &amp; muzzle, Medium-size [b]8 sp[/b] &nbsp; --&amp;item79|Leash &amp; muzzle, Small [b]6 sp[/b] &nbsp; --&amp;item80|Manacles [b]2 gp[/b] &nbsp; --&amp;item81|Mill, hand [b]2 gp[/b] &nbsp; --&amp;item82|Net, butterfly [b]10 gp[/b] &nbsp; --&amp;item83|Orb [b]10 gp[/b] &nbsp; --&amp;item84|Pestle and mortar [b]5 gp[/b] &nbsp; --&amp;item85|Pitchfork, farming tool [b]2 gp[/b] &nbsp; --&amp;item86|Piton [b]5 cp[/b] &nbsp; --&amp;item87|Quiver scabbard [b]10 gp[/b] &nbsp; --&amp;item88|Rod [b]10 [b]gp[/b] &nbsp; --&amp;item89|Sealing wax [b]5 sp[/b] &nbsp; --&amp;item90|Signet ring [b]5 gp[/b] &nbsp; --&amp;item91|Slate board [b]5 gp[/b] &nbsp; --&amp;item92|Sparker [b]2 gp[/b] &nbsp; --&amp;item93|Sprig of mistletoe [b]1 gp[/b] &nbsp; --&amp;item94|Tent, one person [b]5 gp[/b] &nbsp; --&amp;item95|Tent, two-person [b]2 gp[/b] &nbsp; --&amp;item96|Totem [b]1 gp[/b] &nbsp; --&amp;item97|Wand [b]10 gp[/b] &nbsp; --&amp;item98|Wick, candle (50 ft.) [b]2 sp[/b] &nbsp; --&amp;item99|Chest, Large [b]50 gp[/b] &nbsp; --&amp;item100|Acid (vial) [b]25 gp[/b] &nbsp; --&amp;item101|Alchemist’s fire (flask) 50 [b]gp[/b] &nbsp; --&amp;item102|Antitoxin (vial) [b]50 gp[/b] &nbsp; --&amp;item103|Barbed wire (50 ft.) [b]75 gp[/b] &nbsp; --&amp;item104|Book, false [b]30 gp[/b] &nbsp; --&amp;item105|Flotation bags [b]5 gp[/b] &nbsp; --&amp;item106|Fowler's snare [b]20 gp[/b] &nbsp; --&amp;item107|Glass cutter [b]2 gp[/b] &nbsp; --&amp;item108|Hammer, sledge [b]2 gp[/b] &nbsp; --&amp;item109|Holy symbol, Amulet [b]5 gp[/b] &nbsp; --&amp;item110|Holy symbol, Emblem [b]5 gp[/b] &nbsp; --&amp;item111|Holy symbol, Reliquary [b]5 gp[/b] &nbsp; --&amp;item112|Holy text [b]10 gp[/b] &nbsp; --&amp;item113|Holy water (flask) [b]25 gp[/b] &nbsp; --&amp;item114|Ice axe [b]10 gp[/b] &nbsp; --&amp;item115|Jeweler's loupe [b]20 gp[/b] &nbsp; --&amp;item116|Ladder (10-foot) [b]1 sp[/b] &nbsp; --&amp;item117|Lantern, bullseye [b]10 gp[/b] &nbsp; --&amp;item118|Leash &amp; muzzle, Diminutive [b]2 sp[/b] &nbsp; --&amp;item119|Money belt [b]4 gp[/b] &nbsp; --&amp;item120|Perfume (vial) [b]5 gp[/b] &nbsp; --&amp;item121|Potion of healing [b]50 gp[/b] &nbsp; --&amp;item122|Rope, silk (50 feet) [b]10 gp[/b] &nbsp; --&amp;item123|Scale, merchant’s [b]5 gp[/b] &nbsp; --&amp;item124|Teepee [b]60 gp[/b] &nbsp; --&amp;item125|Water, Lawful/Chaotic [b]25 gp[/b] &nbsp; --&amp;item126|Spellbook [b]50 gp[/b] &nbsp; --&amp;item127|Bolt cutters [b]6 gp[/b] &nbsp; --&amp;item128|Grappling ladder (10 ft.) [b]40 gp[/b] &nbsp; --&amp;item129|Insect netting [b]200 gp[/b] &nbsp; --&amp;item130|Abacus [b]2 gp[/b] &nbsp; --&amp;item131|Ascender/slider [b]20 gp[/b] &nbsp; --&amp;item132|Banner/Standard [b]30 gp[/b] &nbsp; --&amp;item133|Cage, Diminutive [b]10 gp[/b] &nbsp; --&amp;item134|Cage, Large [b]75 gp[/b] &nbsp; --&amp;item135|Cage, Medium-size [b]50 gp[/b] &nbsp; --&amp;item136|Cage, Small [b]25 gp[/b] &nbsp; --&amp;item137|Cage, Tiny [b]15 gp[/b] &nbsp; --&amp;item138|Candelabra, Gold, eight candle [b]20 gp[/b] &nbsp; --&amp;item139|Candelabra, Gold, four candle [b]10 gp[/b] &nbsp; --&amp;item140|Candelabra, Gold, sixteen candle [b]25 gp[/b] &nbsp; --&amp;item141|Candelabra, Silver, eight candle [b]35 gp[/b] &nbsp; --&amp;item142|Candelabra, Silver, four candle [b]25 gp[/b] &nbsp; --&amp;item143|Candelabra, Silver, sixteen candle [b]45 gp[/b] &nbsp; --&amp;item144|Crane, portable - (STR 22) [b]30 gp[/b] &nbsp; --&amp;item145|Crane, portable - (STR 24) [b]60 gp[/b] &nbsp; --&amp;item146|Crane, portable - (STR 28) [b]120 gp[/b] &nbsp; --&amp;item147|Finger blades [b]20 gp[/b] &nbsp; --&amp;item148|Grappling hook, collapsible [b]3 gp[/b] &nbsp; --&amp;item149|Heat mat [b]45 gp[/b] &nbsp; --&amp;item150|Hourglass [b]25 gp[/b] &nbsp; --&amp;item151|Housebreaker harness [b]20 gp[/b] &nbsp; --&amp;item152|Lantern, fog-cutter [b]20 gp[/b] &nbsp; --&amp;item153|Leash &amp; muzzle, Tiny [b]4 sp[/b] &nbsp; --&amp;item154|Magnet, small [b]10 gp[/b] &nbsp; --&amp;item155|Magnifying glass [b]100 gp[/b] &nbsp; --&amp;item156|Mirror, steel [b]5 gp[/b] &nbsp; --&amp;item157|Music box [b]35 gp[/b] &nbsp; --&amp;item158|Percolator [b]1 gp[/b] &nbsp; --&amp;item159|Periscope [b]1000 gp[/b] &nbsp; --&amp;item160|Poison, basic (vial) [b]100 gp[/b] &nbsp; --&amp;item161|Post-hole digger, farming tool [b]4 gp[/b] &nbsp; --&amp;item162|Pulley [b]5 gp[/b] &nbsp; --&amp;item163|Ram, portable [b]4 gp[/b] &nbsp; --&amp;item164|Rope, elven (20 ft.) [b]50 gp[/b] &nbsp; --&amp;item165|Shoes, silent [b]10 gp[/b] &nbsp; --&amp;item166|Shriek rock [b]3 gp[/b] &nbsp; --&amp;item167|Skis and poles [b]15 gp[/b] &nbsp; --&amp;item168|Snorkel [b]1 gp[/b] &nbsp; --&amp;item169|Snow goggles [b]2 gp[/b] &nbsp; --&amp;item170|Snowshoes [b]15 gp[/b] &nbsp; --&amp;item171|Spider poles [b]35 gp[/b] &nbsp; --&amp;item172|Sprayer [b]15 gp[/b] &nbsp; --&amp;item173|Springwall [b]60 gp[/b] &nbsp; --&amp;item174|Spyglass [b]1000 gp[/b] &nbsp; --&amp;item175|Stilts [b]5 gp[/b] &nbsp; --&amp;item176|Table case, folding [b]5 gp[/b] &nbsp; --&amp;item177|Tent, four person [b]20 gp[/b] &nbsp; --&amp;item178|Tent, pavilion [b]100 gp[/b] &nbsp; --&amp;item179|Thieving helmet [b]10 gp[/b] &nbsp; --&amp;item180|Tree stand [b]15 gp[/b] &nbsp; --&amp;item181|Tree tent, elven [b]30 gp[/b] &nbsp; --&amp;item182|Winch, portable - (STR 18) [b]20 gp[/b] &nbsp; --&amp;item183|Winch, portable - (STR 20) [b]40 gp[/b] &nbsp; --&amp;item184|Winch, portable - (STR 22) [b]80 gp[/b] &nbsp; --&amp;item185|Yew wand [b]10 gp[/b] &nbsp; --=numUniqueTypes|185 &nbsp; --^INITIALIZE COMMON GEAR COUNTS| &nbsp; --:INITIALIZE COMMON GEAR COUNTS| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[&amp;LoopCounter]|0 &nbsp; --%| &nbsp; --:LOOP THROUGH numRolls TO START ADDING ITEMS &nbsp; --=numRolls1|8 &nbsp; --=numRolls2|9 &nbsp; --=numRolls3|9 &nbsp; --=numRolls4|14 &nbsp; --=numRolls5|16 &nbsp; --=numRolls6|20 &nbsp; --=numRolls7|25 &nbsp; --=numRolls|0 &nbsp; --C[&amp;Settlement]|Thorp:=numRolls;[$numRolls1.Raw]|Hamlet:=numRolls;[$numRolls2.Raw]|Village:=numRolls;[$numRolls3.Raw]|Small Town:=numRolls;[$numRolls4.Raw]|Large Town:=numRolls;[$numRolls5.Raw]|Small City:=numRolls;[$numRolls6.Raw]|Large City:=numRolls;[$numRolls7.Raw] &nbsp; --%LoopCounter|1;[$numRolls.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R1|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R2|1d6 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R3|1d8 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R4|1d10 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R5|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll1|1d50 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll2|1d98 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll3|1d185 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --:NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=MatRoll;[$MatRoll1.Raw]|Hamlet:=MatRoll;[$MatRoll1.Raw]|Village:=MatRoll;[$MatRoll1.Raw]|Small Town:=MatRoll;[$MatRoll2.Raw]|Large Town:=MatRoll;[$MatRoll2.Raw]|Small City:=MatRoll;[$MatRoll3.Raw]|Large City:=MatRoll;[$MatRoll3.Raw] &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=R5;[$R1.Raw]|Hamlet:=R5;[$R1.Raw]|Village:=R5;[$R2.Raw]|Small Town:=R5;[$R2.Raw]|Large Town:=R5;[$R2.Raw]|Small City:=R5;[$R2.Raw]|Large City:=R5;[$R2.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;AddCommonGear|[$MatRoll.Raw];[$R5.Raw] &nbsp;&nbsp;&nbsp; --%| &nbsp; &nbsp; --:BUILD COMMA-SEPARATED LIST| &nbsp; --&amp;displayCommonGearString| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --?[$count[&amp;LoopCounter]] -gt 0|[ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&amp;displayCommonGearString|+&nbsp; [b]([$count[&amp;LoopCounter].Raw])[/b] [&amp;item[&amp;LoopCounter]], &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --]| &nbsp; --%| &nbsp; --:CLEANUP TRAILING COMMA IN THE LIST STRING &nbsp; --~stringLength|string;length;[&amp;displayCommonGearString] &nbsp; --=numCharsToKeep|[$stringLength] - 1 &nbsp; --~displayCommonGearString|string;substring;1;[$numCharsToKeep];[&amp;displayCommonGearString] &nbsp; &nbsp; --:ENUMERATE TOBACCO DESCRIPTIONS| &nbsp; --&amp;item1|(lbs.) of Blackberry Yeti [b]5 sp/oz.[/b] &nbsp; --&amp;item2|(lbs.) of Vanilla Clanvendish [b]5 cp/oz.[/b] &nbsp; --&amp;item3|(lbs.) of Aged Fey Perique [b]5 gp/oz.[/b] &nbsp; --&amp;item4|(lbs.) of Faerun Original [b]3 sp/oz.[/b] &nbsp; --&amp;item5|(lbs.) of Faerun Fire [b]5 sp/oz.[/b] &nbsp; --&amp;item6|(lbs.) of Paladin Black Cherry [b]8 sp/oz.[/b] &nbsp; --&amp;item7|(lbs.) of Halfling Hash [b]1 gp/oz.[/b] &nbsp; --&amp;item8|(lbs.) of Hardbuckler Mint [b]8 sp/oz.[/b] &nbsp; --&amp;item9|(lbs.) of Hardbuckler Smooth [b]5 sp/oz.[/b] &nbsp; --&amp;item10|(lbs.) of Hardbuckler Horn [b]10 sp/oz.[/b] &nbsp; --&amp;item11|(lbs.) of Adventurer Blend [b]2 sp/oz.[/b] &nbsp; --&amp;item12|(lbs.) of Fey Flake [b]5 gp/oz.[/b] &nbsp; --&amp;item13|(lbs.) of The Alliance [b]8 sp/oz.[/b] &nbsp; --&amp;item14|(lbs.) of Lord Ladykiller [b]10 sp/oz.[/b] &nbsp; --&amp;item15|(lbs.) of Miner's Maiden [b]7 sp/oz.[/b] &nbsp; --&amp;item16|(lbs.) of Captain's Delight Gold [b]5 sp/oz.[/b] &nbsp; --&amp;item17|(lbs.) of Captain's Delight Royal [b]5 gp/oz.[/b] &nbsp; --&amp;item18|(lbs.) of The Homesteader [b]3 sp/oz.[/b] &nbsp; --&amp;item19|(lbs.) of Vineshade Grape [b]10 sp/oz.[/b] &nbsp; --&amp;item20|(lbs.) of Vineshade [b]7 sp/oz.[/b] &nbsp; --&amp;item21|(lbs.) of Vineshade Spiced [b]5 gp/oz.[/b] &nbsp; --&amp;item22|(lbs.) of Turmish Blackpool [b]3 gp/oz.[/b] &nbsp; --&amp;item23|(lbs.) of Baldur's Blend [b]7 gp/oz.[/b] &nbsp; --&amp;item24|(lbs.) of Baldur's Blend Platinum [b]10 gp/oz.[/b] &nbsp; --&amp;item25|(lbs.) of Happy Halfling [b]7 cp/oz.[/b] &nbsp; --&amp;item26|(lbs.) of Forge Masters Blend [b]7 cp/oz.[/b] &nbsp; --&amp;item27|(lbs.) of Quarrelshigh Quail [b]2 sp/oz.[/b] &nbsp; --=numUniqueTypes|27 &nbsp; &nbsp; --^INITIALIZE TOBACCO COUNTS| &nbsp; &nbsp; --:INITIALIZE TOBACCO COUNTS| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[&amp;LoopCounter]|0 &nbsp; --%| &nbsp; --:LOOP THROUGH numRolls TO START ADDING ITEMS &nbsp; --=numRolls1|2 &nbsp; --=numRolls2|2 &nbsp; --=numRolls3|2 &nbsp; --=numRolls4|3 &nbsp; --=numRolls5|3 &nbsp; --=numRolls6|4 &nbsp; --=numRolls7|4 &nbsp; --=numRolls|0 &nbsp; --C[&amp;Settlement]|Thorp:=numRolls;[$numRolls1.Raw]|Hamlet:=numRolls;[$numRolls2.Raw]|Village:=numRolls;[$numRolls3.Raw]|Small Town:=numRolls;[$numRolls4.Raw]|Large Town:=numRolls;[$numRolls5.Raw]|Small City:=numRolls;[$numRolls6.Raw]|Large City:=numRolls;[$numRolls7.Raw] &nbsp; --%LoopCounter|1;[$numRolls.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R1|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R2|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R3|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R4|1d1 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R5|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll1|1d27 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll2|1d27 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll3|1d27 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --:NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=MatRoll;[$MatRoll1.Raw]|Hamlet:=MatRoll;[$MatRoll1.Raw]|Village:=MatRoll;[$MatRoll1.Raw]|Small Town:=MatRoll;[$MatRoll2.Raw]|Large Town:=MatRoll;[$MatRoll2.Raw]|Small City:=MatRoll;[$MatRoll3.Raw]|Large City:=MatRoll;[$MatRoll3.Raw] &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=R5;[$R1.Raw]|Hamlet:=R5;[$R1.Raw]|Village:=R5;[$R2.Raw]|Small Town:=R5;[$R2.Raw]|Large Town:=R5;[$R2.Raw]|Small City:=R5;[$R2.Raw]|Large City:=R5;[$R2.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;AddTobacco|[$MatRoll.Raw];[$R5.Raw] &nbsp;&nbsp;&nbsp; --%| &nbsp; &nbsp; --:BUILD COMMA-SEPARATED LIST| &nbsp; --&amp;displayTobaccoString| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --?[$count[&amp;LoopCounter]] -gt 0|[ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&amp;displayTobaccoString|+&nbsp; [b]([$count[&amp;LoopCounter].Raw])[/b] [&amp;item[&amp;LoopCounter]], &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --]| &nbsp; --%| &nbsp; --:CLEANUP TRAILING COMMA IN THE LIST STRING &nbsp; --~stringLength|string;length;[&amp;displayTobaccoString] &nbsp; --=numCharsToKeep|[$stringLength] - 1 &nbsp; --~displayTobaccoString|string;substring;1;[$numCharsToKeep];[&amp;displayTobaccoString] &nbsp; &nbsp; &nbsp; &nbsp; --:ENUMERATE TRAIL FOOD DESCRIPTIONS|====================================================================================== &nbsp; --&amp;item1|Loaves of Buckwheat bread (loaf) [b]1 cp[/b] &nbsp; --&amp;item2|Loaves of Corn bread (loaf) [b]2 cp[/b] &nbsp; --&amp;item3|Loaves of Fruit bread (loaf) [b]5 cp[/b] &nbsp; --&amp;item4|Loaves of Sweet bread (loaf) [b]3 cp[/b] &nbsp; --&amp;item5|lbs. of Berries (lb) [b]3 cp[/b] &nbsp; --&amp;item6|lbs. of Dried Fruit (lb) [b]3 cp[/b] &nbsp; --&amp;item7|lbs. of Figs (lb) [b]3 cp[/b] &nbsp; --&amp;item8|dozen Apples (doz) [b]3 cp[/b] &nbsp; --&amp;item9|dozen Pears (doz) [b]3 cp[/b] &nbsp; --&amp;item10|lbs. of Mixed Nuts (lb) [b]8 cp[/b] &nbsp; --&amp;item11|lbs. of Deer Jerky (lb) [b]1 sp[/b] &nbsp; --&amp;item12|lbs. of Beef Sticks (lb) [b]1 sp[/b] &nbsp; --&amp;item13|jars of Pickled Eggs (jar) [b]5 cp[/b] &nbsp; --&amp;item14|jars of Pickled Olives (jar) [b]5 cp[/b] &nbsp; --&amp;item15|jars of Pickled Beets (jar) [b]3 cp[/b] &nbsp; --&amp;item16|lbs. of Carrots (lb) [b]3 cp[/b] &nbsp; --&amp;item17|lbs. of Potatoes (lb) [b]3 cp[/b] &nbsp; --&amp;item18|heads of Cabbage (head) [b]1 cp[/b] &nbsp; --&amp;item19|dozen Fig Cookies (doz) [b]2 cp[/b] &nbsp; --&amp;item20|Fruit Handpies (ea) [b]3 cp[/b] &nbsp; --&amp;item21|Vegetable Handpies (ea) [b]3 cp[/b] &nbsp; --&amp;item22|dozen Ginger Candy (doz) [b]3 cp[/b] &nbsp; --&amp;item23|dozen Honey Candy (doz) [b]3 cp[/b] &nbsp; --&amp;item24|Fruit Tarts (ea) [b]3 cp[/b] &nbsp; --&amp;item25|Berry Tarts (ea) [b]3 cp[/b] &nbsp; --=numUniqueTypes|25 &nbsp; --^INITIALIZE TRAIL FOOD COUNTS| &nbsp; --:INITIALIZE TRAIL FOOD COUNTS| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[&amp;LoopCounter]|0 &nbsp; --%| &nbsp; --:LOOP THROUGH numRolls TO START ADDING ITEMS &nbsp; --=numRolls1|2 &nbsp; --=numRolls2|2 &nbsp; --=numRolls3|2 &nbsp; --=numRolls4|3 &nbsp; --=numRolls5|3 &nbsp; --=numRolls6|4 &nbsp; --=numRolls7|4 &nbsp; --=numRolls|0 &nbsp; --C[&amp;Settlement]|Thorp:=numRolls;[$numRolls1.Raw]|Hamlet:=numRolls;[$numRolls2.Raw]|Village:=numRolls;[$numRolls3.Raw]|Small Town:=numRolls;[$numRolls4.Raw]|Large Town:=numRolls;[$numRolls5.Raw]|Small City:=numRolls;[$numRolls6.Raw]|Large City:=numRolls;[$numRolls7.Raw] &nbsp; --%LoopCounter|1;[$numRolls.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R1|1d1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R2|1d1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R3|1d1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R4|1d1 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R5|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll1|1d25 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll2|1d25 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll3|1d25 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --:NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=MatRoll;[$MatRoll1.Raw]|Hamlet:=MatRoll;[$MatRoll1.Raw]|Village:=MatRoll;[$MatRoll1.Raw]|Small Town:=MatRoll;[$MatRoll2.Raw]|Large Town:=MatRoll;[$MatRoll2.Raw]|Small City:=MatRoll;[$MatRoll3.Raw]|Large City:=MatRoll;[$MatRoll3.Raw] &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=R5;[$R1.Raw]|Hamlet:=R5;[$R1.Raw]|Village:=R5;[$R2.Raw]|Small Town:=R5;[$R2.Raw]|Large Town:=R5;[$R2.Raw]|Small City:=R5;[$R2.Raw]|Large City:=R5;[$R2.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;AddTrailFood|[$MatRoll.Raw];[$R5.Raw] &nbsp;&nbsp;&nbsp; --%| &nbsp; &nbsp; --:BUILD COMMA-SEPARATED LIST| &nbsp; --&amp;displayTrailFoodString| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --?[$count[&amp;LoopCounter]] -gt 0|[ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&amp;displayTrailFoodString|+&nbsp; [b]([$count[&amp;LoopCounter].Raw])[/b] [&amp;item[&amp;LoopCounter]], &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --]| &nbsp; --%| &nbsp; --:CLEANUP TRAILING COMMA IN THE LIST STRING &nbsp; --~stringLength|string;length;[&amp;displayTrailFoodString] &nbsp; --=numCharsToKeep|[$stringLength] - 1 &nbsp; --~displayTrailFoodString|string;substring;1;[$numCharsToKeep];[&amp;displayTrailFoodString] &nbsp; --&amp;Rations|[b]([=1d20])[/b] Days Rations [b]5 sp[/b] &nbsp; &nbsp; &nbsp; --/| Determine if Special Items are available for sale &nbsp; --:Availability| &nbsp;&nbsp;&nbsp; --=MatRoll|1d100 &nbsp;&nbsp;&nbsp; --?[$MatRoll] -le 85|&gt;SKIP SPECIAL &nbsp;&nbsp;&nbsp; --?[$MatRoll] -ge 86|&gt;ENUMERATE SPECIAL ITEM DESCRIPTIONS &nbsp; --:EndOfAvailability| &nbsp; --:ENUMERATE SPECIAL ITEM DESCRIPTIONS|============================================================================================= &nbsp; --&amp;item1|[=1d8+8] Arrows +1 (ea.) [b]100 gp[/b] &nbsp; --&amp;item2|[=1d8+8] Bolts, Heavy Crossbow +1 (ea.) [b]100 gp[/b] &nbsp; --&amp;item3|Potion of Healing [b]50 gp[/b] &nbsp; --&amp;item4|Keoghtom's Ointment (Per dose) [b]125 gp[/b] &nbsp; --&amp;item5|Helm of Comprehend Languages [b]525 gp[/b] &nbsp; --&amp;item6|Bastard Sword +1 [b]1,200 gp[/b] &nbsp; --&amp;item7|Battleaxe +1 [b]1,200 gp[/b] &nbsp; --&amp;item8|Broad Sword +1 [b]1,500 gp[/b] &nbsp; --&amp;item9|Flail +1 [b]1,000 gp[/b] &nbsp; --&amp;item10|Glaive +1 [b]1,200 gp[/b] &nbsp; --&amp;item11|Greataxe +1 [b]1,300 gp[/b] &nbsp; --&amp;item12|Greatsword +1 [b]1,500 gp[/b] &nbsp; --&amp;item13|Halberd +1 [b]1,200 gp[/b] &nbsp; --&amp;item14|Longsword +1 [b]1,500 gp[/b] &nbsp; --&amp;item15|Maul +1 [b]1,000 gp[/b] &nbsp; --&amp;item16|Morningstar +1 [b]1,000 gp[/b] &nbsp; --&amp;item17|Rapier +1 [b]1,200 gp[/b] &nbsp; --&amp;item18|Scimitar +1 [b]1,200 gp[/b] &nbsp; --&amp;item19|Shortsword +1 [b]1,000 gp[/b] &nbsp; --&amp;item20|Trident +1 [b]1,200 gp[/b] &nbsp; --&amp;item21|Warhammer +1 [b]1,200 gp[/b] &nbsp; --&amp;item22|Whip +1 [b]800 gp[/b] &nbsp; --&amp;item23|Blowgun +1 [b]900 gp[/b] &nbsp; --&amp;item24|Crossbow, hand +1 [b]1,100 gp[/b] &nbsp; --&amp;item25|Crossbow, heavy +1 [b]1,500 gp[/b] &nbsp; --&amp;item26|Great Bow +1 [b]1,800 gp[/b] &nbsp; --&amp;item27|Longbow +1 [b]1,200 gp[/b] &nbsp; --&amp;item28|Net +1 [b]800 gp[/b] &nbsp; --&amp;item29|Club +1 [b]1,000 gp[/b] &nbsp; --&amp;item30|Dagger +1 [b]1,000 gp[/b] &nbsp; --&amp;item31|Greatclub +1 [b]1,200 gp[/b] &nbsp; --&amp;item32|Handaxe +1 [b]900 gp[/b] &nbsp; --&amp;item33|Javelin +1 [b]1,000 gp[/b] &nbsp; --&amp;item34|Mace +1 [b]1,000 gp[/b] &nbsp; --&amp;item35|Quarterstaff +1 [b]1,200 gp[/b] &nbsp; --&amp;item36|Spear +1 [b]1,000 gp[/b] &nbsp; --&amp;item37|Shortbow +1 [b]1,000 gp[/b] &nbsp; --&amp;item38|Sling +1 [b]900 gp[/b] &nbsp; --&amp;item39|Crossbow, Light Repeating +1 [b]1,800 gp[/b] &nbsp; --&amp;item40|Ring of Warmth [b]1,050 gp[/b] &nbsp; --&amp;item41|Shield +1 [b]1,550 gp[/b] &nbsp; --&amp;item42|Rope of Climbing [b]2,000 gp[/b] &nbsp; --&amp;item43|Cloak of Protectiion [b]3,600 gp[/b] &nbsp; --&amp;item44|Bag of Holding [b]4,200 gp[/b] &nbsp; --=numUniqueTypes|44 &nbsp; --^INITIALIZE SPECIAL ITEM COUNTS| &nbsp; --:INITIALIZE SPECIAL ITEM COUNTS| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[&amp;LoopCounter]|0 &nbsp; --%| &nbsp; --:LOOP THROUGH numRolls TO START ADDING ITEMS &nbsp; --=numRolls1|1 &nbsp; --=numRolls2|1 &nbsp; --=numRolls3|2 &nbsp; --=numRolls4|2 &nbsp; --=numRolls5|3 &nbsp; --=numRolls6|3 &nbsp; --=numRolls7|4 &nbsp; --=numRolls|0 &nbsp; --C[&amp;Settlement]|Thorp:=numRolls;[$numRolls1.Raw]|Hamlet:=numRolls;[$numRolls2.Raw]|Village:=numRolls;[$numRolls2.Raw]|Small Town:=numRolls;[$numRolls2.Raw]|Large Town:=numRolls;[$numRolls3.Raw]|Small City:=numRolls;[$numRolls3.Raw]|Large City:=numRolls;[$numRolls3.Raw] &nbsp; --%LoopCounter|1;[$numRolls.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll1|1d10 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll2|1d30 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll3|1d44 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --:NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=MatRoll;[$MatRoll1.Raw]|Hamlet:=MatRoll;[$MatRoll1.Raw]|Village:=MatRoll;[$MatRoll1.Raw]|Small Town:=MatRoll;[$MatRoll2.Raw]|Large Town:=MatRoll;[$MatRoll2.Raw]|Small City:=MatRoll;[$MatRoll3.Raw]|Large City:=MatRoll;[$MatRoll3.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;AddSpecial|[$MatRoll.Raw] &nbsp;&nbsp;&nbsp; --%| &nbsp; --:BUILD COMMA-SEPARATED LIST| &nbsp; --&amp;displaySpecialString| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --?[$count[&amp;LoopCounter]] -gt 0|[ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&amp;displaySpecialString|+ [&amp;item[&amp;LoopCounter]], &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --]| &nbsp; --%| &nbsp; --:CLEANUP TRAILING COMMA IN THE LIST STRING &nbsp; --~stringLength|string;length;[&amp;displaySpecialString] &nbsp; --=numCharsToKeep|[$stringLength] - 1 &nbsp; --~displaySpecialString|string;substring;1;[$numCharsToKeep];[&amp;displaySpecialString] &nbsp; --^Display Card| &nbsp; --:SKIP SPECIAL| &nbsp; --&amp;skip|nothing special for sale at this time... but if your looking to sell something special, [b]"Let's see what you got"[/b]&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; --/| END LIONSHIELD COSTER &amp; DISPLAY TOOLS, WEAPONS, ARMOR, GEAR SECTION ON CARD================================================================= &nbsp; --:Display Card &nbsp;&nbsp;&nbsp; --+|[c]🧰 [b]Tools[/b] 🧰[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;displayToolString] &nbsp;&nbsp;&nbsp; --+|[c]🗡️ [b]Weapons[/b] 🗡️[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;displayWeaponString] &nbsp;&nbsp;&nbsp; --+|[c]🎯 [b]Ammunition[/b] 🎯️[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;displayAmmoString]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --+|[c]🛡️ [b]Armor[/b] 🛡️[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;displayArmorString] &nbsp;&nbsp;&nbsp; --+|[c]🛢️ [b]Gear[/b] 🛢️[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;displayCommonGearString] &nbsp;&nbsp;&nbsp; --+|[c]🌿 [b]Tobacco[/b] 🌿[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;displayTobaccoString]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --+|[c]🌰️ [b]Trail Food[/b] 🌰[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;Rations], [&amp;displayTrailFoodString] &nbsp;&nbsp;&nbsp; --+|[c]🌟 [b]Something Special[/b] 🌟[/c] &nbsp;&nbsp;&nbsp; --+|[b][i]Are you looking for something special?[/i][/b] Well, I have [&amp;displaySpecialString][&amp;skip]&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --^Output Data| &nbsp; --/| Output data &nbsp;&nbsp;&nbsp; --:Output Data| &nbsp; --X| End Macro &nbsp; --:FUNCTIONS|===================================================================================================== &nbsp; &nbsp; --:AddWeapons| accepts the item index and qty. Increments the count of index [%1%] by qty [%2%] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[%1%]|[$count[%1%]] + [%2%] &nbsp; --&lt;| &nbsp; --:AddAmmo| accepts the item index and qty. Increments the count of index [%1%] by qty [%2%] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[%1%]|[$count[%1%]] + [%2%] &nbsp; --&lt;| &nbsp; --:AddArmor| accepts the item index and qty. Increments the count of index [%1%] by qty [%2%] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[%1%]|[$count[%1%]] + [%2%] &nbsp; --&lt;| &nbsp; --:AddCommonGear| accepts the item index and qty. Increments the count of index [%1%] by qty [%2%] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[%1%]|[$count[%1%]] + [%2%] &nbsp; --&lt;| &nbsp; &nbsp; --:AddTools| accepts the item index and qty. Increments the count of index [%1%] by qty [%2%] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[%1%]|[$count[%1%]] + [%2%] &nbsp; --&lt;| &nbsp; &nbsp; --:AddTobacco| accepts the item index and qty. Increments the count of index [%1%] by qty [%2%] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[%1%]|[$count[%1%]] + [%2%] &nbsp; --&lt;|&nbsp;&nbsp; &nbsp; &nbsp; --:AddTrailFood| accepts the item index and qty. Increments the count of index [%1%] by qty [%2%] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[%1%]|[$count[%1%]] + [%2%] &nbsp; --&lt;|&nbsp;&nbsp; &nbsp; &nbsp; --:AddSpecial| accepts the item index &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[%1%]|[%1%] &nbsp; --&lt;| }}&nbsp;&nbsp;&nbsp; &nbsp;
1667260443
Kurt J.
Pro
API Scripter
@DM Scotty - I just pushed 2.1.19a to the github that includes additional type checking on the variable value to prevent this error. On an unrelated note, there are a lot of lines in that script that look to ScriptCards like labels (--:) but don't have a | and are probably meant to be comments (--/|) since they are repeated 8ish times in the code. I don't think there is anything that will break anything, but you should probably be getting a lot of things like the linex below in the console log. I would change --: to --/| in these cases to eliminate these error messages. "ScriptCards Error: Line 9 is missing a | character. (:LOOP THROUGH numRolls TO START ADDING ITEMS&nbsp; &nbsp;)" "ScriptCards Error: Line 9 is missing a | character. (:NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION&nbsp; &nbsp; &nbsp;)" "ScriptCards Error: Line 9 is missing a | character. (:NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION&nbsp; &nbsp; &nbsp;)" "ScriptCards Error: Line 9 is missing a | character. (:CLEANUP TRAILING COMMA IN THE LIST STRING&nbsp; &nbsp;)" "ScriptCards Error: Line 9 is missing a | character. (:LOOP THROUGH numRolls TO START ADDING ITEMS&nbsp; &nbsp;)" "ScriptCards Error: Line 9 is missing a | character. (:NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION&nbsp; &nbsp; &nbsp;)" "ScriptCards Error: Line 9 is missing a | character. (:NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION&nbsp; &nbsp; &nbsp;)" "ScriptCards Error: Line 9 is missing a | character. (:NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION&nbsp; &nbsp; &nbsp;)" "ScriptCards Error: Line 9 is missing a | character. (:NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION&nbsp; &nbsp; &nbsp;)" "ScriptCards Error: Line 9 is missing a | character. (:NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION&nbsp; &nbsp; &nbsp;)" "ScriptCards Error: Line 9 is missing a | character. (:CLEANUP TRAILING COMMA IN THE LIST STRING&nbsp; &nbsp;)"
Ok, just installed the update and have added ( | ) at the end of the --: lines that you suggested.... The card does show up in the chat, however it is not populating like it should in the loop sections for each category as it did before..... (Tools - Trail food section..) MY EDITS BELOW ARE IN BOLD BELOW... &nbsp;!scriptcard {{ &nbsp; --#debug|1 &nbsp; --#title|?{Name of Shop?|} &nbsp; --#titlecardbackground|#606c9b &nbsp; --#leftsub|Adventurer Shop &nbsp; --#bodyFontSize|11px &nbsp; &nbsp; --DISPLAY IMAGE| &nbsp; --+|[&amp;Image] &nbsp; --+|[img]<a href="https://i.pinimg.com/originals/48/e9/51/48e951aeca534599fb39d8fdc02519b6.jpg[/img]" rel="nofollow">https://i.pinimg.com/originals/48/e9/51/48e951aeca534599fb39d8fdc02519b6.jpg[/img]</a> &nbsp; &nbsp; &nbsp; --/| BASED ON SELECTED SETTLEMENT WILL DETERMINE WHICH TABLES TO ROLL &nbsp; --/Determine Settlement| &nbsp;&nbsp;&nbsp; --&amp;Settlement|?{What Size Settlement?|Thorp|Hamlet|Village|Small Town|Large Town|Small City|Large City} &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=&amp;Population;20-80|Hamlet:=&amp;Population;81-400|Village:=&amp;Population;401-900|Small Town:=&amp;Population;901-2K|Large Town:=&amp;Population;2k-5K|Small City:=&amp;Population;5k-12K|Large City:=&amp;Population;12k-25K &nbsp; &nbsp; --:Population| &nbsp;&nbsp;&nbsp; --PopSize|[&amp;Settlement] &nbsp;&nbsp;&nbsp; --=PopSize|[%1%] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Thorp"|&amp;Pop;(20-80) &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Hamlet"|&amp;Pop;(81-400) &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Village"|&amp;Pop;(401-900) &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Small Town"|&amp;Pop;(901-2K) &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Large Town"|&amp;Pop;(2k-5K) &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Small City"|&amp;Pop;(5k-12K) &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Large City"|&amp;Pop;(12k-25K) &nbsp; --:EndPopulation| &nbsp; &nbsp; --DISCRIPTION &amp; SETTLEMENT SIZE| &nbsp; &nbsp; --&amp;Discription|A typical adventurer shop, usually located near monster infested areas and dungeons. They carry the standard supplies, including rations, torches, oil, sacks, useful tools and some basic weapons and armor. &nbsp; --+|[i][b][&amp;Discription][/b][/i] &nbsp; --+Settlement|[&amp;Settlement] [r][b]Population[/b] [&amp;Pop][/r] &nbsp; &nbsp; --:Adventure Shop|======================================================================================================= &nbsp;&nbsp;&nbsp; --Goods&amp;Services| &nbsp;&nbsp;&nbsp; --Buy|[&amp;Settlement] &nbsp;&nbsp;&nbsp; --=Buy|[%1%] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Thorp"|&amp;Buy;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]1 cp[/i], [b]Salt (1lb.)[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Hamlet"|&amp;Buy;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]1 cp[/i], [b]Salt (1lb.)[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Village"|&amp;Buy;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]1 cp[/i], [b]Salt (1lb.)[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Small Town"|&amp;Buy;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]1 cp[/i], [b]Salt (1lb.)[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Large Town"|&amp;Buy;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]1 cp[/i], [b]Salt (1lb.)[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Small City"|&amp;Buy;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]1 cp[/i], [b]Salt (1lb.)[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Large City"|&amp;Buy;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]1 cp[/i], [b]Salt (1lb.)[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --:EndGoods&amp;Services| &nbsp;&nbsp;&nbsp; --Sell|[&amp;Settlement] &nbsp;&nbsp;&nbsp; --=Sell|[%1%] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Thorp"|&amp;Sell;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]2 cp[/i], [b]Salt (1lb.)[/b] [i]5 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Hamlet"|&amp;Sell;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]2 cp[/i], [b]Salt (1lb.)[/b] [i]5 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Village"|&amp;Sell;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]2 cp[/i], [b]Salt (1lb.)[/b] [i]5 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Small Town"|&amp;Sell;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]2 cp[/i], [b]Salt (1lb.)[/b] [i]5 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Large Town"|&amp;Sell;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]2 cp[/i], [b]Salt (1lb.)[/b] [i]5 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Small City"|&amp;Sell;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]2 cp[/i], [b]Salt (1lb.)[/b] [i]5 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Large City"|&amp;Sell;[b]Wheat (1lb.)[/b] [i]1 cp[/i], [b]Flour (1lb.)[/b] [i]2 cp[/i], [b]Salt (1lb.)[/b] [i]5 cp[/i] &nbsp;&nbsp;&nbsp; --:EndGoods&amp;Services| &nbsp;&nbsp;&nbsp; --Service|[&amp;Settlement] &nbsp;&nbsp;&nbsp; --=Service|[%1%] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Thorp"|&amp;Service;[b]Laundry[/b] [i]1 sp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Hamlet"|&amp;Service;[b]Laundry[/b] [i]1 sp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Village"|&amp;Service;[b]Laundry[/b] [i]1 sp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Small Town"|&amp;Service;[b]Laundry[/b] [i]1 sp[/i], [b]Messenger[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Large Town"|&amp;Service;[b]Laundry[/b] [i]1 sp[/i], [b]Messenger[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Small City"|&amp;Service;[b]Laundry[/b] [i]1 sp[/i], [b]Messenger[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Large City"|&amp;Service;[b]Laundry[/b] [i]1 sp[/i], [b]Messenger[/b] [i]2 cp[/i] &nbsp;&nbsp;&nbsp; --:EndGoods&amp;Services| &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; --AlwaysAvailable|[&amp;Settlement] &nbsp; --=AlwaysAvailable|[%1%] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Thorp"|&amp;AlwaysAvailable;[b]([=1d4])[/b] Bedrolls [b]1 gp[/b], [b]([=2d4])[/b] Blankets [b]5 sp[/b], [b]([=1d4]) doz.[/b] Candles [b]1 cp[/b], [b]([=2d4])[/b] Mess Kits [b]2 sp[/b], [b]([=3d6])[/b] Sacks [b]1 cp[/b], [b]([=4d6])[/b] Tinderbox [b]5 sp[/b], [b]([=2d4])[/b] Waterskins [b]2 sp[/b] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Hamlet"|&amp;AlwaysAvailable;[b]([=1d4])[/b] Bedrolls [b]1 gp[/b], [b]([=2d4])[/b] Blankets [b]5 sp[/b], [b]([=1d4]) doz.[/b] Candles [b]1 cp[/b], [b]([=2d4])[/b] Mess Kits [b]2 sp[/b], [b]([=3d6])[/b] Sacks [b]1 cp[/b], [b]([=4d6])[/b] Tinderbox [b]5 sp[/b], [b]([=2d4])[/b] Waterskins [b]2 sp[/b] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Village"|&amp;AlwaysAvailable;[b]([=1d4])[/b] Bedrolls [b]1 gp[/b], [b]([=2d4])[/b] Blankets [b]5 sp[/b], [b]([=1d4]) doz.[/b] Candles [b]1 cp[/b], [b]([=2d4])[/b] Mess Kits [b]2 sp[/b], [b]([=3d6])[/b] Sacks [b]1 cp[/b], [b]([=4d6])[/b] Tinderbox [b]5 sp[/b], [b]([=2d4])[/b] Waterskins [b]2 sp[/b] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Small Town"|&amp;AlwaysAvailable;[b]([=1d4])[/b] Bedrolls [b]1 gp[/b], [b]([=2d4])[/b] Blankets [b]5 sp[/b], [b]([=1d4]) doz.[/b] Candles [b]1 cp[/b], [b]([=2d4])[/b] Mess Kits [b]2 sp[/b], [b]([=3d6])[/b] Sacks [b]1 cp[/b], [b]([=4d6])[/b] Tinderbox [b]5 sp[/b], [b]([=2d4])[/b] Waterskins [b]2 sp[/b] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Large Town"|&amp;AlwaysAvailable;[b]([=1d4])[/b] Bedrolls [b]1 gp[/b], [b]([=2d4])[/b] Blankets [b]5 sp[/b], [b]([=1d4]) doz.[/b] Candles [b]1 cp[/b], [b]([=2d4])[/b] Mess Kits [b]2 sp[/b], [b]([=3d6])[/b] Sacks [b]1 cp[/b], [b]([=4d6])[/b] Tinderbox [b]5 sp[/b], [b]([=2d4])[/b] Waterskins [b]2 sp[/b] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Small City"|&amp;AlwaysAvailable;[b]([=1d4])[/b] Bedrolls [b]1 gp[/b], [b]([=2d4])[/b] Blankets [b]5 sp[/b], [b]([=1d4]) doz.[/b] Candles [b]1 cp[/b], [b]([=2d4])[/b] Mess Kits [b]2 sp[/b], [b]([=3d6])[/b] Sacks [b]1 cp[/b], [b]([=4d6])[/b] Tinderbox [b]5 sp[/b], [b]([=2d4])[/b] Waterskins [b]2 sp[/b] &nbsp;&nbsp;&nbsp; --?"[&amp;Settlement]" -eq "Large City"|&amp;AlwaysAvailable;[b]([=1d4])[/b] Bedrolls [b]1 gp[/b], [b]([=2d4])[/b] Blankets [b]5 sp[/b], [b]([=1d4]) doz.[/b] Candles [b]1 cp[/b], [b]([=2d4])[/b] Mess Kits [b]2 sp[/b], [b]([=3d6])[/b] Sacks [b]1 cp[/b], [b]([=4d6])[/b] Tinderbox [b]5 sp[/b], [b]([=2d4])[/b] Waterskins [b]2 sp[/b] &nbsp; --:EndAlwaysAvailable| &nbsp; &nbsp; &nbsp; --/| SHOP OUTPUT DATA FOR BLACKSMITH. GOODS, SERVICES &amp; ALWAYS AVAILABLE &nbsp; --:SHOPOUTPUT| &nbsp;&nbsp;&nbsp; --+|[c]💰 [b] Buy Trade Goods[/b] 💰[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;Buy] &nbsp;&nbsp;&nbsp; --+|[c]💰 [b] Sell Trade Goods[/b] 💰[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;Sell] &nbsp;&nbsp;&nbsp; --+|[c]🛎️ [b]Services[/b] 🛎️[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;Service] &nbsp;&nbsp;&nbsp; --+|[c]‼️ [b]Always Available[/b] ‼️[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;AlwaysAvailable] &nbsp; --/| BEGIN TOOLS, WEAPONS, ARMOR, GEAR SECTION &nbsp; --:ENUMERATE TOOL DESCRIPTIONS1|=============================================================================================== &nbsp;&nbsp;&nbsp; --&amp;item1|Playing card set [b]5 sp[/b] &nbsp;&nbsp;&nbsp; --&amp;item2|Cook’s utensils [b]2 gp[/b] &nbsp;&nbsp;&nbsp; --&amp;item3|Leatherworker’s tools&nbsp;&nbsp;&nbsp; [b]5 gp[/b] &nbsp;&nbsp;&nbsp; --&amp;item4|Carpenter’s tools [b]10 gp[/b] &nbsp;&nbsp;&nbsp; --&amp;item5|Woodcarver’s tools [b]2 gp[/b] &nbsp;&nbsp;&nbsp; --&amp;item6|Weaver’s tools[b]2 gp[/b] &nbsp;&nbsp;&nbsp; --&amp;item7|Cobbler’s tools [b]8 gp[/b] &nbsp;&nbsp;&nbsp; --&amp;item8|Glassblower’s tools [b]30 gp[/b]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item9|Herbalism kit[b]8 gp[/b]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item10|Brewer’s supplies [b]20 gp[/b] &nbsp;&nbsp;&nbsp; --&amp;item11|Mason’s tools [b]10 gp[/b]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item12|Painter’s supplies [b]10 gp[/b]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item13|Potter’s tools [b]10 gp[/b]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item14|Smith’s tools [b]20 gp[/b]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item15|Calligrapher's supplies [b]10 gp[/b] &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item16|Alchemist’s supplies [b]50 gp[/b]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item17|Cartographer’s tools [b]20 gp[/b]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item18|Dice set[b]2 sp[/b] &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item19|Jeweler’s tools [b]25 gp[/b]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --&amp;item20|Tinker’s tools [b]50 gp[/b] &nbsp;&nbsp;&nbsp; &nbsp; --=numUniqueTypes|20 &nbsp; --:INITIALIZE TOOL COUNTS| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[&amp;LoopCounter]|0 &nbsp; --%| &nbsp; --:LOOP THROUGH numRolls TO START ADDING ITEMS| &nbsp; --=numRolls1|2 &nbsp; --=numRolls2|2 &nbsp; --=numRolls3|3 &nbsp; --=numRolls4|3 &nbsp; --=numRolls5|4 &nbsp; --=numRolls6|5 &nbsp; --=numRolls7|6 &nbsp; --=numRolls|0 &nbsp; --C[&amp;Settlement]|Thorp:=numRolls;[$numRolls1.Raw]|Hamlet:=numRolls;[$numRolls2.Raw]|Village:=numRolls;[$numRolls3.Raw]|Small Town:=numRolls;[$numRolls4.Raw]|Large Town:=numRolls;[$numRolls5.Raw]|Small City:=numRolls;[$numRolls6.Raw]|Large City:=numRolls;[$numRolls7.Raw] &nbsp; --%LoopCounter|1;[$numRolls.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R1|1d1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R2|1d2 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R3|1d3 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R4|1d4 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R5|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll1|1d7 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll2|1d12 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll3|1d20 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll|0 --/|NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=MatRoll;[$MatRoll1.Raw]|Hamlet:=MatRoll;[$MatRoll1.Raw]|Village:=MatRoll;[$MatRoll1.Raw]|Small Town:=MatRoll;[$MatRoll2.Raw]|Large Town:=MatRoll;[$MatRoll2.Raw]|Small City:=MatRoll;[$MatRoll3.Raw]|Large City:=MatRoll;[$MatRoll3.Raw] &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=R5;[$R1.Raw]|Hamlet:=R5;[$R1.Raw]|Village:=R5;[$R2.Raw]|Small Town:=R5;[$R2.Raw]|Large Town:=R5;[$R2.Raw]|Small City:=R5;[$R2.Raw]|Large City:=R5;[$R2.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;AddTools|[$MatRoll.Raw];[$R5.Raw] &nbsp;&nbsp;&nbsp; --%| &nbsp; &nbsp; --:BUILD COMMA-SEPARATED LIST| &nbsp; --&amp;displayToolString| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --?[$count[&amp;LoopCounter]] -gt 0|[ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&amp;displayToolString|+&nbsp; [b]([$count[&amp;LoopCounter].Raw])[/b] [&amp;item[&amp;LoopCounter]], &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --]| &nbsp; --%| &nbsp; --:CLEANUP TRAILING COMMA IN THE LIST STRING| &nbsp; --~stringLength|string;length;[&amp;displayToolString] &nbsp; --=numCharsToKeep|[$stringLength] - 1 &nbsp; --~displayToolString|string;substring;1;[$numCharsToKeep];[&amp;displayToolString] &nbsp; --:ENUMERATE WEAPON DESCRIPTIONS1|==================================================================================================&nbsp;&nbsp;&nbsp; &nbsp; --&amp;item1|Club [b]1 sp[/b] &nbsp; --&amp;item2|Sling [b]1 sp[/b] &nbsp; --&amp;item3|Dagger [b]2 gp[/b] &nbsp; --&amp;item4|Shortbow [b]25 gp[/b] &nbsp; --&amp;item5|Spear [b]1 gp[/b] &nbsp; --&amp;item6|Longsword [b]15 gp[/b] &nbsp; --&amp;item7|Shortsword [b]10 gp[/b] &nbsp; --&amp;item8|Sickle [b]1 gp[/b] &nbsp; --&amp;item9|Blowgun [b]10 gp[/b] &nbsp; --&amp;item10|Handaxe [b]5 gp[/b] &nbsp; --&amp;item11|Longbow [b]50 gp[/b] &nbsp; --&amp;item12|Maul [b]10 gp[/b] &nbsp; --&amp;item13|Javelin [b]5 sp[/b] &nbsp; --&amp;item14|Net [b]1 gp[/b] &nbsp; --&amp;item15|Crossbow, heavy [b]50 gp[/b] &nbsp; --&amp;item16|Scimitar [b]25 gp[/b] &nbsp; --&amp;item17|Flail [b]10 gp[/b] &nbsp; --&amp;item18|Trident [b]5 gp[/b] &nbsp; --&amp;item19|War pick [b]5 gp[/b] &nbsp; --&amp;item20|Glaive [b]20 gp[/b] &nbsp; --&amp;item21|Whip [b]2 gp[/b] &nbsp; --&amp;item22|Rapier [b]25 gp[/b] &nbsp; --&amp;item23|Crossbow, hand [b]75 gp[/b] &nbsp; --&amp;item24|Battleaxe [b]10 gp[/b] &nbsp; --&amp;item25|Halberd [b]20 gp[/b] &nbsp; --&amp;item26|Broad Sword [b]20 gp[/b] &nbsp; --&amp;item27|Mace [b]5 gp[/b] &nbsp; --&amp;item28|Warhammer [b]15 gp[/b] &nbsp; --&amp;item29|Pike [b]5 gp[/b] &nbsp; --&amp;item30|Greatclub [b]2 sp[/b] &nbsp; --&amp;item31|Morningstar [b]15 gp[/b] &nbsp; --&amp;item32|Bastard Sword [b]15 gp[/b] &nbsp; --&amp;item33|Crossbow, Light Repeating [b]125 gp[/b] &nbsp; --&amp;item34|Quarterstaff [b]2 sp[/b] &nbsp; --&amp;item35|Dagger, boot-toe [b]15 gp[/b] &nbsp; --&amp;item36|Greataxe [b]30 gp[/b] &nbsp; --&amp;item37|Gauntlet [b]6 gp[/b] &nbsp; --&amp;item38|Great Bow [b]100 gp[/b] &nbsp; --&amp;item39|Lance [b]10 gp[/b] &nbsp; --=numUniqueTypes|39 &nbsp; --^INITIALIZE WEAPON COUNTS| &nbsp; &nbsp; --:INITIALIZE WEAPON COUNTS| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[&amp;LoopCounter]|0 &nbsp; --%| &nbsp; --:LOOP THROUGH numRolls TO START ADDING ITEMS| &nbsp; --=numRolls1|3 &nbsp; --=numRolls2|4 &nbsp; --=numRolls3|6 &nbsp; --=numRolls4|8 &nbsp; --=numRolls5|9 &nbsp; --=numRolls6|10 &nbsp; --=numRolls7|12 &nbsp; --=numRolls|0 &nbsp; --C[&amp;Settlement]|Thorp:=numRolls;[$numRolls1.Raw]|Hamlet:=numRolls;[$numRolls2.Raw]|Village:=numRolls;[$numRolls3.Raw]|Small Town:=numRolls;[$numRolls4.Raw]|Large Town:=numRolls;[$numRolls5.Raw]|Small City:=numRolls;[$numRolls6.Raw]|Large City:=numRolls;[$numRolls7.Raw] &nbsp; --%LoopCounter|1;[$numRolls.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R1|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R2|1d6 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R3|1d8 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R4|1d8 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R5|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll1|1d15 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll2|1d20 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll3|1d39 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll|0 --/|NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=MatRoll;[$MatRoll1.Raw]|Hamlet:=MatRoll;[$MatRoll1.Raw]|Village:=MatRoll;[$MatRoll1.Raw]|Small Town:=MatRoll;[$MatRoll2.Raw]|Large Town:=MatRoll;[$MatRoll2.Raw]|Small City:=MatRoll;[$MatRoll3.Raw]|Large City:=MatRoll;[$MatRoll3.Raw] &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=R5;[$R1.Raw]|Hamlet:=R5;[$R1.Raw]|Village:=R5;[$R2.Raw]|Small Town:=R5;[$R2.Raw]|Large Town:=R5;[$R2.Raw]|Small City:=R5;[$R2.Raw]|Large City:=R5;[$R2.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;AddWeapons|[$MatRoll.Raw];[$R5.Raw] &nbsp;&nbsp;&nbsp; --%| &nbsp; &nbsp; --:BUILD COMMA-SEPARATED LIST| &nbsp; --&amp;displayWeaponString| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --?[$count[&amp;LoopCounter]] -gt 0|[ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&amp;displayWeaponString|+&nbsp; [b]([$count[&amp;LoopCounter].Raw])[/b] [&amp;item[&amp;LoopCounter]], &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --]| &nbsp; --%| &nbsp; --:CLEANUP TRAILING COMMA IN THE LIST STRING| &nbsp; --~stringLength|string;length;[&amp;displayWeaponString] &nbsp; --=numCharsToKeep|[$stringLength] - 1 &nbsp; --~displayWeaponString|string;substring;1;[$numCharsToKeep];[&amp;displayWeaponString] &nbsp; &nbsp; --:ENUMERATE AMMO DESCRIPTIONS|=================================================================================================== &nbsp; --&amp;item1|Bullets, Sling Stone (20) [b]4 cp[/b] &nbsp; --&amp;item2|Dart [b]5 cp[/b] each &nbsp; --&amp;item3|Bolts, Heavy Crossbow single [b]8 cp[/b] &nbsp; --&amp;item4|Bolts, Heavy Crossbow bundle (20) 1 [b]gp[/b] &nbsp; --&amp;item5|Arrows, single [b]8 cp[/b] &nbsp; --&amp;item6|Arrows, bundle (20) [b]1 gp[/b] &nbsp; --&amp;item7|Bolts, Hand Crossbow single [b]8 cp[/b] &nbsp; --&amp;item8|Arrows, Silvered singe [b]15 gp[/b] &nbsp; --&amp;item9|Bolts, Light Crossbow single [b]8 cp[/b] &nbsp; --&amp;item10|Bolts, Light Crossbow bundle (20) [b]1 gp[/b] &nbsp; --&amp;item11|Arrows, Silvered bundle (10) [b]100 gp[/b] &nbsp; --&amp;item12|Bolts, Hand Crossbow bundle (20) 1 [b]gp[/b] &nbsp; --&amp;item13|Bolts, Light Repeating single [b]12 cp[/b] &nbsp; --&amp;item14|Bolts, Light Repeating bundle (10) [b]1 gp[/b] &nbsp; --=numUniqueTypes|14 &nbsp; --^INITIALIZE AMMO COUNTS| &nbsp; --:INITIALIZE AMMO COUNTS| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[&amp;LoopCounter]|0 &nbsp; --%| &nbsp; &nbsp; --:LOOP THROUGH numRolls TO START ADDING ITEMS| &nbsp; --=numRolls1|3 &nbsp; --=numRolls2|3 &nbsp; --=numRolls3|4 &nbsp; --=numRolls4|4 &nbsp; --=numRolls5|5 &nbsp; --=numRolls6|6 &nbsp; --=numRolls7|7 &nbsp; --=numRolls|0 &nbsp; --C[&amp;Settlement]|Thorp:=numRolls;[$numRolls1.Raw]|Hamlet:=numRolls;[$numRolls2.Raw]|Village:=numRolls;[$numRolls3.Raw]|Small Town:=numRolls;[$numRolls4.Raw]|Large Town:=numRolls;[$numRolls5.Raw]|Small City:=numRolls;[$numRolls6.Raw]|Large City:=numRolls;[$numRolls7.Raw] &nbsp; --%LoopCounter|1;[$numRolls.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R1|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R2|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R3|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R4|1d4 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R5|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll1|1d6 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll2|1d8 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll3|1d14 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll|0 --/|NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=MatRoll;[$MatRoll1.Raw]|Hamlet:=MatRoll;[$MatRoll1.Raw]|Village:=MatRoll;[$MatRoll1.Raw]|Small Town:=MatRoll;[$MatRoll2.Raw]|Large Town:=MatRoll;[$MatRoll2.Raw]|Small City:=MatRoll;[$MatRoll3.Raw]|Large City:=MatRoll;[$MatRoll3.Raw] &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=R5;[$R1.Raw]|Hamlet:=R5;[$R1.Raw]|Village:=R5;[$R2.Raw]|Small Town:=R5;[$R2.Raw]|Large Town:=R5;[$R2.Raw]|Small City:=R5;[$R2.Raw]|Large City:=R5;[$R2.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;AddAmmo|[$MatRoll.Raw];[$R5.Raw] &nbsp;&nbsp;&nbsp; --%| &nbsp; &nbsp; --:BUILD COMMA-SEPARATED LIST| &nbsp; --&amp;displayAmmoString| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --?[$count[&amp;LoopCounter]] -gt 0|[ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&amp;displayAmmoString|+&nbsp; [b]([$count[&amp;LoopCounter].Raw])[/b] [&amp;item[&amp;LoopCounter]], &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --]| &nbsp; --%| &nbsp; --:CLEANUP TRAILING COMMA IN THE LIST STRING| &nbsp; --~stringLength|string;length;[&amp;displayAmmoString] &nbsp; --=numCharsToKeep|[$stringLength] - 1 &nbsp; --~displayAmmoString|string;substring;1;[$numCharsToKeep];[&amp;displayAmmoString] &nbsp; &nbsp; --:ENUMERATE ARMOR DESCRIPTIONS1|================================================================================================== &nbsp; --&amp;item1|Padded [b]5 gp[/b] &nbsp; --&amp;item2|Leather [b]10 gp[/b] &nbsp; --&amp;item3|Studded leather [b]45 gp[/b] &nbsp; --&amp;item4|Hide [b]10 gp[/b] &nbsp; --&amp;item5|Chain shirt [b]50 gp[/b] &nbsp; --&amp;item6|Shield [b]10 gp[/b] &nbsp; --&amp;item7|Ring mail [b]30 gp[/b] &nbsp; --&amp;item8|Scale mail [b]50 gp[/b] &nbsp; --&amp;item9|Chain mail [b]75 gp[/b] &nbsp; --&amp;item10|Splint [b]200 gp[/b] &nbsp; --&amp;item11|Breastplate [b]400 gp[/b] &nbsp; --&amp;item12|Half plate [b]750 gp[/b] &nbsp; --&amp;item13|Plate [b]1,500 gp[/b] &nbsp; --=numUniqueTypes|13 &nbsp; --^INITIALIZE ARMOR COUNTS| &nbsp; --:INITIALIZE ARMOR COUNTS| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[&amp;LoopCounter]|0 &nbsp; --%| &nbsp; &nbsp; &nbsp; --:LOOP THROUGH numRolls TO START ADDING ITEMS| &nbsp; --=numRolls1|2 &nbsp; --=numRolls2|4 &nbsp; --=numRolls3|4 &nbsp; --=numRolls4|6 &nbsp; --=numRolls5|6 &nbsp; --=numRolls6|8 &nbsp; --=numRolls7|8 &nbsp; --=numRolls|0 &nbsp; --C[&amp;Settlement]|Thorp:=numRolls;[$numRolls1.Raw]|Hamlet:=numRolls;[$numRolls2.Raw]|Village:=numRolls;[$numRolls3.Raw]|Small Town:=numRolls;[$numRolls4.Raw]|Large Town:=numRolls;[$numRolls5.Raw]|Small City:=numRolls;[$numRolls6.Raw]|Large City:=numRolls;[$numRolls7.Raw] &nbsp; --%LoopCounter|1;[$numRolls.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R1|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R2|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R3|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R4|1d4 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R5|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll1|1d6 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll2|1d9 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll3|1d13 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll|0 --/|NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=MatRoll;[$MatRoll1.Raw]|Hamlet:=MatRoll;[$MatRoll1.Raw]|Village:=MatRoll;[$MatRoll1.Raw]|Small Town:=MatRoll;[$MatRoll2.Raw]|Large Town:=MatRoll;[$MatRoll2.Raw]|Small City:=MatRoll;[$MatRoll3.Raw]|Large City:=MatRoll;[$MatRoll3.Raw] &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=R5;[$R1.Raw]|Hamlet:=R5;[$R1.Raw]|Village:=R5;[$R2.Raw]|Small Town:=R5;[$R2.Raw]|Large Town:=R5;[$R2.Raw]|Small City:=R5;[$R2.Raw]|Large City:=R5;[$R2.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;AddArmor|[$MatRoll.Raw];[$R5.Raw] &nbsp;&nbsp;&nbsp; --%| &nbsp; &nbsp; --:BUILD COMMA-SEPARATED LIST| &nbsp; --&amp;displayArmorString| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --?[$count[&amp;LoopCounter]] -gt 0|[ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&amp;displayArmorString|+&nbsp; [b]([$count[&amp;LoopCounter].Raw])[/b] [&amp;item[&amp;LoopCounter]], &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --]| &nbsp; --%| &nbsp; --:CLEANUP TRAILING COMMA IN THE LIST STRING| &nbsp; --~stringLength|string;length;[&amp;displayArmorString] &nbsp; --=numCharsToKeep|[$stringLength] - 1 &nbsp; --~displayArmorString|string;substring;1;[$numCharsToKeep];[&amp;displayArmorString] &nbsp; &nbsp; &nbsp; --:ENUMERATE COMMON GEAR DESCRIPTIONS1|================================================================================================== &nbsp; &nbsp; --&amp;item1|Fishing hook [b]1 cp[/b] &nbsp; --&amp;item2|Backpack [b]2 gp[/b] &nbsp; --&amp;item3|Bag of ball bearings (bag o f 1,000) [b]1 gp[/b] &nbsp; --&amp;item4|Barrel [b]2 gp[/b] &nbsp; --&amp;item5|Basket [b]4 sp[/b] &nbsp; --&amp;item6|Healer’s kit [b]5 gp[/b] &nbsp; --&amp;item7|Wooden staff [b]5 gp[/b] &nbsp; --&amp;item8|Bottle, glass [b]2 gp[/b] &nbsp; --&amp;item9|Bucket [b]5 cp[/b] &nbsp; --&amp;item10|Bag of Caltrops (bag of 20) [b]1 gp[/b] &nbsp; --&amp;item11|Whetstone [b]1 cp[/b] &nbsp; --&amp;item12|Case, map or scroll [b]1 gp[/b] &nbsp; --&amp;item13|Chain (10 feet) [b]5 gp[/b] &nbsp; --&amp;item14|Chalk (1 piece) [b]1 cp[/b] &nbsp; --&amp;item15|Component pouch [b]25 gp[/b] &nbsp; --&amp;item16|Crowbar [b]2 gp[/b] &nbsp; --&amp;item17|Fishing tackle [b]1 gp[/b] &nbsp; --&amp;item18|Flask or tankard [b]2 cp[/b] &nbsp; --&amp;item19|Grappling hook [b]2 gp[/b] &nbsp; --&amp;item20|Hacksaw, common [b]5 gp[/b] &nbsp; --&amp;item21|Hammer [b]1 gp[/b] &nbsp; --&amp;item22|Hammock [b]5 gp[/b] &nbsp; --&amp;item23|Twine, roll (50 ft.) [b]1 sp[/b] &nbsp; --&amp;item24|Hoe, farming tool [b]3 gp[/b] &nbsp; --&amp;item25|Hunting trap [b]5 gp[/b] &nbsp; --&amp;item26|Jug or pitcher [b]2 cp[/b] &nbsp; --&amp;item27|Keg, hand [b]5 sp[/b] &nbsp; --&amp;item28|Lamp [b]5 sp[/b] &nbsp; --&amp;item29|Bag of marbles (10) [b]2 sp[/b] &nbsp; --&amp;item30|Torch [b]1 cp[/b] &nbsp; --&amp;item31|Oil (flask) [b]1 sp[/b] &nbsp; --&amp;item32|Parchment [b]1 sp[/b] &nbsp; --&amp;item33|Pick, miner’s [b]2 gp[/b] &nbsp; --&amp;item34|Pipe, wood [b]1 cp[/b] &nbsp; --&amp;item35|Pole (10-foot) [b]5 cp[/b] &nbsp; --&amp;item36|Pot, iron [b]2 gp[/b] &nbsp; --&amp;item37|Pouch [b]5 sp[/b] &nbsp; --&amp;item38|Quiver [b]1 gp[/b] &nbsp; --&amp;item39|Rake, farming tool [b]1 gp[/b] &nbsp; --&amp;item40|Shovel [b]2 gp[/b] &nbsp; --&amp;item41|Rope, hempen (50 feet) [b]1 gp[/b] &nbsp; --&amp;item42|Lock [b]10 gp[/b] &nbsp; --&amp;item43|Saw, folding 2 gp[/b] &nbsp; --&amp;item44|Bag of Spikes, iron (10) [b]1 gp[/b] &nbsp; --&amp;item45|Signal whistle [b]5 cp[/b] &nbsp; --&amp;item46|Soap [b]2 cp[/b] &nbsp; --&amp;item47|Tarp [b]5 gp[/b] &nbsp; --&amp;item48|Staff [b]5 gp[/b] &nbsp; --&amp;item49|Tongs, metal [b]3 gp[/b] &nbsp; --&amp;item50|Vial [b]1 gp[/b] &nbsp; --&amp;item51|Wood box, large [b]15 gp[/b] &nbsp; --&amp;item52|Goblet [b]5 gp[/b] &nbsp; --&amp;item53|Saddle bag [b]4 gp[/b] &nbsp; --&amp;item54|Shoulder purse [b]3 gp[/b] &nbsp; --&amp;item55|Tobacco pouch, leather [b]1 gp[/b] &nbsp; --&amp;item56|Wood box, medium [b]10 gp[/b] &nbsp; --&amp;item57|Wood box, small [b]5 gp[/b] &nbsp; --&amp;item58|Animal Call [b]20 gp[/b] &nbsp; --&amp;item59|Armor Maintenance kit [b]1 gp[/b] &nbsp; --&amp;item60|Bell [b]1 [b[/b] &nbsp; --&amp;item61|Billhook, farming tool [b]5 gp[/b] &nbsp; --&amp;item62|Block and tackle [b]1 gp[/b] &nbsp; --&amp;item63|Book [b]25 gp[/b] &nbsp; --&amp;item64|Brewmaker, dwarven [b]40 gp[/b] &nbsp; --&amp;item65|Candle mold [b]12 sp[/b] &nbsp; --&amp;item66|Candle, insectbane [b]1 sp[/b] &nbsp; --&amp;item67|Case, crossbow bolt [b]1 gp[/b] &nbsp; --&amp;item68|Chest [b]5 gp[/b] &nbsp; --&amp;item69|Climber's kit [b]25 gp[/b] &nbsp; --&amp;item70|Crystal [b]10 gp[/b] &nbsp; --&amp;item71|Earplugs (pair) [b]3 sp[/b] &nbsp; --&amp;item72|Game board, portable [b]2 gp[/b] &nbsp; --&amp;item73|Hacksaw, superior [b]20 gp[/b] &nbsp; --&amp;item74|Ink (1 ounce bottle) [b]10 gp[/b] &nbsp; --&amp;item75|Ink pen [b]2 cp[/b] &nbsp; --&amp;item76|Keg, cask [b]1 gp[/b] &nbsp; --&amp;item77|Lantern, hooded [b]5 gp[/b] &nbsp; --&amp;item78|Leash &amp; muzzle, Medium-size [b]8 sp[/b] &nbsp; --&amp;item79|Leash &amp; muzzle, Small [b]6 sp[/b] &nbsp; --&amp;item80|Manacles [b]2 gp[/b] &nbsp; --&amp;item81|Mill, hand [b]2 gp[/b] &nbsp; --&amp;item82|Net, butterfly [b]10 gp[/b] &nbsp; --&amp;item83|Orb [b]10 gp[/b] &nbsp; --&amp;item84|Pestle and mortar [b]5 gp[/b] &nbsp; --&amp;item85|Pitchfork, farming tool [b]2 gp[/b] &nbsp; --&amp;item86|Piton [b]5 cp[/b] &nbsp; --&amp;item87|Quiver scabbard [b]10 gp[/b] &nbsp; --&amp;item88|Rod [b]10 [b]gp[/b] &nbsp; --&amp;item89|Sealing wax [b]5 sp[/b] &nbsp; --&amp;item90|Signet ring [b]5 gp[/b] &nbsp; --&amp;item91|Slate board [b]5 gp[/b] &nbsp; --&amp;item92|Sparker [b]2 gp[/b] &nbsp; --&amp;item93|Sprig of mistletoe [b]1 gp[/b] &nbsp; --&amp;item94|Tent, one person [b]5 gp[/b] &nbsp; --&amp;item95|Tent, two-person [b]2 gp[/b] &nbsp; --&amp;item96|Totem [b]1 gp[/b] &nbsp; --&amp;item97|Wand [b]10 gp[/b] &nbsp; --&amp;item98|Wick, candle (50 ft.) [b]2 sp[/b] &nbsp; --&amp;item99|Chest, Large [b]50 gp[/b] &nbsp; --&amp;item100|Acid (vial) [b]25 gp[/b] &nbsp; --&amp;item101|Alchemist’s fire (flask) 50 [b]gp[/b] &nbsp; --&amp;item102|Antitoxin (vial) [b]50 gp[/b] &nbsp; --&amp;item103|Barbed wire (50 ft.) [b]75 gp[/b] &nbsp; --&amp;item104|Book, false [b]30 gp[/b] &nbsp; --&amp;item105|Flotation bags [b]5 gp[/b] &nbsp; --&amp;item106|Fowler's snare [b]20 gp[/b] &nbsp; --&amp;item107|Glass cutter [b]2 gp[/b] &nbsp; --&amp;item108|Hammer, sledge [b]2 gp[/b] &nbsp; --&amp;item109|Holy symbol, Amulet [b]5 gp[/b] &nbsp; --&amp;item110|Holy symbol, Emblem [b]5 gp[/b] &nbsp; --&amp;item111|Holy symbol, Reliquary [b]5 gp[/b] &nbsp; --&amp;item112|Holy text [b]10 gp[/b] &nbsp; --&amp;item113|Holy water (flask) [b]25 gp[/b] &nbsp; --&amp;item114|Ice axe [b]10 gp[/b] &nbsp; --&amp;item115|Jeweler's loupe [b]20 gp[/b] &nbsp; --&amp;item116|Ladder (10-foot) [b]1 sp[/b] &nbsp; --&amp;item117|Lantern, bullseye [b]10 gp[/b] &nbsp; --&amp;item118|Leash &amp; muzzle, Diminutive [b]2 sp[/b] &nbsp; --&amp;item119|Money belt [b]4 gp[/b] &nbsp; --&amp;item120|Perfume (vial) [b]5 gp[/b] &nbsp; --&amp;item121|Potion of healing [b]50 gp[/b] &nbsp; --&amp;item122|Rope, silk (50 feet) [b]10 gp[/b] &nbsp; --&amp;item123|Scale, merchant’s [b]5 gp[/b] &nbsp; --&amp;item124|Teepee [b]60 gp[/b] &nbsp; --&amp;item125|Water, Lawful/Chaotic [b]25 gp[/b] &nbsp; --&amp;item126|Spellbook [b]50 gp[/b] &nbsp; --&amp;item127|Bolt cutters [b]6 gp[/b] &nbsp; --&amp;item128|Grappling ladder (10 ft.) [b]40 gp[/b] &nbsp; --&amp;item129|Insect netting [b]200 gp[/b] &nbsp; --&amp;item130|Abacus [b]2 gp[/b] &nbsp; --&amp;item131|Ascender/slider [b]20 gp[/b] &nbsp; --&amp;item132|Banner/Standard [b]30 gp[/b] &nbsp; --&amp;item133|Cage, Diminutive [b]10 gp[/b] &nbsp; --&amp;item134|Cage, Large [b]75 gp[/b] &nbsp; --&amp;item135|Cage, Medium-size [b]50 gp[/b] &nbsp; --&amp;item136|Cage, Small [b]25 gp[/b] &nbsp; --&amp;item137|Cage, Tiny [b]15 gp[/b] &nbsp; --&amp;item138|Candelabra, Gold, eight candle [b]20 gp[/b] &nbsp; --&amp;item139|Candelabra, Gold, four candle [b]10 gp[/b] &nbsp; --&amp;item140|Candelabra, Gold, sixteen candle [b]25 gp[/b] &nbsp; --&amp;item141|Candelabra, Silver, eight candle [b]35 gp[/b] &nbsp; --&amp;item142|Candelabra, Silver, four candle [b]25 gp[/b] &nbsp; --&amp;item143|Candelabra, Silver, sixteen candle [b]45 gp[/b] &nbsp; --&amp;item144|Crane, portable - (STR 22) [b]30 gp[/b] &nbsp; --&amp;item145|Crane, portable - (STR 24) [b]60 gp[/b] &nbsp; --&amp;item146|Crane, portable - (STR 28) [b]120 gp[/b] &nbsp; --&amp;item147|Finger blades [b]20 gp[/b] &nbsp; --&amp;item148|Grappling hook, collapsible [b]3 gp[/b] &nbsp; --&amp;item149|Heat mat [b]45 gp[/b] &nbsp; --&amp;item150|Hourglass [b]25 gp[/b] &nbsp; --&amp;item151|Housebreaker harness [b]20 gp[/b] &nbsp; --&amp;item152|Lantern, fog-cutter [b]20 gp[/b] &nbsp; --&amp;item153|Leash &amp; muzzle, Tiny [b]4 sp[/b] &nbsp; --&amp;item154|Magnet, small [b]10 gp[/b] &nbsp; --&amp;item155|Magnifying glass [b]100 gp[/b] &nbsp; --&amp;item156|Mirror, steel [b]5 gp[/b] &nbsp; --&amp;item157|Music box [b]35 gp[/b] &nbsp; --&amp;item158|Percolator [b]1 gp[/b] &nbsp; --&amp;item159|Periscope [b]1000 gp[/b] &nbsp; --&amp;item160|Poison, basic (vial) [b]100 gp[/b] &nbsp; --&amp;item161|Post-hole digger, farming tool [b]4 gp[/b] &nbsp; --&amp;item162|Pulley [b]5 gp[/b] &nbsp; --&amp;item163|Ram, portable [b]4 gp[/b] &nbsp; --&amp;item164|Rope, elven (20 ft.) [b]50 gp[/b] &nbsp; --&amp;item165|Shoes, silent [b]10 gp[/b] &nbsp; --&amp;item166|Shriek rock [b]3 gp[/b] &nbsp; --&amp;item167|Skis and poles [b]15 gp[/b] &nbsp; --&amp;item168|Snorkel [b]1 gp[/b] &nbsp; --&amp;item169|Snow goggles [b]2 gp[/b] &nbsp; --&amp;item170|Snowshoes [b]15 gp[/b] &nbsp; --&amp;item171|Spider poles [b]35 gp[/b] &nbsp; --&amp;item172|Sprayer [b]15 gp[/b] &nbsp; --&amp;item173|Springwall [b]60 gp[/b] &nbsp; --&amp;item174|Spyglass [b]1000 gp[/b] &nbsp; --&amp;item175|Stilts [b]5 gp[/b] &nbsp; --&amp;item176|Table case, folding [b]5 gp[/b] &nbsp; --&amp;item177|Tent, four person [b]20 gp[/b] &nbsp; --&amp;item178|Tent, pavilion [b]100 gp[/b] &nbsp; --&amp;item179|Thieving helmet [b]10 gp[/b] &nbsp; --&amp;item180|Tree stand [b]15 gp[/b] &nbsp; --&amp;item181|Tree tent, elven [b]30 gp[/b] &nbsp; --&amp;item182|Winch, portable - (STR 18) [b]20 gp[/b] &nbsp; --&amp;item183|Winch, portable - (STR 20) [b]40 gp[/b] &nbsp; --&amp;item184|Winch, portable - (STR 22) [b]80 gp[/b] &nbsp; --&amp;item185|Yew wand [b]10 gp[/b] &nbsp; --=numUniqueTypes|185 &nbsp; --^INITIALIZE COMMON GEAR COUNTS| &nbsp; --:INITIALIZE COMMON GEAR COUNTS| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[&amp;LoopCounter]|0 &nbsp; --%| &nbsp; --:LOOP THROUGH numRolls TO START ADDING ITEMS| &nbsp; --=numRolls1|8 &nbsp; --=numRolls2|9 &nbsp; --=numRolls3|9 &nbsp; --=numRolls4|14 &nbsp; --=numRolls5|16 &nbsp; --=numRolls6|20 &nbsp; --=numRolls7|25 &nbsp; --=numRolls|0 &nbsp; --C[&amp;Settlement]|Thorp:=numRolls;[$numRolls1.Raw]|Hamlet:=numRolls;[$numRolls2.Raw]|Village:=numRolls;[$numRolls3.Raw]|Small Town:=numRolls;[$numRolls4.Raw]|Large Town:=numRolls;[$numRolls5.Raw]|Small City:=numRolls;[$numRolls6.Raw]|Large City:=numRolls;[$numRolls7.Raw] &nbsp; --%LoopCounter|1;[$numRolls.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R1|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R2|1d6 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R3|1d8 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R4|1d10 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R5|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll1|1d50 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll2|1d98 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll3|1d185 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll|0 --/|NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=MatRoll;[$MatRoll1.Raw]|Hamlet:=MatRoll;[$MatRoll1.Raw]|Village:=MatRoll;[$MatRoll1.Raw]|Small Town:=MatRoll;[$MatRoll2.Raw]|Large Town:=MatRoll;[$MatRoll2.Raw]|Small City:=MatRoll;[$MatRoll3.Raw]|Large City:=MatRoll;[$MatRoll3.Raw] &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=R5;[$R1.Raw]|Hamlet:=R5;[$R1.Raw]|Village:=R5;[$R2.Raw]|Small Town:=R5;[$R2.Raw]|Large Town:=R5;[$R2.Raw]|Small City:=R5;[$R2.Raw]|Large City:=R5;[$R2.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;AddCommonGear|[$MatRoll.Raw];[$R5.Raw] &nbsp;&nbsp;&nbsp; --%| &nbsp; &nbsp; --:BUILD COMMA-SEPARATED LIST| &nbsp; --&amp;displayCommonGearString| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --?[$count[&amp;LoopCounter]] -gt 0|[ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&amp;displayCommonGearString|+&nbsp; [b]([$count[&amp;LoopCounter].Raw])[/b] [&amp;item[&amp;LoopCounter]], &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --]| &nbsp; --%| &nbsp; --:CLEANUP TRAILING COMMA IN THE LIST STRING| &nbsp; --~stringLength|string;length;[&amp;displayCommonGearString] &nbsp; --=numCharsToKeep|[$stringLength] - 1 &nbsp; --~displayCommonGearString|string;substring;1;[$numCharsToKeep];[&amp;displayCommonGearString] &nbsp; &nbsp; --:ENUMERATE TOBACCO DESCRIPTIONS| &nbsp; --&amp;item1|(lbs.) of Blackberry Yeti [b]5 sp/oz.[/b] &nbsp; --&amp;item2|(lbs.) of Vanilla Clanvendish [b]5 cp/oz.[/b] &nbsp; --&amp;item3|(lbs.) of Aged Fey Perique [b]5 gp/oz.[/b] &nbsp; --&amp;item4|(lbs.) of Faerun Original [b]3 sp/oz.[/b] &nbsp; --&amp;item5|(lbs.) of Faerun Fire [b]5 sp/oz.[/b] &nbsp; --&amp;item6|(lbs.) of Paladin Black Cherry [b]8 sp/oz.[/b] &nbsp; --&amp;item7|(lbs.) of Halfling Hash [b]1 gp/oz.[/b] &nbsp; --&amp;item8|(lbs.) of Hardbuckler Mint [b]8 sp/oz.[/b] &nbsp; --&amp;item9|(lbs.) of Hardbuckler Smooth [b]5 sp/oz.[/b] &nbsp; --&amp;item10|(lbs.) of Hardbuckler Horn [b]10 sp/oz.[/b] &nbsp; --&amp;item11|(lbs.) of Adventurer Blend [b]2 sp/oz.[/b] &nbsp; --&amp;item12|(lbs.) of Fey Flake [b]5 gp/oz.[/b] &nbsp; --&amp;item13|(lbs.) of The Alliance [b]8 sp/oz.[/b] &nbsp; --&amp;item14|(lbs.) of Lord Ladykiller [b]10 sp/oz.[/b] &nbsp; --&amp;item15|(lbs.) of Miner's Maiden [b]7 sp/oz.[/b] &nbsp; --&amp;item16|(lbs.) of Captain's Delight Gold [b]5 sp/oz.[/b] &nbsp; --&amp;item17|(lbs.) of Captain's Delight Royal [b]5 gp/oz.[/b] &nbsp; --&amp;item18|(lbs.) of The Homesteader [b]3 sp/oz.[/b] &nbsp; --&amp;item19|(lbs.) of Vineshade Grape [b]10 sp/oz.[/b] &nbsp; --&amp;item20|(lbs.) of Vineshade [b]7 sp/oz.[/b] &nbsp; --&amp;item21|(lbs.) of Vineshade Spiced [b]5 gp/oz.[/b] &nbsp; --&amp;item22|(lbs.) of Turmish Blackpool [b]3 gp/oz.[/b] &nbsp; --&amp;item23|(lbs.) of Baldur's Blend [b]7 gp/oz.[/b] &nbsp; --&amp;item24|(lbs.) of Baldur's Blend Platinum [b]10 gp/oz.[/b] &nbsp; --&amp;item25|(lbs.) of Happy Halfling [b]7 cp/oz.[/b] &nbsp; --&amp;item26|(lbs.) of Forge Masters Blend [b]7 cp/oz.[/b] &nbsp; --&amp;item27|(lbs.) of Quarrelshigh Quail [b]2 sp/oz.[/b] &nbsp; --=numUniqueTypes|27 &nbsp; &nbsp; --^INITIALIZE TOBACCO COUNTS| &nbsp; &nbsp; --:INITIALIZE TOBACCO COUNTS| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[&amp;LoopCounter]|0 &nbsp; --%| &nbsp; --:LOOP THROUGH numRolls TO START ADDING ITEMS| &nbsp; --=numRolls1|2 &nbsp; --=numRolls2|2 &nbsp; --=numRolls3|2 &nbsp; --=numRolls4|3 &nbsp; --=numRolls5|3 &nbsp; --=numRolls6|4 &nbsp; --=numRolls7|4 &nbsp; --=numRolls|0 &nbsp; --C[&amp;Settlement]|Thorp:=numRolls;[$numRolls1.Raw]|Hamlet:=numRolls;[$numRolls2.Raw]|Village:=numRolls;[$numRolls3.Raw]|Small Town:=numRolls;[$numRolls4.Raw]|Large Town:=numRolls;[$numRolls5.Raw]|Small City:=numRolls;[$numRolls6.Raw]|Large City:=numRolls;[$numRolls7.Raw] &nbsp; --%LoopCounter|1;[$numRolls.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R1|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R2|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R3|1d4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R4|1d1 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R5|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll1|1d27 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll2|1d27 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll3|1d27 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll|0 --/|NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=MatRoll;[$MatRoll1.Raw]|Hamlet:=MatRoll;[$MatRoll1.Raw]|Village:=MatRoll;[$MatRoll1.Raw]|Small Town:=MatRoll;[$MatRoll2.Raw]|Large Town:=MatRoll;[$MatRoll2.Raw]|Small City:=MatRoll;[$MatRoll3.Raw]|Large City:=MatRoll;[$MatRoll3.Raw] &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=R5;[$R1.Raw]|Hamlet:=R5;[$R1.Raw]|Village:=R5;[$R2.Raw]|Small Town:=R5;[$R2.Raw]|Large Town:=R5;[$R2.Raw]|Small City:=R5;[$R2.Raw]|Large City:=R5;[$R2.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;AddTobacco|[$MatRoll.Raw];[$R5.Raw] &nbsp;&nbsp;&nbsp; --%| &nbsp; &nbsp; --:BUILD COMMA-SEPARATED LIST| &nbsp; --&amp;displayTobaccoString| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --?[$count[&amp;LoopCounter]] -gt 0|[ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&amp;displayTobaccoString|+&nbsp; [b]([$count[&amp;LoopCounter].Raw])[/b] [&amp;item[&amp;LoopCounter]], &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --]| &nbsp; --%| &nbsp; --:CLEANUP TRAILING COMMA IN THE LIST STRING| &nbsp; --~stringLength|string;length;[&amp;displayTobaccoString] &nbsp; --=numCharsToKeep|[$stringLength] - 1 &nbsp; --~displayTobaccoString|string;substring;1;[$numCharsToKeep];[&amp;displayTobaccoString] &nbsp; &nbsp; &nbsp; &nbsp; --:ENUMERATE TRAIL FOOD DESCRIPTIONS|====================================================================================== &nbsp; --&amp;item1|Loaves of Buckwheat bread (loaf) [b]1 cp[/b] &nbsp; --&amp;item2|Loaves of Corn bread (loaf) [b]2 cp[/b] &nbsp; --&amp;item3|Loaves of Fruit bread (loaf) [b]5 cp[/b] &nbsp; --&amp;item4|Loaves of Sweet bread (loaf) [b]3 cp[/b] &nbsp; --&amp;item5|lbs. of Berries (lb) [b]3 cp[/b] &nbsp; --&amp;item6|lbs. of Dried Fruit (lb) [b]3 cp[/b] &nbsp; --&amp;item7|lbs. of Figs (lb) [b]3 cp[/b] &nbsp; --&amp;item8|dozen Apples (doz) [b]3 cp[/b] &nbsp; --&amp;item9|dozen Pears (doz) [b]3 cp[/b] &nbsp; --&amp;item10|lbs. of Mixed Nuts (lb) [b]8 cp[/b] &nbsp; --&amp;item11|lbs. of Deer Jerky (lb) [b]1 sp[/b] &nbsp; --&amp;item12|lbs. of Beef Sticks (lb) [b]1 sp[/b] &nbsp; --&amp;item13|jars of Pickled Eggs (jar) [b]5 cp[/b] &nbsp; --&amp;item14|jars of Pickled Olives (jar) [b]5 cp[/b] &nbsp; --&amp;item15|jars of Pickled Beets (jar) [b]3 cp[/b] &nbsp; --&amp;item16|lbs. of Carrots (lb) [b]3 cp[/b] &nbsp; --&amp;item17|lbs. of Potatoes (lb) [b]3 cp[/b] &nbsp; --&amp;item18|heads of Cabbage (head) [b]1 cp[/b] &nbsp; --&amp;item19|dozen Fig Cookies (doz) [b]2 cp[/b] &nbsp; --&amp;item20|Fruit Handpies (ea) [b]3 cp[/b] &nbsp; --&amp;item21|Vegetable Handpies (ea) [b]3 cp[/b] &nbsp; --&amp;item22|dozen Ginger Candy (doz) [b]3 cp[/b] &nbsp; --&amp;item23|dozen Honey Candy (doz) [b]3 cp[/b] &nbsp; --&amp;item24|Fruit Tarts (ea) [b]3 cp[/b] &nbsp; --&amp;item25|Berry Tarts (ea) [b]3 cp[/b] &nbsp; --=numUniqueTypes|25 &nbsp; --^INITIALIZE TRAIL FOOD COUNTS| &nbsp; --:INITIALIZE TRAIL FOOD COUNTS| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[&amp;LoopCounter]|0 &nbsp; --%| &nbsp; --:LOOP THROUGH numRolls TO START ADDING ITEMS| &nbsp; --=numRolls1|2 &nbsp; --=numRolls2|2 &nbsp; --=numRolls3|2 &nbsp; --=numRolls4|3 &nbsp; --=numRolls5|3 &nbsp; --=numRolls6|4 &nbsp; --=numRolls7|4 &nbsp; --=numRolls|0 &nbsp; --C[&amp;Settlement]|Thorp:=numRolls;[$numRolls1.Raw]|Hamlet:=numRolls;[$numRolls2.Raw]|Village:=numRolls;[$numRolls3.Raw]|Small Town:=numRolls;[$numRolls4.Raw]|Large Town:=numRolls;[$numRolls5.Raw]|Small City:=numRolls;[$numRolls6.Raw]|Large City:=numRolls;[$numRolls7.Raw] &nbsp; --%LoopCounter|1;[$numRolls.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R1|1d1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R2|1d1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R3|1d1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R4|1d1 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=R5|0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll1|1d25 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll2|1d25 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll3|1d25 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll|0 --/|NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=MatRoll;[$MatRoll1.Raw]|Hamlet:=MatRoll;[$MatRoll1.Raw]|Village:=MatRoll;[$MatRoll1.Raw]|Small Town:=MatRoll;[$MatRoll2.Raw]|Large Town:=MatRoll;[$MatRoll2.Raw]|Small City:=MatRoll;[$MatRoll3.Raw]|Large City:=MatRoll;[$MatRoll3.Raw] &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=R5;[$R1.Raw]|Hamlet:=R5;[$R1.Raw]|Village:=R5;[$R2.Raw]|Small Town:=R5;[$R2.Raw]|Large Town:=R5;[$R2.Raw]|Small City:=R5;[$R2.Raw]|Large City:=R5;[$R2.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;AddTrailFood|[$MatRoll.Raw];[$R5.Raw] &nbsp;&nbsp;&nbsp; --%| &nbsp; &nbsp; --:BUILD COMMA-SEPARATED LIST| &nbsp; --&amp;displayTrailFoodString| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --?[$count[&amp;LoopCounter]] -gt 0|[ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&amp;displayTrailFoodString|+&nbsp; [b]([$count[&amp;LoopCounter].Raw])[/b] [&amp;item[&amp;LoopCounter]], &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --]| &nbsp; --%| &nbsp; --:CLEANUP TRAILING COMMA IN THE LIST STRING| &nbsp; --~stringLength|string;length;[&amp;displayTrailFoodString] &nbsp; --=numCharsToKeep|[$stringLength] - 1 &nbsp; --~displayTrailFoodString|string;substring;1;[$numCharsToKeep];[&amp;displayTrailFoodString] &nbsp; --&amp;Rations|[b]([=1d20])[/b] Days Rations [b]5 sp[/b] &nbsp; &nbsp; &nbsp; --/| Determine if Special Items are available for sale &nbsp; --:Availability| &nbsp;&nbsp;&nbsp; --=MatRoll|1d100 &nbsp;&nbsp;&nbsp; --?[$MatRoll] -le 85|&gt;SKIP SPECIAL &nbsp;&nbsp;&nbsp; --?[$MatRoll] -ge 86|&gt;ENUMERATE SPECIAL ITEM DESCRIPTIONS &nbsp; --:EndOfAvailability| &nbsp; --:ENUMERATE SPECIAL ITEM DESCRIPTIONS|============================================================================================= &nbsp; --&amp;item1|[=1d8+8] Arrows +1 (ea.) [b]100 gp[/b] &nbsp; --&amp;item2|[=1d8+8] Bolts, Heavy Crossbow +1 (ea.) [b]100 gp[/b] &nbsp; --&amp;item3|Potion of Healing [b]50 gp[/b] &nbsp; --&amp;item4|Keoghtom's Ointment (Per dose) [b]125 gp[/b] &nbsp; --&amp;item5|Helm of Comprehend Languages [b]525 gp[/b] &nbsp; --&amp;item6|Bastard Sword +1 [b]1,200 gp[/b] &nbsp; --&amp;item7|Battleaxe +1 [b]1,200 gp[/b] &nbsp; --&amp;item8|Broad Sword +1 [b]1,500 gp[/b] &nbsp; --&amp;item9|Flail +1 [b]1,000 gp[/b] &nbsp; --&amp;item10|Glaive +1 [b]1,200 gp[/b] &nbsp; --&amp;item11|Greataxe +1 [b]1,300 gp[/b] &nbsp; --&amp;item12|Greatsword +1 [b]1,500 gp[/b] &nbsp; --&amp;item13|Halberd +1 [b]1,200 gp[/b] &nbsp; --&amp;item14|Longsword +1 [b]1,500 gp[/b] &nbsp; --&amp;item15|Maul +1 [b]1,000 gp[/b] &nbsp; --&amp;item16|Morningstar +1 [b]1,000 gp[/b] &nbsp; --&amp;item17|Rapier +1 [b]1,200 gp[/b] &nbsp; --&amp;item18|Scimitar +1 [b]1,200 gp[/b] &nbsp; --&amp;item19|Shortsword +1 [b]1,000 gp[/b] &nbsp; --&amp;item20|Trident +1 [b]1,200 gp[/b] &nbsp; --&amp;item21|Warhammer +1 [b]1,200 gp[/b] &nbsp; --&amp;item22|Whip +1 [b]800 gp[/b] &nbsp; --&amp;item23|Blowgun +1 [b]900 gp[/b] &nbsp; --&amp;item24|Crossbow, hand +1 [b]1,100 gp[/b] &nbsp; --&amp;item25|Crossbow, heavy +1 [b]1,500 gp[/b] &nbsp; --&amp;item26|Great Bow +1 [b]1,800 gp[/b] &nbsp; --&amp;item27|Longbow +1 [b]1,200 gp[/b] &nbsp; --&amp;item28|Net +1 [b]800 gp[/b] &nbsp; --&amp;item29|Club +1 [b]1,000 gp[/b] &nbsp; --&amp;item30|Dagger +1 [b]1,000 gp[/b] &nbsp; --&amp;item31|Greatclub +1 [b]1,200 gp[/b] &nbsp; --&amp;item32|Handaxe +1 [b]900 gp[/b] &nbsp; --&amp;item33|Javelin +1 [b]1,000 gp[/b] &nbsp; --&amp;item34|Mace +1 [b]1,000 gp[/b] &nbsp; --&amp;item35|Quarterstaff +1 [b]1,200 gp[/b] &nbsp; --&amp;item36|Spear +1 [b]1,000 gp[/b] &nbsp; --&amp;item37|Shortbow +1 [b]1,000 gp[/b] &nbsp; --&amp;item38|Sling +1 [b]900 gp[/b] &nbsp; --&amp;item39|Crossbow, Light Repeating +1 [b]1,800 gp[/b] &nbsp; --&amp;item40|Ring of Warmth [b]1,050 gp[/b] &nbsp; --&amp;item41|Shield +1 [b]1,550 gp[/b] &nbsp; --&amp;item42|Rope of Climbing [b]2,000 gp[/b] &nbsp; --&amp;item43|Cloak of Protectiion [b]3,600 gp[/b] &nbsp; --&amp;item44|Bag of Holding [b]4,200 gp[/b] &nbsp; --=numUniqueTypes|44 &nbsp; --^INITIALIZE SPECIAL ITEM COUNTS| &nbsp; --:INITIALIZE SPECIAL ITEM COUNTS| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[&amp;LoopCounter]|0 &nbsp; --%| &nbsp; --:LOOP THROUGH numRolls TO START ADDING ITEMS| &nbsp; --=numRolls1|1 &nbsp; --=numRolls2|1 &nbsp; --=numRolls3|2 &nbsp; --=numRolls4|2 &nbsp; --=numRolls5|3 &nbsp; --=numRolls6|3 &nbsp; --=numRolls7|4 &nbsp; --=numRolls|0 &nbsp; --C[&amp;Settlement]|Thorp:=numRolls;[$numRolls1.Raw]|Hamlet:=numRolls;[$numRolls2.Raw]|Village:=numRolls;[$numRolls2.Raw]|Small Town:=numRolls;[$numRolls2.Raw]|Large Town:=numRolls;[$numRolls3.Raw]|Small City:=numRolls;[$numRolls3.Raw]|Large City:=numRolls;[$numRolls3.Raw] &nbsp; --%LoopCounter|1;[$numRolls.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll1|1d10 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll2|1d30 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll3|1d44 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=MatRoll|0 --/|NOTE - ONLY USING R1 HERE, BUT YOU COULD ADD CONDITIONALS FOR DIFFERENT ROLLS, CALLING SAME FUNCTION &nbsp;&nbsp;&nbsp; --C[&amp;Settlement]|Thorp:=MatRoll;[$MatRoll1.Raw]|Hamlet:=MatRoll;[$MatRoll1.Raw]|Village:=MatRoll;[$MatRoll1.Raw]|Small Town:=MatRoll;[$MatRoll2.Raw]|Large Town:=MatRoll;[$MatRoll2.Raw]|Small City:=MatRoll;[$MatRoll3.Raw]|Large City:=MatRoll;[$MatRoll3.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;AddSpecial|[$MatRoll.Raw] &nbsp;&nbsp;&nbsp; --%| &nbsp; --:BUILD COMMA-SEPARATED LIST| &nbsp; --&amp;displaySpecialString| &nbsp; --%LoopCounter|1;[$numUniqueTypes.Raw] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --?[$count[&amp;LoopCounter]] -gt 0|[ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&amp;displaySpecialString|+ [&amp;item[&amp;LoopCounter]], &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --]| &nbsp; --%| &nbsp; --:CLEANUP TRAILING COMMA IN THE LIST STRING| &nbsp; --~stringLength|string;length;[&amp;displaySpecialString] &nbsp; --=numCharsToKeep|[$stringLength] - 1 &nbsp; --~displaySpecialString|string;substring;1;[$numCharsToKeep];[&amp;displaySpecialString] &nbsp; --^Display Card| &nbsp; --:SKIP SPECIAL| &nbsp; --&amp;skip|nothing special for sale at this time... but if your looking to sell something special, [b]"Let's see what you got"[/b]&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; --/| END LIONSHIELD COSTER &amp; DISPLAY TOOLS, WEAPONS, ARMOR, GEAR SECTION ON CARD================================================================= &nbsp; --:Display Card &nbsp;&nbsp;&nbsp; --+|[c]🧰 [b]Tools[/b] 🧰[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;displayToolString] &nbsp;&nbsp;&nbsp; --+|[c]🗡️ [b]Weapons[/b] 🗡️[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;displayWeaponString] &nbsp;&nbsp;&nbsp; --+|[c]🎯 [b]Ammunition[/b] 🎯️[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;displayAmmoString]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --+|[c]🛡️ [b]Armor[/b] 🛡️[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;displayArmorString] &nbsp;&nbsp;&nbsp; --+|[c]🛢️ [b]Gear[/b] 🛢️[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;displayCommonGearString] &nbsp;&nbsp;&nbsp; --+|[c]🌿 [b]Tobacco[/b] 🌿[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;displayTobaccoString]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --+|[c]🌰️ [b]Trail Food[/b] 🌰[/c] &nbsp;&nbsp;&nbsp; --+|[&amp;Rations], [&amp;displayTrailFoodString] &nbsp;&nbsp;&nbsp; --+|[c]🌟 [b]Something Special[/b] 🌟[/c] &nbsp;&nbsp;&nbsp; --+|[b][i]Are you looking for something special?[/i][/b] Well, I have [&amp;displaySpecialString][&amp;skip]&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --^Output Data| &nbsp; --/| Output data &nbsp;&nbsp;&nbsp; --:Output Data| &nbsp; --X| End Macro &nbsp; --:FUNCTIONS|===================================================================================================== &nbsp; &nbsp; --:AddWeapons| accepts the item index and qty. Increments the count of index [%1%] by qty [%2%] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[%1%]|[$count[%1%]] + [%2%] &nbsp; --&lt;| &nbsp; --:AddAmmo| accepts the item index and qty. Increments the count of index [%1%] by qty [%2%] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[%1%]|[$count[%1%]] + [%2%] &nbsp; --&lt;| &nbsp; --:AddArmor| accepts the item index and qty. Increments the count of index [%1%] by qty [%2%] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[%1%]|[$count[%1%]] + [%2%] &nbsp; --&lt;| &nbsp; --:AddCommonGear| accepts the item index and qty. Increments the count of index [%1%] by qty [%2%] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[%1%]|[$count[%1%]] + [%2%] &nbsp; --&lt;| &nbsp; &nbsp; --:AddTools| accepts the item index and qty. Increments the count of index [%1%] by qty [%2%] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[%1%]|[$count[%1%]] + [%2%] &nbsp; --&lt;| &nbsp; &nbsp; --:AddTobacco| accepts the item index and qty. Increments the count of index [%1%] by qty [%2%] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[%1%]|[$count[%1%]] + [%2%] &nbsp; --&lt;|&nbsp;&nbsp; &nbsp; &nbsp; --:AddTrailFood| accepts the item index and qty. Increments the count of index [%1%] by qty [%2%] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[%1%]|[$count[%1%]] + [%2%] &nbsp; --&lt;|&nbsp;&nbsp; &nbsp; &nbsp; --:AddSpecial| accepts the item index &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=count[%1%]|[%1%] &nbsp; --&lt;| }}&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;
1667298377
Kurt J.
Pro
API Scripter
Found the issue and pushed 2.1.19b to the github. When I redid the string/array setting commands, I accidentally changed the return type of the string;length function from a roll variable to a string variable :( That is set back properly now.
Kurt, thank you!! Good to Go!!! All shops are now open in my game!!!
1667418674

Edited 1667418876
Jador
KS Backer
Got another minor conundrum, which I think might lie in this line: --C[$NMS.Total]|-3:&gt;minusthree;[$NMS]|-2:&gt;minustwo;[$NMS]|-1:&gt;minusone;[$NMS]|0:&gt;zero;[$NMS]|1:&gt;one;[$NMS]|2:&gt;two;[$NMS]|3:&gt;three;[$NMS]|4:&gt;four;[$NMS]|5:&gt;five;[$NMS]|6:&gt;six;[$NMS]|7:&gt;seven;[$NMS]|8:&gt;eight;[$NMS]|9:&gt;nine;[$NMS]|10:&gt;ten;[$NMS]|11:&gt;eleven;[$NMS]|12:&gt;twelve;[$NMS]|13:&gt;thirteen;[$NMS] This is intended to work exactly like the example on the wiki, with one alteration:&nbsp; the variable NMS is described as follows: --=NMS|1d10 + [&amp;BON] BON being a bonus (or penalty) of -3 to +3, which is added onto the NMS.&nbsp; The problem: It almost always works as intended, but it doesn't seem to be able to deal with numbers outside the 1d10 range.&nbsp; I've made many rolls, and nothing comes up more than 10 or less than 1, though the script does occasionally crash with this output: TypeError: Cannot read property '0' of null TypeError: Cannot read property '0' of null at replaceVariableContent (apiscript.js:16421:59) at apiscript.js:13764:17 at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:70:8) at /home/node/d20-api-server/api.js:1739:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) at Zd.Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) Is there a problem with the code, or is the Case Statement something that can only evaluate a die roll by itself? EDIT: Forgot the pipe before the 0...&nbsp; Doesn't change the output.
1667472393
Kurt J.
Pro
API Scripter
Jador said: Got another minor conundrum, which I think might lie in this line: --C[$NMS.Total]|-3:&gt;minusthree;[$NMS]|-2:&gt;minustwo;[$NMS]|-1:&gt;minusone;[$NMS]|0:&gt;zero;[$NMS]|1:&gt;one;[$NMS]|2:&gt;two;[$NMS]|3:&gt;three;[$NMS]|4:&gt;four;[$NMS]|5:&gt;five;[$NMS]|6:&gt;six;[$NMS]|7:&gt;seven;[$NMS]|8:&gt;eight;[$NMS]|9:&gt;nine;[$NMS]|10:&gt;ten;[$NMS]|11:&gt;eleven;[$NMS]|12:&gt;twelve;[$NMS]|13:&gt;thirteen;[$NMS] This is intended to work exactly like the example on the wiki, with one alteration:&nbsp; the variable NMS is described as follows: --=NMS|1d10 + [&amp;BON] BON being a bonus (or penalty) of -3 to +3, which is added onto the NMS.&nbsp; The problem: It almost always works as intended, but it doesn't seem to be able to deal with numbers outside the 1d10 range.&nbsp; I've made many rolls, and nothing comes up more than 10 or less than 1, though the script does occasionally crash with this output: TypeError: Cannot read property '0' of null TypeError: Cannot read property '0' of null at replaceVariableContent (apiscript.js:16421:59) at apiscript.js:13764:17 at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:70:8) at /home/node/d20-api-server/api.js:1739:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) at Zd.Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) Is there a problem with the code, or is the Case Statement something that can only evaluate a die roll by itself? EDIT: Forgot the pipe before the 0...&nbsp; Doesn't change the output. That works fine for me if I wrap it in a !script {{ }}. Can you post the entire script? It is likely this is coming from somewhere else.
Kurt J. said: That works fine for me if I wrap it in a !script {{ }}. Can you post the entire script? It is likely this is coming from somewhere else. The whole script looks like this: !scriptcard {{ --#title|Scale -3 to 13 --#titleCardBackground|Red --#bodybackgroundimage| linear-gradient( to top, LightYellow, Yellow, Orange, DarkOrange, Red) --#subtitleFontColor|White --#leftsub|1d10 --#rightsub|Plus Bonus --&amp;BON|?{Enter Bonus or Penalty|3|2|1|0|-1|-2|-3} --=NMS|1d10+[&amp;BON] --+|Score: [$NMS], with a bonus of [b][&amp;BON][/b] --/CASE STATEMENT TO EVALUATE NMS + BON. --C[$NMS.Total]|-3:&gt;minusthree;[$NMS]|-2:&gt;minustwo;[$NMS]|-1:&gt;minusone;[$NMS]|0:&gt;zero;[$NMS]|1:&gt;one;[$NMS]|2:&gt;two;[$NMS]|3:&gt;three;[$NMS]|4:&gt;four;[$NMS]|5:&gt;five;[$NMS]|6:&gt;six;[$NMS]|7:&gt;seven;[$NMS]|8:&gt;eight;[$NMS]|9:&gt;nine;[$NMS]|10:&gt;ten;[$NMS]|11:&gt;eleven;[$NMS]|12:&gt;twelve;[$NMS]|13:&gt;thirteen;[$NMS] --X| --:minusthree| --+[c]Val: [$Bon] ([%1])...[/c]|[c]You rolled a negative Three[/c] --&lt;| --:minustwo| --+[c]Val: [$Bon] ([%1])...[/c]|[c]You rolled a negative Two[/c] --&lt;| --:minusone| --+[c]Val: [$Bon] ([%1])...[/c]|[c]You rolled a negative One[/c] --&lt;| --:zero| --+[c]Val: [$Bon] ([%1])...[/c]|[c]You rolled a Zero![/c] --&lt;| --:one| --+[c]Val: [$Bon] ([%1%])...[/c]|[c]You rolled a One![/c] --&lt;| --:two| --+[c]Val: [$Bon] ([%1%])...[/c]|[c]You rolled a Two![/c] --&lt;| --:three| --+[c]Val: [$Bon] ([%1%])...[/c]|[c]You rolled a Three![/c] --&lt;| --:four| --+[c]Val: [$Bon] ([%1%])...[/c]|[c]You rolled a Four![/c] --&lt;| --:five| --+[c]Val: [$Bon] ([%1%])...[/c]|[c]You rolled a Five![/c] --&lt;| --:six| --+[c]Val: [$Bon] ([%1%])...[/c]|[c]You rolled a Six![/c] --&lt;| --:seven| --+[c]Val: [$Bon]...[/c]|[c]You rolled a Seven![/c] --&lt;| --:eight| --+[c]Val: [$Bon]...[/c]|[c]You rolled a Eight![/c] --&lt;| --:nine| --+ [c]Val: [$Bon]...[/c]|[c]You rolled a Nine![/c] --&lt;| --:ten| --+[c]Val: [$Bon]...[/c]|[c]You rolled a Ten![/c] --&lt;| --:eleven| --+[c]Val: [$Bon]...[/c]|[c]You rolled an Eleven![/c] --&lt;| --:twelve| --+[c]Val: [$Bon]...[/c]|[c]You rolled a Twelve![/c] --&lt;| --:thirteen| --+[c]Val: [$Bon]...[/c]|[c]You rolled a Thirteen![/c] --&lt;| }}
1667476382
Kurt J.
Pro
API Scripter
That works for me as well, with both the OneClick install and the GitHub install of ScriptCards. It would be worth throwing a --#debug|1 at the top of the script and looking at the console log to see what the last thing to execute before you get the error is to try to track down what might be wrong, but I don't see anything out of the ordinary.
1667478182
David M.
Pro
API Scripter
Jador, this doesn't help with your sandbox error problem, but it looks like all of your subprocedures/functions are using [$bon] when I think you meant to write [&amp;BON]? Or alternatively, change to a roll variable declaration --=Bon instead of the current string variable --&amp;BON&nbsp; &nbsp; I am also not getting any errors from the posted macro. I just noticed no Val was being printed since you were referencing a roll variable that didn't exist as written.
@Jador - I believe you also seem to have many syntax errors still.&nbsp; e.g.: &nbsp; &nbsp; &nbsp; &nbsp; --Goods&amp;Services| &nbsp;&nbsp;&nbsp; --Buy|[&amp;Settlement] should be (depending upon whether they are labels or subroutines)&nbsp; &nbsp; &nbsp; --:Goods&amp;Services| &nbsp;&nbsp;&nbsp; --&gt;Buy|[&amp;Settlement] or some other such command as neither of the former will be recognized by the API.
1667600277
Kurt J.
Pro
API Scripter
This thread is has reached the maximum number of posts, so I have created a new thread&nbsp; Here &nbsp;( Community Forums: [Script] ScriptCards - Thread #2 | Roll20: Online virtual tabletop )