Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: SirLean on Sun 04/02/2024 01:39:02

Title: SOLVED - Make "SayAt" speech unskippable
Post by: SirLean on Sun 04/02/2024 01:39:02
So I'm using the SayAt function because I need the text to appear as a subtitle, it looks good

problem is: I want the speech to be unskippable, but whatever I try, with a simple click the speech ends

Is there a way to make the SayAt function become blocky and unskippable?

Thanks  :kiss:
Title: Re: Make "SayAt" speech unskippable
Post by: Crimson Wizard on Sun 04/02/2024 02:13:39
All the blocking Say functions are controlled by Speech.SkipStyle and other properties from the Speech group:
https://adventuregamestudio.github.io/ags-manual/Speech.html#speechskipstyle

When you need to apply this setting only for particular Say* call, it may be more convenient to write a custom extender function that toggles setting, calls SayAt, and toggles setting back, for example:

Code (ags) Select
function SayAtNoSkip(this Character*, int x, int y, int width, const string text)
{
    int old_style = Speech.SkipStyle;
    Speech.SkipStyle = eSkipTime;
    this.SayAt(x, y, width, text);
    Speech.SkipStyle = old_style;
}

and used as
Code (ags) Select
WhateverCharacter.SayAtNoSkip(100, 50, 200, "bla bla");


Of course there are other solutions that do not use character speech, such as: text overlays and displaying text on GUI label. These would require to make your own blocking timer using Wait command, like:

Code (ags) Select
SubtitleLabel.Text = text;
SubtitleLabel.Visible = true;
Wait(time);
SubtitleLabel.Visible = false;

Above also may be put into a custom function for easier use.
Title: Re: Make "SayAt" speech unskippable
Post by: SirLean on Sun 04/02/2024 03:21:08
Thanks Crimson! You are like an angel in the AGS forums!  :)