Graphics, Characters, Text & Rooms: Difference between revisions
Graphics, Characters, Text & Rooms (view source)
Revision as of 02:09, 1 December 2005
, 1 December 2005→Naming your character and using that name throughout the game
Line 276: | Line 276: | ||
==Naming your character and using that name throughout the game== | ==Naming your character and using that name throughout the game== | ||
''Is it possible to let the player choose the main character's name, and have that name be used throughout the entire game?''' | |||
It is indeed possible, and very easy. First off, to ask the player for the name... | |||
// Declares a string to store the player's reply | |||
string buffer; | |||
// Asks the player for name and stores it in "buffer" | |||
InputBox("What is your name?",buffer); | |||
// Transfers the content of "buffer" (the name) to the global variable character[...].name | |||
StrCopy(character[EGO].name, buffer); | |||
Be sure to understand the above script in case you make an error and it does not work for you. Then, to call the name in, say, a Display box, just call up the '''character[EGO].name''' variable in any script, like so... | |||
DisplaySpeech(EGO, "My name is %s!", character[EGO].name); //V2.6 and below | |||
cEgo.Say("My name is %s!", character[EGO].name//V2.7+, or... | |||
Display("Your name is %s.", character[EGO].name); | |||
It's as simple as that! | |||
==Changing the size of imported fonts== | ==Changing the size of imported fonts== | ||
==Intermittent crashing in full-screen mode== | ==Intermittent crashing in full-screen mode== |