> For the complete documentation index, see [llms.txt](https://docs.otherside.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otherside.xyz/odk-docs/odk-plugin/npcs/npc-stations.md).

# NPC Stations

{% hint style="warning" %}
This feature will only be available from ODK v10 onwards.

It is an experimental system, and is likely to change over the course of subsequent updates
{% endhint %}

{% hint style="info" %}
NOTE: Uses Unreal's Smart Objects system. For more information on this, see: <https://dev.epicgames.com/documentation/unreal-engine/smart-objects-in-unreal-engine---overview?application_version=5.5>
{% endhint %}

Using the [NPCs](/odk-docs/odk-plugin/npcs.md)system, we have a specific type of spawner: `BP_ODK_NPCSpawner_StationUser`.

NPCs spawned from this spawner run the `BT_ODK_UseStations` behavior: They look around for available `BP_ODK_NPCStation` actors, move to them, and perform the associated action.

## Configuring your station spawner

Each station spawner is a basic NPC spawner, with a few additions:

* `SpecificStations`: If entries are provided in this list, NPCs spawned from this spawner will only consider the stations in this list as viable stations to navigate to.

  <figure><img src="/files/TL7KBa1d1yDbfWVQf4rd" alt=""><figcaption></figcaption></figure>
* `StationSearchRange`: If there are no specific stations, stations will be found using this. Any stations within the range will be viable stations to navigate to.

  <figure><img src="/files/q6N1sp2FGKeUWpKpNdD8" alt=""><figcaption></figcaption></figure>

### Advanced: Station filter

<figure><img src="/files/5jmU3kyakabCOYTBpZM2" alt=""><figcaption><p>An example station filter: The stations' NPCs will be considered <code>TypeA</code>, and search only for stations that are <code>Restricted</code> or <code>Restricted2</code></p></figcaption></figure>

When searching for smart object slots, using either of the above approaches, it is possible to add `SmartObjectRequestFilter` details to it. With this you can e.g.

* Provide `UserTags` to represent NPCs in this station. In your stations' Smart Object Definitions, you can add a `UserTagFilter` to only accept NPCs that have the required tags.
* Provide `ActivityRequirements`. These are effectively the inverse of the above - the NPCs will only accept stations/slots that have the required `ActivityTags`

  <figure><img src="/files/FJvmwrVkDCZU5T4dOfzk" alt=""><figcaption><p>Example details within a Smart Object Definition. This smart object is a <code>Restricted</code> type, and only accepts users (NPCs from a station) that has <code>TypeB</code> as one of its <code>UserTags</code>.</p></figcaption></figure>

## Configuring your stations

Each station extends `BP_ODK_NPCStation`, and can be placed in the world. This will be the target that NPCs will move to.

* `SmartObjectDefinition` controls the behavior that NPCs will perform upon reaching the target, along with other properties. By default we have the `SOD_ODK_NPCStation_Blank` definition, which means the NPC will not do anything upon reaching the target - they will immediately move on to the next target (for randomly walking)
* `RequiresMatchingRotation` is a tickbox that can be used to control whether NPCs need to match the rotation of the station's slot before running the action, or not

  <figure><img src="/files/g02zNOz6mWUlfwao9VhJ" alt=""><figcaption></figcaption></figure>
* `MoveToSpeed` lets you control whether NPCs will walk, jog or run to the target.

(If you use a smart object definition with multiple slots, each slot is a viable "target" for NPCs to move to and interact with)

<figure><img src="/files/7FCfEXhGPvGnpYuFNSp4" alt=""><figcaption></figcaption></figure>

### Smart Object Behaviors

Each station is a Smart Object, with a Smart Object Definition. The behavior definition within a smart object definition controls what behavior runs when interacting with the object.

The most common usage is to add an entry to your `DefaultBehaviorDefinitions`: Add a `GameplayBehaviorSmartObjectBehaviorDefinition`, and a `GameplayBehaviorConfig` within that. You can make and provide your own `BehaviorClass`, where you can add your custom logic.

* As an example, see `GameplayBehavior_ODK_PlayMontage`: This handles playing a montage, getting some additional relevant information from the station.
  * The event to implement is `Event OnTriggeredCharacter`. When finished, pass or fail, call `EndBehavior` to move on.

{% hint style="info" %}
NOTE: One of the existing gameplay behavior config classes is `GameplayBehaviorConfigBehaviorTree` (instead of a regular `GameplayBehaviorConfig`). This has not been verified to work with our current setup, so is not recommended.
{% endhint %}

<figure><img src="/files/GWDjgucuyA7XcJGIEHbX" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
NOTE: Each Smart Object Definition must have at least one slot. This can be the blank "None" slot created if you click the `+` button:

<img src="/files/L1imIndjuHgqhUBKrrJk" alt="" data-size="original">
{% endhint %}

### Montage Stations

These are a specialised form of station, pre-made for convenience. They are set to use the `SOD_ODK_NPCStation_PlayMontage` smart object definition, which will play the configured `MontageName` upon interacting with the station.

(If a `MaxPlayDuration` is provided, then the montage will only play for at most that duration. This avoids NPCs looping forever if they play a looping montage)

<figure><img src="/files/0RMU8o9yruf0leq26zJt" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.otherside.xyz/odk-docs/odk-plugin/npcs/npc-stations.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
