PDA

View Full Version : DMFirmy's Drop Lowest Extension



DMFirmy
November 26th, 2014, 22:31
Hello everyone,

I am very pleased to release the first version of DMFirmy's Drop Lowest Extension for Fantasy Grounds. This extension adds a new slash command that will allow you to roll a set of dice, drop a specified number of the lowest results, and then total the remaining results. It supports the CoreRPG, 3.5E, PFRPG, 4E, 5E, and Numenera rulesets out of the box.

You can download the latest version of this extension from the download release page on (Moderator: Link removed since it no longer works see GitHub link below)

The source code is also available on my GitHub Repository (https://github.com/DMFirmy/Drop-Lowest) page.

I hope that the community finds this extension useful, and I welcome all feedback, suggestions, or comments you may have.

Note: JohnD wanted support for the "Castles and Crusades" ruleset, which I have gone ahead and added. If any other rulesets are requested, please let me know and I will add them to the list.

damned
November 27th, 2014, 04:17
Works beautifully!

damned
November 27th, 2014, 04:18
Oh yeah... now for some exploding dice!

damned
November 27th, 2014, 22:24
Hi DMFirmy - I just tested with C&C and it works there also.

JohnD
November 28th, 2014, 00:57
Thank you very much!

DMFirmy
November 28th, 2014, 01:16
Thank you very much!

No problem... I had fun writing this extension, and I hope to see it put to good use.

Andraax
May 21st, 2015, 18:46
You can download the latest version of this extension from the download release page on DMFirmy.com (https://dmfirmy.com/downloads/dmfirmys-drop-lowest-extension-fantasy-grounds).

Your domain has expired.

DMFirmy
May 21st, 2015, 22:13
Yeah. I have to wait until after the end of the month to pay my bill. ��

Trenloe
May 22nd, 2015, 06:37
Yeah. I have to wait until after the end of the month to pay my bill. ��
Could you attach the latest extension in post #1 of this thread?

DMFirmy
May 22nd, 2015, 15:23
I will make a point to do so this evening.

kylania
July 23rd, 2015, 01:44
Here's the extension from his GitHub updated for version 3.0.

10595

Works lovely!

https://i.imgur.com/aqkU4NN.jpg

inawkwardscience
August 21st, 2015, 04:24
Do you just install and load this extension normally and roll 4d6 and it works automatically?

damned
August 21st, 2015, 04:28
Do you just install and load this extension normally and roll 4d6 and it works automatically?

https://dmfirmy.com/downloads/dmfirmys-drop-lowest-extension-for-fantasy-grounds

inawkwardscience
August 21st, 2015, 05:46
Thank you for your quick response!

Mateles
November 11th, 2015, 01:12
Thanks DMFirmy!

Can anyone comment on making this act as a damage roll? I'm modifying it to work for the 5E Savage Attacker feat (basically advantage on damage on 1 melee attack per round).

11765

Right now it looks like this (above), but I'd like to have it auto-damage the targeted opponent. Do I need to modify manager_action_damage.lua? Or maybe copy code from onDamage / notifyApplyDamage in that script? I've tested adding some of that but still can't get it to apply to the target unless I drag & drop. I only started looking at .ext code a few days ago.

The script flow / functions are still the same as DropLowest.ext, and I can post the code if anyone needs to see it. I figured I'd just wait until it was done to share the finished product.

Also, if anyone knows how to make it do 2 rolls that might make it look nicer and more 'real'. For now it's just doubling the # of dice, not sorting, and separating them into 2 roll sets.

Thanks

Koreapsu
October 25th, 2016, 01:57
Is this a known bug?

I had two players roll up and they rolled exactly the same stats, and even the same dice. They then rolled another test roll and both got the same version of 18.

15847

damned
October 25th, 2016, 02:31
Is this a known bug?

I had two players roll up and they rolled exactly the same stats, and even the same dice. They then rolled another test roll and both got the same version of 18.



That is awesome and bizarre and... annoying?
I just did a quick test with 2 clients connected and could not replicate.
Id love to see if you can replicate this... the odds on the dice landing that way completely randomly are.... highly improbable...

Trenloe
October 25th, 2016, 02:48
...the odds on the dice landing that way completely randomly are.... highly improbable...
https://www.goodreads.com/quotes/95458-scientists-have-calculated-that-the-chances-of-something-so-patently

JohnD
October 25th, 2016, 04:06
Is this a known bug?

I had two players roll up and they rolled exactly the same stats, and even the same dice. They then rolled another test roll and both got the same version of 18.

15847

Go buy a lottery ticket.

Koreapsu
October 25th, 2016, 06:51
That is awesome and bizarre and... annoying?
I just did a quick test with 2 clients connected and could not replicate.
Id love to see if you can replicate this... the odds on the dice landing that way completely randomly are.... highly improbable...

Yeah at first we all just thought "oh look at that the same stats"

Wait - same order.

Wait - same dropped dice

Let's roll some more, oh same results. This is a bit odd.

Needless to say Casey took Dan's rolls since they were pretty good and tecnically he rolled them too :)

Kaineswiftblade
February 7th, 2018, 02:19
Is there a current version of your extension that works with the newest update of Fantasy Grounds?

damned
February 7th, 2018, 03:12
Welcome Kaineswiftblade

DMFirmy hasnt been about for a while. Its a pretty straight forward extension - have you tried it in 3.3.4?

JohnD
February 7th, 2018, 03:14
It worked fine with 3.3.4 when it was in the Test channel.

Overlookedfile
February 9th, 2018, 18:58
I'm not seeing an obvious command option when I bring up the command list in the chat window. What's the chat command to make this extension work?

Andraax
February 9th, 2018, 19:09
Look in your chat window when starting:

https://s3.silent-tower.org/images/rolld.JPG

dulux-oz
February 10th, 2018, 01:15
For the record, and slightly off-topic (sort of), and a Shameless Self-Plug(TM) - the new DORCore Ruleset (https://www.fantasygrounds.com/forums/showthread.php?42221-DORCore-An-Advanced-Beta-Release-Of-A-New-Ruleset&p=375477#post375477) has this dice functionality (and many others) built in. It may be worth people's time to check it out for their future campaigns.

Cheers

Texorcist50
May 25th, 2018, 01:43
"This extension adds a new slash command" what is the command plz?

Andraax
May 25th, 2018, 01:49
"This extension adds a new slash command" what is the command plz?

See here. (https://www.fantasygrounds.com/forums/showthread.php?22637-DMFirmy-s-Drop-Lowest-Extension&p=375538&viewfull=1#post375538)

Sigurd
November 29th, 2018, 00:05
Thanks to DMFirmy wherever you are now.
People seem to be needlessly obtuse about this script.


If you are looking and confused here are some answers.


The script is from May 11, 2015 but seems to work (ultimate 3.3.6). You may be better off to simply subtract the lowest number from the total in your head. Still, if it makes things clear for people...




The extension is still available from the Github link and that is where you should get it:


https://github.com/DMFirmy/Drop-Lowest


Choose "Clone or Download" and then "Download zip"


Expand the download file "Drop-Lowest-master.zip" on your computer and enter the created directory. It should have two files and a 'scripts' subdirectory. Take a moment to read the lua code in 'scripts'. The instructions are in the code. Don't change anything.


Rezip just the two files and the subdirectory into "Drop_lowest.zip". Use zip with standard settings. change the extension of the resultant file to '.ext'.
Start Fantasy Grounds. Click the link for your data folder and place 'Drop_lowest.ext' in your extensions sub directory.


Here are the user instructions from the LUA Script (drop_lowest.lua) ...




"The \"/rolld\" command is used to roll a set of dice, removing a number of the lowest results.\n"
"You can specify the number of dice to roll, the type of dice, and the number of results to be dropped "
"by supplying the \"/rolld\" command with parameters in the format of \"#d# #\", where the first # is the "
"number of dice to be rolled, the second number is the number of dice sides, and the number following the "
"space being the number of results to be dropped.\n"
"If no parameters are supplied, the default parameters of \"4d6 1\" are used."


So, at the command line "/rolld" gives you your standard character creation drop lowest d6 roll. '/rolld 27d12 5' rolls 27 d12s and drops the lowest 5. It only works for standard dice that FG has graphics for.


Advice - do yourself a favour and try to understand the LUA code, at least read the comments between quotes like above... Even if a programmer doesn't make time for documentation, their code has to work to be useful so it does something!

Andraax
November 29th, 2018, 01:54
You may be better off to simply subtract the lowest number from the total in your head. Still, if it makes things clear for people...

The reason this is nice and more useful than subtracting the lowest amount in your head is that you can drag and drop the result...

deer_buster
December 21st, 2018, 07:52
Or, in the manage characters screen, you can use the Roll tab of the chat window to set it up to drop lowest when you roll 4d6

Gozer the Gozerian
April 21st, 2019, 14:20
It seems the author is no longer around, but it would be nice to have this functionality in the 2e ruleset, since 4d6 dropping the lowest die in order is the first method of character generation given in the 1e DMG. Is it possible to get this to work with the 2e ruleset?

Zacchaeus
April 21st, 2019, 14:57
It seems the author is no longer around, but it would be nice to have this functionality in the 2e ruleset, since 4d6 dropping the lowest die in order is the first method of character generation given in the 1e DMG. Is it possible to get this to work with the 2e ruleset?

It already works with the 2e ruleset. Download the extension and open the extension.xml file in notepad or whatever and add the following to the list.


<ruleset>
<name>2E</name>
</ruleset>

Save your changes and activate the extension in the ruleset and it will work

kerrigaj
May 29th, 2020, 13:37
Hi all. Has anyone been able to use the code from the extension to create an action to roll multiple dice for damage and keep the highest? Eg /rolld 2d6 1 correctly rolls 2d6 and drops the lowest, but I have been unable to code this as an action. I suspect it is not possible, but would be very happy to be proven wrong!

Mephisto
September 29th, 2020, 20:21
Hi kerrigaj,
quick and dirty:

Register the script in base.xml with a name of your choosing:


<script file="scripts/droplowest.lua" name="ActionRolls"/>


Then you can call it in a script and basically hand over the same string which you would get from typing it in the chat:


function onDoubleClick(x, y)
local nDiceTest = getDatabaseNode().getValue();
local sParams = "/rolld " .. nDiceTest .. "d6 1";
ActionRolls.processRoll(sParams);
return true;
end

DragonKnightAdam
October 10th, 2020, 11:38
just chiming in, still works even in FG unity

MCFBrandao
March 16th, 2021, 01:59
Anyone kept this extension updated?
my version is from 2017...

damned
March 16th, 2021, 02:16
It should still work.
Also its not required under Unity.

MCFBrandao
March 16th, 2021, 02:24
Also its not required under Unity.

could you give more information about this?

damned
March 16th, 2021, 02:26
Off the top of my head i think under Unity you can just do

/die 4d6k3

and it will work
apologies if I got the syntax wrong...

spoonhead
December 16th, 2021, 13:02
This extension appears to be broken under the latest update.

[12/16/2021 3:56:58 PM] MEASURE: LOAD - PART 1 - 33981.53
[12/16/2021 3:56:58 PM] [ERROR] Script execution error: [string "scripts/drop_lowest.lua"]:12: attempt to call field 'registerLaunchMessage' (a nil value)

damned
December 16th, 2021, 13:03
FGU supports drop lowest out of the box.

spoonhead
December 16th, 2021, 13:05
Yep. Just found out when I searched for this thread.