I'm sure this is basic stuff. Just trying to learn.
Can a macro output a specific text, dependent on a range of the dice roll?
Example:
[[1d100]]
0-50 output "text 1"
51-100 output "text 2"
Thanks
I'm sure this is basic stuff. Just trying to learn.
Can a macro output a specific text, dependent on a range of the dice roll?
Example:
[[1d100]]
0-50 output "text 1"
51-100 output "text 2"
Thanks
The easiest way is to create a rollable table with text "items" that are given the appropriate weight. You can "roll" on that table using [[ 1t[tableName] ]] syntax.
A rollable table will do this for you, if you don't need any modifiers.
If you need to work off of a formula ([[1d100 + @{some_modifier}]], I believe the API Script Cards can do this for you. There are probably other solutions available through the API.
In general though, regular macros are simple dice and reporting formulas, and lack scripting features such as looping or branching.
Yes I considered that. Its NPC specific so for the sake of keeping the collections tab from having tables that are rarely used I thought maybe including it with in the NPC template would be more prudent.
I created a NPC template and the NPC is 50% neutral good or 50% neutral evil.
I created a trait called Variable: Neutral Alignment
In the text explanation I added [[1D100]]
It displays all the trait information and the outcome of the roll when I select the Token Trait Button. (Set up from "Monster Templates" video)
I thought I would try and take it to the next level by outputting "Neutral Good" or "Neutral Evil" rather than the actual dice roll.
If you don't mind storing the source data on the NPC sheet (so it doesn't clutter the collection tab), you can use Muler ... OR ... this might the simpler ... Apply a success threshold to your roll, then have an attribute for a 0 (Neutral Good) and for 1 (Neutral Evil). Finally, use Fetch to return the value, since it will return the value after the roll.
@(Source Character.[[1d100>50]].value)
You can use that in any macro (provided you start as an API call -- can be changed midway through).
To make it work you'll need Fetch and ZeroFrame.