Editors Note: If anyone has any additional tokens to contribute, plesae do! If you think you can clean this one up or make it more straightforward, go for it!
Functions Documentation
View Function Edit Function
Name plyComposeString
Syntax (plyComposeString player string v1 v2 ... vn) -> composedString
Argument List player: The player.
string: The formatted string.
v1 ... vn: these will replace %1%, %2%, etc. in string in the same manner that the subst function does.
Returns composedString: a string with the proper substitutions made for the
Category player, string operator
Description Takes a string that can include substitution tokens and outputs a string that has appropriate things substituted for those tokens.
(see comment for list of tokens)
Example
(plyComposeString gPlayer (cat "Hey boss! "
"That %man% looks like %Name% %2% by %his% %1%! "
"Should I confront %him%?") "new ship" "standing")


Will return one of following strings depending on the players gender ( ___ is the player's name):

"Hey boss! That man looks like ___ standing by his new ship! Should I confront him?"

"Hey boss! That woman looks like ___ standing by her new ship! Should I confront her?"
Comment KNOWN VALID TOKENS:
Gender Based:
%him% him or her
%sir% sir or ma'am
%his% his or her
%son% son or daughter
%brother% brother or sister
%man% man or woman
Others:
%Name% name of the player
String substitutions (like subst):
%1% %2% %3% %4% ...
%-1% %-2% %-3% %-4% ...
Using %-1% instead of %1%, %-2% instead of %2%, etc. will capitalize the first letter of the strings substituted in.