What I want to do is change the dialog system of AGS from default to show an RPG-style dialog box that appears above the head of the character, have the text typed out as they speak, and have a portrait of the character animate with different emotions during the speech. Is there a plugin for this? If not, how do I go about doing it?
You have to write a custom speech function that displays character speech on a gui label, and displays portrait on a button (for example). There were multiple similar questions posted on forums, I think you may search for "Visual Novel style speech" on forum, and these topics will have script examples in them.
As for the "typed text", you may script that yourself, or use one of the existing text typing modules.
For instance, here's my module:
https://www.adventuregamestudio.co.uk/forums/modules-plugins-tools/module-typedtext-0-7-0/
This module can produce a "typing" text animation on a gui label, for example (also buttons, textual overlays, etc).
Hmm..funny...I typed visual novel style speech on the search Engine and only us popped up..there is not even a moduel for visual novel style speech.
So, my understanding is I draw the dialog box and put it in the GUI, then the button on the left will hold the graphics, and the label is the one that will display the text? So...all I have to do is get the total length of the text where it fills the dialog and it does not cross over, truncate the text and save it in an index array. Keep repeating it until all indexes are stored, then using the typewriter modulator to pass the string from the index and have it type there.
It may not be that hard since 98% of the hard job which is the type writing effect is already been done and completed. It is now matter of writing a good custom function where it stores a certain truncated text into the index of array. My only issue is getting the speak animation running during the dialog box...how do you that?
Quote from: xboxown on Yesterday at 03:45:08Hmm..funny...I typed visual novel style speech on the search Engine and only us popped up..there is not even a moduel for visual novel style speech.
I guess you accidentally only searched in this topic or this board.
Check this thread (https://www.adventuregamestudio.co.uk/forums/index.php?topic=62163.new#new) where CW answers a similar question and provides lots of links over in the Beginner's Tech forum.
The custom speech is done by writing a function which you will use instead of standard Character.Say.
This function will need to do following actions (all or some of them):
- display a text, using a gui or overlay
- play animation (animating character, portrait, or both)
- play voice speech (see Game.PlayVoiceClip)
- wait until player's input and/or timeout
- cleanup (remove gui, remove overlay, stop animation, etc)
Since you probably will have to use a GUI method here, the simple code variant may look like this (as an example):
void SayRPG(this Character*, String text)
{
if (String.IsNullOrEmpty(text))
return; // don't display empty text
// cut voice-over token from the speech
int voice_number = -1;
if (text.Chars[0] == '&')
{
String number_str = text.Substring(1, text.Length - 1);
voice_number = number_str.AsInt;
int voice_number_ends = text.IndexOf(' ');
text = text.Substring(voice_number_ends + 1, text.Length - voice_number_ends - 1);
}
// setup things
gSpeech.Visible = true;
lblSpeechText.Text = text;
btnSpeechPortrait.NormalGraphic = SPRITE_NUMBER;
this.LockView(this.SpeechView);
this.Animate(this.Loop, 0, eRepeat, eNoBlock);
AudioChannel* voice_chan;
if (voice_number >= 0)
{
voice_chan = Game.PlayVoiceClip(this, voice_number, true);
}
// wait for the number of frames enough to read the text with the TextReadingSpeed.
// but also limit by the MinimumTextDisplayTimeMs for convenience
int text_read_time = (text.Length * GetGameSpeed()) / Game.TextReadingSpeed;
int min_read_time = Game.MinimumTextDisplayTimeMs * GetGameSpeed() / 1000;
if (text_read_time < min_read_time)
text_read_time = min_read_time;
WaitInput(eInputAny, text_read_time);
// cleanup things
gSpeech.Visible = false;
this.UnlockView();
if (voice_chan != null)
{
voice_chan.Stop();
}
}
and then used like
player.SayRPG("&5 my speech text");
Since you also need typing text animations, and portrait setup, this function will need to be expanded accordingly.