FG Spreadshirt Swag
Page 1 of 2 12 Last
  1. #1

    New Critical Hit

    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
    Attached Files Attached Files

  2. #2
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    20,825
    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.
    If there is something that you would like to see in Fantasy Grounds that isn't currently part of the software or if there is something you think would improve a ruleset then add your idea here https://www.fantasygrounds.com/featu...rerequests.php

  3. #3

  4. #4
    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?

  5. #5
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,409
    Some info about how the base critical hit table works here: https://www.fantasygrounds.com/forum...l=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).
    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!

  6. #6
    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.

  7. #7
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,409
    Quote Originally Posted by Dport406 View Post
    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.

    Quote Originally Posted by Dport406 View Post
    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.

    Quote Originally Posted by Dport406 View Post
    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: https://www.fantasygrounds.com/wiki/index.php/Effects and in the specific RPG system user guide.
    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!

  8. #8
    Quote Originally Posted by Trenloe View Post
    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.

  9. #9
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,409
    Quote Originally Posted by Dport406 View Post
    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.
    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!

  10. #10
    Ok. Next question. And, I'm sure that this shows how beginner I am, what is the lua and how do I find it?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in