Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Fri 30/04/2004 16:01:33

Title: How to change a characters view.
Post by: on Fri 30/04/2004 16:01:33
When I'm in a dialog, I run-script 1, and calls:

function dialog_request(int parameter)
{
 if(parameter==1)
SetObjectGraphic(2,38);
}

I don't really have a clue on how SetObjectGraphic works. I just assumed that since the character I want to change is no. 2, and I want to change his view to sprite number 38, then the script would look like that. But apparently not, so, what to do? :)
Title: Re:How to change a characters view.
Post by: Ashen on Fri 30/04/2004 17:08:39
From the manual:

SetCharacterView
SetCharacterView (CHARID, int view)

Sets character CHARID's view to VIEW. This can be used to perform animations with charaters, for example bending down to pick something up, which don't use the default view.
NOTE: This function locks the character's view to the specified view, so that it can only be changed by other script commands (ie. it won't automatically be changed by the program on shadow areas, screen changes, etc). When you are done with the animation, call ReleaseCharacterView to allow the program to take control back.