Update Quick Start

Kyle Austad 2024-10-17 11:19:06 -06:00
parent 94630de860
commit ec67737cd3

@ -35,3 +35,19 @@ Once you have a data table created, each row is a unique quest. In the *Row Name
Back in your character pawn, select the quest manager component and find the variable in the details panel called *Quests Data Table* and assign the table you just created/edited to that variable. Also input your starting quest in the *Initialize Quest Component* function.
![](https://git.crabinteractive.com/kyaustad/SimpleLinearQuests/media/branch/main/Media/Docs/4.png)
## Creating Objectives
Lastly, you need something for the player to actually do to progress their objectives. Included in the demo files is a *BP_BaseItem*. It contains two variables so for the quick start guide I will show how to use this item but the functionality can be used at any time by any actor.
![](https://git.crabinteractive.com/kyaustad/SimpleLinearQuests/media/branch/main/Media/Docs/5.png)
If you are implementing this with your own item or NPC simply create these 2 variables. Really you only need the 'QuestsAndObjectives' variable if you aren't deleting the object when it updates an objective. *QuestsAndObjectives* variable is an array of *S_Objectives* structs where you can define the corresponding objective names and how much to update their progress by in the *ObjectiveQuantity* field. The *ObjectiveDescription* field of the struct is unused here.
Drag an instance of *BP_BaseItem* into your world and under the details panel add items to the *QuestsAndObjectives* array to correspond to the objectives you want to update. If you want that instance of *BP_BaseItem* to delete when it updates an objective or not, set *ShouldDeleteOnObjectiveUpdate?* accordingly. True means it will delete.
Now walking launch the game and when your character pawn collides with the instances of *BP_BaseItem* it will check if any of its assigned objective names match the current quests current objective and update accordingly. If you plan to implement the quest updating on a different actor, say during an existing dialogue system interaction or upon pulling a lever, all you have to do is on that different actor have an array of *S_Objectives* structs and assign your objectives to update in there. Then, when you wish to trigger the objective update call two functions: the global function *Get Player Quest Component* and from the returned component from that function, call *Update Current Quest*. On that function pass in your *QuestsAndObjectives* variable to the function and if you wish the triggering actor to be destroyed, pass in a *self* reference into the *Interacted Actor* input on that function.
![](https://git.crabinteractive.com/kyaustad/SimpleLinearQuests/media/branch/main/Media/Docs/6.png)
That's it! Passing an array of objective structs (which can contain only 1 objective if you only need that actor to update a single objective) into the *Update Current Quest* function will update the quests according to the flow and structure set in your *Quests Data Table* assigned on the Player Quest Manager.