Adding move event to AI NPC (self)¶
This Add move event to AI NPC (self) assembler allows your configured AI NPC to move when triggered. For example, when the NPC's favor score hits a certain level, the NPC will move within the specified distance.
Prerequisites¶
-
YAHAHA Studio version 0.3.66 or later
-
An AI NPC, created using the Create an AI NPC assembler and placed in the scene Visual Studio Code is installed and integrated with your Studio.
Set up the assembler¶
-
Find the Adding move event to AI NPC (self) assembler from Asset Library and open it in the scene.
-
In the assembler setup window, populate its basic settings:
a Set the AI NPC to trigger the event: Choose an AI NPC in the scene to trigger the move event (self). In our example, we select the AI NPC we created, Mio.
b Select the coordinate of movement: Set the coordinate offset for the NPC to move, with the NPC's position as the origin point (0,0,0).c Select the trigger event: Choose one of the following events as a trigger event for the move event (self):- Emotion 1-10 represents the AI NPC's favor score, ranging from 10% to 100%. It reflects the NPC's contentment level, with 10 being the least content and 100 being the most content.
- Chat Win indicates that the player wins the chat interaction with the AI NPC.
- Chat Lose indicates when the player loses the chat interaction with the AI NPC.
d Set the triggered event name: Enter a name for the triggered event. For example, if you set the trigger to Emotion 4 and the event to Move, the NPC will move when the favor score reaches 40%.
-
Click Assemble to start assembling this assembler. Once done, you can modify their properties in the Properties window.
Edit event-related properties¶
In the AI NPC's Properties window, you can customize the movement speed, move speed, waypoints, looping mode, trigger conditions, and more event-related properties according to your requirements.
In the NPC move pane, you can modify the rotation settings. For more information, see NPC move.
To edit the trigger event, update the properties located in the corresponding AiGameEventRelay pane. For more information on this component, see AiGameEventRelay.