Adding move event to AI NPC (other object)¶
This Add move event to AI NPC (other object) assembler allows your AI NPC to trigger another object to move under a certain condition. For example, when the NPC's favor score hits 60%, another object in the scene 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 (other object) 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 (other object). In our example, we select the AI NPC we created, Mio.
b Select the object triggered to move: Choose an object in the scene to move when triggered. It should be different from the selected AI NPC.c Select the coordinate of movement: Set the coordinate offset for the triggered object to move, with its position as the origin point (0,0,0).d Select the trigger event: Choose one of the following events as a trigger event for the move event (other object):- 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.
e Set the triggered event name: Enter a name for the triggered event. For example, if you set the trigger to Emotion 6 and the event to Move, the triggered object will move when the NPC's favor score hits 60%. -
Click Assemble to start assembling this assembler. Once done, you can modify their properties in the Properties window.
Edit event-related properties¶
In the triggered object's Properties window, you can customize the movement positions, looping mode, trigger conditions, and more event-related properties according to your requirements.
In the Behavior move pane, you can modify the move settings, trigger settings, and set the events to emit. To add more waypoints or triggers, click + New. For more information, see Behavior move.
To edit the trigger event, update the properties located in the corresponding AiGameEventRelay pane. For more information on this component, see AiGameEventRelay.