Namespace in reactor_quests.js

Game_Quests

30 functions in 5 groups · hide internal

The in-game character creator.

Familiar territory. Game_Quests keeps the RPG Maker MZ API, so existing MZ knowledge, tutorials and plugin code apply. Reactor's additions are marked with descriptions below.

Quick Reference

Setup & Creation 1

initialize() Sets up a new instance.

Checks (True / False) 5

isKnown() Whether it is known.
isActive() Whether it is active.
isCompleted() Whether it is completed.
isFailed() Whether it is failed.
isRewardGiven() Whether it is reward given.

Actions 5

reset() Back to never heard of: the log forgets it and its objectives start over.
setObjective() Change one objective (0-based index) or every objective ("all"): "show", "hide", "complete", "fail" or "reset…
setReward() Sets the reward.
giveRewards() Give one reward (0-based index) or every reward ("all") that gives something and has not been given: gold, an…
setTracked() Sets the tracked.

Updating & Drawing 1

update() The rules that run on their own, once a frame on the map: a quest that appears at the start of the game, when…

Other 18

touch() Counts every change the player could see, so the tracker redraws only when one happens.
revision() Revision.
status() Status.
discover() The quest appears in the log, its objectives and rewards at their authored visibility.
_autoTrack() With auto-track on, the tracker follows a new quest when it follows none.
complete() Complete.
fail() Fail.
objectiveStates() Objective states for a quest, one per authored objective.
_mirrorObjectives() Pass some objectives' current states (0-based indices) on to VisuStella's log.
allShownObjectivesDone() Whether every objective the player can see is complete (and there is at least one).
_checkCompletion() Check completion.
rewardsShown() Reward visibility for a quest, one flag per authored reward.
givenRecord() Which rewards were given, per quest; a save from before rewards gave anything has none.
tracked() Tracked.
known() Known quests as data records, in the order they were discovered.
active() Active.
completed() Completed.
failed() Failed.

Setup & Creation

initialize

method source
Game_Quests.prototype.initialize()

Sets up a new instance. (Same as the RPG Maker MZ method of this name.)

Checks (True / False)

isKnown

method source
Game_Quests.prototype.isKnown(id)

Whether it is known. (Same as the RPG Maker MZ method of this name.)

isActive

method source
Game_Quests.prototype.isActive(id)

Whether it is active. (Same as the RPG Maker MZ method of this name.)

isCompleted

method source
Game_Quests.prototype.isCompleted(id)

Whether it is completed. (Same as the RPG Maker MZ method of this name.)

isFailed

method source
Game_Quests.prototype.isFailed(id)

Whether it is failed. (Same as the RPG Maker MZ method of this name.)

isRewardGiven

method source
Game_Quests.prototype.isRewardGiven(id, index)

Whether it is reward given. (Same as the RPG Maker MZ method of this name.)

Actions

reset

method source
Game_Quests.prototype.reset(id)

Back to never heard of: the log forgets it and its objectives start over.

setObjective

method source
Game_Quests.prototype.setObjective(id, index, state)

Change one objective (0-based index) or every objective ("all"): "show", "hide", "complete", "fail" or "reset" (open again).

Details

Change one objective (0-based index) or every objective ("all"): "show", "hide", "complete", "fail" or "reset" (open again). Discovers the quest first if it has to, and completes a quest whose rule is "every shown objective complete" when that becomes true.

setReward

method source
Game_Quests.prototype.setReward(id, index, visible)

Sets the reward. (Same as the RPG Maker MZ method of this name.)

giveRewards

method source
Game_Quests.prototype.giveRewards(id, index)

Give one reward (0-based index) or every reward ("all") that gives something and has not been given: gold, an item, a weapon, an armor, EXP to the party, or a common event.

Details

Give one reward (0-based index) or every reward ("all") that gives something and has not been given: gold, an item, a weapon, an armor, EXP to the party, or a common event. A reward is given once; a reset quest can give it again. Giving shows the reward in the log.

setTracked

method source
Game_Quests.prototype.setTracked(id)

Sets the tracked. (Same as the RPG Maker MZ method of this name.)

Updating & Drawing

update

method source
Game_Quests.prototype.update()

The rules that run on their own, once a frame on the map: a quest that appears at the start of the game, when a switch is on or a variable reaches a value; an objective that completes with a switch; a quest that completes with a switch.

Details

The rules that run on their own, once a frame on the map: a quest that appears at the start of the game, when a switch is on or a variable reaches a value; an objective that completes with a switch; a quest that completes with a switch. Switches read through $gameSwitches, so anything that sets one - an event, a plugin, a script - moves the quest along without knowing it exists.

Other

touch

method source
Game_Quests.prototype.touch()

Counts every change the player could see, so the tracker redraws only when one happens.

revision

method source
Game_Quests.prototype.revision()

Revision. (Same as the RPG Maker MZ method of this name.)

status

method source
Game_Quests.prototype.status(id)

Status. (Same as the RPG Maker MZ method of this name.)

discover

method source
Game_Quests.prototype.discover(id)

The quest appears in the log, its objectives and rewards at their authored visibility.

_autoTrack

method internal source
Game_Quests.prototype._autoTrack(id)

With auto-track on, the tracker follows a new quest when it follows none.

complete

method source
Game_Quests.prototype.complete(id)

Complete. (Same as the RPG Maker MZ method of this name.)

fail

method source
Game_Quests.prototype.fail(id)

Fail. (Same as the RPG Maker MZ method of this name.)

objectiveStates

method source
Game_Quests.prototype.objectiveStates(id)

Objective states for a quest, one per authored objective.

_mirrorObjectives

method internal source
Game_Quests.prototype._mirrorObjectives(quest, indices)

Pass some objectives' current states (0-based indices) on to VisuStella's log.

allShownObjectivesDone

method source
Game_Quests.prototype.allShownObjectivesDone(id)

Whether every objective the player can see is complete (and there is at least one).

_checkCompletion

method internal source
Game_Quests.prototype._checkCompletion(quest)

Check completion. (Same as the RPG Maker MZ method of this name.)

rewardsShown

method source
Game_Quests.prototype.rewardsShown(id)

Reward visibility for a quest, one flag per authored reward.

givenRecord

method source
Game_Quests.prototype.givenRecord()

Which rewards were given, per quest; a save from before rewards gave anything has none.

tracked

method source
Game_Quests.prototype.tracked()

Tracked. (Same as the RPG Maker MZ method of this name.)

known

method source
Game_Quests.prototype.known()

Known quests as data records, in the order they were discovered.

active

method source
Game_Quests.prototype.active()

Active. (Same as the RPG Maker MZ method of this name.)

completed

method source
Game_Quests.prototype.completed()

Completed. (Same as the RPG Maker MZ method of this name.)

failed

method source
Game_Quests.prototype.failed()

Failed. (Same as the RPG Maker MZ method of this name.)