-
January 1st, 2021, 12:51 #11
A few things -
wildie is not the same as wilddie
i dont think this string /die 1d6!1s6f1 does what you think it does
dont you just want /die 1d6!s6f1 but even then are you counting successes or total of all dice including explosions?
in which case /die 1d6! covers the wild die
now you can do simple math in the new die rollers like:
/die (3-1)d6!
so /die ({dexterity_number}-1)d6! in theory should work however there is some glitch there in the RW and despite it reporting (eg) /die 2d6! it doesnt work
so you could create a hidden field and on the hidden field set the value to ({dexterity_number}-1) and then use /die {dexterity_number_hidden}d6!
Or you can go the route of writing a custom dice handler which is fine - but a little tricky with exploding dice
-
January 1st, 2021, 12:57 #12
In the Star Wars OpenD6 / WEG system, the wild die is the only die requiring logic, so /die 1d6!1s6f1 is working well enough.
if a 1 is rolled, it highlights as a failure
if a 6 is rolled, it highlights as a success and rolls another die, continuing if another 6 is rolled.
My first attempt was to use (3-1)d6.... which reporting 2d6 but only rolled 1, just like the glitch you mentioned.
I am working on using the hidden field method now.
Thanks for the reply. I don't feel as stupid now.
Then I want to work on adding chat text when a success or failure occurs on the wild die.
-
January 1st, 2021, 13:24 #13
Ok so you do want to count Success and Failure as well as the Dice Total?
If so I would still drop the 1s6f1 part of the roll because FG will only report the Success or failure and not the Dice total which (I think?) is more important?
I would report the Success Fail result in the text.
Create the roll.
Roll the roll.
Count Fails
Count Successes
Count Total
Append Custom Messages
Write to chat
-
January 1st, 2021, 13:34 #14
I need to report the dice total and if a 1 was rolled on the wild die. I had been using a failure to highlight it. With the hidden field it changes the math so I can't use it.
{nDexterity}d6+d6!+{dexterity_modifier}
Works except for reporting if a 1 is rolled only on the wild die 'd6!'. Since the die is highlighted in chat if a 6 is rolled, that is enough in that case. The challenge is when a 1 is roiled, the GM decides what the impact is. Right now, I can always use the last die in chat and see if it is a 1, but I would really like to highlight it somehow.
The script I wrote is for a wild die on the table, which is rolled by itself. The first thing I did was make sure everything can be rolled manually from the table. You would select the number of d6, manually subtracting 1, then roll the wild die & add the 2 rolls together. Since that uses a custom script, I could write to chat.
Now, I am trying to automate that in the character sheet. It appears I need a slightly modified version of the default script, eh?
I was really trying to avoid that, but it is what it is.
-
January 1st, 2021, 14:22 #15
-
January 1st, 2021, 14:23 #16
-
January 1st, 2021, 14:32 #17
So field one is:
dex_score it has the following Lua attached
Code:function onValueChanged() window.dex_hidden.setValue(window.dex_score.getValue() - 1); end
dex_mod
You could add code to dex_score to also set this value
field three is:
dex_hidden
and should be set to Invisible (True)
Button one is:
Default using Ruleset Wizard only and gives a partial result using the following settings:
Dice Roll string: 1d6!+{dex_hidden}r6+{dex_mod}
Roll Description Text: Dexterity [{dex_score}] Roll
Use Modifier Stack: (True)
Button two is:
My custom button which gives a descriptive result using the following settings:
Dice Roll string: 1d6!+{dex_hidden}r6+{dex_mod}
result handler Function: managerRoll.skillRoll
Roll Description Text: Dexterity [{dex_score}] Roll
Use Modifier Stack: (True)
managerRoll is a Script file with the following code:
Code:function skillRoll(rSource, rTarget, rRoll) -- Name the function and accept 3 parameters local nSuccesses = 0; -- Set nSuccesses variable - we will track Successes here local nFails = 0; -- Set nSuccesses variable - we will track Successes here local nTotal = 0; -- Set nDice variable - we will count # dice here local rMessage = ActionsManager.createActionMessage(rSource, rRoll); -- initialise the message function for k,v in ipairs(rRoll.aDice) do -- Iterate through all dice rolled (explosions) nTotal = nTotal + rRoll.aDice[k].result; end if rRoll.aDice[1].result >= 6 then -- Test if the DICE is a 6 nSuccesses = 1; -- increment success count by 1 rMessage.text = rMessage.text .. "\n[Successes] " .. nSuccesses .. "\n[Total] " .. nTotal; elseif rRoll.aDice[1].result == 1 then -- Test if the DICE is a 1 nFails = 1; -- increment success count by 1 rMessage.text = rMessage.text .. "\n[Fails] " .. nFails .. "\n[Total] " .. nTotal; else rMessage.text = rMessage.text .. "\n[Total] " .. nTotal; end rMessage.dicedisplay = 1; Comm.deliverChatMessage(rMessage); -- Deliver message to Chat end
-
January 1st, 2021, 14:36 #18
-
January 1st, 2021, 14:45 #19
Works like a charm. Thank you very much.
-
January 1st, 2021, 15:01 #20
So you should be able to take that example and expand on it
Auto generate the modifier value based on the attribute score
Most likely you will roll from the Skill rather than the Attribute but you can use the same techniques
Add a hidden field to the Skill that holds the derived number of dice and keep that field up to date with onValueChanged() on the Attribute Score and on the Skill Score
You might notice that my nTotal is incorrect - I havent included the dex_mod value so you should fix that AND I am not checking the Modifier Stack in my code either so you will also need to add that in
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks