Hello,
I've tried out AGS quite a bit week ago. And have a questing about text/dialog displaying.
Dialog are displayed all sentence/speech at once. Does is possible to make it display letter by letter like SNES's RPG style?
Here's an example from ClockTower[SNES]
http://www.youtube.com/watch?v=Ng72snjGLCU
Thanks in advance ;)
Here is something to start with, put in globalscript.asc:
function SayLetterByLetter(this Character*, String sentence)
{
String builder = "";
int i=0;
while (i < sentence.Length)
{
builder = builder.AppendChar(sentence.Chars[i]);
this.SayBackground(String.Format("%s", builder));
Wait(5);
i++;
}
Wait(40);
}
and in globalscript.ash:
import function SayLetterByLetter(this Character*, String sentence);
and you can use it from the rooms script;
cEgo.SayLetterByLetter("This is the first sentence");
Nope, it's not possible in General, you would have to make a costum GUI/function. Try this code:
//global script start
int Letterspeed;
function SayRPGGUI(this Character*,const string message){
String Text=message;
gRPGSpeech.Visible=true;
int for=1;
while(for<=Text.Length){
lblRPGSpeech.Text=Text.Truncate(for);
PlaySound(2);
Wait(1);
for=for+Letterspeed;
}
WaitKey(10000);
gRPGSpeech.Visible=false;
lblRPGSpeech.Text="";
}
Should work. Remember to declare the function and Letterspeed in the Global header, and to set Letterspeed in game_start (if it's 0, the game will crash because the loop will be repeated to many times).
Thank you very much, NsMn,tzachs. :D
I'll try them out.