Oh, I found the problem—you need to add .ToLower().
quest.fields.Find(f => f.title == "State").value = questStateToAdd.ToString().ToLower();
When converting QuestState in the Inspector to a string, the first character is capitalized by default.
Search found 3 matches
- Tue Feb 04, 2025 4:53 am
- Forum: Dialogue System for Unity
- Topic: database's quest inspector "State" field always show as (None) when trying to add quest through C# script
- Replies: 4
- Views: 2842
- Mon Feb 03, 2025 11:59 pm
- Forum: Dialogue System for Unity
- Topic: database's quest inspector "State" field always show as (None) when trying to add quest through C# script
- Replies: 4
- Views: 2842
Re: database's quest inspector "State" field always show as (None) when trying to add quest through C# script
Hi, Some important points: 1. At runtime, consider the dialogue database to be read only. All runtime changes go into the Lua environment. 2. Generally speaking, the Dialogue Editor will show the original values of your database, not runtime values, with the exception of the Watches tab. 2. Use the...
- Mon Feb 03, 2025 6:42 pm
- Forum: Dialogue System for Unity
- Topic: database's quest inspector "State" field always show as (None) when trying to add quest through C# script
- Replies: 4
- Views: 2842
database's quest inspector "State" field always show as (None) when trying to add quest through C# script
I'm trying to add a quest through a C# script at edit time. Here’s the snippet: public string questTitleToAdd; public string questDescriptionToAdd; public QuestState questStateToAdd; public DialogueDatabase database; [ContextMenu("Add Quest")] public void AddAQuest() { Item item = database...