Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ XR Studio

Interacting with NPC

  • Last UpdatedDec 06, 2023
  • 1 minute read

A player can interact with Non Playing Characters.

Create interactions for NPC

  1. Create an ItemBasic node and call it item_NPCNAME.

  2. When picking the NPC in selection mode the system assumes to pick the item_NPCNAME.Thanks to the loose mesh naming search, the NPC avatar cmesh is recognized as the item one.

  3. With User actions, you can define different interactions with the NPC, such Talk or Give.

  4. The Active and Actionable parameters of user action permit enable you to present different actions according to different situations.

  5. The developer must implement a corresponding behavior to occur when a NPC-related action is triggered.

    For example, Talk might open a multi-option menu to allow the player to decide what to tell the NPC.

Code example

A code example for scripting NPC interaction.

<ItemBasic name="item_NPC_colleague" displayName="Collegue" displayValue="" group="Collegues" userActions="talk">

<patch name="item_NPC_colleague" action.talk.active="true" action.talk.actionable="true" action.talk.hotkey="none" action.talk.text="Talk"/>

</ItemBasic>

<share field="item_NPC_colleague.value" direction="inout" stateZero="true"/>

TitleResults for “How to create a CRG?”Also Available in