> For the complete documentation index, see [llms.txt](https://visualonecompany.gitbook.io/storyframeworkdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://visualonecompany.gitbook.io/storyframeworkdocs/core-components/questing/objective-completion-rules.md).

# Objective Completion Rules

Every objective created requires a `Completion Rule` to be defined. This is essentially the logic that will determine when an objective gets completed. Below are the list of completion rules included out-of-the-box:

* **AfterInteractWith\_Object**\
  Will complete an objective after the player interacts with any object that has an `Object ID` corresponding with the ID defined in the `Completion Property` field ("After Interaction" is executed when exiting an inspection, after dialogue with an NPC, etc)
* **GoTo\_Location**\
  Will complete an objective when the player nears the world location set in the `Completion Property` field (tip: A world location can be set here by placing an actor in the scene in the location that you want to require the player to go to > Shift + Right-Click on the "Location" field in the details panel to copy its values > Ctrl + V to paste it into the `Completion Property` field).
* **InventoryItem\_Added**\
  Will complete an objective when an item with an `Object ID` corresponding with the ID set in the `Completion Property` field is added to the players inventory (if an objective with this `Completion Rule` becomes active after the player has already picked up the target item, then this completion logic will check the players inventory first).
* **OnInteractWith\_Object**\
  Will complete an objective when the player interacts with any object that has an `Object ID` corresponding with the ID defined in the `Completion Property` field.
* **StoryTag\_Added**\
  Will complete an objective when the player receives the Story Tag defined in the `Completion Property` field (if an objective with this `Completion Rule` becomes active after the player has already received the target Story Tag, then this completion logic will check if the player already has the target Story Tag first).

<div align="left"><figure><img src="https://2310584459-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuiMQl6UzBr8OnuaoaiWO%2Fuploads%2FeFDKAynJ5pNJ6XZjkOtE%2Fimage.png?alt=media&amp;token=5e1ce2ae-f9c7-488d-b925-7a199a7c27c0" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
Find out more about what **Story Tags** are and how they connect logic between different SF-related systems [here.](https://visualonecompany.gitbook.io/storyframeworkdocs/core-components/referencing-and-general-info.md#story-tags)
{% endhint %}

***

Along-side the existing completion rules that exist, custom rules can also be created. This can be done by duplicating any one of the existing completion rule objects within the content browser (assign it a custom name)

<div align="left"><figure><img src="https://2310584459-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuiMQl6UzBr8OnuaoaiWO%2Fuploads%2FSWIdGiz0MI5ndpmXgEjD%2Fimage.png?alt=media&amp;token=87c0e4d0-1ebc-4398-98ef-cce85fe62c46" alt=""><figcaption><p>Core > Gameplay > Quests > Data > Objects > ObjectiveCompletion</p></figcaption></figure></div>

Open up the blueprint of your newly duplicated object, and remove all of the previous logic from the asset you duplicated the currently opened object from aside from the `Event OnObjectiveActivated` event and the `Call Objective Completed` dispatcher call.\
\
As you would assume, any logic to check when the objective that is using this custom completion rule becomes active would be setup off of the `Event OnObjectiveActivated` event. If its a condition that needs to be repeatedly checked, then I would recommend setting up a slow timer to do so.\
\
When your logic returns true (i.e. the completion rule has been met), execute the `Call Objective Completed` event dispatcher.<br>

<div align="left"><figure><img src="https://2310584459-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuiMQl6UzBr8OnuaoaiWO%2Fuploads%2Fx8vWMgsFPNwKqX9D43a5%2FCustomCompletionLogic.png?alt=media&amp;token=be74d331-955d-4df3-9206-e7d1fe5b0c54" alt=""><figcaption><p>Context Example</p></figcaption></figure></div>

You can also make use of the `Property` variable inside of your custom completion logic object blueprint by searching for "Get Property" in your graph.

<div align="left"><figure><img src="https://2310584459-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuiMQl6UzBr8OnuaoaiWO%2Fuploads%2FIcxU47EjARhb6482PDUb%2FCompletionProperty.png?alt=media&amp;token=eb5ebe3b-a2a3-45e8-b8a2-5abbac20c4bb" alt=""><figcaption></figcaption></figure></div>

This value is set on any objective within the details panel inside of the quest editor. To be specific, the `Completion Property` field.

***
