# RPTools.net

Discussion and Support

It is currently Tue Dec 12, 2017 5:28 am

 Page 1 of 1 [ 2 posts ]
Author Message
 Rumble   Deity Joined: Tue Jul 01, 2008 6:48 pmPosts: 6237
 Post subject: Dice Rollers for Godlike, Wild Talents, and REIGNPosted: Mon Dec 15, 2008 2:24 pm
Hello all. I've been digging deep into MapTool lately to work on some D&D stuff, but I needed a break from polishing that particular...apple...and started working on a dice roller for the One-Roll Engine games.

I don't know if anybody plays them, or if any roller code has already been posted, but I thought I'd share. For those who don't know, the mechanic for those games is to roll a pool of 2 to 10 d10's, and then count matches. If you get a match (two dice coming up the same number), you have a set. Set have "width" - in other words, how many dice matched; and "height", or what number was matched.

So if you rolled and had two dice come up 10, you would have a set that was 2 wide and 10 high, or a "2x10" set.

Anyway, so I wrote a macro that rolls some number of d10s and figures out how many sets.

Code:
[h:resList=""]
[h:outputList=""]

[h,count(dicepool),CODE:
{
[h:resList=setStrProp(resList,"roll"+roll.count,1d10)]
}]

[h:sets1=0]
[h:sets2=0]
[h:sets3=0]
[h:sets4=0]
[h:sets5=0]
[h:sets6=0]
[h:sets7=0]
[h:sets8=0]
[h:sets9=0]
[h:sets10=0]

[h,count(10),code:
{
[h:sets1=sets1+if(getStrProp(resList,"roll"+roll.count)=="1",1,0)]
[h:sets2=sets2+if(getStrProp(resList,"roll"+roll.count)=="2",1,0)]
[h:sets3=sets3+if(getStrProp(resList,"roll"+roll.count)=="3",1,0)]
[h:sets4=sets4+if(getStrProp(resList,"roll"+roll.count)=="4",1,0)]
[h:sets5=sets5+if(getStrProp(resList,"roll"+roll.count)=="5",1,0)]
[h:sets6=sets6+if(getStrProp(resList,"roll"+roll.count)=="6",1,0)]
[h:sets7=sets7+if(getStrProp(resList,"roll"+roll.count)=="7",1,0)]
[h:sets8=sets8+if(getStrProp(resList,"roll"+roll.count)=="8",1,0)]
[h:sets9=sets9+if(getStrProp(resList,"roll"+roll.count)=="9",1,0)]
[h:sets10=sets10+if(getStrProp(resList,"roll"+roll.count)=="10",1,0)]
}]

[h,for(x,0,9),CODE:
{
[h:setSlot=x+1]
[h:sets=eval("sets"+setSlot)]
[h:setString=if(sets>=2, sets+"x"+setSlot, "")]
[h:outputList=if(setString!="", listAppend(outputList, setString), outPutList)]
}]

[IF(outputList!=""),CODE:
{
Rolling [r:dicepool+"d"]: [r:outputList]
};
{
Rolling [r:dicepool+"d"]: No sets.
};]

Please feel free to critique, compliment, or borrow as you feel appropriate! It's not perfectly elegant, but there are some list functions that don't yet exist that would have made it simpler. Fortunately, you can never roll more than 10 dice, so there's a limit to possible sets, which makes this doable. Anyway, it seems to work, so enjoy.

_________________

 yoshifanx   Kobold Joined: Sat Sep 12, 2015 4:08 pmPosts: 1
 Post subject: Re: Dice Rollers for Godlike, Wild Talents, and REIGNPosted: Sat Sep 12, 2015 4:10 pm
I Like it but is there any way it can show each individual roll?

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 2 posts ]

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

 Search for: Jump to: Select a forum ------------------ General    Announcements    Ideas for New Applications    General Discussion    Developer Notes       Java Programming Info    User Creations       Requests for HELLLLP!       Tilesets, Token Libraries, and Complete Maps          Token Libraries          Tilesets/Graphics for Map-making          Complete Maps       Campaign Frameworks          D&D 5e Frameworks          D&D 4e Frameworks          [D&D3.5 + Pathfinder] Campaign Macros          Shadowrun 4e Frameworks          Savage Worlds Frameworks       Published Module Support       Tutorials          Graphics, Images, Tokens, Maps          Drop-In Macros and Scripts          Campaign Frameworks       Drop-In Macro Resources    Links & External Resources    Looking For Group       "Living" Campaigns       Dungeons and Dragons       Savage Worlds       WoD       Wargaming    Documentation Requests/Discussion    Session Report-Back Tools    MapTool       How To       Macros       Feature Requests          Resolved       Bug Reports          Resolved       WIP - User FAQ       Testing    MapTool 1.4    TokenTool    DiceTool    InitiativeTool    CharacterTool       Support: d20 D&D       Support: D&D 4e       Support: Hero System       Support: Savage Worlds       Support: GURPS Other    RPTools Sightings    Running Campaigns       Thiera's College of Adventurers       Age of Might       Scales of War       Renwold       Dead Men Walking       Dark Sun - 4th Edition       Warhammer Fantasy Roleplay       Return of Uchly Namen       Insert Campaign Here       Antium       The Mystic Moon       World of Lagal       GangerRun       FB Scales of War       Sellswords of Eberron          Archive       Orbs of Chaos       World of Omegus       Keep on the Shadowfell - 4E       Rise of the Runelords       Aurith In The Age Of Steam       Widdershins       Nos's Pathfinder Campaign       Falcons Hollow       Verwirrte Welten       With it or on it       Starter Set - Jeff

### Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest