Requirements Manager

The RequirementsManager class is for managing the requirements of active (accepted) quests. You can use this class to update quest requirements.

When a quest is accepted (with Quest.TryAccept), it's automatically added to the requirements manager.

Adding Managed Requirements

Requirements are taken from a Quest.

var quest = QT.GetQuest("MyQuestKey");
RequirementsManager.AddManagedRequirements(quest);

Removing Managed Requirements

RequirementsManager.RemoveManagedRequirements(quest);

Updating Requirements

To update a specific requirement, you need a reference it its key.

Since not all requirements are the same, there are multiple methods to satisfy all requirement types.

Integer Value Requirement

Add Amount

RequirementsManager.AddAmount("MyRequirementKey", 1);

Remove Amount

RequirementsManager.RemoveAmount("MyRequirementKey", 1);

Set Amount

RequirementsManager.SetAmount("MyRequirementKey", 1);

Float Value Requirement

Add Amount

RequirementsManager.AddAmount("MyRequirementKey", 1f);

Remove Amount

RequirementsManager.RemoveAmount("MyRequirementKey", 1f);

Set Amount

RequirementsManager.SetAmount("MyRequirementKey", 1f);

Bool Value Requirement

Set Value

RequirementsManager.SetBool("MyRequirementKey", true);

Events

If you'd like something to happen when requirements are updated, you can try the RequirementsManager.onRequirementsUpdated event.

Last updated