Roll Randomly Between Separate Tables

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
tcharleschapman
Kobold
Posts: 16
Joined: Wed Jul 24, 2013 11:50 am

Roll Randomly Between Separate Tables

Post by tcharleschapman »

Hi All,

I would like to create a macro that rolls randomly on separate tables to generate items. For example, there is a 50% chance that you will roll on Table X but a 25% chance on table Y. Any help appreciated.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Roll Randomly Between Separate Tables

Post by Jagged »

I would use tables, just like they do in the games.

So table 1 would contain a list of table names:
tbl1.jpg
tbl1.jpg (44.38 KiB) Viewed 442 times
Then your code would be something like:

Code: Select all

[h:tableName= table("tbl1")]
[r: table(h:tableName)]
Then you can muck about with the percentages, just by altering the values in the tables.

Post Reply

Return to “MapTool”