Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Iago on Sun 06/02/2005 10:38:45

Title: non blocking cutscene
Post by: Iago on Sun 06/02/2005 10:38:45
I want a NPC to do stuff, while the player is playing:

The NPC shall take a wrench lying around, say "This could be useful" and then put it in his pocket. Then the NPC shall take another tool and do the same, infinitely, until the player chooses to talk to the NPC.

I tried putting this script into the "player enters room" event:

AnimateCharacterÃ,  (4,0,4,0);
DisplayMessage (11);
AnimateCharacter (4,2,4,0);
DisplayMessage (14);
AnimateCharacter (4,3,4,0);

The problems are:

The animations are not displayed, instead, you see him in his talking view (I don't want to see his talking view)

The messages are blocking, so the player cannot walk around when the NPC speaks.



any help would be very appreciated!  :)
Title: Re: non blocking cutscene
Post by: Rui 'Trovatore' Pires on Sun 06/02/2005 13:55:03
DisplaySpeechBackground, or something of the sort, sure is a handy function, ain't it? It's in the manual, too. ;)

But I think you may have to fiddle a bit with repeatedly execute, making sure that the animation is over BEFORE displaying the text.
Title: Re: non blocking cutscene
Post by: Pumaman on Sun 06/02/2005 14:35:53
Because AnimateCharacter isn't blocking, you don't see the animation because you keep starting a new one before the old one had time to play.

The way you need to tackle this sort of situation is put some code in the room's Repeatedly EXecute event to check if the NPC is currently doing nothing. If they're idle, then run an animation on them.
Title: Re: non blocking cutscene
Post by: SSH on Sun 06/02/2005 14:40:16
Also, see http://www.adventuregamestudio.co.uk/yabb/index.php?topic=11868.0 which has a bunch of scripts to help you with this
Title: Re: non blocking cutscene
Post by: Iago on Tue 08/02/2005 23:39:15
thanks!  ;)

This could  help me a lot...

But I think I'm going to keep it simple (i.e. cutscene not running in background) because otherwise I'll spend too much time on it. and then It could even not work correctly...  :-\

I thought it would be easier to do.
But again, thanks for the answers.  :)