phrase_push_string - ryzom/ryzomcore GitHub Wiki


title: Phrase Push String description: published: true date: 2023-03-12T19:58:42.501Z tags: editor: markdown dateCreated: 2023-03-12T19:53:50.411Z

phrasePushString

The phrasePushString AI script function is used to push a value as a string on the parameter stack used by the ()phraseEndSystemMsg(f, s, s), ()phraseEndNpcMsg(f, s, s), and ()phraseEndSystemMsg(f, s, s) functions.

The value must be a string, which can be internally converted to a number, sheetId, or entityId when needed. The following input types are accepted:

  • Number: money, integer, and time
  • String literal: literal
  • EntityId: player, bot, and entity
  • SheetId name: item, outpost, creature_model, creature, sphrase, and sbrick
  • String identifier: place, event_faction, title, and bot_name
  • StringId (number): dyn_string_id and string_id
  • Enum value: skill, faction, power_type, race, damage_type, characteristic, score, and body_part

Other enum types can be handled as well, but must be passed as their C++ integer value. If the input value is not one of the above enum types, the leveldesigner must ask a coder to create a scripting function that takes a string containing the enum value (e.g. "matis") and returns the C++ enum value as an integer (e.g. 4).

Syntax

phrasePushString(paramType: s, value: s) // phrasePushString_ss_

Arguments

  • paramType (string): The type of the parameter.
  • value (string): The value of the parameter.

Examples

($playerEid)getCurrentPlayerEid();
($botEid)group3.getBotEid(4);
()phraseBegin();
()phrasePushValue("integer", 15);
()phrasePushString("integer", "15");
()phrasePushString("literal", "Test 123");
()phrasePushString("player", $playerEid);
()phrasePushString("bot", $botEid);
()phrasePushString("item", "abc.sitem");
()phrasePushString("sbrick", "toto.sbrick");
()phrasePushString("creature_model", "toto.creature");
()phraseEndSystemMsg(0, "say", "PHRASE_WITH_SOME_PARAMETERS");

In this example code, the phraseBegin function is called to clear the parameter stack, and then several values are pushed onto the stack using phrasePushValue and phrasePushString. Finally, the phraseEndSystemMsg function is called to end the system message with the specified parameters.

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