5E Character Create Playlist
  1. #1

    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.

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,505
    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
    It is possible to change the hard coding for this script to use 3d6 if the maximum number in the table is between 12 and 18, here is an example of the code to add between the d12 and d20 sections:
    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");
    Note
    - 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!

  3. #3
    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?

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,505
    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]
    So, in my test table in the screenshot above, I could use the following, without having to modify the ruleset - this forces the table to roll 3d6:
    Code:
    /rollon Test Table -c d6 -d 3d6
    Back to your question about adding modifiers for a second table roll. I can't see anything in the code for this, so there would have to be more than a simple modification to the table code to include a modifier to the next table roll. It could be done, but it's beyond a simple look...
    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!

  5. #5
    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.

  6. #6
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,505
    Quote Originally Posted by kenneth_burnell
    ok well if you happen to get a chance to take a look into it that would be cool
    Not much chance of that I'm afraid, sorry.
    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!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
STAR TREK 2d20

Log in

Log in