PDA

View Full Version : Traveller Dice Help



damned
January 21st, 2017, 07:08
Im trying to add a set of Traveller Dice to MoreCore.

It currently displays like this:

https://www.fantasygrounds.com/forums/attachment.php?attachmentid=17542

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 :)

Moon Wizard
January 21st, 2017, 07:12
Look at chatwindow.onDiceTotal event.
https://www.fantasygrounds.com/refdoc/chatwindow.xcp#onDiceTotal

Regards,
JPG

damned
January 21st, 2017, 07:30
Thanks JPG - can you think of an example used anywhere?

Moon Wizard
January 21st, 2017, 08:20
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

damned
January 21st, 2017, 08:24
No. I built the feature for something like this, but never needed for a core system. You get to be the guinea pig.

Thank you! (I think) :)

Andraax
January 21st, 2017, 13:34
Skill checks in Traveller don't use that mechanic. It's a straight 2d6, totaled, checked against a target number (usually 8).

damned
January 21st, 2017, 13:55
Skill checks in Traveller don't use that mechanic. It's a straight 2d6, totaled, checked against a target number (usually 8).

So what is d66 used for?

OTG_Wraith
January 21st, 2017, 22:33
So what is d66 used for?

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" };.

https://i.imgur.com/ErU7puV.jpg

damned
January 21st, 2017, 22:58
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" };.

https://i.imgur.com/ErU7puV.jpg

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...

https://www.fantasygrounds.com/forums/attachment.php?attachmentid=17547&d=1485007427

If yours rolls a d6 and the 1s generate 10s etc Id love to see if the code is compatible with what Im doing...

OTG_Wraith
January 21st, 2017, 23:14
Maybe I'm not following what you're asking precisely, but I am just doing what you did in the reply above...



<customdie name="d60">
<model>d6</model>
<menuicon>customdice</menuicon>
<script>
function onValue(result)
return result*10;
end
</script>
</customdie>


And then having the internal roll and die calls use the new d60 and an additional d6.

Are you asking how to trap for the d60 results individually in a d66 roll?

damned
January 21st, 2017, 23:58
Thanks for the reply OTG_Wraith. I want to actually see 2d6 animated dice roll and for the code to reflect what the dice do.
If you see in my pic from post #9 my d60 is throwing a dF. I did that because its less jarring than when the 3d d6 shows 5 and 6 and FG reports the roll as 20 and 6.
Mutant Year Zero does it - it defines all new dice and dice faces and the code is more complex.

OTG_Wraith
January 22nd, 2017, 00:03
Ah, I see. No I didn't take it that far. The dice just throw single digits on both. The amount is accurate before the x10, but other than that, yea, it's just 2d6s.

damned
January 22nd, 2017, 00:21
Ah, I see. No I didn't take it that far. The dice just throw single digits on both. The amount is accurate before the x10, but other than that, yea, it's just 2d6s.

Actually your code does do what I wanted/needed - much appreciated.

OTG_Wraith
January 22nd, 2017, 00:46
Ok, great. Glad it helped. I thought you meant you were looking for one of the 3D die to have 10, 20, 30... etc. on it.