PDA

View Full Version : Skill Check: Special Effects on Critical Success/Failure



jkeller
May 28th, 2023, 17:58
Is there any way to automatically do something when a PC rolls a skill check and gets a 1 or a 20? Or an extension that does this?

I'm thinking of something along the lines of the Crit/Fumble tables, but for skill checks instead of attacks.

Thanks!

Zacchaeus
May 28th, 2023, 18:40
You would need an extension; but I don't know of one. It would all depend on what you want to happen when the 1 or 20 gets rolled.

jkeller
May 28th, 2023, 18:52
Nothing fancy. Just roll on a table and show the result in the chat window. The trick would be to use a different table for each different skill.

This might be something I could develop (I'm a programmer), but I'm not even sure where to begin. Any suggestions would be most welcome!

LordEntrails
May 28th, 2023, 18:54
Theogeek has an extension that does special criticals on a natural 20 for attacks, but not for other skills checks. So it's possible, but like Mr Z, I'm not aware of any extensions that do what you are wanting.
Fantasy Grounds Forge (https://forge.fantasygrounds.com/shop/items/161/view)

Trenloe
May 28th, 2023, 21:55
Nothing fancy. Just roll on a table and show the result in the chat window. The trick would be to use a different table for each different skill.

This might be something I could develop (I'm a programmer), but I'm not even sure where to begin. Any suggestions would be most welcome!
There's an example of this in the 5E ruleset scripts\manager_action_attack.lua file - the onPostAttackResolve function that calls ActionAttack.notifyApplyHRFC with the name of the table to roll - for example: ActionAttack.notifyApplyHRFC("Critical Hit"); would roll on a table called "Critical Hit".

You could do something similar for skill checks - in the scripts\manager_action_skill.lua file - the onRoll function determines the success level, and you could override this function in an extension and determine if a table has to be rolled and which table to roll.

The Fg developer guide can be found in the Wiki, which will help to get you started: https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996644285/Developer+Guide

Trenloe
May 28th, 2023, 22:46
Try the attached extension as an example (5E Skill Crit Table) - the code is in the my_manager_action_skill.lua file - in the "-- Custom code" section.

This will check for a 20 or a 1 and then roll on a table called either "Critical Skill - XXXX" table or "Fumble Skill - XXXX", where XXXX is the skill name parsed from the [SKILL] XXXX chat data.

This means you'll need different tables for each skill. Change the code to whatever you'd like!

EDIT: I've updated the extension - made it more future proof (i.e. using less code from the 5E ruleset) and made it handle skill names with spaces properly.

jkeller
May 29th, 2023, 00:36
Thank you so much! I will give it a try :)

Trenloe
May 29th, 2023, 09:22
I've edited the extension - updated in post #6 above.

jkeller
May 29th, 2023, 17:18
> ActionSkill.onRoll

Thanks Trenloe. I'm glad to see there's a way to invoke the default implementation, without having to copy the code.

jkeller
May 29th, 2023, 17:56
I've got it installed (locally) now. So far so good!

jkeller
May 29th, 2023, 19:18
It's working great so far!

If I want to include tables, can that be done as part of the extension? Or would it need to be a module or rule-set or something?

My next steps:

1) Data entry of all the tables. I'm trying to contact the author (I backed the Kickstarter - Critical Codex), but I hope he'll consider making them available via Forge, or at least to his other backers.

2) Attribute/Tool checks. For example, Lockpicking. This isn't a 5E skill, so it would be a DEX check (using Thieves' Tools). I assume I can override the attribute check, but I'm not sure yet how I would do so just for lockpicking. Perhaps adding an Action to the character? Or maybe the extension would only apply the custom code if some condition was met (e.g. Alt-roll, or whatever). That would probably be fairly easy to implement, but not very intuitive.

3) Saving Throws.

4) Combat (Attacks and Spells). I assume I could do this based on Trenloe's Nat20 extension. Ideally, though, it would use different tables for different weapon/damage types (at least for bludgeoning/piercing/slashing).

Trenloe
May 29th, 2023, 22:46
It's working great so far!

If I want to include tables, can that be done as part of the extension? Or would it need to be a module or rule-set or something?
Glad it’s working well so far.

As tables are data they can only be packaged outside a campaign, for use in other campaigns, in the form of a module.

jkeller
May 31st, 2023, 18:57
Can anyone point me to where I can find documentation about packages like ActionSkill?

I've looked in: the wiki (https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996644285/Developer+Guide)
And in this : reference document (https://www.fantasygrounds.com/refdoc/)

But I don't see it. Thanks!

Moon Wizard
May 31st, 2023, 19:56
The documentation is only for the core client APIs and packages. Any CoreRPG or ruleset-specific packages are not documented; and should be reviewed directly.

Regards,
JPG

jkeller
May 31st, 2023, 20:16
Would that be somewhere in C:\Users\XXX\AppData\Roaming\SmiteWorks\Fantasy Grounds?

I unzipped rulesets/5E.pak and CoreRPG.pak and found some things, but not ActionSkill or ActionsManager, etc.

Thanks again!

Moon Wizard
May 31st, 2023, 20:47
ActionsManager is part of CoreRPG; and ActionSkill is part of 5E. They are denoted in the base.xml for each ruleset.

<script name="ActionsManager" file="scripts/manager_actions.lua" />

<script name="ActionSkill" file="scripts/manager_action_skill.lua" />

Make sure that you get a text editor with a good multi-file search; so you can search over all of the code for definitions. (i.e. Sublime Text, Notepad++, VS Code, etc.)

Regards,
JPG

jkeller
May 31st, 2023, 23:43
Ah, I see - thank you!