struct and stepping? (quest line)

Hi, I would like to create a Quest Line scriptable object.

point: To have a quickly made questline, as my quests are scriptableObjects as wel…

I would Like to make a structure, which has several elements, and if a quest is complete, it goes to the next line in the structure, picking up the next quest available.

Could you please help me out or point me in the right direction?

So my concept was:

  • Quest Handler - a monobehaviour class which handles the quests, which quest is selected at the moment in the questline, can be placed on the player.
  • Questline - a scripltable object so i can create several questlines
  • Quest - a scriptable object which is basically the quest itself.

So I am halfway there but I will publish the solution regarding my question:

Quest Handler

public class QuestHandler : MonoBehaviour {
public Quest quest;
public Questline questline;

public int QuestlineIndex;

public void Update()
{
    if (Input.GetKeyDown(KeyCode.Space))
    NextQuest();
}

public void NextQuest()
{
    if (QuestlineIndex < questline.QuestLines.Length)
    {
        DisplayNextQuest();
        Debug.Log(quest);
        QuestlineIndex += 1;
    } else {
        QuestlineIndex = 0;
    }
}

public void DisplayNextQuest()
{
    QuestLine line = questline.QuestLines[QuestlineIndex];
    quest = line.quest;
}

 **Questline**
 

  [CreateAssetMenu(fileName = "New Questline", menuName= "Inventory System/Quest/new Questline")] [System.Serializable] public class Questline : ScriptableObject {
    public QuestLine[] QuestLines; }

[System.Serializable] public struct QuestLine {
    public Quest quest; }



**Quest**

public enum QuestType
{
    Cook
}

[System.Serializable]
public class Quest : ScriptableObject
{
    public int ID;
    public QuestType type;
    public ItemObject toCook;
    public int howMuchToGather;
}

I will update if I have the full system :slight_smile: