DICE PACKS BUNDLE
  1. #1

    Can Library Objects be Renamed in an Extension?

    I'll start by saying I've only ever created simple FGC extensions for the Savage Worlds ruleset. I've been adapting the Adventure in Middle Earth setting for D&D5e, so that I can run a campaign for my kids. The challenge with that setting is that Races are called "Cultures" and Feats are called "Virtues". While I can make it work with the existing names of Races and Feats in the Library, it'd be much preferable if they were changed, as some of what I'm adding makes reference to them - i.e. Human cultures that have a feature named "Starting Virtue" which grants a free Cultural Virtue.

    I'm not sure how modifiable the D&D 5e ruleset is and have these questions...

    I see a 5E.PAK file in the \rulesets folder, is that the D&D 5e ruleset?
    If so, do I just extract its contents into it's own \rulesets\5E\ folder as I did for the SavageWorlds.PAK?
    Does anyone know which XML file controls the naming of the "Races" and "Feats" for the Library, and which controls those names on the Player Character sheet?
    Does any LUA code need to be changed to support this?
    Is there other locations in the ruleset where I'd need to change those names as well?

    Any answers to those questions would be much appreciated.
    Last edited by kronovan; May 19th, 2020 at 17:52.

  2. #2

    Join Date
    May 2016
    Location
    Jacksonville, FL
    Posts
    2,211
    Blog Entries
    7
    Yes, extract the 5E.pak into a folder.

    Sounds like all you need to do is write a very short extension that would replace a few strings. See the /strings/strings_5e.xml file. Search for whatever you need such as "race" or "feat" and see the string elements that are used in various places within the ruleset. Simply change those to the strings you need.

  3. #3
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    I'd recommend you do as Talyn mentions - just replace the strings.

    If you look to rename the underlying database nodes then you'll need to go through all of the ruleset to see where the previous named entries might be used. In theory, as top level object, this wouldn't be much - but you'd still need to do that. And then you'd have to work out how to do that in an extension - because you don't want to keep using a modified ruleset, otherwise you'll not get future updates.
    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
    Many thanks for the info. Yes I had hoped it would be as simple as changing a top-level string and my hopes are that I can create an extension that's loaded each time with the campaign.

    I find these 2 string assignments in the strings_5e.xml file:

    <string name="library_recordtype_label_feat">Feats</string>
    <string name="library_recordtype_label_race">Races</string>

    I also find these 2 strings and wonder if I should be concerned about them.

    <string name="library_recordtype_empty_feat">« New Feat »</string>
    <string name="library_recordtype_empty_race">« New Race »</string>

    For the SavageWorlds ruleset, I removed the defaults strings and assigned my own for the Arcane Backgrounds drop-down menu, which was something similar. For that I needed to unregister the defaults and then reassign my own via a function call. It wasn't hard to find the LUA script that contained the correct function and a forum member gave me the syntax for calling it.

    I'm having a hard time finding something equivalent for the 5e ruleset. I've browsed the data_library_5E.LUA script and I see this OnInit function:

    function onInit()
    LibraryData.setCustomFilterHandler("item_isidentif ied", getItemIsIdentified);
    for kDefSidebar,vDefSidebar in pairs(aDefaultSidebarState) do
    DesktopManager.setDefaultSidebarState(kDefSidebar, vDefSidebar);
    end
    for kRecordType,vRecordType in pairs(aRecordOverrides) do
    LibraryData.overrideRecordTypeInfo(kRecordType, vRecordType);
    end
    for kRecordType,vRecordListViews in pairs(aListViews) do
    for kListView, vListView in pairs(vRecordListViews) do
    LibraryData.setListView(kRecordType, kListView, vListView);
    end
    end
    LibraryData.setRecordTypeInfo("vehicle", nil);
    end
    But I don't know if anything there is of use to me? Otherwise I don't see any other LUA script in the main \Scripts folder that would involve the Library objects. I do see these entries in a lengthy chunk of code in data_library_5E.LUA which overides the CoreRPG records:

    ["feat"] = {
    bExport = true,
    aDataMap = { "feat", "reference.featdata" },
    aDisplayIcon = { "button_feats", "button_feats_down" },
    sRecordDisplayClass = "reference_feat",
    },
    and

    ["race"] = {
    bExport = true,
    aDataMap = { "race", "reference.racedata" },
    aDisplayIcon = { "button_races", "button_races_down" },
    sRecordDisplayClass = "reference_race",
    },
    Once again a fine puzzle to puzzle through. If anyone has any suggestions I'm keen to hear about them.

  5. #5

    Join Date
    May 2016
    Location
    Jacksonville, FL
    Posts
    2,211
    Blog Entries
    7
    That's why I suggested simply changing the string. Nothing more. That way "Race" will be "Culture" and whatever other purely textual alterations the Middle Earth thing changes, but your data won't break...

    I'm not seeing a need for any Lua whatsoever for this. Yes, adding/removing Arcane Backgrounds in Savage Worlds requires (for now) some Lua scripting but all you've mentioned in your original post was changing text.

  6. #6
    Quote Originally Posted by Talyn View Post
    That's why I suggested simply changing the string. Nothing more. That way "Race" will be "Culture" and whatever other purely textual alterations the Middle Earth thing changes, but your data won't break...

    I'm not seeing a need for any Lua whatsoever for this. Yes, adding/removing Arcane Backgrounds in Savage Worlds requires (for now) some Lua scripting but all you've mentioned in your original post was changing text.
    Yes, I seemed to have done a brain fart above and over-complicated something that's simple. I've now created a simple Extension.xml that has a single include statement for my custom replacement_strings.xml file. That custom XML file just contains the 4 library master index strings of:

    <string name="library_recordtype_label_feat">Virtues</string>
    <string name="library_recordtype_empty_feat">« New Virtue »</string>
    <string name="library_recordtype_label_race">Cultures</string>
    <string name="library_recordtype_empty_race">« New Culture »</string>

    It works perfect with both objects correctly renamed in the Library and a new object appearing as <<New Virtue>> and <<New Culture>>. The entries of course are still Feats and Races on the PC sheet, but I'm thinking I just need to find those string settings and also include them in my custom strings file.

    [Edit] OK so I added the strings from Character Main, Character Abilities and the Party Sheet and all appears to be working fine with correct labeling.
    Last edited by kronovan; May 20th, 2020 at 01:51.

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
  •  
STAR TREK 2d20

Log in

Log in