get_current_speaker_eid - ryzom/ryzomcore GitHub Wiki


title: Get Current Speaker EId description: published: true date: 2023-03-14T13:55:03.288Z tags: editor: markdown dateCreated: 2023-03-12T23:38:47.263Z

getCurrentSpeakerEid

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}

Syntax

(botEidAsString: s)getCurrentSpeakerEid()

Return value

  • botEidAsString (string): The EntityId of the bot as a string.

Example

($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.

See also

⚠️ **GitHub.com Fallback** ⚠️