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

Use Rollable tables to generate a series of prompts

So, I've come up with an idea to up my GMing level, as I often forget to describe various odds and ends when players enter a room. I'm thinking to create a macro that, for lack of a better name, I'll call 'Room.' What this macro will ideally do is pull from several Rollable tables to come up with basic descriptions for the room. (Not planning to use them all every time in game, but like I'll pull two or three of the ideas and work from there). The idea would be something like: Ceiling: Cracked and dusty. Walls: Water drips down walls. Floors: Dust covers the floor in a thick layer. Odds and Ends One: A cracked blade lays on the floor. Odds and Ends Two: A vial of reddish brown liquid. All of it should only be for me, and it doesn't have to be bold. That's just for example purposes. Each prompt pulls from its own table simultaneously. The problem is that I'm not one-hundred percent sure of how to make a macro like that. Any advice?
1723134824
timmaugh
Pro
API Scripter
Using the rollable tables is fairly straightforward: [[1t[TableName]]] That will get you a return from the specified table. So let's say you set up tables named RoomCeilings, RoomWalls, RoomFloors, and RoomThings (for your odds and ends).  You can reference all of those independently, and put the returns into a template (I'll use the default template): &{template:default} {{name=?{Name of Room|Generic}}} {{Ceiling=[[1t[RoomCeilings]]]}} {{Walls=[[1t[RoomWalls]]]}} {{Floors=[[1t[RoomFloors]]]}} {{Odds and Ends=[[1t[RoomThings]]]}} As you see, that only pulls one time from the RoomThings table. While you can do things like: [[2t[RoomThings]]] ...unless the returns are numbers, you will only get a single returned item (and, if they're numbers, you get the sum of the numbers). So, to do multiple Odds and Ends (without a script), you would want to have different versions of your macro hard-coded... a single-item room, a two-item room, etc. Obviously, the two-item room would change that last template part (from the previous statement) to be "Odds and Ends One," like your example, then it would include another template part: ...  {{Odds and Ends One=[[1t[RoomThings]]]}}  {{Odds and Ends Two=[[1t[RoomThings]]]}} With that approach, were I doing this, I would probably create an ability for each of the room configurations I wanted to have available (a 1-item room, a 2-item room, etc.), and I'd create them on a Mule Character  . Then I could create one further ability on that character that would be a Chat Menu of the options. That way, I could run the chat menu and click the button for the room configuration I wanted to generate. If the abilities were named GenerateRoom1, GenerateRoom2, GenerateRoom3, etc., and they were stored on the same character as housed the chat menu ability, the chat menu could look like: &{template:default}{{name=Room Generation Menu}}{{[1 Item](~GenerateRoom1) [2 Item](~GenerateRoom2) [3 Item](~GenerateRoom3)}} Script Alternative If you didn't want to go the route of a Chat Menu, you could use the MetaScriptToolbox to give you a dynamic number of items from a single ability. This would use the ability to extract multiple items from a roll against a single table (like the [[2t[RoomThings]]] option I mentioned, above). The metascript version of this command would look like this: ! &{template:default} {{name=?{Name of Room|Generic}}} {{Ceiling=[[1t[RoomCeilings]]]}} {{Walls=[[1t[RoomWalls]]]}} {{Floors=[[1t[RoomFloors]]]}} {{Odds and Ends=[[?{How many odds and ends?|0|1|2|3|4|5}t[RoomThings]]].items(", ")}} {&simple} That would prompt you with a query for how many items you wanted, but no matter if you answered 1 or 5, it would use the same template to output the result.
You can do the prompted number of items without scripts, too, by using the query to show the desired number of rows: &{template:default} {{name=?{Name of Room|Generic}}} {{Ceiling=[[1t[RoomCeilings]]]}} {{Walls=[[1t[RoomWalls]]]}} {{Floors=[[1t[RoomFloors]]]}} {{Odds and Ends [1](#)=[[1t[RoomThings]]]}} {{Odds and Ends [[[{2,?{number of odds and ends?|1|2|3|4|5}}kl1]]](#)=[[1t[RoomThings]]]}} {{Odds and Ends [[[{3,?{number of odds and ends?|1|2|3|4|5}}kl1]]](#)=[[1t[RoomThings]]]}}   {{Odds and Ends [[[{4,?{number of odds and ends?|1|2|3|4|5}}kl1]]](#)=[[1t[RoomThings]]]}} {{Odds and Ends [[[{5,?{number of odds and ends?|1|2|3|4|5}}kl1]]](#)=[[1t[RoomThings]]]}} All five odds and ends are rolled, but only the specified number is shown, as the last item overwrites the extra rows.
timmaugh said: Using the rollable tables is fairly straightforward: [[1t[TableName]]] That will get you a return from the specified table. So let's say you set up tables named RoomCeilings, RoomWalls, RoomFloors, and RoomThings (for your odds and ends).  You can reference all of those independently, and put the returns into a template (I'll use the default template): &{template:default} {{name=?{Name of Room|Generic}}} {{Ceiling=[[1t[RoomCeilings]]]}} {{Walls=[[1t[RoomWalls]]]}} {{Floors=[[1t[RoomFloors]]]}} {{Odds and Ends=[[1t[RoomThings]]]}} As you see, that only pulls one time from the RoomThings table. While you can do things like: [[2t[RoomThings]]] ...unless the returns are numbers, you will only get a single returned item (and, if they're numbers, you get the sum of the numbers). So, to do multiple Odds and Ends (without a script), you would want to have different versions of your macro hard-coded... a single-item room, a two-item room, etc. Obviously, the two-item room would change that last template part (from the previous statement) to be "Odds and Ends One," like your example, then it would include another template part: ...  {{Odds and Ends One=[[1t[RoomThings]]]}}  {{Odds and Ends Two=[[1t[RoomThings]]]}} With that approach, were I doing this, I would probably create an ability for each of the room configurations I wanted to have available (a 1-item room, a 2-item room, etc.), and I'd create them on a Mule Character  . Then I could create one further ability on that character that would be a Chat Menu of the options. That way, I could run the chat menu and click the button for the room configuration I wanted to generate. If the abilities were named GenerateRoom1, GenerateRoom2, GenerateRoom3, etc., and they were stored on the same character as housed the chat menu ability, the chat menu could look like: &{template:default}{{name=Room Generation Menu}}{{[1 Item](~GenerateRoom1) [2 Item](~GenerateRoom2) [3 Item](~GenerateRoom3)}} Script Alternative If you didn't want to go the route of a Chat Menu, you could use the MetaScriptToolbox to give you a dynamic number of items from a single ability. This would use the ability to extract multiple items from a roll against a single table (like the [[2t[RoomThings]]] option I mentioned, above). The metascript version of this command would look like this: ! &{template:default} {{name=?{Name of Room|Generic}}} {{Ceiling=[[1t[RoomCeilings]]]}} {{Walls=[[1t[RoomWalls]]]}} {{Floors=[[1t[RoomFloors]]]}} {{Odds and Ends=[[?{How many odds and ends?|0|1|2|3|4|5}t[RoomThings]]].items(", ")}} {&simple} That would prompt you with a query for how many items you wanted, but no matter if you answered 1 or 5, it would use the same template to output the result. That looks great. Would it be visible to my players too, or only me? 
1723160003
timmaugh
Pro
API Scripter
If you want it whispered to you so your players don't see it, just put: /w gm ..at the start of the line (or immediately following the exclamation point in the script version ) So the lines would start: /w gm &{template: default}... OR !/w gm &{template: default}...
timmaugh said: If you want it whispered to you so your players don't see it, just put: /w gm ..at the start of the line (or immediately following the exclamation point in the script version ) So the lines would start: /w gm &{template: default}... OR !/w gm &{template: default}... Awesome! I’ve got it set up now across most of my campaigns :)