Thread: Basic success counting extension
-
May 12th, 2016, 16:25 #1
Basic success counting extension
I checked in with DMFirmy (the creator of the drop lowest extension I mentioned above) and he was very happy for me to do a quick success reporting extension based off the framework he used in his extension. Thanks very much DMFirmy!
Attached is a very basic success reporting extension. This should work in all rulesets based on CoreRPG and uses a basic slashhandler to roll dice and report on the number of successes.
- Download the attached CountSuccesses.ext file and install in your <FG App Data>\extensions directory.
- Load up a CoreRPG based campaign and select the "Count Successes" extension.
- Once in your campaign you can use the success count extension through a slash command in the chat window - see usage below.
Usage
Use the /successes chat slashhandler as follows:
/successes XdY Z Where XdY is the dice string to roll, e.g. 5d10, 25d12, etc. and Z is the target success number (each dice equal to or above this number will be counted as a success).
Fantasy Grounds will count the number of successes and report these in the chat window as part of the roll result.
For example: /successes 10d10 7 will roll ten 10 sided dice and report the total number of dice that were 7 or more.
Example screenshot:
There's no further integration into any ruleset, this is just a quick extension to show what can be done - and to provide some use to people who want this basic functionality.
The /successes string can be dragged to a FG hotkey to allow quick rolling of frequently used rolls.
I'll expand on this/provide further documentation (probably in extension comments) at some point...
EDIT: Minor edit to extension to allow active identity (PC, GM ID, etc.) to be shown in the roll.Last edited by Trenloe; September 4th, 2016 at 18:40.
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!
-
May 12th, 2016, 16:26 #2
Reserved.
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!
-
June 13th, 2016, 08:42 #3
Hey Trenloe when you roll usin this extension it reports the Username and not the Character name as making the roll.
I had a look but I cant work out what to change
-
June 13th, 2016, 18:12 #4Private 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!
-
June 14th, 2016, 08:18 #5
Much obliged Trenloe that fixed both this one and DMFirmys Drop Lowest extension.
-
September 21st, 2016, 03:36 #6
Hi Trenloe is it possible (how would you go about) setting this up to report the Successes and not the Sum? It already reports the Success Count but I would like to know how you would report this number as a the draggable number.
-
September 21st, 2016, 03:41 #7
https://www.fantasygrounds.com/refdoc/Comm.xcp dicedisplay = 0 stops the total being displayed.
You'd then have to construct any drag data separately - and code in the value/s you want to be available in a drag action: https://www.fantasygrounds.com/refdoc/dragdata.xcpPrivate 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!
-
September 21st, 2016, 03:47 #8
Hi Trenloe - can you think of anywhere that I can see an example of setting your own dragdata?
-
September 21st, 2016, 04:03 #9
CoreRPG, campaign\record_char_main.xml - line 111, you need to put the info together in the onDragStart function. Do other searches for onDragStart for other examples. You'll need to get info out of the chat info when the drag starts, so you may need to use some coding in [] or something in the description to easily get to the info you want. Info on the onDragStart event here: https://www.fantasygrounds.com/refdo...cp#onDragStart There's a bunch of stuff already there (related to the comm data structure: https://www.fantasygrounds.com/refdoc/Comm.xcp) you'll probably want to do lots of Debug.console commands to see exactly what is available when you start the drag.
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!
-
September 21st, 2016, 04:33 #10
Depending on what you want to do (as I'm not sure what you're wanting to do), you might not even need the onDragStart code. Set the info in the chat message and then it will come across in the draginfo, and decode in the onDrop function on the control/window where you drop the drag: https://www.fantasygrounds.com/refdo...rol.xcp#onDrop
I do this for damage in the Star Wars ruleset. I send a line of [Damage: X] to the chat window, where X is the amount of damage done. This message is constructed using:
Code:local damagemsg = {}; damagemsg.font = "msgfont"; damagemsg.type = "wounds"; local sDamage = ""; sDamage = string.match(description, "%[DAMAGE:%s*(%w+)%]"); local totaldamage = tonumber(sDamage) + resultSummary.success damagemsg.text = "[Damage: " .. totaldamage .. "]"; deliverMessage(damagemsg);
Code:if draginfo.isType("wounds") then if draginfo.getDescription() then sDamage = string.match(draginfo.getDescription(), "%[Damage:%s*(%w+)%]"); end end
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