Quest Conditions
v4.0
Last updated
v4.0
Last updated
Quest Conditions are the things that must be (i.e. must be true, or must be false), for a Quest Step to be marked a success or failure -- which in turn marks a Quest as successful or a failure.
There are many types of Quest Conditions, and you can also create your own, which is very useful when you have unique mechanics in your game which may be part of a condition comparison.
Quest Condition scripts all inherit from QuestCondition
, but have unique methods based on the comparison they are evaluating.
Many things can be checked using the included Quest Conditions. For example, any quest that requires a comparison to a number -- ANY number -- can use Blackboard Value Number.
You will need to ensure the number you care about is being posted to the MainBlackboard, but once that is the case, quests which utilize that Quest Condition will find it.
See all included Quest Condition scripts: Assets/InfinityPBR/---Game Modules/Quests/Scripts - Quest Conditions/
Navigate to the folder in your project where you wish to store your Quest Condition objects. Right-click in the project view and choose Create/Game Modules/Quest Condition/[Comparison Of Choice]
While the Game Modules ships with many Quest Condition comparison types, and more will likely be added over time, you may want to create your own Quest Conditions. This is very useful when you have unique mechanics and concepts in your project, and you'd like to use those unique things with the Quests module.
While this does require some scripting, it is likely easier than you think!
Create a Custom Quest ConditionKeep in mind Quest Conditions are not themselves a "Success" or "Failure". They are simply a fact that is either true or false. The condition is "met" when the fact is true.
"The King is Dead", an example on the Blackboard Value Bool page, does not specify whether it is a good or bad thing that the king is dead. Simply:
"The condition is met when the bool value of the Blackboard Note with the Topic 'King' and Subject 'Is Dead' is true."
Your Quest may consider this to be a failure -- you let the king die -- or a success -- you successfully killed the king. Entirely up to you and your game.
All Quest Condition objects will have this section, specifying the Blackboard Note "Topic" and "Subject" which will contain the data the condition cares about. When querying whether the condition has been met, these are the values the Quest Condition will look for on the MainBlackboard
.
When true, the "Topic" will be the value of GameId()
for the object which owns this quest. This is useful when you don't know what the Topic
will be -- such as situations where the Actor is not known at edit time, perhaps because the actor is an enemy or other NPC.
When true, the "Subject" we will be looking for will be a combination of the Quest Name and Quest Step Name, in this format: "Quest Name-Quest Step Name".
(Note, if there are spaces in the names, they will be included in this string. The dash between each section does not contain spaces before or after it.)
This is useful when you don't know which Quest or Quest Step the Quest Condition will be included in, but need to get information out of that Quest/Step.
In some cases, the data will be automatically populated, or could be so as an option, such as with Stat
values. In other cases, you will need to post notes to the Blackboard through the normal course of your game.
Most likely you'd post a Blackboard Note to MainBlackboard
for "King" "Is Dead" with the bool
value true
when the king has died.