👩❤️👨 Reputation system with tags
This tutorial shows how to use the tag system by guiding you through creating a reputation system - using Game of Thrones as an example 😊
Let's create our own reputation system
The idea
As you complete quests, your reputation for that NPC increases - and not just that! Your reputation for the NPCs "house" will also increase. As you gain reputation, you will unlock more quests and better rewards for quests from that house. NPCs from that house will also let you in their homes and give you access to other secret locations.
How to do that
Basically, we will use NotQuests powerful tag system for that, together with a smart combination of actions, conditions and the conversation system.
The tag system
NotQuests tag system allows you to save data per-player. That's it. Sounds simple, but it's super powerful. You can save integers (= numbers), floats/doubles (= numbers with decimal places), strings (= text) and booleans (= true or false) for each player.
With actions, we can modify the tags and with conditions, we can check the tags (& even do math with them or compare them to other variables and tags).
Creating our first tags
We have three NPCs: Jon Snow (ID=0), Arya Stark (ID=1) and Cersei Lannister (ID=2). Jon Snow and Arya Stark belong to House Stark. Cerse Lannister belongs to House Lannister.
First let's create a tag called JonSnowReputation. This tag will store the reputation the player has with Jon Snow. It will be an Integer Tag, as we only need full numbers:
Let's do the same for the other NPCs and houses
Well done!
Creating actions to modify our reputation tags
Now, let's create some actions which increased the houses reputation by 10 and some which will deduct the reputation by 1 (more info on that later):
Now let's create the actual actions which will be run when a player completes a quest for a house. For completing a quest for House Stark, the player should get +10 reputation for house stark and -1 reputation for House Lannister (as they don't like seeing you support their rivals):
With this 'Action' action, we can create one action which executes two other actions at the same time. Let's do the same for House Lannister:
Actual actions which will be added to the NPCs: More action nesting
But we also want the NPCs individual reputation to increase if you complete a quest for them, don't we? Let's create the final actions for that. First the actions for the reputation:
And now the actual final actions:
Adding the actions to our quests
Awesome! Now we just need to add these last two actions as a reward to the respective quests. We have already created the quests
Voilà, we're done! Try completing those quests and check how your reputation changes:
Checking your reputation (tags)
Here is an example of house you can check your reputation for house stark:
Let's add some privileges & rewards for our reputation system: Conditions
Example condition which checks if you have at least 50 reputation in house stark - can be used anywhere, for example in Quest requirements, objectives or conditions:
To be continued... I'll write this part up when I have time. Feel free to contribute to this tutorial (or any other tutorials) here: Contribute to the docs.