PDA

View Full Version : Weapon Degradation/Maintenance Houserule (5e Ruleset)



SilverStud
December 29th, 2018, 21:07
Hello there!

I've recently begun using FG for my games (switched from Roll20), and I absolutely love the automation of most of the math. It's super nice to just have stuff be added or subtracted automatically.

In one of my games, I have a houserule that adds weapon degradation and maintenance to the game. Basically, weapons take damage on near-misses (atk 14 vs AC 15, for example) or critical misses (Nat1). Ironically, it's easier to track that damage without FG's automation, because I mostly just look at whether the chat says "hit" before moving on, you know?

So here's my question to all you experts: how would I go about making FG notify me in the chat about those "near-misses?"

Let's say Adventurer Bob attacks a Hobgoblin and "near-misses." Normally it reports like this:
Attack [17] -> [at Hobgoblin] [MISS]

How could I make it say something like this instead:
Attack [17] -> [at Hobgoblin] [NEAR MISS] [WEAPON IS NOTCHED]

Any help would be appreciated! Thanks!

Zacchaeus
December 29th, 2018, 22:05
Hi SilverStud welcome to FG.

As you gather there's nothing like that in FG so you would need to write an extension to do it, which would require you to learn lua and XML coding. I'm not unfortunately a programmer who could point you in the right direction as far as that goes.


Damned has done some tutorials (https://www.fantasygrounds.com/forums/showthread.php?43312-Basic-Extension-Coding-Tutorial-Session) if you want to have a look.

damned
December 30th, 2018, 00:04
Its perfectly doable but will require you diving under the hood...

SilverStud
December 30th, 2018, 00:08
Hmmm.... okay, well I don't know XML very well and I didn't know Lua existed until today. I tried watching some of your videos, damned, but I was lost almost instantly (because I don't even know the beginning of XML).

Do you think there's anyone I could pass some cash in exchange for this? Or any other extension work, for that matter?

damned
December 30th, 2018, 00:17
Hmmm.... okay, well I don't know XML very well and I didn't know Lua existed until today. I tried watching some of your videos, damned, but I was lost almost instantly (because I don't even know the beginning of XML).

Do you think there's anyone I could pass some cash in exchange for this? Or any other extension work, for that matter?

Im sure you probably could... but youd have to negotiate that with someone who was interested.
Most extensions are done because the author wanted something tweaked for their game.
This one is going to require someone to really dive in and look at and understand the code.
If you were paying someone their hourly rate I think it could get quite expensive...

I think I understand why you want the near miss to possibly damage the weapon - the near miss most likely hit their armour or weapon and so impact was involved.
Mathematically however its not really any different to doing the other end and just counting the 1s and 2s and that would be much easier on you as the GM.
At the start of the next few sessions announce to the players -
"If your attack roll is a 1 or 2 you must do the weapon damage roll.
Failure to do this will accelerate the likelihood of weapon damage..."
And then let them manage it for you :)

SilverStud
December 30th, 2018, 00:57
That's a decent idea. Also, you have no idea how satisfying it is that you understood the houserule immediately. Thanks for the advice!

LordEntrails
December 30th, 2018, 07:32
What about using the optional critical fumble tables? You can customize those pretty easily and therefore could make some of the entries result in weapon damage. What do you think of that idea? Out of the box it's only on a 1, but I would guess it wouldn't be any harder than the mod you are already talking about and might add more flavor for you. Just a thought :)

Claneidosyan
January 16th, 2019, 19:46
Hi!
I don't know if you're still looking for something like that, but if you just wanted a chat notification on near misses, I tried to do it.

Now when the result of one attack is the AC of the attacked creature -1, the chat shows [NEAR MISS] instead of [MISS].
Everything else is the same as before and there are no added functions to keep track of the weapon degradation.

I just changed the file "scripts/manager_action_attack.lua" in the section where the attack result is compared to the opponent's AC, adding a new case.
If you want to check the code, it's at row 403 of the lua script contained in the attached extension.

This is not compatible with other extensions which change the same file (unless there's a way to do rules layering with lua scripts :P)

Trenloe
January 16th, 2019, 20:01
This is not compatible with other extensions which change the same file (unless there's a way to do rules layering with lua scripts :P)
Yes, but only at the function level (i.e. you replace a full function, or call the original function from the new custom function, and code to correctly handle the new and old functionality - which can be much harder to do, sometimes not possible at all, and maintain) for global scripts like "scripts/manager_action_attack.lua".

As you changed the ActionAttack.onAttack function for this extension, you could override that function in the original script package with something like the following in a script package in the extension:


function onInit()
ActionAttack.onAttack = custom_onAttack;
end


function custom_onAttack(rSource, rTarget, rRoll)
-- The whole of the new onattack function code here.
...
...
end