Table of Contents

Class Quest

Namespace
S1API.Quests
Assembly
S1API.dll

An abstract class intended to be derived from for creating custom quests in the game.

public abstract class Quest : Saveable
Inheritance
Quest
Inherited Members
Extension Methods

Remarks

To create a quest, you must use CreateQuest<T>(string?) to instantiate your quest.

Constructors

Quest()

INTERNAL: Public constructor used for instancing the quest.

public Quest()

Fields

QuestEntries

A list of all quest entries added to this quest.

public readonly List<QuestEntry> QuestEntries

Field Value

List<QuestEntry>

Properties

AutoBegin

Whether to automatically begin the quest once instanced. NOTE: If this is false, you must manually .Begin() this quest.

protected virtual bool AutoBegin { get; }

Property Value

bool

Description

The description provided to the player.

protected abstract string Description { get; }

Property Value

string

QuestIcon

Optional icon sprite to display for the quest. Override to use a custom icon loaded at runtime (e.g., from a file). protected override Sprite? QuestIcon => ImageUtils.LoadImage("icon.png");

protected virtual Sprite? QuestIcon { get; }

Property Value

Sprite

QuestState

The current quest state for this quest

protected QuestState QuestState { get; }

Property Value

QuestState

Title

The title of the quest to display for the player.

protected abstract string Title { get; }

Property Value

string

Methods

AddEntry(string, NPC)

Adds a new quest entry to the quest with an NPC as the POI location. The POI marker will automatically update when the NPC moves.

protected QuestEntry AddEntry(string title, NPC npc)

Parameters

title string

The title for the quest entry.

npc NPC

The NPC to use as the POI location.

Returns

QuestEntry

A reference to the quest entry

AddEntry(string, Vector3?)

Adds a new quest entry to the quest.

protected QuestEntry AddEntry(string title, Vector3? poiPosition = null)

Parameters

title string

The title for the quest entry.

poiPosition Vector3?

A position for the point-of-interest, if applicable.

Returns

QuestEntry

A reference to the quest entry

Begin()

Starts the quest for the save file.

public void Begin()

Cancel()

Cancels the quest for the save file.

public void Cancel()

Complete()

Completes the quest for the save file.

public void Complete()

End()

Ends the quest for the save file. NOTE: This is done upon completion of the entries by default.

public void End()

Expire()

Expires the quest for the save file.

public void Expire()

Fail()

Fails the quest for the save file.

public void Fail()

Events

OnComplete

An action called once a quest has been completed.

public event Action OnComplete

Event Type

Action

OnFail

An action called once a quest has been failed.

public event Action? OnFail

Event Type

Action

See Also