Push the Button

This demo quest requires the player to walk through three colorful cubes -- red, green, blue -- which unlocks the "Lucky Treasure".

Quest Details

In the Demo Scene, there's a big red cube. When the player walks into the cube, it disappears, and a green cube appears. Walking into that makes it disappear and a blue cube appear. Finally, walking into the blue cube makes it disappear, and also completes a Quest.

View the Quest object in the Inspector: Assets/InfinityPBR/---Game Modules/_Demo Files/Demo Files - Quests/Demo - Group Quests

The Quest is called "Push the Buttons". In the Inspector, we can see that the Quest will Subscribe to Blackboard. This is required for a quest to auto complete or fail, as it will use the Blackboard to get the data it needs to know whether Quest Conditions have been met.

Sequential Steps is also true, which means the Quest Steps will be checked only if the prior steps have been completed successfully. Otherwise, all Quest Steps will be checked for success or failure at all times, and can be completed in any order.

Auto Succeed is also marked true. This means the system will automatically check if the Quest succeeds or fails. In this demo, there are no failure conditions, so the Auto Fail option has no impact.

Completion

In the demo scene, the "Lucky Treasure" button starts out red, and is locked. Clicking the button will show a Debug.Log indicating the treasure is locked. View the "Lucky Treasure Box" object in the Inspector to see action for the UI Button, and the DemoQuestLockedBox.cs component.

This script controls the logic for the box, and is also the receiver for QuestEvent objects.

Inheriting from QuestFollower provides the basic plumbing required, but Quest DemoLockBox.cs has the specific logic for its own purposes.

DemoQuestLockedBox.cs inherits from QuestFollower, which is a script you can use in your own project. QuestFollower implements IFollowQuests and has all the needed methods for doing so.

You can override the Receive() method to run your own logic depending on the use case in your project.

Last updated

Was this helpful?