phrase_end_npc_msg - ryzom/ryzomcore GitHub Wiki


title: Phrase End NPC Message description: published: true date: 2023-03-12T20:44:08.757Z tags: editor: markdown dateCreated: 2023-03-12T20:16:34.514Z

phraseEndNpcMsg

The phraseEndNpcMsg AI script function is used to send a message with parameters through a bot chat bubble. The parameters are taken from the parameter stack created by phrasePushValue and phrasePushString functions.

Syntax

phraseEndNpcMsg(botIndex: s, sayType: s, phraseIdentifier: s) // phraseEndNpcMsg_fss_

Arguments

  • botIndex (string): The position of the bot in the group. See getBotIndexByName function.
  • sayType (string): The type of the say dialog. Possible values are: "say", "shout", "civilization", "territory", "universe", "arround", "system", and "region".
  • 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

()phrasePushString("literal", "text non traduit");
()groupOf5Bot.phraseEndNpcMsg(4, "say", "PHRASE_TOTO");

In this example code, a string is pushed onto the parameter stack using phrasePushString, and then the phraseEndNpcMsg function is called to send a message through a bot says.

Notes

In the phrase_wk.txt, the PHRASE_TOTO must be defined as follows to take the bot and the literal as parameters.

PHRASE_TOTO(bot b, literal l)
{
	[I am $b$, and the following text is an untranslated literal: $l$]
}

The first parameter is always the bot that says the text and its value is automatically set.

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