Thread: Traveller Dice Help
-
January 21st, 2017, 07:08 #1
Traveller Dice Help
Im trying to add a set of Traveller Dice to MoreCore.
It currently displays like this:
Im currently calculating the value of the dice as first dice * 10 + second dice
and I can output that fine in the Chat Description but I dont know how to tell the Dice Display to be
11 and not 2, or 26 and not 8 etc.
I will need this to be able to drag the result and have the drag data be correct.
function createChatMessage(rSource, rRoll)
local rMessage = ActionsManager.createActionMessage(rSource, rRoll);
rMessage.dicedisplay = 0; -- don't display total
local nVal = rRoll.aDice[1].result *10 + rRoll.aDice[2].result;
rMessage.text = "[Skill] " .. rMessage.text;
rMessage.text = rMessage.text .. "\n[Result] "..nVal.." \n[Target] not used yet";
return rMessage;
end
Any pointers please
-
January 21st, 2017, 07:12 #2SmiteWorks
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 23,392
Look at chatwindow.onDiceTotal event.
https://www.fantasygrounds.com/refdo...cp#onDiceTotal
Regards,
JPG
-
January 21st, 2017, 07:30 #3
Thanks JPG - can you think of an example used anywhere?
-
January 21st, 2017, 08:20 #4SmiteWorks
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 23,392
No. I built the feature for something like this, but never needed for a core system. You get to be the guinea pig.
cheers,
JPG
-
January 21st, 2017, 08:24 #5
-
January 21st, 2017, 13:34 #6Celestial Paragon
- Join Date
- Jun 2013
- Location
- Isanti, MN
- Posts
- 2,682
Skill checks in Traveller don't use that mechanic. It's a straight 2d6, totaled, checked against a target number (usually 8).
-
January 21st, 2017, 13:55 #7
-
January 21st, 2017, 22:33 #8
Just about anything Traveller needs a larger sample from than 2-12. Examples would be cargoes, patrons, random encounters, etc. Large lots that 2-12 can't handle with enough granularity.
Now I might be missing something you need to do in the code, but back when I made a Traveller ruleset, I just made a custom d60 and then just called rRoll.aDice = { "d60","d6" };.
My YouTube: https://www.youtube.com/channel/UCzz...8HEYmAemPeaDsA
My Twitter: https://twitter.com/OTG_Wraith
Fantasy Grounds Reddit: http://www.reddit.com/r/FantasyGrounds
-
January 21st, 2017, 22:58 #9
Thanks OTG_Wraith. What did you do for rolling the d60?
Ive got that working but I havent worked out how to grab the number of the real d6 and multiply by 60 in the dice results so Im throwing a 3d dF and generating my number from 10-60 programatically...
If yours rolls a d6 and the 1s generate 10s etc Id love to see if the code is compatible with what Im doing...
-
January 21st, 2017, 23:14 #10
Maybe I'm not following what you're asking precisely, but I am just doing what you did in the reply above...
And then having the internal roll and die calls use the new d60 and an additional d6.Code:<customdie name="d60"> <model>d6</model> <menuicon>customdice</menuicon> <script> function onValue(result) return result*10; end </script> </customdie>
Are you asking how to trap for the d60 results individually in a d66 roll?My YouTube: https://www.youtube.com/channel/UCzz...8HEYmAemPeaDsA
My Twitter: https://twitter.com/OTG_Wraith
Fantasy Grounds Reddit: http://www.reddit.com/r/FantasyGrounds
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)

Reply With Quote


Bookmarks