Roll-On plugin for TW5?

102 views
Skip to first unread message

Jalen MichalsLevy

unread,
Apr 17, 2020, 6:50:00 PM4/17/20
to TiddlyWiki
Joshua Macy made a really cool functionality in TW classic: http://rollon.tiddlyspot.com/. Does anyone know if there is an equivalent plugin for TW5?  Alternatively, is there a way to load this within the TW5 framework or upgrade it? Thanks!

TonyM

unread,
Apr 17, 2020, 11:14:37 PM4/17/20
to TiddlyWiki
Jalen

I'm sure its possible if not already available. Althought it may take a bit of effort to make the input as versatile. Moving the list of possible titles into a list field or seperat tiddlers with a shared tag or field then returning a random title should be easy and have other advantages. Evans formulae plugin should have the random primatives as do some others.

Try searching for random selection etc but you could extract milliseconds from the now macro then divide it by the items in the list found using count.

These are quick tips from my mobile so do ask if you want more details.

Regards
Tony

Jalen MichalsLevy

unread,
Apr 18, 2020, 1:42:19 PM4/18/20
to tiddl...@googlegroups.com
Thanks for the reply.

I would love more details if you got them! I have MK Lauber's shuffle plugin which adds a "Shuffle" filter operator which gives a number of random items in a list and is close to what you describe. Unfortunately I do not know how to make some of those titles weighted, such that they are more likely to be selected, without just repeating their title in the list. The original plugin can take something like this,

1-2. Red
3-5. Blue
6. Green 
7-10. White
 
and interpret it properly so that it returns the value based on its weight. I'd rather not do something like: Red Red Blue Blue Blue Green White White White. This is the feature I am most interested in, though I will admit, the input versatility is also very useful to me.

Thanks!

TonyM

unread,
Apr 18, 2020, 7:27:02 PM4/18/20
to TiddlyWiki
Jalen

I was not aware of the weighting as a requirement. So its not different sided dice you are emulating. Perhaps you can make a data tiddler with the range of numbers and the values? Allowing duplicate values.

Alternativly after generating the random number a set of tests for each number or range of numbers that return the desired result.

This is all achievable with macros not a plugin.

Regards
Tony

TonyM

unread,
Apr 18, 2020, 7:36:15 PM4/18/20
to TiddlyWiki
So Here is a quick partial experiment

\define roll() 3
{{{ [<roll>match[1]then[red]] [<roll>match[2]then[red]] [<roll>match[3]then[blue]] }}}

But there is a new compare operator in the latest release that could do this even more elegantly.

Regards
Tony

TonyM

unread,
Apr 18, 2020, 7:38:56 PM4/18/20
to TiddlyWiki
Even

{{{ [<roll>] +[match[1]then[red]] +[match[2]then[red]] +[match[3]then[blue]] }}}

Regards
Tony

TonyM

unread,
Apr 18, 2020, 7:56:54 PM4/18/20
to TiddlyWiki
And even

\define roll() 6
{{{ 1 2  +[match<roll>then[red]] }}}
{{{ 3 4 5  +[match<roll>then[blue]] }}}
{{{ 6  +[match<roll>then[green]] }}}
{{{ 7 8 9 10 +[match<roll>then[white]] }}}

Regards
Tony
Reply all
Reply to author
Forward
0 new messages