Difference between revisions of "Quest Documentation"
(→Quest Giver) |
(→Quest Table) |
||
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
back to [[Project Phoenix#Quests]] | back to [[Project Phoenix#Quests]] | ||
+ | ==Files== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! File Name !! Description | ||
+ | |- | ||
+ | | scripts/quest_giver.lua || contains all the functioning for the quest giver and handling of player interaction | ||
+ | |- | ||
+ | | scripts/quest_giver_initializer.lua || initialization of the xml template data for the quest giver | ||
+ | |- | ||
+ | | scripts/quest_helpers || Core functions for the quest system | ||
+ | |- | ||
+ | | scripts/quest_information || Quest table definitions | ||
+ | |- | ||
+ | | scripts/quest_npc_dialog_window || Quest dynamic window and quest log dynamic window | ||
+ | |- | ||
+ | | scripts/globals/include_custom_quests || Setup for quest table for global usage | ||
+ | |} | ||
+ | |||
==Functions== | ==Functions== | ||
CustomQuests.Helpers.<FunctionName>(Args) | CustomQuests.Helpers.<FunctionName>(Args) | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! Function Name !! Description | + | ! Function Name !! Arguments !! Description |
|- | |- | ||
− | | AddSlayTask|| Adds a slay task to the quest table | + | | AddSlayTask|| template,amount,objvarneeded,killname ||Adds a slay task to the quest table |
|- | |- | ||
− | | AddHarvestTask || Adds a harvest task to the quest table | + | | AddHarvestTask|| template,amount,objvarneeded,collectname || Adds a harvest task to the quest table |
|- | |- | ||
− | | AddCraftTask || Adds a craft quest to the quest table | + | | AddCraftTask|| template,amount,resourceneeded,collectname || Adds a craft quest to the quest table |
|- | |- | ||
− | | AddTameTask || Adds a tame quest to the quest table | + | | AddTameTask|| template,amount,objvarneeded,collectname || Adds a tame quest to the quest table |
|- | |- | ||
− | | CanGetQuest || Checks to see if the player can get the quest | + | | CanGetQuest|| player,questgiver,questname || Checks to see if the player can get the quest |
|- | |- | ||
− | | HasQuest || Checks to see if the player has the quest | + | | HasQuest|| player,questname || Checks to see if the player has the quest |
|- | |- | ||
− | | GiveQuest || Give the player a quest and toss it in the quest log | + | | GiveQuest|| player,questname || Give the player a quest and toss it in the quest log |
|- | |- | ||
− | | RemoveQuest || Remove a quest by name from the player | + | | RemoveQuest|| player,questname || Remove a quest by name from the player |
|- | |- | ||
− | | IsQuestComplete || Checks if the quest tasks are completed or not | + | | IsQuestComplete|| player,questname || Checks if the quest tasks are completed or not |
|- | |- | ||
− | | CheckQuestObjectives || Checks to see if the player completed a part of the objective | + | | CheckQuestObjectives|| player,object || Checks to see if the player completed a part of the objective |
|- | |- | ||
− | | CheckDelay|| Checks to see if the player an pick the quest up again (daily,hourly) or what other interval | + | | CheckDelay|| player,quest || Checks to see if the player an pick the quest up again (daily,hourly) or what other interval |
|} | |} | ||
+ | |||
==Quest Giver== | ==Quest Giver== | ||
The quest system has a few limitations as of now but can be fixed either by me later when I get around to it, or feel free to do it yourself in your own methods<BR><BR> | The quest system has a few limitations as of now but can be fixed either by me later when I get around to it, or feel free to do it yourself in your own methods<BR><BR> | ||
Line 35: | Line 54: | ||
===Template=== | ===Template=== | ||
+ | Below is a list of object variables that are important and not just standard in a npc template. | ||
====Object Variables==== | ====Object Variables==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Object Variable !! Type !! Description | ||
+ | |- | ||
+ | | Quests_WindowStyle || string || support for custom quest window look | ||
+ | |- | ||
+ | | Dialogs_Intro || string || the string that appears in the initial window when you first talk to the npc. | ||
+ | |} | ||
====Initializer==== | ====Initializer==== | ||
+ | file: scripts/quest_giver_initializer.lua<br> | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Initializer Variable !! Description | ||
+ | |- | ||
+ | | QuestsToOffer || A string list of table names from the quest_information.lua file | ||
+ | |- | ||
+ | | Equipment || General npc equipment initialization. | ||
+ | |} | ||
==Quest Table== | ==Quest Table== | ||
− | = | + | file: scripts/quest_information.lua<br> |
− | + | CustomQuests.Quests.questtablename | |
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Table Variable !! Description | ||
+ | |- | ||
+ | | Title|| Quest Title Name | ||
+ | |- | ||
+ | | Description|| Quest Description | ||
+ | |- | ||
+ | | QuestCompletedMessage|| Quest completed message | ||
+ | |- | ||
+ | | Delay|| delay in seconds until the player can get quest again | ||
+ | |- | ||
+ | | Tasks|| table of tasks the player must complete (4 max)(ui size) | ||
+ | |- | ||
+ | | Rewards|| table of rewards the player earns for completing the quest | ||
+ | |- | ||
+ | | Requirements|| a Check(player,quest_npc,quest) to see if the player can pick the quest up. | ||
+ | |} |
Latest revision as of 13:37, 20 June 2018
back to Project Phoenix#Quests
Contents
Files
File Name | Description |
---|---|
scripts/quest_giver.lua | contains all the functioning for the quest giver and handling of player interaction |
scripts/quest_giver_initializer.lua | initialization of the xml template data for the quest giver |
scripts/quest_helpers | Core functions for the quest system |
scripts/quest_information | Quest table definitions |
scripts/quest_npc_dialog_window | Quest dynamic window and quest log dynamic window |
scripts/globals/include_custom_quests | Setup for quest table for global usage |
Functions
CustomQuests.Helpers.<FunctionName>(Args)
Function Name | Arguments | Description |
---|---|---|
AddSlayTask | template,amount,objvarneeded,killname | Adds a slay task to the quest table |
AddHarvestTask | template,amount,objvarneeded,collectname | Adds a harvest task to the quest table |
AddCraftTask | template,amount,resourceneeded,collectname | Adds a craft quest to the quest table |
AddTameTask | template,amount,objvarneeded,collectname | Adds a tame quest to the quest table |
CanGetQuest | player,questgiver,questname | Checks to see if the player can get the quest |
HasQuest | player,questname | Checks to see if the player has the quest |
GiveQuest | player,questname | Give the player a quest and toss it in the quest log |
RemoveQuest | player,questname | Remove a quest by name from the player |
IsQuestComplete | player,questname | Checks if the quest tasks are completed or not |
CheckQuestObjectives | player,object | Checks to see if the player completed a part of the objective |
CheckDelay | player,quest | Checks to see if the player an pick the quest up again (daily,hourly) or what other interval |
Quest Giver
The quest system has a few limitations as of now but can be fixed either by me later when I get around to it, or feel free to do it yourself in your own methods
- You can only display 3 quest choices on any NPC due to user interface size.
- All quests can be repeated, you are given a Delay value.
Template
Below is a list of object variables that are important and not just standard in a npc template.
Object Variables
Object Variable | Type | Description |
---|---|---|
Quests_WindowStyle | string | support for custom quest window look |
Dialogs_Intro | string | the string that appears in the initial window when you first talk to the npc. |
Initializer
file: scripts/quest_giver_initializer.lua
Initializer Variable | Description |
---|---|
QuestsToOffer | A string list of table names from the quest_information.lua file |
Equipment | General npc equipment initialization. |
Quest Table
file: scripts/quest_information.lua
CustomQuests.Quests.questtablename
Table Variable | Description |
---|---|
Title | Quest Title Name |
Description | Quest Description |
QuestCompletedMessage | Quest completed message |
Delay | delay in seconds until the player can get quest again |
Tasks | table of tasks the player must complete (4 max)(ui size) |
Rewards | table of rewards the player earns for completing the quest |
Requirements | a Check(player,quest_npc,quest) to see if the player can pick the quest up. |