Thread: Help with the tables
-
April 12th, 2013, 17:50 #1
- Join Date
- Feb 2011
- Location
- Upstate NY
- Posts
- 46
Help with the tables
I am adding tables, but one of the tables that I have add from within the game needs to use a specific roll. I have already set the roll results but need to change the dice that are rolled for the table. I want it to roll 3d6, but I am not sure how to set it up so it will do that. A little help plz.
-
April 17th, 2013, 21:22 #2
Unfortunately, you can't do this without modifying the ruleset LUA code. The table functionality is coded to decide which single die (including d100 as a single die) to roll based on the max number the table goes up to using the following code in the manage_table.lua script file (from the 3.5e ruleset):
Code:-- Determine die to roll for this table function getTableDice(nodeTable) local nMax = 0; for _,v in pairs(DB.getChildren(nodeTable, "tablerows")) do local nTo = DB.getValue(v, "torange", 0); if nTo > nMax then nMax = nTo; end end local aDice = {}; if nMax <= 2 then table.insert(aDice, "d2"); elseif nMax <= 3 then table.insert(aDice, "d3"); elseif nMax <= 4 then table.insert(aDice, "d4"); elseif nMax <= 6 then table.insert(aDice, "d6"); elseif nMax <= 8 then table.insert(aDice, "d8"); elseif nMax <= 10 then table.insert(aDice, "d10"); elseif nMax <= 12 then table.insert(aDice, "d12"); elseif nMax <= 20 then table.insert(aDice, "d20"); else table.insert(aDice, "d100"); table.insert(aDice, "d10"); end return aDice; end
Code:elseif nMax <= 12 then table.insert(aDice, "d12"); elseif nMax <= 18 then table.insert(aDice, "d6"); table.insert(aDice, "d6"); table.insert(aDice, "d6"); elseif nMax <= 20 then table.insert(aDice, "d20");
- You need to add d6 three times to the dice table, you can't add "3d6" at once.
- The table will just show "d6" by the dice rolling button, but it will roll 3d6 and use the result to return the relevant entry in the table.
Edit: Here is a screenshot of the results of using the above code and a table with the max number = 18:
Last edited by Trenloe; April 17th, 2013 at 21:27.
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
April 18th, 2013, 01:00 #3
- Join Date
- Feb 2011
- Location
- Upstate NY
- Posts
- 46
Thanks for the help this was very helpful. Now I do have tables that need to have a modifier for the table. So if one table gets a certain result the next table that it would roll on has a modifier for it. So lets say that the first table rolls 35% and when it brings up the next table to roll it should be modified +1 to the d20 that it rolls for that table. Any suggestions?
-
April 18th, 2013, 01:14 #4
Didn't realise this until I looked at the code - you can trigger a table roll from the chat line, with the following syntax:
Code:/rollon tablename -c [column name] [-d dice] [-hide]
Code:/rollon Test Table -c d6 -d 3d6
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
April 18th, 2013, 01:59 #5
- Join Date
- Feb 2011
- Location
- Upstate NY
- Posts
- 46
ok well if you happen to get a chance to take a look into it that would be cool, and thank you again for all the help so far.
-
April 18th, 2013, 02:13 #6Originally Posted by kenneth_burnellPrivate Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks