SOLVED: LockViewFrame() won't survive speech view

Started by Tamanegi, Tue 30/11/2010 22:49:06

Previous topic - Next topic

Tamanegi

I have a character sitting in the room and locked her to a sitting view, facing left. The player can only stand to her right, so the talking animation has her looking right without turning her body:
Code: ags

// before fadein
cGirl.LockView(GIRL_BSIT);
cGirl.SpeechView=GIRL_BTALK;


When she is clicked with the speak cursor, this is executed (Lucasarts-style speech):
Code: ags

player.Say("Hi!");
cGirl.Say("Don't you also feel like you're being played with?");
dTest.Start();


What this does is as long as she talks she is in her speech view, but while she isn't talking (game waits for player's line choice) she is looking the other way again. So I tried this:

Code: ags

player.Say("Hi!");
cGirl.LockViewFrame(GIRL_BTALK, 0, 2); // this is added
cGirl.Say("Don't you also feel like you're being played with?");
dTest.Start();

But it doesn't change anything. She isn't locked in the frame anymore after she finishes talking and just jumps back to GIRL_BSIT.

What am I missing to make this work?
Don't Look! MAGS 12-2010
Mediocre Expectations Current development blog

Khris

Try cGirl.ChangeView(GIRL_BSIT);

LockView is for changing the view temporarily, usually to do a short animation. I imagine as soon as she finishes talking, her view is unlocked and returns to her NormalView.

Tamanegi

#2
Actually no, her NormalView is GIRL_NORMAL. She does return to the view I locked her to (GIRL_BSIT) instead of staying in the frame I locked her to, which is quite strange.

What is even stranger, at least to me, is that cGirl.ChangeView(GIRL_BSIT) actually helped... "lock" sounds more strict to me than "change", so I would have thought that it is more resilient against other functions  ::) Thanks for your help!
Don't Look! MAGS 12-2010
Mediocre Expectations Current development blog

Khris

I tried this myself and locked a character to frame 1, loop 2 of their talking view in AfterFadein.
Both after .Say and during/after a dialog the character returns to that frame after speaking just fine.
It also worked when I locked them to a specific frame of their walking view and another so far unused view.

Not sure why this didn't work for you.

Tamanegi

When I read this, I started thinking, and I guess I found the mistake... until shortly before it worked, I had the following line after dTest.Start():

cGirl.LockView(GIRL_BSIT);

And this locked the view back to GIRL_BSIT before the dialog started, because the dialog isn't called before the script is finished... I didn't think of this before because I learned that after I changed the line to cGirl.ChangeView(GIRL_BTALK,0,2), but before I tested it, so I took it out of the script and put it in the dialogue before the STOP commands...
Don't Look! MAGS 12-2010
Mediocre Expectations Current development blog

SMF spam blocked by CleanTalk