Hi all, I'm looking to write a macro for rolling dice for the new Warhammer 40k RPG Wrath and Glory.
The system is based on the Shadowrun dice pool system but with two major changes.
1. A roll of 4 - 5 is one success and the roll of a 6 is two successes.
2. There is a special dice that is always rolled and replaces one of the normal dice this is a 'wrath' dice.
This dice has a fail condition if a 1 is rolled and the same success conditions as above but if a 6 is rolled that needs to be announced.
My current issue is what is the best way to count these successes in a macro?
Thanks in advance.
Wrath and Glory dice macro.
Moderators: dorpond, trevor, Azhrei, Gamerdude
Re: Wrath and Glory dice macro.
I'm guessing the special die is wrath (1) glory (6). The output would be something like the number of successes followed by one of those words if appropriate. I'll do you a favor and write the macro because it's super easy. Then you can modify it if you like from there.
Code: Select all
@@ @rollWGdice
<!-- rollWGdice(numDice): successes (wrath/glory)
numDice - number of dice to be rolled. Sub one die for wrath die
successes - output the number of successes along with the result of wrath die
-->
[H: numDice = arg(0)]
[H: results = "[]"]
[H: wrathDie = json.append(' <b color=red>(WRATH)</b>',"",' <b color=blue>(GLORY)</b>')]
[H: wrathOutput = ""]
[H: successes = 0]
[H, c(numDice), code: {
[H: roll = 1d6]
[H, if(roll.count == 0): wrathOutput = json.get(wrathDie,if(roll == 1,0,if(roll == 6,2,1)))]
[H: results = json.append(results,roll)]
[H: successes = successes + if(roll == 6,2,if(roll >= 4,1,0))]
}]
[R: strformat('<span title="%{results}">Successes: %{successes}%{wrathOutput}</span>')]
!!
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Wrath and Glory dice macro.
Thank you very much the 6 isn't glory, tbh I can't remember if they gave a 6 name, but close enough.
Edit:
Sorry would you mind explaining this a bit more?
Like does this need to be called by another macro.
Thanks.
Edit:
Sorry would you mind explaining this a bit more?
Like does this need to be called by another macro.
Thanks.
Re: Wrath and Glory dice macro.
Ok so I have assumed that it requires the use of a wrapper macro and looked at this wiki http://lmwcs.com/rptools/wiki/Calling_macros
So I wrote the following, but it is just returning "Rolled for athletics"
Any help is much appreciated.
So I wrote the following, but it is just returning "Rolled for athletics"
Code: Select all
<!-- Will roll the labeled skill for the selected token -->
[h, macro("rollWGdice@campaign"): Athletics_Total]
Rolled [r: macro.return] for athletics