- Home /
Too subjective and argumentative
Creating Quests in Unity
How would I go about creating a quest system in unity with C#
Define what you mean by 'quest' system. What do you want to get out of the system? Have you tried your own simple quest system in C# yet? This is a very open-ended question that needs more clarification.
Your question is too general. Building such a system is a project to be taken. Try to be more specific. When faced with specific problems, we could surely try and help out.
oh well I meed to be able to accept a quest and the the script needs to be smart as two count how many people I killed
That sounds simple enough, why don't you implement it in C# yourself then let us know if you get stuck?
Answer by ckfinite · Jun 25, 2011 at 04:20 PM
Well, since the question is very vague, and I have a lot of time, I will go over the aspects of a quest system that I think you need.
What is important in a quest? Well, you need to have a start, and end, and possibly some conditions as to if you can finish. For example, this could be a quest:
At inn, learn that there are creatures menacing the town, and that there is a 100 amount reward for killing 10 of them.
A quest description (e.g. how much the quest is worth (100), where it starts (inn), what the objective is (kill 10), and where it ends (inn)),
A dialog system, the is flexible enough to display the quest information,
A way to give the player that quest description,
And last but very much not least, a way of determining when to kick off the dialog.
Now go and kill 10 enemies
First, you need a HP system, and a method of notifying when a creature is killed
Then, you need to notify some sort of quest handler, that checks what the quest needs (in this case, kills) and if there is match with a possible quest event, decrements/increments that number.
Once the requisite number of enemies has been killed, show another dialog that you have succeeded, and go back to the start.
Go back to the inn and get the reward
First, you need a mechanism of determining you are in the inn, in the right spot, which you presumably have from the first step.
Then, you need to show a dialog of the reaction to your success
Then, add the 100 to the players wallet, then quest over.
In terms of implementation, I would go for a OOP/MVC based system, where the quest description if the model, the view is the GUI, and the controller both updates the view and checks for the objectives. I would have a Quest class that was built up from a string that would describe the quest, and would be changed by the controller. This architecture would also enable quest creation by a writer.---
Answer by Unamine · Jun 25, 2011 at 05:30 PM
Tutorial rpg full: http://www.burgzergarcade.com/hack-slash-rpg-unity3d-game-engine-tutorial
There isn't anything that outlines quests in this series, if I'm wrong please be a little more helpful and at least post a link
Answer by Kikke · Apr 04, 2012 at 03:01 PM
I've just created a code for the quest giver, to show the player if he has a quest or not.
using UnityEngine;
using System.Collections;
public class questGiver : MonoBehaviour {
public bool onQuest;
public GameObject questMark;
public Material questMarkedOn;
public Material questMarkedOff;
// Update is called once per frame
void Update () {
if(onQuest) {
questMark.renderer.material = questMarkedOn;
}
else {
questMark.renderer.material = questMarkedOff;
}
}
}
so in the quest marked on you should fill in a Eg. a yellow renderer, and in quest marked on you should fill in a invisible renderer.
and in the quest mark its gonna be your object that could be a 3d question mark. and if the quest giver is on a quest you simply checks on the checkbox saying on quest.
and the quests you would have to create piece for piece.
I started working on a Quest system for my game. If I manage to turn it into, as some call it, a General Solution, I am willing to share for free, but don't hold your breath, since I am a One $$anonymous$$an Development Team, so I need some luck and a few months spare time ;-)
busy trying to make one but this one is or showing information.
I'll share if I can get it to work but I'm still quite new to program$$anonymous$$g in unity so don't put your hopes on me ;)