PDA

View Full Version : Definition of custom die not working properly



JMessmer
January 29th, 2024, 12:01
I added some custom die in the gameelements.xml and remarked that some die will not be recognized properly depending on the sequence they are added



<die name="W20">
<model>d20</model>
<icon>d20icon</icon>
</die>
<die name="W2">
<model>d6</model>
<icon>d6icon</icon>
<side result="1" value="1" />
<side result="1" value="1" />
<side result="1" value="1" />
<side result="2" value="2" />
<side result="2" value="2" />
<side result="2" value="2" />
</die>


Now I found out that if the d2 is before the d20 in the sequence in _tRulesetDice (Core Ruleset) of the die in scripts/manager_dice.lua.initDiceState() { #1 = s'W2', #2 = s'W20' } then W20 will not be recognized when using the command /die W20. It will always roll a W2.
If the sequence is the other way round and W20 is before W2 then it is working fine.
In my opinion it is a bug.

Moon Wizard
January 30th, 2024, 02:34
It is a limitation of the system that attempts to parse the dice at this time. As you say, this can be worked around by ordering the dice in more specific to least specific.

Regards,
JPG