Item variable names in dialogue
Posted: Thu Feb 02, 2023 9:02 pm
Hi, I'm just getting my footing with plugin and am liking the experience so far, but I am coming up against one particular issue during my initial testing.
I have configured an item "Orb" within the items database and an item variable called "test.item" with its intial value set to the "Orb" item.
How would I obtain the name of this item during dialogue? Some other posts I have found lead me to believe I could accomplish this using the following snippet:
but this throws an error at runtime:
My assumption was that would return the ID of the item, which I could then use to index into the Item database and extract the name from the resulting item, but the error leads me to believe this is the part of the code that is failing.
Any suggestions would be appreciated. Cheers.
I have configured an item "Orb" within the items database and an item variable called "test.item" with its intial value set to the "Orb" item.
How would I obtain the name of this item during dialogue? Some other posts I have found lead me to believe I could accomplish this using the following snippet:
Code: Select all
[lua(Item[Variable["test.item"]].Name)]
Code: Select all
Dialogue System: Lua code 'return Item[Variable["test.item"]].Name' threw exception 'Lookup of field 'Name' in the table element failed because the table element itself isn't in the table.'
Code: Select all
Variable["test.item"]
Any suggestions would be appreciated. Cheers.