5E Character Create Playlist
  1. #1
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    17,244
    Blog Entries
    9

    Understanding Item Types and Dynamic Field Creation

    In my ruleset I would like different types of items to have different attributes. This is similar to how in the D&D 5E ruleset Weapons, Armor, and Arcane Focus items have additional fields like AC, Damage, Bonus, etc that those types of items can have.

    I believe I have worked out in 5E this is handled in the file "item_main.lua". That part that confuses me is here:
    Code:
    	local bID = LibraryData.getIDState("item", nodeRecord);
    	wand
    	local bWeapon, sTypeLower, sSubtypeLower = ItemManager2.isWeapon(nodeRecord);
    	local bArmor = ItemManager2.isArmor(nodeRecord);
    	local bArcaneFocus = (sTypeLower == "rod") or (sTypeLower == "staff") or (sTypeLower == "wand");
    First, what the heck is that second line "wand" doing? It that some remnant or typo?

    To the important stuff: I understand how bArcaneFocus gets set, i.e. if the sTypeLower field equals rod, staff, wand then bArcaneFcus is true. And though I don't quite understand why the bWeapon and bArmor functins have a bunch of other stuff in them, I do see how they get set to True, but I don't understand why they are evaluated in manager_item2.lua.

    Now my question; why would I want to use the bWeapon approach over the bArcaneFocus approach?

    And, if I want some of my types to have sub-types with unique attributes, does that impact the approach above? i.e weapons that are ranged to have other attributes.

    Problems? See; How to Report Issues, Bugs & Problems
    On Licensing & Distributing Community Content
    Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
    Note, I am not a SmiteWorks employee or representative, I'm just a user like you.

  2. #2
    That is all down to what you would like to do honestly. Both have their merits. The bWeapon line and bArmor line have built in functions to verify the item is a weapon or a piece of armor. In some cases in 5e, the subtype would also contain weapon for it to be used as such mechanically throughout the ruleset. The bArcaneFocus line is a more deliberate approach looking for those types without any additional checks needed. I would check out TEST soon for some changes to this approach and may give you a better way of approaching this process and help organize data fields better.
    Dominic Morta
    Ruleset Developer
    Smiteworks

    How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it

    How to provide an Unity Connection issue?-Connection Issues and What to Provide

    Unity Updater issue?-Updater Issues

    Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained

    Comcast or Cox ISP User?-Comcast XFinity and Cox Users

    Have a suggestion?-Feature Request

  3. #3
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    17,244
    Blog Entries
    9
    Ok, thanks. So bWeapon and bArmor are also checking for subtypes that may make the item a weapon or armor. Makes sense now. I don't see that I will need that. Will check out test as well to see about the change you mention.

    Still curious about the "wand" line though

    Problems? See; How to Report Issues, Bugs & Problems
    On Licensing & Distributing Community Content
    Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
    Note, I am not a SmiteWorks employee or representative, I'm just a user like you.

  4. #4
    As I mentioned, the bArcaneFocus line is more deliberate query. It will return true if the sTypeLower is one of those three item types.

    Example:
    If I create a blank item in 5e, and go and type in Wand into the Type field, it will then change what is visible on the frame. A new bonus field should now be available. If I remove it, it removes the bonus field.
    Dominic Morta
    Ruleset Developer
    Smiteworks

    How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it

    How to provide an Unity Connection issue?-Connection Issues and What to Provide

    Unity Updater issue?-Updater Issues

    Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained

    Comcast or Cox ISP User?-Comcast XFinity and Cox Users

    Have a suggestion?-Feature Request

  5. #5
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,404
    Quote Originally Posted by LordEntrails View Post
    Still curious about the "wand" line though
    I don't see that the live 5E ruleset item_main.lua on my install.
    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
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    17,244
    Blog Entries
    9
    Quote Originally Posted by Trenloe View Post
    I don't see that the live 5E ruleset item_main.lua on my install.
    Hmm, not there when I refresh. I must have corrupted/changed the file myself when experimenting. Probably meant to by typing in FG and actually types in NPP. Thanks for checking
    Last edited by LordEntrails; July 5th, 2022 at 19:04.

    Problems? See; How to Report Issues, Bugs & Problems
    On Licensing & Distributing Community Content
    Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
    Note, I am not a SmiteWorks employee or representative, I'm just a user like you.

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
  •  
DICE PACKS BUNDLE

Log in

Log in