PDA

View Full Version : 5E - Better Sneak Attack



kentmccullough
April 8th, 2020, 01:36
This is now available on DMs Guild Here (https://www.dmsguild.com/product/312685?affiliate_id=1307708) Both this and ONTURN effects are bundled (https://www.dmsguild.com/product/312686?affiliate_id=1307708) as well.

This extension allows you to add an effect to the rogue that you can leave always that's "Sneak Attack"

When you hit it will automatically apply the sneak attack damage effect to you. If used in conjunction with my other mod 5E Turn Based Effects (https://www.fantasygrounds.com/forums/showthread.php?55617-5E-Turn-Based-Effects) you can add an effect "Sneak Attack; ONTURN;" and leave it always on the rogue to never worry about that kind of thing again.

If you have advantage on the attack it will apply the sneak attack damage modifier, if the thing you're targeting is on a map and there's a unit there that is not of the same type as it (friendly/faction/neutral/foe) it will apply the sneak attack damage modifier.

This is under “License: GNU GPLv3”
This means you can commercialize it or do anything else with it, as long as they give you credit for the parts of your work they use and they too release it under the same license.

Let me know if there's any feedback.

Version 1.1:
- Fixed issue with it not working properly with the ONTURN extension where it would disable the effect even if it didn't activate the damage effect.
- Fixed issue with classic version where distances are calculated differently.
Version 1.2:
- Added compatibility with the 5E Enhancer Extension (https://www.fantasygrounds.com/forums/showthread.php?51353-5E-Enhancer) (current version v0.8.0) if this breaks again with future releases of that extension let me know.
Version 1.3:
- Fixed a few bugs that could happen on crit/fumble if using the tables in your rules.
Version 1.4:
- Added in that the damage effect added will take the Sneak Attack's visibility (GM only or not) so it can be hidden from players.
Version 1.5:
- Changed some handling so that it should play nicely with other extensions regardless of their updates.
Version 1.6:
- Fixed bug that was allowing disadvantage to still gain sneak attack damage.
Version 1.7:
- Changed the sneak damage to expire on singles instead of on action (incase you roll the attack twice or something)
- Added in support for Rakish Audacity. It will check your character sheet's features list to see if there's one called rakish audacity, so no additional setup for the effect is required.
Version 1.8:
- Changed the sneak damage expiration from singles to action. This should handle expiring the sneak damage correctly now.
Version 1.9:
- Changed to using the OOB message so that it will work even if the player doesn't own the node.
Version 1.10:
- Properly use the OOB messages.
Version 1.11:
- Redid the distance calculations for units to make it more robust. Fixes some issues where it wasn't properly calculating.
Version 1.12:
- Cleaned up the code and fixed it so the distance calculations are used correctly between both allies nearby as well as rakish audacity checks.
Version 1.13:
- Added a vehicle type as a creature type and exclude it from granting sneak attack bonuses.

4wire
April 8th, 2020, 16:51
So the player has to remove the effect if the attack is not a sneak?

kentmccullough
April 8th, 2020, 18:29
If the attack is not a sneak it shouldn't apply the actual damage effect. It will check to make sure the conditions qualify to grant the additional damage. If it did apply the damage effect when it shouldn't please let me know and yes you would have to remove the damage effect then.

4wire
April 8th, 2020, 18:42
I'll definitely try it out!

4wire
April 8th, 2020, 20:05
Should this work? Am I testing this wrong?

33285

It's broken because of "5E enhancer" in FGU

kentmccullough
April 9th, 2020, 09:45
Yes that should work 4wire, but other extensions could break it, if you like I can look at making it work with the 5E enhancer, send me the link to where that extension is and I'll try and post an update. although I've noticed FGU seems to ignore extension's load order, so I can't promise anything. I'll definitely take a look and try to make it work. I'm on a mac so FGU is my primary focus for my extensions, and I'd like for things to play nicely so I'll try and make it happen.

4wire
April 9th, 2020, 14:11
This one here: https://www.fantasygrounds.com/forums/showthread.php?51353-5E-Enhancer

kentmccullough
April 9th, 2020, 17:35
Updated the extension, it should work the the 5E Enhancer extension now, although if this breaks for his future updates do let me know and I'll have to adjust again. Hopefully that helps for you 4wire.

4wire
April 9th, 2020, 18:33
Yup, that works! After doing some tests, I'm wondering: Should the dynamic effect not be hidden? Right now it sorts of give away the fact that the attack is a hit even if the roll result (miss/hit) is hidden.

What do you think? I think I would lean on making it hidden to the players.

kentmccullough
April 9th, 2020, 19:22
Updated so the damage effect will inherit the Sneak Attack effect's GM only visibility if turned on so that it can be hidden.

kentmccullough
April 9th, 2020, 21:05
Updated to Version 1.5 this change should make this extension work with other extensions regardless of their updates or what they're doing.

MasterJena
April 10th, 2020, 09:33
Nice one!

Disadvantage should cancel sneak attack even on a hit with ally @5feet tho.
The effect always adds 0d6 damage... Is something broken? d6 quantity is always half rogue lvl rounded up if it helps.

kentmccullough
April 10th, 2020, 16:36
Whoops on the disadvantage, had a small typo, bDis is not the same as bDIS. Not sure why the effect damage would be 0d6 unless you don't have rogue levels on the character sheet...

local numDie = math.ceil(rogueLevel/2); Getting 0d6 means that it's got 0 for the rogue level. Let me know if there's someway I can help you get it sorted out.

Updated to Version 1.6: Fixed the disadvantage bug.

MasterJena
April 10th, 2020, 20:53
Nice catch!

The whole 0d6 thing was a conflict with a translation ext. Sorry :(

Any chance you could think of an option to Swashbucklers? I might do it myself, your code has enlightened me :D

kentmccullough
April 10th, 2020, 22:22
For the Rakish Audacity to give you sneak attack if there's no one else near you other than the target.... I could build something in for that. It wont be today though, perhaps over the weekend, but more likely would be next week sometime.

Stv
April 10th, 2020, 22:49
Nice, Rakish Audacity was on my list to quiz you about. Nice job on the extension btw :)

Cheers, Steve.

kentmccullough
April 13th, 2020, 20:50
Updated to Version 1.7:
- Changed the sneak damage to expire on singles instead of on action (incase you roll the attack twice or something)
- Added in support for Rakish Audacity. It will check your character sheet's features list to see if there's one called rakish audacity, so no additional setup for the effect is required.

Let me know if you guys have other requests for this extension.

avitale34
April 14th, 2020, 06:50
I might be doing something wrong but I am in FGU and the effect seems to be working for the first attack but once it is applied it never comes off, it is applying damage on every attack regardless of if there is an ally next to them or if they advantage or not. Screen shot added for clarity. I have to go in and remove the second effect to make it stop and function properly again. 33659

kentmccullough
April 14th, 2020, 16:20
Whoops setting the rolls to singles was not what I needed to do there.... it's now set to roll and is fixed.

Version 1.8:
- Changed the sneak damage expiration from singles to action. This should handle expiring the sneak damage correctly now.

avitale34
April 15th, 2020, 00:13
Whoops setting the rolls to singles was not what I needed to do there.... it's now set to roll and is fixed.

Version 1.8:
- Changed the sneak damage expiration from singles to action. This should handle expiring the sneak damage correctly now.

It's working perfectly right now for the DM but for some reason it is not working right when the player rolls it always deactivates the effect, appreciate you taking the time to look at this.

kentmccullough
April 15th, 2020, 00:24
Deactivates the “Sneak Attack; ONTURN” effect without adding the sneak damage effect?

Screenshots are helpful. I’ll take a look and get it fixed if I can identify what’s going wrong.

avitale34
April 15th, 2020, 07:38
Made a quick Gif showing the problem.

https://media.giphy.com/media/Zb631cDiSJZmK4JW30/giphy.gif

33729

kentmccullough
April 15th, 2020, 07:52
Can you try without the 5E combat enhancer enabled, just curious if they're not playing nicely... It looks like it's working based on the chat box, but obviously the effect isn't being properly added so that's an issue to be sure. I'll try and take a closer look tomorrow morning, not sure what would be going wrong. If you could type "/console" into the chat and see if you're getting any error message there. Why it would work for the GM and not the player is baffling to me, but I'm sure there's something I'm just not understanding about some interaction.

avitale34
April 15th, 2020, 08:02
Thank you for your patience! Here is the console: 33730

kentmccullough
April 15th, 2020, 08:09
Thank you for that log, looks like it is indeed an issue with my extension and I'm looking into it now.

kentmccullough
April 15th, 2020, 08:36
Updated to Version 1.9:
- Changed to using the OOB message so that it will work even if the player doesn't own the node.

This should fix your issue @avitale34. If not please let me know. If it does work, also please let me know so I can be sure I did this correctly. Thanks :)

kentmccullough
April 15th, 2020, 09:00
Updated to Version 1.10:
- Properly use the OOB messages.

NOW this should fix your issue, I'll be updating the onturn effects extension as well with this update, as the sneak attack is now working, but the on turn is not properly deactivating.

The Turn Based Effects extension has been updated as well.

Let me know if this fixes the issue, I managed to test as a player also this time, so it should all be working correctly, but do please let me know if it's not.

Merecraft
April 15th, 2020, 14:58
Hi

I'm still having issues with this excellent extension. When a character with the Sneak Attack effect on hits, the following error arises:

Script Error: [string "scripts/manager_effect_tbe.lua"]:33: attempt to call field 'deactivateEffect' (a nil value)

I unloaded all my other extensions and reinstalled them one at a time. It happens when the 5E Combat Enhancer Classic (here (https://www.fantasygrounds.com/forums/showthread.php?47146-5e-Combat-Enhancer-(built-on-retired-GPL-Advanced-Kombat-extension))) is installed. It runs fine with the other extensions. I have double checked I have the latest versions of all the extensions.

Any help would be greatly appreciated!

kentmccullough
April 15th, 2020, 16:31
That would be an issue with the fact that the 5E Combat Enhancer Classic is overwriting the entire Effect Manager and didn't bother to include new functionality that was added to CoreRPG. I'd post it in the thread there and let that extension owner know.

Merecraft
April 15th, 2020, 16:37
Will do, and thanks!

avitale34
April 16th, 2020, 02:02
Working great now thank you!

solomani
April 16th, 2020, 07:24
Maybe its me but can I confirm this should work in FGU and with Enhancer? Assuming yes, apart from activating the plugin do I need to do anything more? As you can see the advantage for sneak attack is not triggering so sneak attack is not triggering:

33776

(testing as the DM so maybe that's the issue?)

4wire
April 16th, 2020, 15:54
Maybe its me but can I confirm this should work in FGU and with Enhancer? Assuming yes, apart from activating the plugin do I need to do anything more? As you can see the advantage for sneak attack is not triggering so sneak attack is not triggering:

33776

(testing as the DM so maybe that's the issue?)

You need to " add an effect to the rogue that you can leave always that's "Sneak Attack" "

kentmccullough
April 16th, 2020, 17:08
Exactly what 4wire said. add an "Sneak Attack" effect to the rogue (I recommend using my onturn extension as well and making that effect be "Sneak Attack; ONTURN")

Also I'm a mac user, so all of my extensions are tested primarily on Unity.

I also just tested with the 5E Enhancer v0.8.0 and can confirm that it works correctly with that extension on as well.

It does not seem to work with the Combat Enhancer on Classic however, at least unless that extension gets/got an update as it removes one of the functions from CoreRPG+ likely just due to not being updated when CoreRPG+ was to include the new functionality.

solomani
April 17th, 2020, 04:52
Yep, will use onTurn when I can get the basic version working. Here is the setup with Sneak Attack active, but not sneak attack damage:

33843

kentmccullough
April 17th, 2020, 05:01
Does Rex have levels in rogue? The damage is calculated based on the pc’s rogue level.

solomani
April 17th, 2020, 05:03
He does, though its a custom archetype:

33844

kentmccullough
April 17th, 2020, 05:12
Ah i see, it’s a custom subclass, however it’s reading as the actual class.

For instance assassin subclass still says rogue in the class. Try manually changing his class from ninja to rogue and see if that works.

solomani
April 17th, 2020, 05:37
Working perfectly, ditto with the Intern counter. Thank you for your help.

Any idea why FGU would be looking at his sub-class as his class? Its done that with all the customers archetypes Ive made I noticed.

kentmccullough
April 17th, 2020, 05:42
Not sure on that, I’ve always just dragged rogue in however, then selected the subclass at level 3 when it’s presented... could just be with how you’ve dragged the classes in.

solomani
April 17th, 2020, 07:39
Most likely what my PC did, thanks for your help.

Bonkon
April 17th, 2020, 20:24
Good Day kentmccullough :)
Great addition!! :) We have a rogue that is forever forgetting to hit his Sneak Attack button when it is applicable :)
I tried this in FGC and FGU with the 5E Enhancer version 0.9.0 and was wondering if it can work with elevations too? I had an ally 5 feet from the target but 20 feet up (Accessed by hovering over the token and Shift+Roll to change elevation) and it still registered as a Sneak Attack.

Thanks for the convenience of making both these extensions that work together so well!

Lo Zeno
April 18th, 2020, 18:44
Hi, I am very VERY new to FGU; I'm trying to figure out how the extension works? I've added it to my extensions folder in FGU (I'm the DM), I activated it when I loaded the campaign, but when our rogue has an attack with advantage it still doesn't apply the sneak attack damage. Do I have to do some other steps to activate it?

wjpennington
April 18th, 2020, 19:07
I keep getting "Script Error: [string "scripts/manager_effect_tbe.lua"]:33: attempt to call field 'deactivateEffect' (a nil value)" Any suggestions?

It still will roll the sneak attack damage though. In fact, it rolls the sneak attack with every hit during an action, not just once.

kentmccullough
April 18th, 2020, 19:56
@Bonkon not sure what the 5E Enhancer is doing for height and such I don't use it... This extension will give you sneak attack if the tokens are adjacent on the map, not sure how it would even calculate height.

@LoZeno, you need to add an effect to your rogue that is "Sneak Attack" or "Sneak Attack; ONTURN" if you're using my turn based effects extension as well.

@wjpennington That's an error with the classic combat extension. That extension removes the method from CoreRPG+ and needs to be updated to work with ONTURN effects.

wjpennington
April 18th, 2020, 20:18
So..not going to work. Ok, was a nice thought. Thanks for the information, appreciate it.

Lo Zeno
April 18th, 2020, 20:30
@LoZeno, you need to add an effect to your rogue that is "Sneak Attack" or "Sneak Attack; ONTURN" if you're using my turn based effects extension as well.

Ah I understand! It saves me from enabling the effect each time, it doesn't save me from adding an effect to the character sheet

For some reason I thought it would automatically recognise a Rogue classed character... my mistake. Still awesome though!

wjpennington
April 18th, 2020, 20:55
on a wierd note, downloaded the FGU combat enhancer for Classic. The Sneak attack emhancer works now works!

Tatershal
April 20th, 2020, 07:16
Hi, guys
can someone explain to me how this extension works? step by step?

Bonkon
April 20th, 2020, 18:30
Good Day and Welcome Tatershal :)
As shown in the first post, this extension works best in conjunction with the authors other extension:


This extension allows you to add an effect to the rogue that you can leave always that's "Sneak Attack"

When you hit it will automatically apply the sneak attack damage effect to you. If used in conjunction with my other mod 5E Turn Based Effects (https://www.fantasygrounds.com/forums/showthread.php?55617-5E-Turn-Based-Effects) you can add an effect "Sneak Attack; ONTURN;" and leave it always on the rogue to never worry about that kind of thing again.

If you have advantage on the attack it will apply the sneak attack damage modifier, if the thing you're targeting is on a map and there's a unit there that is not of the same type as it (friendly/faction/neutral/foe) it will apply the sneak attack damage modifier.



If you have not used extensions before here is the Wiki link: https://www.fantasygrounds.com/wiki/index.php/Data_Files_Overview#Extensions

Basically, download the extension, place in your FG extensions folder (Easily found by clicking the folder icon on the first splash screen when you open FG) then when you create or load a campaign you select these from the list given.
You need to be sure when you make the effect it is case sensitive so follow it exactly as shown in the post. Sneak Attack; ONTURN

4wire
April 20th, 2020, 19:28
Nevermind, I'm dumb.

Edit: To help anyone asking themselves the same question and not reading, like me, with the ONTURN extension, sneak is triggered only once per turn.

Tatershal
April 21st, 2020, 01:10
Good Day and Welcome Tatershal :)
As shown in the first post, this extension works best in conjunction with the authors other extension:



If you have not used extensions before here is the Wiki link: https://www.fantasygrounds.com/wiki/index.php/Data_Files_Overview#Extensions

Basically, download the extension, place in your FG extensions folder (Easily found by clicking the folder icon on the first splash screen when you open FG) then when you create or load a campaign you select these from the list given.
You need to be sure when you make the effect it is case sensitive so follow it exactly as shown in the post. Sneak Attack; ONTURN


I understood! Thanks.

Will it be a sneak attack whenever an enemy is five feet away? And when you have a condition that gives you the right advantage?
But when the character is simply hidden, then it has to roll manually, right?

kentmccullough
April 21st, 2020, 01:36
If the character is hidden they would roll the attack by hitting the adv button typically. If thatís the case it will apply the sneak damage also. If they donít have advantage on the attack from being hidden (or any other method) then it will check for a nearby ally.

Edit: Also if you encounter any situations where it should apply the damage and doesnít, or where it does but shouldnít let me know here and Iíll take a look and adjust if needed.

kentmccullough
April 21st, 2020, 22:08
Updated to Version 1.11 which fixes some issues with the distance calculation not working properly in all cases.

kentmccullough
April 29th, 2020, 17:55
Updated to Version 1.12 which cleaned up the code and fixed a potential issue with distance calculation for rakish audacity. All distance calculations are now done the same way.

kentmccullough
April 29th, 2020, 18:22
Version 1.13 - Added vehicle type as a creature type and excluded any creatures of that type from granting sneak attack bonuses for being nearby.

This has come up in our Descent into Avernus campaign so the hell riders and such do not grant sneak attack bonuses.

greglbg
May 24th, 2020, 21:25
When my players try to use this, they click advantage and roll the attack. I see the message go across that it detected a sneak attack should be applied, but then when the player rolls the damage it does not apply the sneak attack. However when I (as DM) do the exact same actions it applies the sneak attack. am I missing anything?

kentmccullough
May 24th, 2020, 21:55
That’s an old version. The updated version is now available On dmsguild.

greglbg
May 24th, 2020, 22:15
I just figured that out. I went ahead and bought the "updated" version...