πNPC Stations
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
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
Using the NPCssystem, 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.
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.
Advanced: Station filter

TypeA, and search only for stations that are Restricted or Restricted2When 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
UserTagsto represent NPCs in this station. In your stations' Smart Object Definitions, you can add aUserTagFilterto 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 requiredActivityTags
Example details within a Smart Object Definition. This smart object is a Restrictedtype, and only accepts users (NPCs from a station) that hasTypeBas one of itsUserTags.
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.
SmartObjectDefinitioncontrols the behavior that NPCs will perform upon reaching the target, along with other properties. By default we have theSOD_ODK_NPCStation_Blankdefinition, which means the NPC will not do anything upon reaching the target - they will immediately move on to the next target (for randomly walking)RequiresMatchingRotationis 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
MoveToSpeedlets 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)

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, callEndBehaviorto move on.
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.

NOTE: Each Smart Object Definition must have at least one slot. This can be the blank "None" slot created if you click the + button:

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)

Last updated

