talk_to - ryzom/ryzomcore GitHub Wiki
title: Talk To description: published: true date: 2023-03-16T23:12:29.235Z tags: editor: markdown dateCreated: 2023-03-16T22:30:34.974Z
The talkTo native AI script function adds an entry to the NPC contextual menu allowing a player to talk to the NPC. This function can only be called after the event "player_target_npc".
After the player talks to the NPC, two user events are triggered on the NPC group:
-
user_event_1
: triggered each time (see Notes). -
user_event_3
: triggered after the player has talked to the NPC.
This function can only be called after the event "player_target_npc". {.is-warning}
()talkTo(missionText: s, groupToNotify: c)
- missionText (string): The text that will appear in the NPC contextual menu.
- groupToNotify (context): The NPC group that will receive the user events.
An empty give item request is used to send a message to the EGS. This is a trick used to inform the EGS that the player has talked to the NPC, as there is no other way to send such a message to the EGS.
(@groupToNotify)group_name.context();
()talkTo("Mission text", @groupToNotify);
This example code adds an entry to the NPC contextual menu of the group named "group_name" with the text "Mission text", allowing the player to talk to the NPC. The NPC group will receive user events after the player talks to the NPC.