PDA

View Full Version : Table Rolling Extension



SpudmanWP
January 14th, 2011, 02:37
I have created a table rolling extension. Right now it is written for Grups (Crit Hits, Misses, etc), but can be easily adapted for other gaming systems. In this first version it uses a simple random number generator and I will adapt it to throw dice as I learn the systems involved.

The help menu can be accessed by the using "/t", "/t ?", or "/t help". In the Gurps version, using "/t CH" will roll on the Critical Hit table, "/t CF" will roll on the "Critical Failure table", etc.

For Gurps, this version (1.0) includes the following tables:
Critical Hits
Critical Miss
Unarmed Critical Miss
Critical Head Blow
Human & Humanoid Hit Location
Firearms Malfunctions
Fright Check Failure
Critical Spell Failure

The only caveat is that is that the modifier stack is ignored (and I need it for the Gurps Fright Check Failure table). Like I said, there are a few things I still need to learn.

Future editions:
--Roll actual dice (Semi-DONE in v1.2)
--Include the Modifier Stack (DONE in v1.2)
--Silent rolls for the GM (DONE in v1.2)

Here is the Help Menu:

https://i619.photobucket.com/albums/tt271/SpudmanWP/FG2/96475764.jpg

Here are samples from each category:

https://i619.photobucket.com/albums/tt271/SpudmanWP/FG2/293f2265.jpg

--Updated to version 1.1 (2011-01-14)
Added the modifier changes and spelling fixes.

--Updated to version 1.1.1 (2011-01-15)
Fixed the issue with the addMessage/deliverMessage switch.

--Updated to version 1.2 (2011-01-17)
Added the dieList & diemodifier methods to integrate the mod stack and show real dice.

https://i619.photobucket.com/albums/tt271/SpudmanWP/FG2/f7ffde5f.jpg

--Updated to version 2.0 (as Universal Tables) 2011-01-18
I have changed the ext to support any number & type of dice therby making it uiversal. It now has a new post to support this change.

https://www.fantasygrounds.com/forums/showthread.php?p=102749

I will leave this older file here in case anyone wants it. All my support and development will be with the Universal version. The Universal version will still be Gurps by default so you can get the new ones there.

Bidmaron
January 14th, 2011, 04:14
Spud, check out the table extension for 4e. It does something similar and may have the features you're looking for. You can get it from Dr. Zeuss' site (just look at the 4e game forum and you can't miss it).

SpudmanWP
January 14th, 2011, 05:47
Thanks, I will

SpudmanWP
January 14th, 2011, 08:47
I made a few more changes.

1. I corrected some spelling and Table Name issues (changing "Critical Fail" to Critical Miss", etc to match the GM's screen).

2. Changed the instructions to flow easier. Instead of saying "Shows the X table results", it says "Rolls on the X table".

3. Added a rudimentary mod parsing engine for use in the Fright Check Failure table.

...Now you can type "/t FCF 5" where 5 is what you missed the original fright check by.
...Any 2 digit number (up to 50) can be used. It only looks at the last 2 characters typed, so "/t FCF mary had a little lamb 12" would work :)
...If you try and use a mod for any other table, nothing will happen.
...Negative numbers will not work.

Like I said, rudimentary ;)

The file in the first thread has been updated to version 1.1

SpudmanWP
January 16th, 2011, 00:18
I found an issue. The rolls were only showing up on the person who rolled it, instead of the whole group.

I had used 'addMessage' which only delivers the message to the one user. I swapped it for 'deliverMessage' which sends the message to the whole group.

Attached file in the first message updated with the latest version (v1.1.1)

SpudmanWP
January 17th, 2011, 08:35
I've got the throwDice part covered, but am having problems with intercepting the onDiceLanded event.

HOW!

I have read many places where people have been told to capture this event. I even created a simple test:


function onDiceLanded( draginfo )
print("Got it")
if ChatManager then
ChatManager.addMessage({font = "systemfont", text = "onDiceLanded"});
end
return false;
end

Nada, kaput, zilch, zero... no error and no test message.

How do I get this function to catch the event?

Bidmaron
January 17th, 2011, 12:49
I think this is a handler. What you have to do is in the code where you set up the roll, you have to register your handler, like:
onDiceLanded=myDiceLandedEventHandler;

and then you would change the function name to:
function myDiceLandedEventHandler(draginfo)

drahkar
January 17th, 2011, 15:11
Actually this isn't a handler. The problem he was experiencing was that this event is only called within the chatwindow object.

https://www.fantasygrounds.com/refdoc/chatwindow.xcp#onDiceLanded

Bidmaron
January 17th, 2011, 16:21
Thanks, drahkar, I stand corrected.

SpudmanWP
January 17th, 2011, 20:37
I give up... ;)

I decided that a onDiceLanded approach would be too much of a problem for very little benefit.

I decided on using the dieList & diemodifier functions of deliverMessage to at least show real dice and to integrate the modifier stack.

Here is a screenshot showing the instructions, a GM roll (but anyone can use it) and the results of the GM dragging the results to a player (through his icon).

https://i619.photobucket.com/albums/tt271/SpudmanWP/FG2/f7ffde5f.jpg

This updated file is in the first thread.

SpudmanWP
January 19th, 2011, 01:34
Converted to a Universal format with any number & type of dice (including custom dice).

New name and format here:
https://www.fantasygrounds.com/forums/showthread.php?p=102749