phrase_push_value - ryzom/ryzomcore GitHub Wiki


title: Phrase Push Value description: published: true date: 2023-03-12T19:38:21.634Z tags: editor: markdown dateCreated: 2023-03-12T19:38:17.337Z

phrasePushValue

The phrasePushValue native AI script function pushes a value as number on the parameter stack, which is used by ()phraseEndSystemMsg(f, s, s), ()phraseEndNpcMsg(f, s, s), and ()phraseEndSystemMsg(f, s, s) functions.

Syntax

()phrasePushValue(paramType: s, value: f) // phrasePushValue_sf_ 

Arguments

  • paramType (string): The type of the parameter. Valid values are: "money", "integer", "time", "skill", "faction", "power_type", "race", "damage_type", "characteristic", "score", and "body_part".
  • value (float): The value of the parameter.

Examples

()phraseBegin();
()phrasePushValue("money", 15);
()phrasePushValue("integer", 15);
()phrasePushValue("time", 15);
()phraseEndSystemMsg(0, "say", "PHRASE_WITH_3_PARAMETERS");

This example code demonstrates how to use phrasePushValue to push three parameters onto the parameter stack, and then call phraseEndSystemMsg to create a system message with those parameters.

Notes

  • The value must be a number, and only a few types are handled.
  • Some values other than the valid types listed above can be handled if they are the C++ code enum value, but a script function that returns the C++ enum value as int would need to be created.
  • The parameter stack must be cleaned before use with ()phraseBegin().
  • See also ()phrasePushString(s, s), ()phraseEndSystemMsg(f, s, s), ()phraseEndNpcMsg(f, s, s), and ()phraseEndSystemMsg(f, s, s).
⚠️ **GitHub.com Fallback** ⚠️