Refer a Friend
  1. #1

    Building module with tables for random item - can't link to SFRPG2 items - how to?

    Hello.

    Not sure it is the right thread. I got hit by inspiration and now I have created a few Tables with items for my SFRPG2 players to get. I did the first table by hand. Exported the campaign db.xml, use the template to create my own module. By following this path, the item that I add in the XML will not link back to actual SFRPG2 items, and my players end up having to replace my now placeholder items for the SFRPG2 actual item.

    This is quite inconvenient. Is there a way for XML populated tables to contain items that will not just be placeholders?

    This is the first time I build a module and was hoping to save time... Grrr

    I do have other projects, but this is my first one and I can't get the result I need.

    Any feedback is welcome.

  2. #2
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    22,644
    I'm not sure exactly what you've done here. You say you created a table and then exported it and then used that as a template? What does that mean? To create a module that players can use create your table inside a new campaign and then export it as a player module. Your players will then be able to open that module when they join your game. Note that whatever you link to that table must also be shared with your players - so if, for example, you link things from a module that isn't available to your players they won't be able to access that item.
    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
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    34,718
    Quote Originally Posted by mcharbon72 View Post
    By following this path, the item that I add in the XML will not link back to actual SFRPG2 items, and my players end up having to replace my now placeholder items for the SFRPG2 actual item.
    Please provide examples of the XML you've created - better yet, the whole .mod file you're using. It's extremely difficult to guess why it's not working for you without seeing the XML code.
    FG Wiki: How to Compile the FG Logs

    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!

  4. #4
    While trying to answer you and provide evidence, I stumbled upon my answer.
    My tables that I generated in a module were not containing "links" to actual SF2 objects from the Player Core.
    These links are provide in the <resultlink> block attached the the line item of the table.

    So for a medpatch - commercial, the link is "item.id-00058@PZOSMWPZO22001FG"

    Now I need to list of all SF2 objects from the Player Core (PZOSMWPZO22001FG) and their individual Item ID.
    Medpatch - commercial = item.id-00058

    Where can I find this?

    Here's the working table code. I want to add items, but I'm missing the "links" to SF2 Player Core. Can you guide me on where to get them?

    Code:
    <tables>
        <category name="LootBox Example Tables">
          <id-table_example_bronze>
            <name type="string">Bronze Loot</name>
            <resultscols type="number">1</resultscols>
            <labelcol1 type="string">Item</labelcol1>
            <output type="string">parcel</output>
            <tablerows>
    
              <id-00001>
                <fromrange type="number">1</fromrange>
                <torange type="number">100</torange>
                <results>
                  <id-00001>
                    <result type="string">Medpatch - commercial</result>
                    <resultlink type="windowreference">
                      <class>item</class>
                      <recordname>item.id-00058@PZOSMWPZO22001FG</recordname>
                    </resultlink>
                  </id-00001>
                </results>
              </id-00001>
    
            </tablerows>
          </id-table_example_bronze>
        </category>
      </tables>

  5. #5
    Hello,

    I did posted code examples and actual challenges I'm trying to find around. It told me the moderators would need to look at it before releasing my response.

    Can you provide me with an update? I would love to roll out my loot box system to my players this weekend

    Cheers!

  6. #6
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    34,718
    Sorry, I missed that a post required moderation, I've approved it. Probably the easiest way to get a database reference is to use the /debug on chat command to show the debug window in the top left of the FG desktop, then hover over the name of the item/s you're interested in.

    See the image below - 1) Hovering over the name in the item list; 2) The DB reference - it'll include the .name (as that's the DB field of the name control), just remove that to give the base item DB path - in this screenshot item.id-00082.name@PZOSMPZO22001FG -> item.id-00082@PZOSMPZO22001FG

    Attached Images Attached Images
    FG Wiki: How to Compile the FG Logs

    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!

  7. #7
    Thank you!

    Now I have a path forward.

    Is there a way to get the full list instead of building it manually? If not, I'll work around it

    Thanks again!

  8. #8
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    34,718
    Quote Originally Posted by mcharbon72 View Post
    Is there a way to get the full list instead of building it manually? If not, I'll work around it
    It's a manual process either way - use the debug process I previously mentioned, or drag all the items to a story entry and then look at the link data in the campaign db.xml file.
    FG Wiki: How to Compile the FG Logs

    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!

  9. #9
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    22,644
    Would it not be easier just to build the table inside of Fantasy Grounds and you can then just drag the links into the table? I could be missing something as to why you need to do it in code.
    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

  10. #10
    I’m creating 144 loot boxes with randomized objects.
    This is a lot of tables aligned with box theme and quality.

    And I created tons of custom items too.

    The table will generate the loot in a parcel that can be dragged into the players inventory.

    As each item is a reference, I need the actual item reference from SF2 to allow everything to work.

    Why code instead of manual built?
    I wrote myself a python script to generate my loot randomness and thematic tables.

    And I wanted to learn how to build FGU modules, which needed only a few tweaks to bring my python output to FGU Modules compliant XML.

    I did lots of reverse engineering on this and now all is working.

    I will be able to update and change my loot system, but will always have to provide manually the object reference into the code each time I add objects, or if the rule set DB updates, or when a new rule book with items comes out. I will have to live with that.

    Cheers and thanks for your help!

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
  •  
Fantasy Grounds Merchandise

Log in

Log in