Hi Tony
I have a question, how to access "New Field" added to quest entry:
I would like to access this second field, how i can do it?
How to access new field in Quest Entry (via Code)
Re: How to access new field in Quest Entry (via Code)
Hi,
You have a duplicate field. Expand All Fields, and delete the second "Entry 3" field:
When you add a new entry field, enter some text to append to the end of the field name. For example, to create a field named "Entry 3 Reward", set the text entry area to "Reward" before clicking Create:
To access this field in C#, use DialogueLua.GetQuestField(). Example:
You have a duplicate field. Expand All Fields, and delete the second "Entry 3" field:
When you add a new entry field, enter some text to append to the end of the field name. For example, to create a field named "Entry 3 Reward", set the text entry area to "Reward" before clicking Create:
To access this field in C#, use DialogueLua.GetQuestField(). Example:
Code: Select all
string reward = DialogueLua.GetQuestField("Thief Quest", "Entry 3 Reward").asString;
Re: How to access new field in Quest Entry (via Code)
Thanks for answer, it will help a lot
I understand that with help of SetQuestField() I can change field value via code. Where i can check what variables is accepted by what field type?
I understand that with help of SetQuestField() I can change field value via code. Where i can check what variables is accepted by what field type?
Re: How to access new field in Quest Entry (via Code)
Lua is a dynamically typed language. You can assign any type of value to any variable or field. So you can do this, even though it might not make sense:
Code: Select all
DialogueLua.SetQuestField("Kill Rats", "XP Reward", 50); // Set the XP Reward field to the number 50.
DialogueLua.SetQuestField("Kill Rats", "XP Reward", "Internet Exposure"); // Set the XP Reward field to the string "Internet Exposure".
Re: How to access new field in Quest Entry (via Code)
Hi Tony
One more question, Let's say quest was changed from Timeline or Dialogue Trigger is there a some kinda event telling unity that this quest was changed to another state?
One more question, Let's say quest was changed from Timeline or Dialogue Trigger is there a some kinda event telling unity that this quest was changed to another state?