dogfisc
February 28th, 2021, 20:23
I'm trying to figure out how, given a node in a PC's "weaponlist", to get to the linked node in the "inventorylist". The weaponlist has a value called "shortcut":
<shortcut type="windowreference">
<class>item</class>
<recordname>....inventorylist.id-00001</recordname>
</shortcut>
I'm currently doing this:
local sClass, sRecordName = DB.getValue(vWeaponNode, "shortcut");
-- s'sClass: ' | s'item'
-- s'sRecordName: ' | s'charsheet.id-00004.inventorylist.id-Longbow'
local vInvNode = DB.findNode(sRecordName);
-- s'vInvNode: ' | databasenode = { charsheet.id-00004.inventorylist.id-Longbow }
This seems to be easy, and work, but because DB.getValue(vWeaponNode, "shortcut") returns a number of strings, I don't know that I can be certain they will always be consistent, i.e. the second string will contain the path to the inventorylist node.
Does the above code seem reasonable, or is there a safer way to go about it?
<shortcut type="windowreference">
<class>item</class>
<recordname>....inventorylist.id-00001</recordname>
</shortcut>
I'm currently doing this:
local sClass, sRecordName = DB.getValue(vWeaponNode, "shortcut");
-- s'sClass: ' | s'item'
-- s'sRecordName: ' | s'charsheet.id-00004.inventorylist.id-Longbow'
local vInvNode = DB.findNode(sRecordName);
-- s'vInvNode: ' | databasenode = { charsheet.id-00004.inventorylist.id-Longbow }
This seems to be easy, and work, but because DB.getValue(vWeaponNode, "shortcut") returns a number of strings, I don't know that I can be certain they will always be consistent, i.e. the second string will contain the path to the inventorylist node.
Does the above code seem reasonable, or is there a safer way to go about it?