StaticQuest

StaticQuest

class

Quest definition and its runtime progress

Fields

NameTypeDescription
label Loc Localized quest title
description_parts Loc[] Localized description paragraphs
context AutosizeInventory Inventory of items shown next to the description
chapter StaticChapter Chapter this quest belongs to
required_quests StaticQuest[] Quests that must be completed first
auto_unlock boolean Unlock automatically once requirements are met
any_objective boolean Complete on any one objective instead of all of them
state integer Current state: locked, active or completed
events table? Table of event handlers keyed by event id
on_unlock function? Called when the quest becomes active
on_complete function? Called when the quest is completed
objectives QuestObjective[] Objectives of this quest

Functions

StaticQuest:add_context(item)

Add an item to the context inventory

item StaticItem Item to show

StaticQuest:clear_context()

Remove every item from the context inventory

StaticQuest:refresh_events()

Resubscribe the handlers listed in events

StaticQuest:complete()

Complete the quest and fire on_complete

StaticQuest:clear_objectives()

Drop every objective

StaticQuest:create_objective(id)

Create and append an objective

id string Identifier unique within the quest

returns QuestObjective

StaticQuest:add_objective(objective)

Append an existing objective

objective QuestObjective Objective to append

StaticQuest:find_objective_by_id(id)

Find an objective by its identifier

id string Objective identifier

returns QuestObjective

StaticQuest:set_objective_list(objectives)

Replace the objective list

objectives table Array of objectives or objective descriptions

StaticQuest:set_objective_complete(index, completed)

Set the completion flag of an objective by index

index integer Zero based objective index
completed boolean New completion state

returns boolean

StaticQuest:set_objective_complete_by_id(id, completed)

Set the completion flag of an objective by identifier

id string Objective identifier
completed boolean New completion state

returns boolean

StaticQuest:set_objective_progress(index, current, required, show_progress)

Set the progress counters of an objective

index integer Zero based objective index
current integer Current amount
required integer Required amount
show_progress boolean Whether the counter is shown

returns boolean

StaticQuest:set_objective_label(index, label)

Set the localized text of an objective

index integer Zero based objective index
label Loc New localized text

returns boolean

Standard members (5)

Generated for every class of this kind by the game's codegen, not written for StaticQuest.

StaticQuest.cast(object) Trying to cast Object into StaticQuest
StaticQuest.get_class() Return StaticQuest class object
StaticQuest.find(name) Looks StaticQuest up in db, nil when there is none
StaticQuest.get(name) Takes StaticQuest from db, reports a miss to the log
StaticQuest.reg(name) Register a new StaticQuest static object
Inherited from Prototype (2)
Inherited from Object (1)

Used by