Skip to Content
AwakenUnreal pluginRegister NPCs in Blueprint

Register NPCs in Blueprint

You can list an NPC in the Awaken views without writing C++. Add the Awaken Npc component to the actor for the common case, or call the Awaken Debug Subsystem nodes for an NPC that has no actor.

The project still has to be a C++ project, because the plugin is built from source with it. See Install into a project.

With the Awaken Npc component

This is the shortest route. The component registers its actor when play begins and removes it when play ends.

Add the component

Open the actor’s Blueprint. Choose Add, then Awaken Npc.

Set the first state

Select the component. In the Details panel, under Awaken, set:

PropertyUse
Npc IdA stable id. Empty: the actor’s object name.
Display NameThe name shown in the views. Empty: the actor’s label.
StatusA short state, such as Idle.
GoalThe goal the NPC is working on now.
GoalsThe goal list, most important first.
BlackboardKeys and text values.
Tree JsonA behaviour tree snapshot: any JSON object.

Update it as the NPC changes

In the event graph, drag from the component and call its nodes:

NodeUse
Set StatusChange the status.
Set GoalChange the current goal.
Set GoalsReplace the goal list.
Set Blackboard ValueSet a key to a text value.
Set Blackboard NumberSet a key to a number. It is published as a number, not as text.
Remove Blackboard KeyRemove a key.
Set Tree JsonReplace the tree snapshot. Returns false and keeps the previous snapshot when the text is not a JSON object.
Push AllSend every property to the subsystem again.
Get Registered IdThe id the component registered under. Empty before play begins.

With the subsystem nodes

Use the subsystem for something that has no actor, such as a squad or an encounter director, or when you want to register an actor without adding a component.

Get the subsystem

In a graph, add the Awaken Debug Subsystem node.

Register

Call Register Npc with an id and a display name. Or call Register Actor with the actor; it returns the id.

Report state

Call the setters with that id. They are the same functions as in C++:

GroupNodes
Who and whatSet Npc Name, Set Npc Status, Set Npc Goal, Set Npc Goals, Set Npc Position
BlackboardSet Blackboard Value, Set Blackboard Number, Set Blackboard Bool, Remove Blackboard Key, Clear Blackboard
TreeSet Npc Tree Json
ReadingGet Npc Ids, Get Npc Count, Is Registered, Get Actor Npc Id, Get Npc, Describe Npcs
HUD selectionSelect Npc, Get Selected Npc Id

Every setter returns false when the id is not registered.

Remove

Call Unregister Npc or Unregister Actor. An actor’s NPC is also removed when the actor is destroyed.

The subsystem exists only in game and Play In Editor worlds.

Next steps

Last updated on