Error in characterview

Started by fiaschetta, Tue 14/11/2006 01:58:45

Previous topic - Next topic

fiaschetta

The script, when i look an inventory item, is:


ChangeCharacterView (PG, 38);
character[PG].Animate(0, 40);
character[PG].ChangeView(1);
DisplaySpeech (PG, "It's a beautiful book");



But, when i test the game, when i exit, go out a windows that says:

"ChangeCharacterView was used while the view fixed - call ReleaseCharView first"

Where is my error?

SSH

You must have locked the character view in some other script run previously somewhere...
12

fiaschetta

Quote from: SSH on Tue 14/11/2006 09:31:35
You must have locked the character view in some other script run previously somewhere...

I don't find the error

Scorpiorus

You should not use ChangeCharacterView() command to switch to another view just for animation, use a combination of Character.LockView() and Character.UnlockView() commands instead:


ChangeCharacterView (PG, 38); character[PG].LockView(38);
character[PG].Animate(0, 40);
character[PG].ChangeView(1); character[PG].UnlockView();
DisplaySpeech (PG, "It's a beautiful book");

And each LockView call should be followed by UnlockView one.

If you forget to call UnlockView command for some LockView and use ChangeCharacterView the warning you got may be generated when you exist the game.

So browse you scripts and make sure each LockView has a corresponding UnlockView.

Note: In older versions of AGS LockView was known as SetCharacterView andÃ,  UnlockView was known as ReleaseCharacterView, so check those too in case you use old-style scripting function names.

SMF spam blocked by CleanTalk