Correct way to set an item custom field value via LUA?
Posted: Thu Feb 24, 2022 3:42 pm
Hello,
i am trying to update a custom field i created on items:
to add more information:
i use this "InInventory" field to check if the item is in the player's inventory.
i am trying to update a custom field i created on items:
Code: Select all
Item["Letter"].InInventory = true
- the field is a Bool, called "InInventory"
- the code is in a script field during a normal conversation
- The debug log says the script is being executed "Dialogue System: Lua(Item["Letter"].InInventory = true)"
to add more information:
i use this "InInventory" field to check if the item is in the player's inventory.
Code: Select all
foreach (var item in DialogueManager.masterDatabase.items)
{
if (item.IsItem)
{
if (item.AssignedField("InInventory").value == "True")
[ . . . ]