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:
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).
phrasePushString(paramType: s, value: s) // phrasePushString_ss_
($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.