Namespace in reactor_quests.js
Game_Quests
27 public functions in 5 groups · show internal (_) functions
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 15
| 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. |
| complete() | Complete. |
| fail() | Fail. |
| objectiveStates() | Objective states for a quest, one per authored objective. |
| allShownObjectivesDone() | Whether every objective the player can see is complete (and there is at least one). |
| 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 sourceGame_Quests.prototype.initialize()
Sets up a new instance. (Same as the RPG Maker MZ method of this name.)
Checks (True / False)
isKnown
method sourceGame_Quests.prototype.isKnown(id)
Whether it is known. (Same as the RPG Maker MZ method of this name.)
isActive
method sourceGame_Quests.prototype.isActive(id)
Whether it is active. (Same as the RPG Maker MZ method of this name.)
isCompleted
method sourceGame_Quests.prototype.isCompleted(id)
Whether it is completed. (Same as the RPG Maker MZ method of this name.)
isFailed
method sourceGame_Quests.prototype.isFailed(id)
Whether it is failed. (Same as the RPG Maker MZ method of this name.)
isRewardGiven
method sourceGame_Quests.prototype.isRewardGiven(id, index)
Whether it is reward given. (Same as the RPG Maker MZ method of this name.)
Actions
reset
method sourceGame_Quests.prototype.reset(id)
Back to never heard of: the log forgets it and its objectives start over.
setObjective
method sourceGame_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 sourceGame_Quests.prototype.setReward(id, index, visible)
Sets the reward. (Same as the RPG Maker MZ method of this name.)
giveRewards
method sourceGame_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 sourceGame_Quests.prototype.setTracked(id)
Sets the tracked. (Same as the RPG Maker MZ method of this name.)
Updating & Drawing
update
method sourceGame_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 sourceGame_Quests.prototype.touch()
Counts every change the player could see, so the tracker redraws only when one happens.
revision
method sourceGame_Quests.prototype.revision()
Revision. (Same as the RPG Maker MZ method of this name.)
status
method sourceGame_Quests.prototype.status(id)
Status. (Same as the RPG Maker MZ method of this name.)
discover
method sourceGame_Quests.prototype.discover(id)
The quest appears in the log, its objectives and rewards at their authored visibility.
complete
method sourceGame_Quests.prototype.complete(id)
Complete. (Same as the RPG Maker MZ method of this name.)
fail
method sourceGame_Quests.prototype.fail(id)
Fail. (Same as the RPG Maker MZ method of this name.)
objectiveStates
method sourceGame_Quests.prototype.objectiveStates(id)
Objective states for a quest, one per authored objective.
allShownObjectivesDone
method sourceGame_Quests.prototype.allShownObjectivesDone(id)
Whether every objective the player can see is complete (and there is at least one).
rewardsShown
method sourceGame_Quests.prototype.rewardsShown(id)
Reward visibility for a quest, one flag per authored reward.
givenRecord
method sourceGame_Quests.prototype.givenRecord()
Which rewards were given, per quest; a save from before rewards gave anything has none.
tracked
method sourceGame_Quests.prototype.tracked()
Tracked. (Same as the RPG Maker MZ method of this name.)
known
method sourceGame_Quests.prototype.known()
Known quests as data records, in the order they were discovered.
active
method sourceGame_Quests.prototype.active()
Active. (Same as the RPG Maker MZ method of this name.)
completed
method sourceGame_Quests.prototype.completed()
Completed. (Same as the RPG Maker MZ method of this name.)
failed
method sourceGame_Quests.prototype.failed()
Failed. (Same as the RPG Maker MZ method of this name.)