phrase_end_emote_msg - ryzom/ryzomcore GitHub Wiki


title: Phrase End Emote Msg description: published: true date: 2023-03-12T20:49:02.356Z tags: editor: markdown dateCreated: 2023-03-12T20:47:29.585Z

phraseEndEmoteMsg

The phraseEndEmoteMsg native AI script function is used to send a custom emote message with parameters through a chat message. The parameters are taken from the parameter stack created by phrasePushValue and phrasePushString functions.

Syntax

phraseEndEmoteMsg(botIndex: s, phraseIdentifier: s) // phraseEndEmoteMsg_fs_

Arguments

  • botIndex (string): The position of the bot in the group. See getBotIndexByName function.
  • phraseIdentifier (string): The identifier phrase as seen in phrase_wk.uxt.

Parameters stack

The function uses the parameter stack created by phrasePushValue and phrasePushString functions.

Example

($playerEid)getCurrentPlayerEid();
($botEid)getCurrentSpeakerEid();

()phrasePushString("player", $playerEid);
()groupOf5Bot.phraseEndEmoteMsg(0, "PHRASE_TOTO1");

()phrasePushString("bot", $botEid);
()groupOf5Bot.phraseEndEmoteMsg(0, "PHRASE_TOTO2");

In this example code, two emote messages are sent using phraseEndEmoteMsg. The first message uses the PHRASE_TOTO1 identifier phrase, which takes a player parameter. The phrasePushString function is used to push the parameter onto the parameter stack. The second message uses the PHRASE_TOTO2 identifier phrase, which takes a bot parameter. Again, phrasePushString is used to push the parameter onto the parameter stack.

Notes

In the phrase_wk.txt, the PHRASE_TOTO1 and PHRASE_TOTO2 must be defined to take either a player or a bot as a parameter, respectively.

PHRASE_TOTO1(player p)
{
	[$p$ is laughing.]
}

PHRASE_TOTO2(bot b)
{
	[$b$ is sad.]
}

The first parameter is not automatically the bot that says the text as phraseEndNpcMsg, because a bot can make a player do an emote text. The emote message must be sent by a bot that has a valid position.

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