breaking up a dice roll in a macro

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

Post Reply
xavram
Dragon
Posts: 891
Joined: Tue Apr 20, 2010 8:22 pm

breaking up a dice roll in a macro

Post by xavram »

I know that a tool tip (expanded or something like that) can show you what the individual dice results were of a roll like "2d+2". But is there a way to see this within a macro? I need to be able to see what each die rolled, not just the total.

I know I could break about the "2d" into "okay, roll 1 d6, get the result, then roll a second 1 and do the same" but this seems clunky. If that's the route I need to go, so be it, but was wondering if there's some other way I'm overlooking.

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: breaking up a dice roll in a macro

Post by aliasmask »

I wrote this awhile ago: http://forums.rptools.net/viewtopic.php ... 87#p241200

rollDice(numDice,sides): result
<!-- hidden return with tooltip in variable dice.tooltip -->

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Re: breaking up a dice roll in a macro

Post by jfrazierjr »

Is the new parser Craig wrote in the current version? I had asked him to expand the way roll expressions returned from the parser. ie, instead of a string returning an array(or map or whatever.. I don't remember the details). I had had asked this for my plan of writing Dicetool and needed such a breakdown... of course, I assumed it would not be needed in MT, but MT could just pull out the first element or keyed name(ie, the one with "just the total") only while DiceTool needed each dice to show.

However, there is no reason why a "roll" macro could not be told to return the array so that calling macro could then format as needed.
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

Post Reply

Return to “Macros”