-
January 5th, 2022, 00:06 #751
in this line:
local nResult = rRoll.aDice[1].result;
you are "capturing" the rRoll.aDice[1].result and storing it as nResult.
I dont know if that description uses the correct terms - Im no programmer!
Have a look at the rest of the output from the Debug
Also - regarding aDice - that is an array.
It stores several pieces of information about each dice that was thrown - the dice size and the dice result and the dice value (one of which you can manipulate) and dice type and expression and it stores it for each dice thrown. The first dice is known as aDice[1] and the second dice is aDice[2]
Anyway your modifiers are not stored in the aDice part - but they are there elsewhere in the rRoll data
try doing things like
Debug.chat("nBonuses: ", rRoll.nBonuses);
Debug.chat("s'nMod: ", rRoll.s'nMod);
Debug.chat("s'sType: ", rRoll.s'sType);
etc
Then work out what you need to do next...
-
January 6th, 2022, 16:02 #752
- Join Date
- Nov 2017
- Location
- North Carolina, USA
- Posts
- 266
This vid describes what I am wanting to do, does it not? Apply the mod to the target number before the roll. All I will need to do is edit and add the top half of your script from AAF and retain the nResult portion from mine.
Basic Ruleset Creation Tutorial Series 007
https://www.youtube.com/watch?v=5wRR5vi-X8c
-
January 6th, 2022, 22:07 #753
What you are looking for is something like this:
Code:local nDamage = 0; for _,v in ipairs(rRoll.aDice) do nDamage = nDamage + v.result; end nDamage = nDamage + rRoll.nMod +rRoll.nBonuses;
-
January 6th, 2022, 22:40 #754
- Join Date
- Nov 2017
- Location
- North Carolina, USA
- Posts
- 266
Nudges followed, videos reviewed, other rulesets perused. Still a blindfolded drunk in a knife fight. I have an understanding of some LUA phrasing. But its like knowing what taco, hacienda and pantalones mean and trying to say in spanish "While wearing my red pants, I ate tacos at the house."
-
January 6th, 2022, 22:42 #755
-
January 6th, 2022, 22:58 #756
- Join Date
- Nov 2017
- Location
- North Carolina, USA
- Posts
- 266
Its not a damage script, its my managerRolls skill roll. Here's what I am experimenting with so far:
function Skill(rSource, rTarget, rRoll)
Debug.chat("rRoll: ", rRoll);
local sModDesc, nMod = ModifierStack.getStack(true);
local nSkillScore = tonumber(rRoll.SkillScore);
Debug.chat("nSkillScore: ", nSkillScore);
local nTarget = nSkillScore + nMod;
Debug.chat("nTarget: ", nTarget);
local nResult = rRoll.aDice[1].result;
Debug.chat("nResult: ", nResult);
local sResult = '';
if nResult > nSkillScore then
if nResult % 5 == 0 then
sResult = ' (' .. nResult .. " vs EML " .. nSkillScore .. ") = Critical Failure ";
else
sResult = ' (' .. nResult .. " vs EML " .. nSkillScore .. ") = Marginal Failure ";
end
else
if nResult % 5 == 0 then
sResult = ' (' .. nResult .. " vs EML " .. nSkillScore .. ") = Critical Success ";
else
sResult = ' (' .. nResult .. " vs EML " .. nSkillScore .. ") = Marginal Success ";
end
end
local rMessage = ActionsManager.createActionMessage(rSource, rRoll);
rMessage.text = rMessage.text .. sResult;
Comm.deliverChatMessage(rMessage);
return true
end
-
January 6th, 2022, 22:59 #757
also post the output from the Debug.chat("rRoll: ", rRoll);
-
January 6th, 2022, 23:00 #758
- Join Date
- Nov 2017
- Location
- North Carolina, USA
- Posts
- 266
It will find the SkillScore and the nMod, it just wont do the math. nSkillScore + nMod
-
January 6th, 2022, 23:00 #759
-
January 6th, 2022, 23:01 #760
- Join Date
- Nov 2017
- Location
- North Carolina, USA
- Posts
- 266
s'rRoll: ' | { s'nBonuses' = s'0', s'aDice' = { #1 = { s'value' = #87, s'type' = s'd100', s'result' = #87 }, s'expr' = s'd100' }, s'nMod' = #-20, s'sType' = s'wpn1_a_emlRollAction', s'bSecret' = bFALSE, s'SkillScore' = s'65', s'sDesc' = s'Attack EML Test Result For ML 80 - 15 PP [-20]' }
s'nSkillScore: ' | #65
s'nTarget: ' | #65
s'nResult: ' | #87
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks