DICE PACKS BUNDLE
Page 1 of 3 123 Last
  1. #1

    sOs SIDEBAR category how to add a ext to a custum sidebar category?! ext issue

    I noticed that I can load only three ext under the campaign category! Is that normal? Is there a limit on the number of ext that can be loaded under the campaign if so how do I add my ext to a new custom category? what is the script code, and xml string code that goes with it? Did anyone else have this problem with loading more than three ext under the campaign category?!

    thanks a bunch
    "When in doubt wing it!"
    "cool, a different error code finally making some progress!"

  2. #2
    I figured out how to add a new category but I can only load two sidebar ext at a time. is there a limit on ext use on the sidebar?
    "When in doubt wing it!"
    "cool, a different error code finally making some progress!"

  3. #3
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    There's no limit on the number of extensions you can load. Provide examples of the code you're using to add sidebar buttons and maybe we can help identify the issue.
    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
    Quote Originally Posted by Trenloe View Post
    There's no limit on the number of extensions you can load. Provide examples of the code you're using to add sidebar buttons and maybe we can help identify the issue.

    I use this script code with PSIONICS IS THE EXT EXAMPLE NAME

    Code:
    function onInit()
    
    LibraryData.aRecords
    ["PSIONICS"] = {
    bExport = true,
    aDataMap = { "PSIONICS", "reference.PSIONICS" },
    sRecordDisplayClass = "PSIONICS",
    sSidebarCategory = "mycategory" ,
    
    		
    	}
    
    	
    end
    STRING CODE EXAMPLE

    Code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <root>
    	<string name="library_category_label_mycategory">mycategory</string>
       <string name="library_recordtype_label_PSIONICS">PSIONICS</string>     
    </root>
    thanks for your help! I found if I disable an ext the other appears, and visa versa. Is there a better way code-wise to add them?
    Last edited by twoditdmonk; June 8th, 2023 at 11:31.
    "When in doubt wing it!"
    "cool, a different error code finally making some progress!"

  5. #5
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    Quote Originally Posted by twoditdmonk View Post
    I use this script code with PSIONICS IS THE EXT EXAMPLE NAME

    [CODE]function onInit()

    LibraryData.aRecords
    ["PSIONICS"] = {
    bExport = true,
    aDataMap = { "PSIONICS", "reference.PSIONICS" },
    sRecordDisplayClass = "PSIONICS",
    sSidebarCategory = "my category goes here" ,


    }
    This code overrides the base LibraryData.aRecords. You need to write code that adds to LibraryData.aRecords.

    For an example of how to do this, refer to the onInit function in the 2E ruleset scripts\data_library_5E.lua file.
    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!

  6. #6

    I am lost! I dont know what to make of it.

    Quote Originally Posted by Trenloe View Post
    This code overrides the base LibraryData.aRecords. You need to write code that adds to LibraryData.aRecords.

    For an example of how to do this, refer to the onInit function in the 2E ruleset scripts\data_library_5E.lua file.
    THE FILE 5E.LUA is confusing way too much info!
    Am I to use aRecords = {

    Code:
      ["skill"] = {
        bExport = true, 
        aDataMap = { "skill", "reference.skilldata" }, 
        aDisplayIcon = { "button_skills", "button_skills_down" },
        sRecordDisplayClass = "reference_skill", 
        aGMListButtons = { "button_skill_bystat" };
        aPlayerListButtons = { "button_skill_bystat" };
        aCustomFilters = {
          ["Type"] = { sField = "stat", fGetValue = getSkillTypeValue},
        },
        aPlayerListButtons = { "button_skills_type_player" };
      },
    Code:
    aRecords = {
      -- ["image"] = { 
        -- bExport = true,
        -- bID = true,
        -- sIDOption = "IMID",
        -- aDataMap = { "image", "reference.images" }, 
        -- aDisplayIcon = { "button_maps", "button_maps_down" }, 
        -- sListDisplayClass = "masterindexitem_id",
        -- sRecordDisplayClass = "imagewindow",
        -- aGMListButtons = { "button_folder_image", "button_store_image" },
      -- },
    "When in doubt wing it!"
    "cool, a different error code finally making some progress!"

  7. #7
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    As I mentioned - look at the onInit function at the end of that file, it only does two things - set a custom handler (ignore that) and adds the custom records to the library.

    Specifically, this is the code:

    Code:
      for kRecordType,vRecordType in pairs(aRecords) do
        LibraryData.setRecordTypeInfo(kRecordType, vRecordType);
      end
    This iterates through a LUA table (aRecords) and adds them to the base library records using LibraryData.setRecordTypeInfo.

    Set the aRecords LUA table in that a similar file with the data you need to setup your sidebar buttons - there's plenty of examples in that file, and the CoreRPG library_data.lua file has a bunch of comments (and more examples). Then have an onInit function that does the above code.
    Last edited by Trenloe; June 8th, 2023 at 12:28.
    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!

  8. #8
    ok I looked through both files, and I admit I am lost (I am not new to code work every program uses its own values even though it's the same program language.) I need a clear example from start to Finish with psionics as an example in the code. sorry. I understand what you are saying I need to do it's just the exact code on how to achieve it escapes me.

    I was up all night trying to come up with a working example code with no luck. I feel a little burned out. if someone can take the time I would appreciate it. the code I used is what was shown to me through a tutorial.
    sorry again for asking for help.
    thanks a bunch for your effort.
    "When in doubt wing it!"
    "cool, a different error code finally making some progress!"

  9. #9
    Look at the 4E ruleset in the file data_library_4E.lua. It's a simpler version of the other ones.

    Try this simple example that I clipped from the 4E code:
    Code:
    aRecordOverrides = {
    	["feat"] = {
    		bExport = true, 
    		aDataMap = { "feat", "reference.feats" }, 
    		sRecordDisplayClass = "powerdesc", 
    	},
    };
    
    function onInit()
    	LibraryData.overrideRecordTypes(aRecordOverrides);
    end

  10. #10
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    Or try this extension. It includes a basic "psionics" windowclass.
    Attached Files Attached Files
    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!

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