If you have a new project, you can simply connect a ready-made character in your project! To do this, go to: //Project Settings/Maps & Mode/Default GameMode/ Here just select BP_GameMode and you will have a customized character.
Connecting your character
To connect the system to your character, simply add a component to the character BP_QuestComponent. The system is fully connected and ready to work!
Creating a new task
To create a new task, you need to create a child class from BP_MasterQuest. In the created task, you need to fill in the structure Quest Info and then, in the editor window, build the very structure of the task using the functions of the system. For example, 2 tasks have already been created in the asset BP_Quest_01, BP_Quest_02 which you can quickly get used to. Here is an example of creating a new task.
The task should require the player to visit 2 places in turn and then interact with the NPC.
Create a class - Creating a task BP_Quest_01 as a child of BP_MasterQuest and open it.
Adding a description - To the array Quest Stage let's add 3 cells of the stages of the task. The first stage will require the player to visit 2 places in turn. Inside the stage slot, we add 2 task slots Task Goal. We enter the names of each task and set the default values:
Update to update a stage task.
Show to display information on the screen. Also, for example, we make a description in step 2 and 3.
Updating a task - Adding an event to the graph Event Update Quest with switch and function Get Stage Current after that, we implement the code of each stage.
Stage 0 it has an input design for updating each task by number. Using a macro The Only Launch so that the task is updated only 1 time. We create a trigger with the required ID and delete it on the trigger event and run the next similar task after completing which we start updating the next stage and move on to the next stage.
Stage 1 also, when updating 1 time, creates an item in the world and uses its interaction event. After which the transition to the next stage is performed.
Stage 2 created simply for a separate description of the completed task and the transfer of the task to the completed status.
Completing a task - Adding an event to the graph Event End in order to display a message that the task has been completed. Here you can also give the player a reward
Quit the task - Also, in case the task is thrown, we add an event to the graph Event Trow and we remove the triggers of the task.
You can start the created task with the function Start Quest in which you need to specify the task class. Also attached is a video showing the implementation of this task
Creating a task with a limited time to complete
Functions
Trigger Functions:
Add Trigger Hit - Creates a simple touch trigger and assigns the specified ID to it
Add Trigger Overlap - Creates a trigger that can track the entry, exit of the player from the zone and assigns him the specified ID
Get Trigger by ID - Allows you to get a link to a trigger by its ID
Destroy Trigger - Destroys the trigger with the specified ID
Task launch functions:
Start Quest - Starts the specified task
Start Quests - Runs all specified tasks
Task completion functions:
Finish Quest (Self) - Finishes the task with the selected status
Quest End - The event that will be triggered when the task is completed
Trow Quest - Allows you to quit the specified task
Update - Starts updating the current task and player widgets
Task update functions:
Update Quest - The event that triggers the task update
Get Stage (Current) - The function outputs the number of the current stage of the task being performed
Update Task Goal - A macro that causes each task to be updated in a stage
Update - A function that causes the update of the task and the player interface
Task management functions:
is Current Level Equal - A macro that allows you to limit the execution of a branch at different levels
The Only Launch - A macro that blocks the re-execution of a branch
Next Stage - Performs the transition to the next or specified stage of the task, marking the current stage as completed
Next Task - Performs the transition to the next or specified task in the current stage, marking the current task completed
Get Quest Class - Outputs the class of the current task
Get Quest Status Info - A function that allows you to get all the information about the task, stages and tasks
Get Quest Status Info - A macro that performs the same function but also contains a branching on the verification of obtaining information
Get Quest Status Completion - A function that allows you to find out the status of the specified task
is Quest Status Equal - A macro that checks whether the task status is equal to the specified one
Checking Quantity in Task - A function that checks if enough items are collected to complete the task
Set Task Info - A function that allows you to manage the task settings in the task
Task Information Management functions:
Set/Quest Info - A category of special functions that allow you to change all the information about the quest
Set/Stage Info - A category of special functions that allow you to change all the information about the stages
Set/Task Info - A category of special functions that allow you to change all information about tasks
Functions for saving and loading:
Get All Quest (Save Game) - A function that transmits all the information to save the job system
Load All Active Quest (Load Game) - The function that is called to load the task system
Additionally
New Game - In order to select the quests that will be launched at the start of a new game, you need to go to the connected character and select the tasks component to add the necessary tasks to the array Start Quests located in the category New Game