Pokémon SDK Wiki
Credits

Managing Quests

This page is about managing quests, not creating them. To learn how to create quests go here.

In PSDK you manage quests through $quests. All the methods are explained in the documentation : PFM::Quests.

We'll see how to use this variable

1st Step : Start Quests

To start a quest, call $quests.start(id) where id is the id of the quest in Ruby Host.

Once $quests.start(id) was called you need to tell the System to check started quests:

$quests.check_up_signal

This method checks the quest from start to finish. It also shows the quest name in the screen.

Quest informer
Starting a new quest

2nd step : Validate the Goal

There are various methods to validate goals:

The other objectives are automatically validated by PSDK.

You should call $quests.check_up_signal at the end of the event that validates the goals.

2nd Step Continued : Showing a Hidden Goal

To show a hidden goal call:

$quests.show_goal(quest_id, goal_index)

The parameters are:

You should only hide the "Speak to an NPC" objectives!

3rd Step: Check If the Quest Is Finished and Give the Reward

To finish a quest you have two things to do, check if all the goals are done & distribute the reward.

If you don't distribute the reward, the quest book will not consider the quest as finished.

Check If All the Goals Are Done

To check if all the goals are done, write the following line in a condition:

$quests.finished?(quest_id)

Check If the Rewards Were Distributed

To check if the rewards were distributed write this line in a condition:

$quests.earnings_got?(quest_id)

To distribute them use the following command:

$quests.get_earnings(quest_id)

It's recommanded to check if the quest is finished before checking if the rewards were distributed.