Adventure Game Studio | Forums

AGS Support => Beginners' Technical Questions => Topic started by: Rik_Vargard on Fri 12/11/2021 19:03:21

Title: [SOLVED] Speech not on top of player
Post by: Rik_Vargard on Fri 12/11/2021 19:03:21
Hiya!

So when my player is close to the left or right border of the room and he says something, The speech text doesn't appear on top of him but is shifted left or right, depending on the character position, like if the speech text doesn't want to go beyond some invisible border from the center.

I've found a topic talking about an invisible narrator that would follow the player but didn't understand it and it didn't work for me.
Scripting is as far on the other side of me as a thing can be, but I did this thing:

Code (ags) Select

function hBed_Look()
{
  player.SayAt(player.x - 250, player.y - 500, 500, "I don't need to sleep right now");
}


And it works.

I don't mind copy/paste the thing every time but I wonder if there's a way to make the speech x and y values based on the player position something permanent?
Perhaps in the Global Script?

Cheers!  :)
Title: Re: Speech not on top of player (Half Solution)
Post by: arj0n on Fri 12/11/2021 23:13:00
The invisible narrator is probably an invisible (transparent) character (like an npc) that always follow the player via Character.FollowCharacter.
This narrator will have the speech text instead of the player him/her self.

for example:
cNarator.FollowCharacter(player, 20, 80);

just play a bit with the 2 values to find the best fit for your situation.
In the example case, if the player character stands (close) to a left or right hand room edge, cNPC will never stand at that same spot, avoiding the issue that the speech text doesn't appear on top of him (the narrator).
Title: Re: Speech not on top of player (Half Solution)
Post by: Rik_Vargard on Sat 13/11/2021 14:59:58
Hey thank you for the reply!

The ghost thing didn't work for me so I tried some stuff that didn't work neither.

But then I went to the general settings and tested the speech options and the Lucasarts speech fixed the whole problem just like that!
Now the speech shows up nicely on top of the player.

Thanks again! :)
Title: Re: Speech not on top of player (Half Solution)
Post by: Crimson Wizard on Sat 13/11/2021 15:26:41
Quote from: Rik_Vargard on Sat 13/11/2021 14:59:58
But then I went to the general settings and tested the speech options and the Lucasarts speech fixed the whole problem just like that!
Now the speech shows up nicely on top of the player.

Oh, I am guessing you had "Sierra with transparent background" on? In "Sierra" case you are supposed to provide character portraits to be displayed at the side of the text, this is also why the text is limited to the center of the screen.
Title: Re: Speech not on top of player (Half Solution)
Post by: Rik_Vargard on Sat 13/11/2021 17:47:14
Aha! I'm sure that was part of the problem! Good to know, thanks!

I had it set on "Wholescreen" wich gave me the same problem as the Sierra thing when I tested that one.
Luckily Lucasarts fixed the thing  :grin: