Valarian
October 29th, 2019, 11:28
Ruleset: The One Ring
Issue: Custom result images not used.
The custom dice images defined in the gameelements.xml are not displayed when the results are shown.
This will affect other rulesets that customise the dice, such as Star Wars: Edge of the Empire, and Warhammer.
<root>
<distance>
<base>5</base>
<diagmult>1.5</diagmult>
<suffix>'</suffix>
</distance>
<!-- Hide Dice -->
<die name="dF" merge="delete"/>
<die name="d4" merge="delete"/>
<die name="d6">
<icon>d6icon</icon>
<menuicon>customdice</menuicon>
<position>220,-68</position>
</die>
<die name="d8" merge="delete"/>
<die name="d10" merge="delete"/>
<die name="d20" merge="delete"/>
<customdie name="d2" merge="delete"/>
<customdie name="d3" merge="delete"/>
<!-- Custom Dice for The One Ring -->
<!-- d12 -->
<die name="d12.1"><icon>d12icon.1</icon></die>
<die name="d12.2"><icon>d12icon.2</icon></die>
<die name="d12.3"><icon>d12icon.3</icon></die>
<die name="d12.4"><icon>d12icon.4</icon></die>
<die name="d12.5"><icon>d12icon.5</icon></die>
<die name="d12.6"><icon>d12icon.6</icon></die>
<die name="d12.7"><icon>d12icon.7</icon></die>
<die name="d12.8"><icon>d12icon.8</icon></die>
<die name="d12.9"><icon>d12icon.9</icon></die>
<die name="d12.10"><icon>d12icon.10</icon></die>
<die name="d12.11"><icon>d12icon.11</icon></die>
<die name="d12.12"><icon>d12icon.12</icon></die>
<!-- d6 -->
<die name="d6.1"><icon>d6icon.1</icon></die>
<die name="d6.2"><icon>d6icon.2</icon></die>
<die name="d6.3"><icon>d6icon.3</icon></die>
<die name="d6.4"><icon>d6icon.4</icon></die>
<die name="d6.5"><icon>d6icon.5</icon></die>
<die name="d6.6"><icon>d6icon.6</icon></die>
</root>
Fantasy Grounds Classic
29640
Fantasy Grounds Unity
29641
Issue: Custom dice results not recognised.
When rolling the dice through a custom dice handler, the results total for the dice is not being shown.
function onInit()
ActionsManager.registerResultHandler("dice", handleDiceLanded);
end
function handleDiceLanded(rSource, rTarget, rRoll)
local successes = 0;
local gandalfrune = false;
local eyeofsauron = false;
local add_total = true;
local total = 0;
local firstResult = 0;
local secondResult = 0;
local dicetable = rRoll.aDice;
if dicetable then
for n = 1, table.maxn(dicetable) do
if dicetable[n].type == "d12" and dicetable[n].result == 12 then
if User.isHost() then
total = total + 10;
else
total = total + 0;
end
gandalfrune = true;
elseif dicetable[n].type == "d12" and dicetable[n].result == 11 then
if User.isHost() then
total = total + 0;
else
total = total + 10;
end
eyeofsauron = true;
elseif dicetable[n].type == "d6" and dicetable[n].result == 6 then
successes = successes + 1;
total = total + 6;
else
total = total + dicetable[n].result;
end
dicetable[n].type = dicetable[n].type .. "." .. dicetable[n].result;
if User.isHost() then
if dicetable[n].type == "d12.11" then
dicetable[n].result = 10;
elseif dicetable[n].type == "d12.12" then
dicetable[n].result = 0;
end
else
if dicetable[n].type == "d12.11" then
dicetable[n].result = 0;
elseif dicetable[n].type == "d12.12" then
dicetable[n].result = 10;
end
end
end
end
total = total + ModifierStack.getSum();
local rMessage = ChatManager.createBaseMessage(rSource, rRoll.sUser);
rMessage.type = rRoll.sType;
rMessage.text = rMessage.text .. rRoll.sDesc;
rMessage.text = rMessage.text .. " [" .. successes .. " " .. Interface.getString("dice_label_tengwar") .. "]";
if gandalfrune then rMessage.text = rMessage.text .. " (" .. Interface.getString("dice_label_gandalf") .. ")"; end
if eyeofsauron then rMessage.text = rMessage.text .. " (" .. Interface.getString("dice_label_eye") .. ")"; end
rMessage.dice = rRoll.aDice;
rMessage.diemodifier = rRoll.nMod;
-- Check to see if this roll should be secret (GM or dice tower tag)
if rRoll.bSecret then
rMessage.secret = true;
if rRoll.bTower then
rMessage.icon = "dicetower_icon";
end
elseif User.isHost() and OptionsManager.isOption("REVL", "off") then
rMessage.secret = true;
end
-- Show total if option enabled
if OptionsManager.isOption("TOTL", "on") and rRoll.aDice and #(rRoll.aDice) > 0 then
rMessage.dicedisplay = 1;
end
Comm.deliverChatMessage(rMessage);
ModifierStack.reset();
return true;
end
Issue: Custom result images not used.
The custom dice images defined in the gameelements.xml are not displayed when the results are shown.
This will affect other rulesets that customise the dice, such as Star Wars: Edge of the Empire, and Warhammer.
<root>
<distance>
<base>5</base>
<diagmult>1.5</diagmult>
<suffix>'</suffix>
</distance>
<!-- Hide Dice -->
<die name="dF" merge="delete"/>
<die name="d4" merge="delete"/>
<die name="d6">
<icon>d6icon</icon>
<menuicon>customdice</menuicon>
<position>220,-68</position>
</die>
<die name="d8" merge="delete"/>
<die name="d10" merge="delete"/>
<die name="d20" merge="delete"/>
<customdie name="d2" merge="delete"/>
<customdie name="d3" merge="delete"/>
<!-- Custom Dice for The One Ring -->
<!-- d12 -->
<die name="d12.1"><icon>d12icon.1</icon></die>
<die name="d12.2"><icon>d12icon.2</icon></die>
<die name="d12.3"><icon>d12icon.3</icon></die>
<die name="d12.4"><icon>d12icon.4</icon></die>
<die name="d12.5"><icon>d12icon.5</icon></die>
<die name="d12.6"><icon>d12icon.6</icon></die>
<die name="d12.7"><icon>d12icon.7</icon></die>
<die name="d12.8"><icon>d12icon.8</icon></die>
<die name="d12.9"><icon>d12icon.9</icon></die>
<die name="d12.10"><icon>d12icon.10</icon></die>
<die name="d12.11"><icon>d12icon.11</icon></die>
<die name="d12.12"><icon>d12icon.12</icon></die>
<!-- d6 -->
<die name="d6.1"><icon>d6icon.1</icon></die>
<die name="d6.2"><icon>d6icon.2</icon></die>
<die name="d6.3"><icon>d6icon.3</icon></die>
<die name="d6.4"><icon>d6icon.4</icon></die>
<die name="d6.5"><icon>d6icon.5</icon></die>
<die name="d6.6"><icon>d6icon.6</icon></die>
</root>
Fantasy Grounds Classic
29640
Fantasy Grounds Unity
29641
Issue: Custom dice results not recognised.
When rolling the dice through a custom dice handler, the results total for the dice is not being shown.
function onInit()
ActionsManager.registerResultHandler("dice", handleDiceLanded);
end
function handleDiceLanded(rSource, rTarget, rRoll)
local successes = 0;
local gandalfrune = false;
local eyeofsauron = false;
local add_total = true;
local total = 0;
local firstResult = 0;
local secondResult = 0;
local dicetable = rRoll.aDice;
if dicetable then
for n = 1, table.maxn(dicetable) do
if dicetable[n].type == "d12" and dicetable[n].result == 12 then
if User.isHost() then
total = total + 10;
else
total = total + 0;
end
gandalfrune = true;
elseif dicetable[n].type == "d12" and dicetable[n].result == 11 then
if User.isHost() then
total = total + 0;
else
total = total + 10;
end
eyeofsauron = true;
elseif dicetable[n].type == "d6" and dicetable[n].result == 6 then
successes = successes + 1;
total = total + 6;
else
total = total + dicetable[n].result;
end
dicetable[n].type = dicetable[n].type .. "." .. dicetable[n].result;
if User.isHost() then
if dicetable[n].type == "d12.11" then
dicetable[n].result = 10;
elseif dicetable[n].type == "d12.12" then
dicetable[n].result = 0;
end
else
if dicetable[n].type == "d12.11" then
dicetable[n].result = 0;
elseif dicetable[n].type == "d12.12" then
dicetable[n].result = 10;
end
end
end
end
total = total + ModifierStack.getSum();
local rMessage = ChatManager.createBaseMessage(rSource, rRoll.sUser);
rMessage.type = rRoll.sType;
rMessage.text = rMessage.text .. rRoll.sDesc;
rMessage.text = rMessage.text .. " [" .. successes .. " " .. Interface.getString("dice_label_tengwar") .. "]";
if gandalfrune then rMessage.text = rMessage.text .. " (" .. Interface.getString("dice_label_gandalf") .. ")"; end
if eyeofsauron then rMessage.text = rMessage.text .. " (" .. Interface.getString("dice_label_eye") .. ")"; end
rMessage.dice = rRoll.aDice;
rMessage.diemodifier = rRoll.nMod;
-- Check to see if this roll should be secret (GM or dice tower tag)
if rRoll.bSecret then
rMessage.secret = true;
if rRoll.bTower then
rMessage.icon = "dicetower_icon";
end
elseif User.isHost() and OptionsManager.isOption("REVL", "off") then
rMessage.secret = true;
end
-- Show total if option enabled
if OptionsManager.isOption("TOTL", "on") and rRoll.aDice and #(rRoll.aDice) > 0 then
rMessage.dicedisplay = 1;
end
Comm.deliverChatMessage(rMessage);
ModifierStack.reset();
return true;
end