PDA

View Full Version : dice rolls with /die - What exactly happens



Fenloh
October 10th, 2020, 10:28
Hello everyone,

maybe one of you knows this.

In the FGU CoreRPG, when you use the chat window with "/die 3d6k2", what exactly happens. Which functions are used in what Order to produce the correct result.

I am asking this, because for a Campaign, I would like to have Mathematical Rolls, like the one above, in the Charactersheet and the NPC Sheet. Unfortunatly it is not working with the NPC Rolls (seems it has a problem with the Mathematical Expressions. This issue will be taken care of somewhen in the Future), but in the meantime I like to see if it can be solved manually, and it has to be integreated to the Characterheet. I would like to use as much of the standard functionality as possible.

LG
Fenloh

Zacchaeus
October 10th, 2020, 12:35
I'm assuming you are talking about Unity?

The dice roller hasn't been integrated into any of the rulesets as yet. All such rolls are made using the /die command in the chat window

In your example above that means roll 3d6 and keep the two highest results. More on the dice roller here https://fantasygroundsunity.atlassian.net/wiki/spaces/FGU/pages/688330/Rolling+Dice

Moon Wizard
October 11th, 2020, 04:29
It's interpreted internally by the FGU client as a slash command; not something handled by the ruleset (for FGU only). To use the FGU dice rolling, the best way is to submit a roll using the Comm.throwDice API (just like the ActionsManager in CoreRPG does), or you could use the Comm.activateSlashCommand API to call the /die command directly. The ActionsManager does a few more things in FGU (i.e. integrates with modifier box and manual roll option); but hasn't needed to be updated to support complex roll schemes directly.

Regards,
JPG

Fenloh
October 11th, 2020, 09:55
Thanks a lot for the fast reply.

I am playing around with it, but I cant get it to work as I want it to :). It seems I cant get the dragdata right for it to work properly.

How does the dragdata has to look like if I want the formula "3d6k2" to work with the throwdice API?

rRoll = {
sType = "dice",
aDice = {"d6", "d6", "d6", "d6" } ,
nMod = 0,
sDesc = "Attack with Sword"
};
rThrow = ActionsManager.buildThrow(nil , nil , rRoll, false);
Comm.thowDice(rThrow);

would result in a 4d6 Diceroll with no Modifiers and the modifier Stack would not be touched.

I have not yet understood how you actually make the "/die 4d6k2" to work from the Chat window O_O.

Sorry for asking such dumb questions. Havent done anything in FG(U) for a long time.

Moon Wizard
October 11th, 2020, 22:19
You can't currently use the API or CoreRPG ActionsManager script to trigger the FGU die handling yet.

I'll look into adding the first part for the next version update. After the update, it would look something like this:
rRoll = {
sType = "dice",
aDice = { expr = "4d6k2" } ,
nMod = 0,
sDesc = "Attack with Sword"
};
ActionsManager.performAction(nil, nil, rRoll);

Regards,
JPG

Fenloh
October 12th, 2020, 04:12
Thats really great!
Thanks a lot.

BR,
Fenloh

damned
October 18th, 2020, 06:58
Ive just got this working in MoreCore using ActionsManager.performAction
Just a basic implementation so far without any targeting.

Fenloh
October 23rd, 2020, 12:33
Hey damned, thanks.
Also there was an update on FGU that covered it.

LG
Fenloh