-
September 19th, 2021, 04:27 #1
- Join Date
- Jun 2017
- Posts
- 61
Need direction to add Roll Modifier in output
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.
Code: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
-
September 19th, 2021, 09:19 #2
I would try to create the action message after you have adjusted rRoll. Since rMessage was already created at the start of your function, it will only have what rRoll was when created, not when you have changed it for the ability modifier.
-
September 19th, 2021, 16:11 #3
- Join Date
- Jun 2017
- Posts
- 61
TY. That got me what I needed.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks