Too Many Darn Lists

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

ziltmilt
Dragon
Posts: 331
Joined: Sun Apr 29, 2007 9:28 pm
Contact:

Too Many Darn Lists

Post by ziltmilt »

RPGs have lots of lists and with Paizo's Gamemastery Guide coming out soon, it got me thinking about all the various lists a gamemaster could use to help give texture to his world on the fly. Plus, other publications in the past have provided lists of taverns, common names, insults, ... the list of lists is pretty endless.

It seems to me it'd be pretty easy to utilize Maptool's tables to help collect and centralize lists that folks find useful. I think it's possible to have a central macro that would

1) scan for all tables with a common prefix ... maybe 'lst' in front of a table name that is a good indicator?
2) sort this array of listnames alphabetically or some other sensible scheme
3) present the GM with a list of available lists
4) after selecting a list, the GM then gets a random result from it

For example, say I've got a several 'lst' tables ... one for fantasy insults, one for names of streets, and one for names of noblemen. I need a noble's name, so I click my universal list button, choose the 'Noble Names' list, and BAM! Maptool spits out a randomly selected name from the indicated list: 'Lord Bartholomew Hexagon' or whatever.

As users, we could share & swap lists on the forums here via file attachments. Maybe this topic has been brought up previously. Does this sound do-able and is there any interest in creating such lists? Myself, I'd love to have an assortment of lists covering aspects of a fantasy RPG, but all in 1 place! Maptool seems like an ideal host for this kind of data.

User avatar
CoveredInFish
Demigod
Posts: 3104
Joined: Mon Jun 29, 2009 10:37 am
Location: Germany
Contact:

Re: Too Many Darn Lists

Post by CoveredInFish »

Doable. With getInfo("campaign") Wiki: getInfo() you a get a json full of infos with a key "tables". That is an json array with all known tables. You'd have to hand-filter that using Wiki: startsWith() and then you could build a dialog and use Wiki: table() to retrieve the result.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Too Many Darn Lists

Post by wolph42 »

that looks like quite a redundant hassle to me. You only need to create the list of tables once and store that on a lib token.
then you can do something alog the lines of

Code: Select all

    [h:listOfListTables = getLibProperty("listOfTables", "Lib:Compendium")]
    [h:status=input("chosenList|"+listOfListTables +"|Choose a list|LIST|SELECT=0")]
    [h:abort(status)]
etc.
if you aregoing to create these tables with lists, might I suggest you use my table creator tool (see sig.) saves you a LOT of hassle.

If you're willing to create these tables, I'm willing to write the basic code around it to get it working.

ziltmilt
Dragon
Posts: 331
Joined: Sun Apr 29, 2007 9:28 pm
Contact:

Re: Too Many Darn Lists

Post by ziltmilt »

