Custom Conditions
If you want to create new effects or conditions, you can create a new script that inherits from ConditionData or EffectData, and override one of the functions.
Conditions
For example, let's create a new condition that checks how many quests have been completed by the player: ConditionQuestCount.cs
The loop will count all the completed quests, then the compare int will compare the amount of completed quest to the operator and value defined in the scriptable object data file. The other function explains which value should be visible in the unity inspector. In our case, a int value, and the int operator (to select between: less, greater, equal, not equal...). You can also define the labels that will appear in the unity inspector.
Data Files
We will now create the data files for the condition we just created.
In Unity, right click inside a folder (the other conditions are in the Resources folder), and select Create -> DialogueQuests -> Conditions, select your new condition, it should be named what you set in the tag [CreateAssetMenu] in your new script.
You can now add conditions to any NarrativeCondition in your dialogues and events.
Other Values
If you want to see the list of possible values that can be displayed in the inspector for effects, open the ConditionData.cs script and you will see all the available functions that can be overriden.
Last updated