Player portrait switching sides on its own

Started by Laura Hunt, Thu 04/07/2019 07:00:13

Previous topic - Next topic

Laura Hunt

Please. My game, it's very sick.

I am using Sierra speech with "Alternating" portraits.

My game starts in room 1, with cCharlie as the player character. When the player clicks on stuff, Charlie says things about the stuff. His portrait is on the left side of the screen.

But when I move Charlie to room 2 and click on stuff there, his portrait is now on the right.

When I go back to room 1, his portrait is on the left again. UNLESS I haven't clicked anything (i.e., he hasn't spoken) in room 2, in which case his portrait will be on the right.

I have no idea what's happening here and it's driving me insane. It's as if every time I change rooms, the game treats the player as a different character. Should I be calling "cCharlie.Say" instead of "player.Say"? Should I always be using "cCharlie" when it comes to moving, changing rooms, etc, rather than "player"?

I'm completely stumped and tearing my hair out here, any help would be appreciated!

(P.S.: I know that a possible workaround would be to set portraits to the left in the general settings and force NPC portraits to appear on the right with SetGameOption(OPT_PORTRAITPOSITION) every time a NPC speaks, but I'd rather try to understand why this is happening so I can actually learn some stuff).


Cassiebsg

I think it depends on where your character is on the room.
Is your character on the left side of the room when the portrait shows on the left and on the right when he's on the right?
Do you have other characters in the room? If so, are you left or right of them when your charterer speaks? Same for objects and hotspots.

I think that if you want him  to always be on the left and others on the right, that you might have to force that.
There are those who believe that life here began out there...

Laura Hunt

Quote from: Cassiebsg on Thu 04/07/2019 12:47:51
I think it depends on where your character is on the room.

I don't think so, given there's a separate option for setting portraits depending on character position ???


Quote from: Cassiebsg on Thu 04/07/2019 12:47:51Is your character on the left side of the room when the portrait shows on the left and on the right when he's on the right?

Nope... As long as I stay within the same room, the portrait shows on the left side all the time, no matter where I move or where the objects and hotspots are. Things only get out of whack when I change rooms.

Quote from: Cassiebsg on Thu 04/07/2019 12:47:51Do you have other characters in the room? If so, are you left or right of them when your charterer speaks? Same for objects and hotspots.

There's an invisible character in the room but he doesn't become visible or speak with the player until much later. Also, this character spawns on the left side, so if anything, I guess it would force the player's portrait to show on the right.

Quote from: Cassiebsg on Thu 04/07/2019 12:47:51I think that if you want him to always be on the left and others on the right, that you might have to force that.

*cries in AGS*

Slasher

#3
I've did this a few years back, but did not use Sierra and I used dummy characters where player portrait is always on the left and it only showed when character was talking..

Laura Hunt

#4
Quote from: Slasher on Thu 04/07/2019 13:08:18
I've did this a few years back, but did not use Sierra and I used dummy characters where player is always on the left...
.

Yeah I've heard about the use of dummy characters for this purpose, but in my case I think that (if this doesn't have another solution) it would be much easier to just hard-set portraits to the left in general settings and then create some kind of NPCSay extender function so that I can position other characters' portraits on the right:

Code: ags
function NPCSay (this Character*, String message) {
  
   SetGameOption(OPT_PORTRAITPOSITION, 1);
   this.Say("%d", message);
   SetGameOption(OPT_PORTRAITPOSITION, 0);
}


And then call it with
Code: ags
cPatrick.NPCSay("Hey old buddy");


... I guess this would work? (Can't open AGS right now, so don't be too harsh if I made any formatting mistakes!)

morganw

I can't really imagine how the built-in 'alternate' option would work in practise, it sounds like it is alternating but that the result isn't very usable.
AGS 3.5 does already have support for a custom say implementation, where speech calls are redirected through an extender function. I know of one person who has used it and it seemed to work OK, although there are still some restrictions about using it.

https://www.adventuregamestudio.co.uk/forums/index.php?topic=57133.msg636605743#msg636605743

Crimson Wizard

Quote from: notarobotyet on Thu 04/07/2019 13:01:41
Nope... As long as I stay within the same room, the portrait shows on the left side all the time, no matter where I move or where the objects and hotspots are. Things only get out of whack when I change rooms.

Maybe it's a bug in the engine?

Here's from the manual:
QuoteSierra-style portrait location - if you're using Sierra-style speech, then this determines whether the portrait appears on the left or the right of the screen. The "alternate" setting means it swaps sides whenever a different person talks, and the "Based on X position" setting means that the side of the screen is chosen depending on where the characters are standing.

But I think it's better to first define how you'd like things to work, and then find a suitable solution for that.

Laura Hunt

#7
Quote from: morganw on Thu 04/07/2019 15:48:43
I can't really imagine how the built-in 'alternate' option would work in practise, it sounds like it is alternating but that the result isn't very usable.
AGS 3.5 does already have support for a custom say implementation, where speech calls are redirected through an extender function. I know of one person who has used it and it seemed to work OK, although there are still some restrictions about using it.

https://www.adventuregamestudio.co.uk/forums/index.php?topic=57133.msg636605743#msg636605743

Thanks, morganw. I tried removing all other characters from the game, I tried replacing all instances of player.Say with cCharlie.Say... nothing worked. It's one of those "little AGS things" then, I guess.

I don't think I'll switch to 3.5 for now in the end, but no worries. I think my extender function will do the trick, and if the character is going to say several lines in a row, it's even easier to do this directly in the dialog editor:

Code: ags

@S
player: Hey, where have you been?
 SetGameOption(OPT_PORTRAITPOSITION, 1);
 cPatrick.SetIdleView(14,0); // inserting talking animations into the Idle view in order to combine Lucasarts and Sierra styles, because complicating things is fun!
patrick: Oh, you know, here, there...
patrick: Anywhere... who cares... this is just a test dialogue.
 SetGameOption(OPT_PORTRAITPOSITION, 0);
 cPatrick.SetIdleView(12,0); // back to his regular idle view
player: That's nice to hear.
stop


So yeah, I think I have this covered :) I just wish that sometimes doing apparently simple things in AGS was... well, simple!

Laura Hunt

#8
Quote from: Crimson Wizard on Thu 04/07/2019 16:41:18

Here's from the manual:
QuoteSierra-style portrait location - if you're using Sierra-style speech, then this determines whether the portrait appears on the left or the right of the screen. The "alternate" setting means it swaps sides whenever a different person talks, and the "Based on X position" setting means that the side of the screen is chosen depending on where the characters are standing.

Yeah that's the problem, in theory it's always the same person talking: Charlie. But it's as if upon changing rooms, the engine decided that Charlie is now a different person/character? Even though I've found a solution/workaround, I'm still intrigued as to the why. But hey, at least I got things working.

SMF spam blocked by CleanTalk