Post by Virgil Sovereign on May 19, 2014 19:14:24 GMT -8
Azerik: The issue of restricting users to specific rolls has come up a few times before.
Having multiple instances of the plugin unfortunately isn't an option since all instances share the same plugin ID, which is a unique identifier used to get settings for the plugin. I would have to create multiple versions of the plugin, each with a unique plugin ID, which isn't a tenable option.
However, using VDice Advanced, it is possible to restrict users to specific rolls, and have each range use its own special set of graphics. Below I've excerpted parts of a private conversation I had with another user on the subject:
Hopefully this makes sense.
In your case specifically , you would most likely make two aliases:
D10 -- aliases to --> azerik:1d10
D20 -- aliases to --> azerik:1d20
In the Advanced Graphics tab of VDice Advanced, you'd have three rules:
1. Captures azerik:1d10 and uses the graphic resources, etc. for a 10-sided die.
2. Captures azerik:1d20 and uses the graphic resources, etc. for a 20-sided die.
3. Captures .+ and uses the "illegal" template that declares the roll to be illegal.
This way, users would simply type in "D10" or "D20" as a range, and all other possible ranges would be declared illegal.
If this is confusing, I can send you a preconfigured version of the plugin so that you can poke around in the settings to get a handle on what's going on.
Having multiple instances of the plugin unfortunately isn't an option since all instances share the same plugin ID, which is a unique identifier used to get settings for the plugin. I would have to create multiple versions of the plugin, each with a unique plugin ID, which isn't a tenable option.
However, using VDice Advanced, it is possible to restrict users to specific rolls, and have each range use its own special set of graphics. Below I've excerpted parts of a private conversation I had with another user on the subject:
I would recommend [using] the Advanced Graphics tab in the following way:
Set up all your (valid) roll aliases with a secret prefix. For example:
sword -- aliases to --> mysecret:2-15
axe -- aliases to --> mysecret:6-9
shield -- aliases to --> mysecret:3d6+3
Then in the Advanced Graphics tab, enter two rules. The first rule will capture patterns starting with the prefix, and will have all other fields left blank (which causes VDice to use the defaults). Hence,
Pattern: mysecret:.+
and all other fields blank in that row.
The second rule would capture everything, and you would specify a special roll template, "illegal", as the roll template. Hence,
Pattern: .+
Roll Template: illegal
for that row.
Under the Advanced Templates tab, you would then define a new roll template called "illegal", and set it to the HTML you wanted to appear if a roll was illegal. For example, <b><font color="red">This is not a legal roll.</font></b>.
By taking all of these steps, only the aliases would produce valid rolls. If you're already using the Advanced Graphics tab, the same idea applies. Make sure each alias includes a token that will cause it to be captured by at least one rule in the list, and then add a final rule to the list that catches everything, which will capture everything else (which is presumably illegal) and display your warning message.
Set up all your (valid) roll aliases with a secret prefix. For example:
sword -- aliases to --> mysecret:2-15
axe -- aliases to --> mysecret:6-9
shield -- aliases to --> mysecret:3d6+3
Then in the Advanced Graphics tab, enter two rules. The first rule will capture patterns starting with the prefix, and will have all other fields left blank (which causes VDice to use the defaults). Hence,
Pattern: mysecret:.+
and all other fields blank in that row.
The second rule would capture everything, and you would specify a special roll template, "illegal", as the roll template. Hence,
Pattern: .+
Roll Template: illegal
for that row.
Under the Advanced Templates tab, you would then define a new roll template called "illegal", and set it to the HTML you wanted to appear if a roll was illegal. For example, <b><font color="red">This is not a legal roll.</font></b>.
By taking all of these steps, only the aliases would produce valid rolls. If you're already using the Advanced Graphics tab, the same idea applies. Make sure each alias includes a token that will cause it to be captured by at least one rule in the list, and then add a final rule to the list that catches everything, which will capture everything else (which is presumably illegal) and display your warning message.
Hopefully this makes sense.
In your case specifically , you would most likely make two aliases:
D10 -- aliases to --> azerik:1d10
D20 -- aliases to --> azerik:1d20
In the Advanced Graphics tab of VDice Advanced, you'd have three rules:
1. Captures azerik:1d10 and uses the graphic resources, etc. for a 10-sided die.
2. Captures azerik:1d20 and uses the graphic resources, etc. for a 20-sided die.
3. Captures .+ and uses the "illegal" template that declares the roll to be illegal.
This way, users would simply type in "D10" or "D20" as a range, and all other possible ranges would be declared illegal.
If this is confusing, I can send you a preconfigured version of the plugin so that you can poke around in the settings to get a handle on what's going on.