STAR TREK 2d20
  1. #1

    PFRPG - Calculating Character Wealth Extension Idea/Help

    Hi All,

    First time trying to write an extension for FG. Haven't programmed in LUA before, but I do have programming experience in multiple programming/scripting languages.

    As a GM for Pathfinder, I fairly regularly need to check each character's wealth in gold pieces to make sure they are at the appropriate Wealth by Level. https://www.d20pfsrd.com/Gamemasteri...ealth-by-Level

    Currently, I have to create an Excel Spreadsheet and manually calculate the total gold value of all items for each character. It takes a while and is annoying.

    I was thinking about creating an extension for the PFRPG ruleset to do this.

    What I would like to do:
    • Have a command that the user can enter. Such as "/characterwealth [character name]"
    • This would then search for the character name. If it does not find the character name, it will print a "Character [character name] not found" message to the chat window.
    • If it does find the character, it will start at the first item in the character's inventory. There will be a running summation of the character's wealth in gold pieces.
    • For each item in the inventory, it will obtain the item cost. The item cost can be in terms of copper pieces (cp), silver pieces (sp), gold pieces (gp), or platinum pieces (pp). The cost type that it searches for can be of any capitalization combination, i.e. (gp, Gp, gP, or GP). I know you can change the currencies, but for now, it will only be for the standard currencies for Pathfinder.
    • Item costs will be converted as follows: 1 cp = 0.01 gp; 1 sp = 0.1 gp; 1 gp = 1 gp; 1 pp = 10 gp; If there is no cost type (cp, sp, gp, or pp) associated with the number, then it is assumed to be "gp".
    • If there is an item that has an unknown cost type, it will add it to a list, which will be outputted to the chat at the end, once all items have been iterated through. (This can help notify the user of what items have not been calculated into the total character wealth)
    • Once the cost has been calculated in terms of gold pieces, it will get added to the running total.
    • Once all items have been iterated through, the final total will be outputted to the chat.


    My questions:
    • How feasible will this be? If it is feasible, then I have the following questions:
    • What are some potential issues that may be encountered? (compatibility with other extensions and future updates?)
    • What would I have to do the create a new command for the chat?
    • What resources would I have to access to get a character name, items in a character's inventory, and the cost field of an item?
    • How do I output a value to the chat?


    Future Improvements:
    • Keep a running total for each type (and maybe subtype) of item, such as weapons, armor, wondrous items, etc. Then output to the chat, along with the total wealth, the total gold value of all items in the character's inventory with that type. This can be outputted as a decimal number and as a percentage of the total character wealth.
    • Compare the character's expected wealth at their current level, to their current level and print to chat how much ahead or behind they are.
    • Add a UI element for this.


    Thank you in advance!

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    It's not exactly what you're looking for. But you may want to look at the PF2 ruleset, which has a section of the inventory that displays the total value of equipment in the inventory.



    The PF2 ruleset is based on the PF1 ruleset, so you should be able to port that over pretty easily if it's something you're interested in looking into.
    Attached Images Attached Images
    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!

  3. #3
    @Trenloe
    Thanks for the reply. I've downloaded the PFRPG2 ruleset and I'm looking at the code how the character wealth is calculated.
    If I have any questions, I'll be sure to post again!

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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