[quote="wolph42" You only need to create the list of tables once and store that on a lib token. [/quote]

Well, the idea is that your available lists will change and grow, so the 'list of lists' should be dynamic .. hopefully the community here will exchange lists. Are you thinking that a macro would store this list index on a lib token only once or can do so on demand?

Sure, I have no problem with generating some tables using your tool. It should be pretty easy to do so, since it's only going to be a number and then some text.

User avatar
biodude
Dragon
Posts: 444
Joined: Sun Jun 15, 2008 2:40 pm
Location: Montréal, QC

Re: Too Many Darn Lists

Post by biodude »

ziltmilt wrote:
wolph42 wrote: You only need to create the list of tables once and store that on a lib token.
Well, the idea is that your available lists will change and grow, so the 'list of lists' should be dynamic .. hopefully the community here will exchange lists. Are you thinking that a macro would store this list index on a lib token only once or can do so on demand?
The list of tables would need to be updated far less frequently than you would need to refer to it. It would be faster to have a separate macro that builds the list of tables, and stores this in a Lib Property. Then your UI would just have to refer to this list (instead of re-building it every time), but the list can be updated dynamically those few times that the data is changed (manually, 'on demand').
"The trouble with communicating is believing you have achieved it"
[ d20 StatBlock Importer ] [ Batch Edit Macros ] [ Canned Speech UI ] [ Lib: Math ]

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Too Many Darn Lists

Post by wolph42 »

What he said. That said, I'm still willing to code it if your willing to create ( at least a basis of) tables.

neofax
Great Wyrm
Posts: 1694
Joined: Tue May 26, 2009 8:51 pm
Location: Philadelphia, PA
Contact:

Re: Too Many Darn Lists

Post by neofax »

I have quite a bit of tables for Pathfinder and 4E and generic stuff. I can generate the tables this weekend.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Too Many Darn Lists

Post by wolph42 »

I'll prolly have some time to start coding this weekend. Shall we agree on that the tablenames start with lst.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Too Many Darn Lists

Post by wolph42 »

well... that was a tough cooky :P
Attached is the campaign with the function and two (very creative) test tables.

There is a lib token with two macros doing exactly the same, only the representation of the list is different.

I guess people prolly want some additional feats once this is in operation, if its not too exotic, im available to implement.

Note that you only need to move the token from this file into your own campaign in order to use this. Next to that it currently lists all tables that start with "lst"

heres the code:

Code: Select all

<!--lists-->

[h:campProps   = getInfo("campaign")]
[h:jsonTables  = json.get(campProps, "tables")]
[h:allTables   = json.toList(jsonTables)]

[h:listTables = ""]
[h, foreach(item, allTables), if(startsWith(item, "lst")):listTables=listAppend(listTables,item) ]

[h:status=input("chosenList|"+listTables +"|Choose a list|RADIO|SELECT=0 VALUE=STRING")]
[h:abort(status)]

[r:table(chosenList)]
Attachments
tablesList.cmpgn
(87.25 KiB) Downloaded 90 times

ziltmilt
Dragon
Posts: 331
Joined: Sun Apr 29, 2007 9:28 pm
Contact:

Re: Too Many Darn Lists

Post by ziltmilt »

Good golly ! That was fast!! OK, I've got to get hopping on some lists.

The piece of this is returning a random item from a selected list. That shouldn't be too hard, right? Just scan a list for the number of items and then return a random item from within that range ...

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Too Many Darn Lists

Post by wolph42 »

ziltmilt wrote:Good golly ! That was fast!! OK, I've got to get hopping on some lists.

The piece of this is returning a random item from a selected list. That shouldn't be too hard, right? Just scan a list for the number of items and then return a random item from within that range ...
if you create a table like
1 Theo
2 Olner
3 Luuk
4 Peter
And you name it lstFirstNames

Alternative:
1-4 Theo
5-20 Olner
21-22 Luuk
23-30 Peter

If you want to distribute chances

You can leave the rest blank

When running the macro youll get a menu where you can choose lstFristNames.
When you choose it it will automatically spit out a random name chosed from the 4.

Thus the only thing you need to do is create a table like the above example. And as mentioned before I would strongly suggest to use my table editor for excel (link in sig.)

Good luck!

ziltmilt
Dragon
Posts: 331
Joined: Sun Apr 29, 2007 9:28 pm
Contact:

Re: Too Many Darn Lists

Post by ziltmilt »

This is awesome! Thanks for putting this together so quickly. Can a few things on this be changed?

- when populating the drop down list box, can the choices have 'lst' parsed out of the beginning? So, to the user, instead of 'lstExoticFruits', they see 'ExoticFruits'

- are embedded spaces ok in the table names?

- can the list of lists be sorted alphabetically? I can see a day when a user could have dozens of lists

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Too Many Darn Lists

Post by wolph42 »

ziltmilt wrote:This is awesome! Thanks for putting this together so quickly. Can a few things on this be changed?

- when populating the drop down list box, can the choices have 'lst' parsed out of the beginning? So, to the user, instead of 'lstExoticFruits', they see 'ExoticFruits'

- are embedded spaces ok in the table names?

- can the list of lists be sorted alphabetically? I can see a day when a user could have dozens of lists
1. already thought of doing that, though its a bit tricky (but not too) so i didn't do it immediately
2. i think so but there is one sure way to find out :D (that is let me know if it does :)
3. thats easy

ziltmilt
Dragon
Posts: 331
Joined: Sun Apr 29, 2007 9:28 pm
Contact:

Re: Too Many Darn Lists

Post by ziltmilt »

So would this thread be a suitable place to share lists or should we find some other location?

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Too Many Darn Lists

Post by wolph42 »

ziltmilt wrote:So would this thread be a suitable place to share lists or should we find some other location?
I would suggest creating a new thread and reserve a few posts. I also
wouldn't put it in the macro section. This makes it much clearer.

Post Reply

Return to “Macros”