Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Lukey J on Tue 15/12/2020 16:43:19

Title: Dialogue onto more then one line!?
Post by: Lukey J on Tue 15/12/2020 16:43:19
im trying to get long strings to text onto more lines

(https://i.ibb.co/59Vs31S/Capture.png) (https://ibb.co/xsQzb2B)

Title: Re: Dialogue onto more then one line!?
Post by: Crimson Wizard on Tue 15/12/2020 17:37:42
Please clarify how do you do speech in your game, are you using Character.Say, a custom speech module, or scripted your own speech display?
The solution depends on that.
Title: Re: Dialogue onto more then one line!?
Post by: Lukey J on Tue 15/12/2020 23:20:29
Character.Say

im using the thimbleweed template
Title: Re: Dialogue onto more then one line!?
Post by: Crimson Wizard on Tue 15/12/2020 23:41:52
Quote from: Lukey J on Tue 15/12/2020 23:20:29
Character.Say

I mostly asked because of the "balloon" speech box. Thimbleweed template does not do that, so I wondered if it's done by a script module or your own script.

I think Character.Say in "Lucas Arts" style only splits lines when they reach certain big width, which is something like 2/3 of the screen.
You may force linebreaks using "\n" in the text, but that may be lots of manual work, besides anything done this way may stop workin as expected if you decide to change fonts in the future, for instance. If it's fine with you, you can do that ofcourse.
If you want to implement your own automatic linebreaking I'd suggest scripting a custom speech function.
Title: Re: Dialogue onto more then one line!?
Post by: Snarky on Wed 16/12/2020 07:53:37
If you use the SpeechBubble module (https://www.adventuregamestudio.co.uk/forums/index.php?topic=55542.0), you can set SpeechBubble.MaxTextWidth.
Title: Re: Dialogue onto more then one line!?
Post by: Lukey J on Wed 16/12/2020 08:28:30
Cheers for all your help!

Title: Re: Dialogue onto more then one line!?
Post by: Laura Hunt on Wed 16/12/2020 08:44:42
Quote from: Crimson Wizard on Tue 15/12/2020 23:41:52
You may force linebreaks using "\n" in the text, but that may be lots of manual work, besides anything done this way may stop workin as expected if you decide to change fonts in the future, for instance. If it's fine with you, you can do that ofcourse.

Is this something new in 3.5.0? In version 3.4.3 I use the left square bracket for line breaks (cChar.Say("This is one line.[And this is another.");), and I've never had any issues.

Title: Re: Dialogue onto more then one line!?
Post by: Crimson Wizard on Wed 16/12/2020 09:35:00
Quote from: Laura Hunt on Wed 16/12/2020 08:44:42
Quote from: Crimson Wizard on Tue 15/12/2020 23:41:52
You may force linebreaks using "\n" in the text, but that may be lots of manual work, besides anything done this way may stop workin as expected if you decide to change fonts in the future, for instance. If it's fine with you, you can do that ofcourse.

Is this something new in 3.5.0? In version 3.4.3 I use the left square bracket for line breaks (cChar.Say("This is one line.[And this is another.");), and I've never had any issues.

"\n" is supported in AGS for some time but I don't remember since when. Personally, I don't like recommending "[" because it always seemed nonsense to me, as it is a regular character, and I have no idea why it was added as a linebreak. Maybe it was thought to be easier to remember for most people? Could be a reason too...
"\n" is a standard symbol of linebreak almost in every programming language afaik.

EDIT: for some reason our Changes.txt does not mention "\n", so maybe someone secretly added it in the past and forgot to announce.
Title: Re: Dialogue onto more then one line!?
Post by: Khris on Wed 16/12/2020 11:06:52
Lukey, please clarify how you're getting these Speech Bubbles (which AGS does not have natively) and what exactly fixed the problem for you, because other people might find this thread in the future.