quest_completed(quest:Dictionary)
- Emitted when a quest is complete, returns the quest dictionaryquest_failed(quest:Dictionary)
- Emittied when a quest was failedstep_complete(step:Dictionary)
- Emitted when a step is complete returns the step dictionarynext_step(step:Dictionary)
- Emits the new step after the previous step was completedstep_updated(step:Dictionary)
- Emitted when a step is updated returns the step dictionarynew_quest_added(quest_name:String)
- Emitted when a quest is added to player quests, returns quest_namequest_reset(quest_name:String)
- Emitted when a quest was reset returns quest name
The 7 types of quest steps currently.
active_quest :String= ""
- Helper variable to assign a quest namecurrent_resource:QuestResource
-current loaded resourceplayer_quests :Dictionary= {}
- all player questscounter :float= 0.0
-counter for tracking time
Passing in a Quest Resource and a Quest name it will add that quest to the player quests by its quest_id
A Quest
has various properties such as:
quest_name
- The name of the added quest.quest_details
- The details of the quest.quest_id
- A id assigned to the quest.completed
- Boolean stating if quest is complete.failed
- Boolean stating if quest was failed.group
- The group that the quest is in.next_id
- The current steps id this value gets updated each stepsteps
- A Dictionary of Steps as Dictionaries containing one or more of the following:action_step
- This step requires an action to be completed.id
- The ID of this stepdetails
- Details for this stepstep_type
- The type of step i.eaction_step
next_id
- The next steps id after this step.complete
- boolean stating if step is completedmeta_data
- A dictionary containing stored meta data for this step
incremental_step
- This step requires an amount of an item to be collected.id
- The ID of this stepdetails
- Details for this stepitem_name
- Name of item to collectstep_type
- The type of step i.eincremental_step
collected
- integer of total items collectedrequired
- integer of total items requirednext_id
- The next steps id after this step.complete
- boolean stating if step is completedmeta_data
- A dictionary containing stored meta data for this step
items_step
- This step requires a unique set of actions/items to be completed/collectedid
- The ID of this stepdetails
- Details for this stepstep_type
- The type of step i.eitems_step
item_list
- An Array of Dictionaries of actions/items requiredname
- name of itemcomplete
- boolean stating if item was collected/complete
next_id
- The next steps id after this step.complete
- boolean stating if step is completedmeta_data
- A dictionary containing stored meta data for this step
timer_step
- This step tracks time and can serve both as a timer or a stop watchid
- The ID of this stepdetails
- Details for this stepstep_type
- The type of step i.etimer_step
.time
- The time remaining or time elapsed in seconds.total_time
- the total time set in secondstime_minutes
- The total minutes set in the editor.time_seconds
- The total seconds set in the Editor.is_count_down
- boolean stating if Time counts down or count up.fail_on_timeout
- boolean stating if quest fails on timeout if not step becomes complete.next_id
- The next steps id after this step.complete
- boolean stating if step is completedmeta_data
- A dictionary containing stored meta data for this step
callable_step
- This step calls a function on an autoloaded script then immediately goes to the next step.id
- The ID of this stepcallable
-The function that will be called ieQuestManager.testfunc
step_type
-The type of this step i.efunction_call_step
details
- Details for this step. Not used copy ofcallable
params
- An array of data to be passed to the callable.next_id
- The next steps id after this step.complete
-boolean stating if step was complete
branch_step
- This step is similar to an action step but optionally branches to alternate stepsid
- The ID of this stepstep_type
- The type of this step i.ebranch_step
details
- Details for this stepbranch
- Boolean stating if this step should branch default tofalse
next_id
- The next steps id after this step.complete
- Boolean stating if step was completebranch_step_id
- The id of the alternate step for branchingmeta_data
- A dictionary containing stored meta data for this step
end
- The End of a questid
- The ID of the stepdetails
- Details of this step. Not used contains 'Complete'
meta_data
- A dictionary containing stored meta data for the quest -key
- name of variable -value
- Variant type of valueint,float,string,boolean,vec2,vec3
Sets the current quest resource
Get a quest that the player has accepted is_id
optional to get the quest by id
Get all the current quests the player has
Returns all player quests names as an array
If the current step is a branch set it branch to alternate step.
func progress_quest_by_name(quest_name:String, item_name:String="", quantity:int=1, collected:bool=true)->void
Progress a quest using its name. This function pulls the id for the quest then uses it to progress_quest below function
progress_quest(quest_id:String,step_id:String,item_name:String="",amount:int=1,collected:bool=true) -> void
Progresses a quest to its next step if it was an action step updates other steps and progresses to next step if all requirements for that step are met. Completes quest if it was at its last step.
quest_id
- id of the quest to progressstep_id
- id of the current step you want to progressitem_name
- Name of an item to collect/complete.amount
- Amount to incrementincremental_steps
. 1 by defaultcollected
- set ifitem_name
was collected default true if not set
Called by the Engine and updates the time of any quest that is currently at a timer_step
Get the id of the quest quest_name
Returns all the quest stored in the current_resource. optionally get only the quests in the specified group
Add quest to player_quest from current dictionary
Add a ScriptQuest to player_quests.
Returns a quest from the current_resource
Returns if the player has this quest quest_name
. Optionally pass if quest_name is an id using is_id
Returns if the player has completed this quest quest_name
Returns if the player has failed this quest quest_name
Returns a dictionary of the current quest step of this quest quest_name
Removes quest from player_quests quest_name
Completes quest quest_name
Used by quest manager to call a function from a callable_step
Return the meta data Dictionary of the quest quest_name
Create new or Change meta data of the quest quest_name
Fails the quest quest_name
Returns all quests that have not been completed or failed
Resets the quest quest_name
Wipes the entire player_quests dictionary useful for starting a name game for example.
Test function that prints "Hello Quest Manager" plus passed array