Common ways to develop code of character quests


Try to understand how should I start to develop code to make character to run story quest or task. Just need to clarify some high-level logic how to implement such things. So have some questions: How to store quests - some separate scripts or something, how connect quests to characters dialogs? how to save and store quests results?

It would be great if someone share his experience.

As timsk said it is a good idea to write down what you want to be able to do step by step, but maybe the following explanation also helps a little bit. How to implement a quest system strongly depends on what you want to do with it, but I would try to implement a simple "text quest system" in the following way.

Lets say you have different questnumbers, for example 1 = MainQuest 2-? are side quests,.. Then you need a QuestScript which you can add to characters, objects, etc. which has public variables like id, progressNumber and text. The progresssNumber just counts how far you have come with a quest.

Next you need a QuestSystemScript which tracks the different quests in an "public static" array, and checks the quests on collision. Like if you have the progressNumber 2 on quest 1, and you collide with an object attached the QuestScript, with the variables progressNumber 2 and id 1, you trigger the text and raise the progressNumber by one. Which means you have to check if the player got the needed progress.

So far you should have a simple system which allows you to trigger text as you go through your quest, other stuff would need further implementations but it should be easy to just add new features on seperate scripts by simply checking if it just reached the needed progress and then activating the other scripts "on collision". Hope that helps, and gives an idea how you could implement different quest systems. ;-)