Finished Dialogue Editor and Future Quest Plans

I’ve always liked the threads the lecturers make to post our work, so I decided to create one now that I finished crawling my way through the Dialogue and Quest course.

The custom editor section was a really nice surprise, it will make editing and managing a lot of different ScriptableObjects much easier. I fell into a rabbit hole starting with resizing the text area to fit multiple lines, then integrating all of the variables to be able to be edited by their node UI. I also pulled the Quest/Objective bits into the nodes, so that one NPC would be able to give more than one quest or complete more than one objective. The nodes are getting a little big now, but here’s what the editor looks like currently:

I changed the Enter/Exit Actions and Conditions to enums, but since they handled multiple types, I kept the parameters as string lists. Since the stuff we’ve made already has ways of grabbing objects by string, there wasn’t a lot to worry about with typing errors, but the node closely controls the sizing of the parameter list based on what’s selected. For example, here’s a new method for QuestCompletion that is passed info originating in the node to complete some quest’s objective:

public void CompleteObjective(string[] questInfo)
{
    QuestList questList = GameObject.FindGameObjectWithTag("Player").GetComponent<QuestList>();
    quest = Quest.GetByName(questInfo[0]);
    questList.CompleteObjective(quest, questInfo[1]);
}

In the editor, the “Complete Objective” option locks the list size to 2 so that it won’t go out of index. “Has Item” does the same, but the second field uses int.TryParse to ensure that it only contains a number.

The “Condition Group” is a little strange. Each block of those count as a Conjuction, with the different conditions inside as the Disjunctions. However, if you’re checking for multiple conditions with the same predicate, they all get grouped together as a Conjuction. When laying out the checks, this felt pretty intuitive (and I wrote all of the check logic before getting to the last lecture :cry:). Here’s what multiple quest checks looks like in the editor and inspector:

The next step is going to be to expand some of the scripts related to quests, but I’m not sure the best path forward. I was thinking that the QuestList could contain two dictionaries, one for quests in progress and one for completed quests, both using <string, QuestStatus> for typing. If completed quests are hidden, it would at least help with ensuring that quests don’t get repeated infinitely (although a bool in the Quest SO may allow it).

One quest I hoped this course would cover is the ubiquitous “Kill X of Monster”, since I don’t know what systems we have in place would be best for doing that. For a small example: killing the two town guards if the Dialogue makes them attack, I made the Health.OnDie() trigger call QuestCompletion’s default method, each completing an objective. Perhaps another adding another property to the Objective class with Count would work? Different enemies could submit the same objective completion, but it wouldn’t be marked off until the count was fulfilled.

Anyway, thanks for reading, I hope in future courses each lecture will have its own discussion thread again. Feedback or any tips about my quest questions is much appreciated!

2 Likes

I suggest looking into this official Unity Course in their learning site, it’s pretty basic, but it can give you some nice ideas onto how to do other kind of quests and other how to enhance your own tools. They use a similar approach but quite different at the same time.

https://learn.unity.com/project/creator-kit-rpg

1 Like

I like what you’ve done in expanding the nodes and making the details editable within them! Great job on this!

1 Like

Privacy & Terms