Thread: MoreCore Ruleset
-
December 4th, 2018, 04:45 #1291
-
December 4th, 2018, 11:47 #1292
Patriarch
- Join Date
- Nov 2015
- Posts
- 378
It's an unpublished game system called Factor12. Ideally, each skill would have an option for straight 2d12 and then the more complicated roll, and rolling 24 on the 2d12 would also trigger rolling the extra die once and adding it to the 24 total. Being able to "slot" the Competency (extra) die into the skill on the player side would be good, but as long as the formula at least did the 2d12+1d#+#, take best 2, the other stuff could be figured out in game.
Has openlegend been coded for morecore? I could look at that maybe. I was working a bit with altering rolled last night, but haven't been able to test it out.
Edit: and rolling 2 on the 2d12 would also trigger the Competency die, with another 1 indicating a "deuce"(fumble).Last edited by DMReckless; December 4th, 2018 at 11:52.
-
December 5th, 2018, 01:57 #1293
Patriarch
- Join Date
- Nov 2015
- Posts
- 378
Working with rolld, I've been able to get it to roll the extra type die and keep the top two. Gotta figure out how to add in a modifier now.
-
December 5th, 2018, 02:03 #1294
-
December 5th, 2018, 05:24 #1295
Patriarch
- Join Date
- Nov 2015
- Posts
- 378
Darned frustrating, trying to find nMod strings among all that other stuff, hours later, going to bed with no luck.
---
--- Initialization
---
local sCmd = "factwelve";
-- MoreCore v0.60
function onInit()
CustomDiceManager.add_roll_type(sCmd, performAction, onLanded, true, "all");
end
function onInit()
Comm.registerSlashHandler("factwelve", processRoll);
GameSystem.actions["factwelve"] = { bUseModStack = true };
ActionsManager.registerModHandler("factwelve", onMod)
ActionsManager.registerResultHandler("factwelve", onRoll);
-- send launch message
local msg = {sender = "", font = "emotefont"};
msg.text = "Factor12 Dice loaded. Type \"/factwelve ?\" for usage.";
ChatManager.registerLaunchMessage(msg);
end
---
--- This is the function that is called when the factwelve slash command is called.
--- The default value for sParams is equal to "2d12+1d4+0 1"
---
function processRoll(sCommand, sParams)
if not sParams or sParams == "" then
sParams = "2d12+1d4+0 1";
end
if sParams == "?" or string.lower(sParams) == "help" then
createHelpMessage();
else
local rRoll = createRoll(sParams);
ActionsManager.roll(nil, nil, rRoll);
end
end
---
--- This function creates the roll object based on the parameters sent in
---
function createRoll(sParams)
local rRoll = {};
rRoll.sType = "factwelve";
rRoll.nMod = 0;
rRoll.sUser = User.getUsername();
rRoll.aDice = {};
rRoll.aDropped = {};
-- If no number to drop is specified, we will assume it is 1
if(not sParams:match("(%d+)d([%dF]*)+(%d+)d([%dF]*)+(%d+)%s(%d+)") and sParams:match("(%d+)d([%dF]+(%d+)d([%dF]*)+(%d+)+)")) then
sParams = sParams .. " 1"
end
-- Now we check that we have a properly formatted parameter, or we set the sDesc for the roll with a message.
if not sParams:match("(%d+)d([%dF]*)+(%d+)d([%dF]*)+(%d+)%s(%d+)") then
rRoll.sDesc = "Parameters not in correct format. Should be in the format of \"2d12+#d#+# #\"";
return rRoll;
end
local sNum, sSize, tNum, tSize, aMod, sDrop = sParams:match("(%d+)d([%dF]+)+(%d+)d([%dF]*)+(%d+)%s(%d+)");
local count = tonumber(sNum);
local comp = tonumber(tNum);
local drop = tonumber(sDrop);
if (drop > count + comp) then
rRoll.sDesc = "You cannot drop more results than the number of dice being rolled.";
return rRoll;
end
while count > 0 do
table.insert(rRoll.aDice, "d" .. sSize);
-- For d100 rolls, we also need to add a d10 dice for the ones place
if sSize == "100" then
table.insert(rRoll.aDice, "d10");
end
count = count - 1;
end
while comp > 0 do
table.insert(rRoll.aDice, "d" .. tSize);
-- For d100 rolls, we also need to add a d10 dice for the ones place
if sSize == "100" then
table.insert(rRoll.aDice, "d10");
end
comp = comp - 1;
end
rRoll.nDrop = drop;
return rRoll;
end
---
--- This function first sorts the dice rolls in ascending order, then it splits
--- the dice results into kept and dropped dice, and stores them as rRoll.aDice
--- and rRoll.aDropped.
---
function dropDiceResults(rRoll)
if #(rRoll.aDice) < 2 then return rRoll end
local len = #(rRoll.aDice) or 0;
local drop = tonumber(rRoll.nDrop) or 0;
local dropped = {};
local kept = {};
table.sort(rRoll.aDice, function(a,b) return a.result < b.result end);
local count = 1;
while count <= len do
if count <= drop then
table.insert(dropped, rRoll.aDice[count]);
else
table.insert(kept, rRoll.aDice[count]);
end
count = count + 1;
end
rRoll.aDice = kept;
rRoll.aDropped = dropped;
return rRoll;
end
---
--- This function creates a chat message that displays the results.
---
function createChatMessage(rSource, rRoll)
local rMessage = ActionsManager.createActionMessage(rSource, rRoll);
if #(rRoll.aDice) > 0 then
rMessage.text = rMessage.text .. "[KEPT]";
for _,v in ipairs(rRoll.aDice) do
rMessage.text = rMessage.text .. " " .. v.result;
end
end
if #(rRoll.aDice) > 0 and #(rRoll.aDropped) > 0 then
rMessage.text = rMessage.text .. "\n";
end
if #(rRoll.aDropped) > 0 then
rMessage.text = rMessage.text .. "[DROPPED]";
for _,v in ipairs(rRoll.aDropped) do
rMessage.text = rMessage.text .. " " .. v.result;
end
end
return rMessage;
end
---
--- This function creates the help text message for output.
---
function createHelpMessage()
local rMessage = ChatManager.createBaseMessage(nil, nil);
rMessage.text = rMessage.text .. "The \"/factwelve\" command is used to roll a set of dice, removing a number of the lowest results.\n";
rMessage.text = rMessage.text .. "You can specify the number of dice to roll, the type of dice, and the number of results to be dropped ";
rMessage.text = rMessage.text .. "by supplying the \"/factwelve\" command with parameters in the format of \"#d#+#d#+# #\".";
rMessage.text = rMessage.text .. "If no parameters are supplied, the default parameters of \"2d12+1d4+0 1\" are used.";
Comm.deliverChatMessage(rMessage);
end
---
--- This is the callback that gets triggered after the roll is completed.
---
function onRoll(rSource, rTarget, rRoll)
rRoll = dropDiceResults(rRoll);
rMessage = createChatMessage(rSource, rRoll);
rMessage.type = "dice";
Comm.deliverChatMessage(rMessage);
end
-
December 5th, 2018, 12:39 #1296
I will have a look tomorrow.
What are some valid dice test strings - with different sized dice?
-
December 5th, 2018, 14:38 #1297
Patriarch
- Join Date
- Nov 2015
- Posts
- 378
/factwelve 2d12+1d4+1 1
/factwelve 2d12+1d8+4 1
Really, anything in that setup works (except for the mod) like
/factwelve 3d6+2d8+1 2
will drop the lowest 2 dice but won't add in the 1 mod.
I'm also having a problem getting it to work as a macro inside the MoreCore character sheet, but that's probably a function of having to set up "factwelve" withe the sheet scripts?Last edited by DMReckless; December 5th, 2018 at 14:41.
-
December 5th, 2018, 18:42 #1298
-
December 6th, 2018, 02:15 #1299
Patriarch
- Join Date
- Nov 2015
- Posts
- 378
thanks. followed that, but getting script error:
Script Error: [string "common/scripts/morecore_rolls/lua"]:80: attempt to concatenate 'sParams' (a nil value}
-
December 6th, 2018, 20:13 #1300
- Join Date
- Jan 2013
- Posts
- 8
Hi !
First thanks for this great "rule pak";
We use it to play hackmaster and it work ok.
However since last update as a GM i have encounter a little problem: I can't open the Old character selection screen ?
Now, instead i've got a scrolling list who looks exactly like the NPC list. (no portrait of the character only their name).
I can open Character sheet from this list but I cannot "own" them, export or import them. Only the create and erase option are available when right clicking in this list.
For Player who join a game the "old" character selction screen open once at the beginning and if they close it we didn't find a way to open it again.
I guess there is a new function that i'm not aware of.
Thanks for the pak anyway it's great !
Thread Information
Users Browsing this Thread
There are currently 2 users browsing this thread. (0 members and 2 guests)
Bookmarks