Hi Toni!
The subject of the topic is pretty self explanatory! I am looking for a way of getting the quest ID. Is this by any means possible?
Best regards,
João
Get quest ID
Re: Get quest ID
Hi,
Are you looking for a Dialogue System quest ID or a Quest Machine quest ID?
For the Dialogue System, the quest ID is the quest's Name field:
There's also an internal ID number, but in general you should never need to access it.
The quest's Name is used in Lua functions such as SetQuestState() and in C# methods such as QuestLog.SetQuestState():
Are you looking for a Dialogue System quest ID or a Quest Machine quest ID?
For the Dialogue System, the quest ID is the quest's Name field:
There's also an internal ID number, but in general you should never need to access it.
The quest's Name is used in Lua functions such as SetQuestState() and in C# methods such as QuestLog.SetQuestState():
Re: Get quest ID
Hi Toni!
I have been looking to the Dialogue System quest ID.
I am trying to get the quest data (id, title, description, quest state) and with that populate a custom class of my own. In that class, let's call it "Quest", i will be adding some other relevant variables to me, such as the "start_timestamp" and "end_timestamp" and "quest_dependencies[] {quest_id_0, quest_id_1, ...}" (do not ask me how i will implement this last one, because i do not know it myself... Still need to figure it out ).
Anyway, as you can see since i need the quest IDs i would like to have the "original" ones instead of generating my own with methods like "System.Guid.NewGuid" which return enormous IDs that do not correlate with the Dialogue System quest IDs.
Thank you in advance,
João
I have been looking to the Dialogue System quest ID.
I am trying to get the quest data (id, title, description, quest state) and with that populate a custom class of my own. In that class, let's call it "Quest", i will be adding some other relevant variables to me, such as the "start_timestamp" and "end_timestamp" and "quest_dependencies[] {quest_id_0, quest_id_1, ...}" (do not ask me how i will implement this last one, because i do not know it myself... Still need to figure it out ).
Anyway, as you can see since i need the quest IDs i would like to have the "original" ones instead of generating my own with methods like "System.Guid.NewGuid" which return enormous IDs that do not correlate with the Dialogue System quest IDs.
Thank you in advance,
João
Re: Get quest ID
Hi João,
You can either use the quest Name field as its unique ID, or you can use its internal ID number. To get the internal ID number:
To list all IDs:
IDs are only valid for quests that are defined in the dialogue database. The information about these quests are also present in the Dialogue System's Lua environment.
If you create new quests at runtime, their information will only be in the Lua environment. You can use the QuestLog and DialogueLua classes to access them. To list all quests:
The QuestLog class has many other methods to get and set information.
To get or set a specific field, you can also use DialogueLua:
I hope this information helps. If you have more specific requirements, I may be able to provide clearer information.
You can either use the quest Name field as its unique ID, or you can use its internal ID number. To get the internal ID number:
Code: Select all
int id = DialogueManager.masterDatabase.GetItem("Get the Launch Codes").id;
Code: Select all
foreach (var quest in DialogueManager.masterDatabase.items)
{
if (!quest.IsItem) Debug.Log("Quest " + quest.Name + " ID = " + quest.id);
}
If you create new quests at runtime, their information will only be in the Lua environment. You can use the QuestLog and DialogueLua classes to access them. To list all quests:
Code: Select all
string[] allQuests = QuestLog.GetAllQuests(QuestState.Unassigned | QuestState.Active | QuestState.Success);
To get or set a specific field, you can also use DialogueLua:
Code: Select all
int numPasswordAttempts = DialogueLua.GetQuestField("Get the Launch Codes", "Password Attempts").asInt;
DialogueLua.SetQuestField("Get the Launch Codes", numPasswordAttempts + 1);
Re: Get quest ID
Once more you've made my day! Thank you so much!
Best regards,
João
Best regards,
João