get_current_speaker_eid - ryzom/ryzomcore GitHub Wiki
title: Get Current Speaker EId description: published: true date: 2023-03-16T23:07:12.053Z tags: editor: markdown dateCreated: 2023-03-16T22:23:49.034Z
The getCurrentSpeakerEid native AI script function gets the EntityId of the bot at which the player is clicking at.
This function is only valid when called from a
player_target_npc
event. {.is-warning}
(botEidAsString: s)getCurrentSpeakerEid()
- botEidAsString (string): The EntityId of the bot as a string.
($botEid)getCurrentSpeakerEid();
($playerEid)getCurrentPlayerEid();
phrasePushString("player", $playerEid);
phrasePushString("bot", $botEid);
(index)getBotIndex($botEid);
phraseEndEmotMsg(index, "EMOT_PLAYER_INSULT_BOT");
This example code gets the EntityId of the bot clicked by the player and uses it in a chat message.
-
getCurrentPlayerEid
: Returns the Entity ID of the player that is clicking on a bot.