I want to bring up a text box in the game that will allow the player to use a custom name . Then I would like to if there is a code to use in between text so that I can see the custom name that was made.
cego.say("Hi my name is ?");
What should I put for "?"
Are you asking how to display the value of the variable containing the custom name, or how to store the custom name into a variable (or both)?
// set name
String buffer = Game.InputBox("What is your name?");
if (!String.IsNullOrEmpty(buffer)) player.Name = buffer;
// display name
cEgo.Say("Hi, my name is %s.", player.Name);
P.S. You might not actually want to use Game.InputBox in your game..but that should give you the general idea of what you want to do. Most likely you'll want to create a custom GUI with a Label control to display the question and a TextBox control for the response..then put the "set name" interactions into the TextBox's Activate event..
Ok, Thanks monkey
You're welcome. You should check out the manual entry on String formatting (http://americangirlscouts.org/agswiki/String_formatting_(manual)) as well..
Any functions that list "..." as the final parameter (namely Display and Character.Say) accept this type of formatting. If it doesn't then you can pass String.Format as the parameter which also accepts formatting (obviously). Custom functions cannot use the "..." method because the function can't read or make use of any of the other data passed as parameters.
quick question, AGS doesn't know what buffer is?
In what context? In my above example I defined "buffer" as a String variable. That can take place in or outside of a function, but it can then only be set within a function. Inside a function it can be created and set simultaneously (as I have done).
"buffer" isn't an AGS keyword. It's just a generic name for a temporary String variable.