PDA

View Full Version : New Critical Hit



Dport406
March 26th, 2018, 15:13
I have an idea to incorporate a crit table I found on sterlingvermin.com. As I am someone who is not familiar with coding/scripting; I figured that speaking with someone who is, would be a good start. I understand that the project I want to undertake is extensive and will take a long time but it's interesting enough for me that I opted to enroll into college for computer programing to help me. I would like to get a jump on this though and was wondering if you would be able to point me in the right direction? Namely, where do I start? I'll attach a hyperlink so you can see what it is that I want to create in FG.

I don't know if this is able to be done as a module or an extension. I have already created the tables (I've added, I think...) in FG although, there are no automations to apply effects or damage. Any ideas?

Dport

Zacchaeus
March 26th, 2018, 18:56
Firstly you'd need to mention for what ruleset.

There already exists (for 5e; I don't know if it works in other rulesets) a module called Default Fumble and Critical hit Tables. You could amend those tables to include whatever you want to do I think.

damned
March 27th, 2018, 00:08
I believe you name the module the same, turn it on in options, and load your module instead of the default one.

Dport406
March 27th, 2018, 03:29
I'm sorry, this would be for 5e. I understand that there is already a table built in. However, the tables I have listed are broken down by damage type. e.g. bludgeoning, fire, acid, etc. Would the tables automatically adjust by the type? Or, would I have to select the table and roll?

Trenloe
March 28th, 2018, 20:00
Some info about how the base critical hit table works here: https://www.fantasygrounds.com/forums/showthread.php?43049-A-question-about-tables&p=382689&viewfull=1#post382689

In 5E the ruleset sets which table to roll at the end of the onAttack function in scripts\manager_action_attack.lua At this point the damage type is not easily available - as this is all worked out in a different action - the damage action in manager_action_damage.lua. Damage type has nothing to do with the attack action. So potentially complex code would have to be added to the attack action code that gets the damage type from the weapon DB record - or maybe move the critical table rolling code to the damage action code (there's a handle critical section in the modDamage function).

Dport406
March 29th, 2018, 14:36
Uuuuhhhhhh..... I know nearly nothing about scripting.. Lol. However, if I understand you correctly, you're saying that when FG rolls attack, it doesn't care about the damage type. So, when (using the core crit tables) it just thinks, "crit hit, roll on crit table". And, to change that would be to fundamentally change the scripting. Right?

Is there a way to insert a sliver of code to 'pull' or look up the damage type prior to getting to the crit table? Would that be easier than moving the crit table look up?

Also, with these tables, they can apply conditions to characters. Would that be something that can be auto applied? What about conditions that are not pre-built, how do I make those?

I'm sorry for all the questions, I am a lot a bit behind in the scripting world and I'm trying to catch up.

Trenloe
March 29th, 2018, 18:18
Is there a way to insert a sliver of code to 'pull' or look up the damage type prior to getting to the crit table? Would that be easier than moving the crit table look up?
This would be more difficult than moving the code to the damage handler. The downside of the critical code in the damage handler is that you actually have to roll damage to see the critical effect.


Also, with these tables, they can apply conditions to characters. Would that be something that can be auto applied?
These can't be applied automatically from a table. You could link effects in the table and then these could be manually applied.


What about conditions that are not pre-built, how do I make those?
Create them manually, then export them with your crit table module. Info on creating effects here: http://www.fantasygrounds.com/wiki/index.php/Effects and in the specific RPG system user guide.

Dport406
March 30th, 2018, 01:32
This would be more difficult than moving the code to the damage handler. The downside of the critical code in the damage handler is that you actually have to roll damage to see the critical effect.

Don't you have to roll damage after a crit already? I'm not sure how the organic crit tables work. Our group hasn't been using them.

Trenloe
March 30th, 2018, 12:00
Don't you have to roll damage after a crit already?
Yes, attack-damage is always a two step action.

Currently the critical text is displayed as part of the attack - it gives flavor etc. to the attack, even before you roll damage.

Dport406
April 4th, 2018, 00:38
Ok. Next question. And, I'm sure that this shows how beginner I am, what is the lua and how do I find it?

Trenloe
April 4th, 2018, 00:43
Lots of info about modifying a ruleset here: https://www.fantasygrounds.com/forums/showthread.php?19033-Modifying-the-3-5e-PFRPG-ruleset This refers to 3.5E, but it is equally relevant to 5E.

Item #5 in the bullet list has a link to the section on LUA.