Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Dualnames on Fri 24/10/2008 09:20:47

Title: Narrator Text(I messed it up, help me unmess it)
Post by: Dualnames on Fri 24/10/2008 09:20:47
Ok, well, first I'm using AGS 3.02, I'm using a 640x480(low-res coordinates(320x200)) resolution, the backgrounds are 320x200, I'm using lucas arts speech style.

Problem: I'm having a narrator that has an empty 1x1 normal view, baseline = 480, clickable,solid=false, and his only visible when he's talking. Also I'm using this part of the code in the rep_exec section of the global script:


if (player.Room!=cNa.Room){//script name of the narrator is cNa
NewRoomNPC(player.Room,cNa.x,cNa.y);
}
//the above line just transports narrator to the players room so that when he talks he can be seen.

//also the below lines set narrators position if the room is scrolling/able
cNa.x=GetViewPortX()-280;//or something similar anyway..


So when I want something to be said by the narrator I use this:
cNa.SayAt(40,cNa.y,100,"whatever");

-So what's the problem:
Well, narrator's position is fine, everything seems to be fine but the way text is displayed.
It doesn't go over the narrator, but it gets wrapped up..

Example:
                   Big day today
NARRATOR  so anyway I was
                   walking down the
                   street singing do                                                 <Screen Edge(320)
                   ah die dieadadsd
                   and the fish went dea.


And when I use bigger width than 100:
It appears like this:

  NARRATOR   Big day today so anyway I was  walking down the street singing do ah die dieadadsd  <Screen Edge(320)
                                                        and the fish went dea.

Instead of that I want to have something like this:


  NARRATOR   Big day today so anyway I was  walking down the street singing do ah  <Screen Edge(320)
                     die dieadadsd  and the fish went dea.

I don't mind reshaping all my code, if it has to. So any ideas are welcome.
Title: Re: Narrator Text(I messed it up, help me unmess it)
Post by: Khris on Fri 24/10/2008 12:16:51
With LucasArts speech style, the text is always centered. I'm pretty sure one can't change that.
Title: Re: Narrator Text(I messed it up, help me unmess it)
Post by: Dualnames on Fri 24/10/2008 13:12:02
Quote from: KhrisMUC on Fri 24/10/2008 12:16:51
With LucasArts speech style, the text is always centered. I'm pretty sure one can't change that.

Well, in case you want to see what I'm talking about you can check the HHGTG demo. So what you're saying is that I can't do it like I want to.. it's weird though because in Sierra Style Speech..the text gets wrapped up better but I'm assuming that is because of the text window?
Title: Re: Narrator Text(I messed it up, help me unmess it)
Post by: Lt. Smash on Fri 24/10/2008 13:38:15
you could try game.speech_text_align = eAlignLeft.
Title: Re: Narrator Text(I messed it up, help me unmess it)
Post by: Dualnames on Fri 24/10/2008 13:43:29
Quote from: Lt. Smash on Fri 24/10/2008 13:38:15
you could try game.speech_text_align = eAlignLeft.

I assume that this works with lucas arts speech?
Title: Re: Narrator Text(I messed it up, help me unmess it)
Post by: Lt. Smash on Fri 24/10/2008 13:51:00
I think only for LA speech.
Title: Re: Narrator Text(I messed it up, help me unmess it)
Post by: Dualnames on Fri 24/10/2008 13:58:08
Ok, that might do the job, I'll give it a go and tell you about it.
Title: Re: Narrator Text(I messed it up, help me unmess it)
Post by: Khris on Fri 24/10/2008 14:17:56
Damn, I should stop posting BS without looking at the manual... :-\
Sorry.

QuoteSets how text in Lucasarts-style speech is aligned. Same possible values as game.text_align, default eAlignCentre
Title: Re: Narrator Text(I messed it up, help me unmess it)
Post by: Dualnames on Sat 25/10/2008 22:52:07
So wondering if I increase the width from 100 to 233 and set lucas arts speech will it work?
Title: Re: Narrator Text(I messed it up, help me unmess it)
Post by: Trent R on Sat 25/10/2008 23:35:52
I was thinking that I read something in the manual that will return how long a string is in pixels.... but I can't find it. Maybe I'm smoking something :(

If it does exist, you could use that to set the width.


~Trent