PDA

View Full Version : Question for Coders



Aaron
January 25th, 2016, 06:53
Hey dudes.

I'm wanting to find out from those who have successfully coded extensions for Fantasy Grounds (5e Ruleset), whether the following idea is firstly doable, and if they believe a novice coder (myself) could learn the relevant skills to be able to code such a thing? I've not delved into the extension side of things for Fantasy Grounds as yet, but I have been able to create modules using Par5e. If it's not possible I'd rather someone let me know, rather than spending time trying to, and ultimately failing.

The idea is to increase the damage of a strike by an amount equal to the amount that you beat a target's armour class. For example, my target has an AC of 14, I end up with a final hit roll of 18, so the damage is increased by 4 for that one strike.

I want to be able to automate this, so that FG handles the complications, so for the example above, it would create something like a 'On Next Roll' damage effect of +4, for that strike, similar to how FG seems to create an invisible 'On Next Roll' effect when you make a critical strike, applying it automatically.

So, if you have familiarity with extension coding for FG, and believe this is possible, please let me know, and if you could give me an idea of how advanced such a thing would be, that would be welcome as well. If it's possible then I'll begin delving into the exciting world of extension coding.

Thanks for your time.

damned
January 25th, 2016, 12:46
Im not positive but I think that is quite likely to be doable. It is probably not a great first extension to tackle for a non-programmer though...!

Moon Wizard
January 25th, 2016, 15:56
It would be fairly complex, plus it would need to be updated on most releases since it would be modifying core combat mechanics which are also updated regularly.

As damned mentioned, it's not a great first coding project for FG.

Regards,
JPG

dulux-oz
January 26th, 2016, 01:43
I have to concur with Moon and damned - its do-able, but it's be a very complex piece of code - akin to building an entire house when you're only got the skills for some odd handyman jobs.

But if you want to tackle it then go ahead - you'll get lots of help from the Community :)

Aaron
January 26th, 2016, 03:28
Thanks for the replies, and the honesty about the difficulty.

I think I'll try and learn about the coding side of things and see if another, easier project comes to mind while doing so.

Thanks again for the advice. It most likely saved me a lot of frustration.

dulux-oz
January 26th, 2016, 04:52
Why don't you take a look at damned's MoreCore Extension, or one of my Extensions (mind you, my Extensions are generally "layered" on top of the DOEBase Extension) to get an idea of what's going on - at the very least it'll teach you how to reverse-engineer a piece of code, and that's something worthwhile in knowing

Cheers

Aaron
January 26th, 2016, 09:52
That's a good idea Dulux, I'll have a look at those as well.

Thanks.

Aaron
March 17th, 2016, 06:11
Hello again,

I'm still on my original idea, and have made an extension which displays in chat the AC of the creature when you make a hit. A tiny change, but I was very happy to have figured that out. Now I'm on to the automation part of it but I am stuck trying to find the name of a variable.

13450

When you click and type a number into the quick modifier patch (the one directly below the chat window, see picture), what is the variable name that it sets? I've tried many different ones from looking at the code (such as rAction.modifier, etc), but cannot pin down the correct one. Or I've pinned down the correct variable but my code line isn't working to set it.

Any help is appreciated.

Thankyou, and have fun. :)

Trenloe
March 17th, 2016, 06:19
Have a look in CoreRPG - desktop\scripts\modifierstack.lua getSum() will return the total in the modifier stack. Call this as ModifierStack.getSum() in your code.

Aaron
March 17th, 2016, 06:31
Thankyou Trenloe,

I'll start fiddling with that and see how I go.