STAR TREK 2d20
Page 2 of 2 First 12
  1. #11
    Ardem's Avatar
    Join Date
    Nov 2011
    Location
    Sydney, Australia
    Posts
    920
    So this is the new code, but it makes my head hurt. The code above I could understand this one is a little out of my league

    This is based on this code 'Debug.console('DEPRECATED (v3.2.2) (ItemManager.isItemClass): Use LibraryData.isRecordDisplayClass("item", sClass)');'

    Code:
    function isRecordDisplayClass(sRecordType, sClass)
    	if aRecords[sRecordType] then
    		if aRecords[sRecordType].fIsRecordDisplayClass then
    			return aRecords[sRecordType].fIsRecordDisplayClass(sClass);
    		elseif aRecords[sRecordType].aRecordDisplayClasses then
    			return StringManager.contains(aRecords[sRecordType].aRecordDisplayClasses, sClass);
    		elseif aRecords[sRecordType].sRecordDisplayClass then
    			return (aRecords[sRecordType].sRecordDisplayClass == sClass);
    		else
    			return (sRecordType == sClass);
    		end
    	end
    	return false;
    end
    If someone can psuedo code the above code it might help me figure this out. Sorry I know I never said i was a coder but I try my best.

    This code is in the rec_char_inventory.xml I think this is where I need to include armor and weapons but not sure how

    local bID = LibraryData.getIDState("item", getDatabaseNode(), true);
    Last edited by Ardem; February 8th, 2017 at 02:54.

  2. #12
    Are you trying to build a new ruleset on top of CoreRPG, or are you just trying to make a CoreRPG item library?

    If you are building a new ruleset, you should be looking at scripts/data_library_35E.lua in the 3.5E ruleset (or similar in the other official rulesets) for how additional item types are added. (And look for instances of those new item types in the ruleset also.)

    If you are just trying to make a CoreRPG library, then you will have to use "item", and there is no concept of different item types. Otherwise, you need to build an extension or ruleset.

    Cheers,
    JPG

  3. #13

    Join Date
    May 2014
    Location
    Sydney, Australia
    Posts
    808
    Ninjaed!

  4. #14
    Ardem's Avatar
    Join Date
    Nov 2011
    Location
    Sydney, Australia
    Posts
    920
    Trying to fix up the Extinction Event ruleset once it broke in 3.2.2 due to the new code, which but will review data_library_35E to fix it thanks

  5. #15
    Yeah, definitely review the data_library_35E script. From the item class names used, I think you will be able to borrow heavily from the 3.5E/PFRPG implementation.

    Cheers,
    JPG

  6. #16
    Ardem's Avatar
    Join Date
    Nov 2011
    Location
    Sydney, Australia
    Posts
    920
    So to tie this off all nicely and thanks to ianward for the additional support. the final code need included a new data_library_EE.lua. to use with the existing item_manager2 code. This all worked great!

    Code:
    function isItemRecordDisplayClass(sClass)
    	if sClass == "item" then
    		return true;
    	end
    	return ItemManager2.isItemClass(sClass);
    end
    
    aRecords = {
    	-- CoreRPG override
    	["item"] = { 
    		bExport = true,
    		bID = true,
    		sIDOption = "MIID",
    		aDataMap = { "item", "reference.items","referenceweapon","reference.weapon","referencearmor","reference.armor" }, 
    		aDisplayIcon = { "button_items", "button_items_down" }, 
    		sListDisplayClass = "masterindexitem_id",
    		fIsRecordDisplayClass = isItemRecordDisplayClass,
    		},
    	...

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
  •  
5E Character Create Playlist

Log in

Log in