PDA

View Full Version : Need Help With Custom Extension



Death Rodent
June 28th, 2020, 20:40
I'm currently working on an extension to implement a house rule I use in my 5e game. I'm a novice when it comes to coding extensions. I've read other posts and watched some videos. I've had success with creating new ability scores but I'm having no luck with this thing.

The house rule is a mana system. It works just like hitpoints but instead of being calculated with CON and HD it'll be calculated with the modifiers of CHA, INT, and WIS combined. Basically what I want to do is duplicate the code for hp, rename it, and adjust the visual locations so they all appear somewhere that isn't overlapping with other stuff. I'd like to make this work at least on PC character sheets but the goal is to have it work with everything.

Does anyone have any tips for how to do this?

Three of Swords
June 28th, 2020, 23:34
I have no clue how to get started on that. But I can tell you it's going to be a pretty advanced extension. Good luck!

damned
June 29th, 2020, 07:20
I'm currently working on an extension to implement a house rule I use in my 5e game. I'm a novice when it comes to coding extensions. I've read other posts and watched some videos. I've had success with creating new ability scores but I'm having no luck with this thing.

The house rule is a mana system. It works just like hitpoints but instead of being calculated with CON and HD it'll be calculated with the modifiers of CHA, INT, and WIS combined. Basically what I want to do is duplicate the code for hp, rename it, and adjust the visual locations so they all appear somewhere that isn't overlapping with other stuff. I'd like to make this work at least on PC character sheets but the goal is to have it work with everything.

Does anyone have any tips for how to do this?

Welcome Death Rodent

As far as what you have outlined so far - eg no automation other than calculating the Mana value - either of these should give you enough to go by:
https://www.youtube.com/watch?v=UPKJDwUt554
https://www.youtube.com/watch?v=x4leZBomtOc

You have broken down the main components already I think this is quite achievable.

Death Rodent
July 2nd, 2020, 14:45
Thank you very much!

I've made slow but steady progress. Currently, I have a usable version of the extension. It'll function for this week's game but it's not at the level of functionality I'd like it to be.

The character sheet is able to record values for mana but isn't able to automate its value. What I mean is that on increasing level the mana's max doesn't increase as HP's max would. I'm not sure if I fully understand the scripting. I've tried duplicating the code that calculates hit points and renaming it, but no luck. I may not understand how the .lua files work or there may be another part of the code that I'm missing. The console reads
Script Error: [string "mp"]:1: attempt to call field 'onManaChanged' (a nil value)
whenever I adjust the max value of man on the character sheet. "mp" and "onManaChanged" were originally "hp" and "onHealthChanged" before the rename. I don't really know where to begin to fix this.

I'm confident that I can add fields to the combat tracker, party sheet, and npcs but I want to try to get this script figured out first. I appreciate the tutorials and encouragement. Any more leads will be greatly appreciated.