Hi Tony,
I'm wondering what's the best choice to access the field of an item (or actor...), in terms of performances. I'm talking about a value that never changes (which is immutable, always the same between the database and the Lua environment). Is it better to look for the value in the database or the Lua environment? Or in other words:
DialogueManager.masterDatabase.GetItem(id).AssignedField("title").value;
or
DialogueSystem.DialogueLua.GetItemField("item", "field");
Best regards,
Marc
Best way to look for immutable fields: database or lua environment?
Re: Best way to look for immutable fields: database or lua environment?
They're actually comparable in performance. DialogueLua uses optimized table lookups versus regular Lua expressions. So feel free to use whichever one you prefer. If you use DialogueManager.masterDatabase.GetItem(), use LookupValue. Example:
Code: Select all
string s = DialogueManager.masterDatabase.GetItem("Name").LookupValue("title");
Re: Best way to look for immutable fields: database or lua environment?
Thank you for the information!
Have a nice day : )
Have a nice day : )