mixologee
September 19th, 2021, 04:27
So I am trying to get a roll to show the modifier that happens based on the roll and the ability used during the role. Here is my handler code and a screenshot of what FG shows. The value is calculated and added to the CT correctly, but not showing in the roll itself. Thanks in advance.
function InitHandler(rSource, rTarget, rRoll)
local rMessage = ActionsManager.createActionMessage(rSource, rRoll);
if (rSource) then
local sPCNodeName = ActorManager.getCreatureNodeName(rSource);
local sInfo = DB.getChild(sPCNodeName, "init_cb").getValue();
local nAbility = 0;
if sInfo == "Prowess" then
nAbility = tonumber(DB.getChild(sPCNodeName, "prowess").getValue());
elseif sInfo == "Coordination" then
nAbility = tonumber(DB.getChild(sPCNodeName, "coordination").getValue());
elseif sInfo == "Strength" then
nAbility = tonumber(DB.getChild(sPCNodeName, "strength").getValue());
elseif sInfo == "Intellect" then
nAbility = tonumber(DB.getChild(sPCNodeName, "intellect").getValue());
elseif sInfo == "Awareness" then
nAbility = tonumber(DB.getChild(sPCNodeName, "awareness").getValue());
elseif sInfo == "Willpower" then
nAbility = tonumber(DB.getChild(sPCNodeName, "willpower").getValue());
end
rRoll.nMod = nAbility;
local nTotal = ActionsManager.total(rRoll);
rCreature = DB.findNode(rSource.sCTNode);
rCreature.getChild("initresult").setValue(nTotal);
rMessage.text = rMessage.text .. "[Initiative : " .. sInfo .. "]";
end
Comm.deliverChatMessage(rMessage);
end
49187
function InitHandler(rSource, rTarget, rRoll)
local rMessage = ActionsManager.createActionMessage(rSource, rRoll);
if (rSource) then
local sPCNodeName = ActorManager.getCreatureNodeName(rSource);
local sInfo = DB.getChild(sPCNodeName, "init_cb").getValue();
local nAbility = 0;
if sInfo == "Prowess" then
nAbility = tonumber(DB.getChild(sPCNodeName, "prowess").getValue());
elseif sInfo == "Coordination" then
nAbility = tonumber(DB.getChild(sPCNodeName, "coordination").getValue());
elseif sInfo == "Strength" then
nAbility = tonumber(DB.getChild(sPCNodeName, "strength").getValue());
elseif sInfo == "Intellect" then
nAbility = tonumber(DB.getChild(sPCNodeName, "intellect").getValue());
elseif sInfo == "Awareness" then
nAbility = tonumber(DB.getChild(sPCNodeName, "awareness").getValue());
elseif sInfo == "Willpower" then
nAbility = tonumber(DB.getChild(sPCNodeName, "willpower").getValue());
end
rRoll.nMod = nAbility;
local nTotal = ActionsManager.total(rRoll);
rCreature = DB.findNode(rSource.sCTNode);
rCreature.getChild("initresult").setValue(nTotal);
rMessage.text = rMessage.text .. "[Initiative : " .. sInfo .. "]";
end
Comm.deliverChatMessage(rMessage);
end
49187