Jibble

Author Topic: non blocking cutscene  (Read 786 times)

non blocking cutscene
« on: 06 Feb 2005, 10:38 »
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!  :)
« Last Edit: 06 Feb 2005, 13:43 by Iago »

Rui 'Trovatore' Pires

  • Lunge da lei per me non v'ha diletto!
    • I can help with AGS tutoring
    • I can help with play testing
    • I can help with proof reading
    • I can help with scripting
    • I can help with story design
    • I can help with translating
    • I can help with voice acting
Re: non blocking cutscene
« Reply #1 on: 06 Feb 2005, 13:55 »
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.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Pumaman

  • Creator of AGS
  • Administrator
  • Mittens King
  • I sense danger.
    • Lifetime Achievement Award Winner
    • Pumaman worked on one or more games that won an AGS Award!
    •  
    • Pumaman worked on one or more games that was nominated for an AGS Award!
Re: non blocking cutscene
« Reply #2 on: 06 Feb 2005, 14:35 »
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.

SSH

  • Flying round the world at the speed of haggis
    • I can help with scripting
    • SSH worked on one or more games that won an AGS Award!
    •  
    • SSH worked on one or more games that was nominated for an AGS Award!
Re: non blocking cutscene
« Reply #3 on: 06 Feb 2005, 14:40 »
Also, see http://www.adventuregamestudio.co.uk/yabb/index.php?topic=11868.0 which has a bunch of scripts to help you with this

Re: non blocking cutscene
« Reply #4 on: 08 Feb 2005, 23:39 »
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.  :)