-
July 5th, 2022, 06:08 #1
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");
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.
-
July 5th, 2022, 06:32 #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
-
July 5th, 2022, 15:27 #3
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.
-
July 5th, 2022, 16:50 #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
-
July 5th, 2022, 17:07 #5Private 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!
-
July 5th, 2022, 19:00 #6
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