Display (string message, ...)
Displays a message to the screen. It will be displayed in the standard
message box, and centred in the middle of the screen. You can insert the
values of variables using "%d" and "%s" in the message. To insert the value
of an integer variable, use %d, to insert a string use %s. For example,
Display ("The counter is currently set to %d.", my_counter);
This will replace the '%d' with the value of the variable "my_counter".
Note: Display is a blocking function - that is, control will not return
to the script until the player has removed the text window (by pressing a
key or clicking the mouse). While the window is displayed, all other
processing, like animations and interface display, are disabled. This is
usually used for responses to the player LOOKing at things.
Display ("It's a beautiful day");
DisplayAt(int x, int y, int width, string message, ...)
Identical to the "Display" function, only this allows you to define the
position and size of the window where the text is displayed. The X and Y
variables define the co-ordinates of the upper-left corner of the window.
The WIDTH variable defines the width of the window. The height is then
automatically calculated so that the message fits into the window.
Note: This is a blocking call. See the "Display" help for more information.
DisplayAt (234, 122, 100 "It's a beautiful day");
DisplayMessage (int message_number)
Identical to the Display function, but this uses a message text defined in
the Room Editor rather than in the script. It will either use a message
from the current room, or a global message (if message_number >= 500).
DisplaySpeech (int charid, string message)
Displays the text MESSAGE as speech above the specified character's head.
The text will remain on screen for a limited time, and the user may or may
not be able to click it away depending on the setting of "Player can't
skip speech text". The text displayed by this function looks identical to
that used by the dialog system.
NOTE: This function does not allow variables like "%d" and "%s" in the
DisplaySpeech (NAME, "It's a beautiful day");
DisplaySpeechBackground (int charid, string message)
Similar to DisplaySpeech, except that this function returns immediately
and the game continues while the character is talking. This allows you
to have characters talking in the background while the player does other
things. Note that the character's talking animation is not played if this
function is used.
DisplaySpeechBackground (NAME, "It's a beautiful day");
SetSkipSpeech (int new_mode)
Changes whether the player can skip speech text by clicking the mouse.
This option is initially set in a checkbox in the Main tab of RoomEdit, but
this function allows you to change it at run-time.
The value of NEW_MODE means the following:
0 player can skip text by clicking mouse or pressing key
1 player can skip text by pressing key only, not by clicking mouse
2 player cannot skip text with mouse or keyboard
3 text does not time-out; player must click mouse or press key each time
Example: (Make the player skip text only by pressing a
SetVoiceMode (int new_mode)
Changes whether voice speech is used with dialog lines. The default
is on if the voice file is present, or off otherwise.
Valid values are:
0 no voice, text only
1 both voice and text
2 voice only, no text
WARNING: you should only ever use mode 2 at the player's request to do so,
because there is no guarantee that they even have a sound card and so may
not understand what is going on.
The animation speed for talking views (default 5).
How long speech text stays on the screen. Default 15,
lower number means shorter time.