Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: HillBilly on Mon 01/03/2004 07:12:47

Title: Cutscene problem.
Post by: HillBilly on Mon 01/03/2004 07:12:47
Right, I'm gonna try to make this as short as possible:

I'm gonna make a intro cutscene with the hero on the floor, sleeping. So, therefore I need to aware AGS that it's a start of a cutscene, putting the StartCutscene (1); action there. Next, I remove the GUI's, using the GUIOff (0); and GUIOff (2); actions. After that, I start the sleeping animation:


SetCharacterView(EGO,5);
AnimateCharacterEx(EGO, 0, 12, 5, 0, 0);


I test the game, but when the scene start, I can in about 1 second see the GUI, and that EGO stands(Front walking animation first frame). Is there any way to make this go away?  ???

Just in case someone didn't understand, here's the cutscene(I removed the text so it wouldn't spoil the storyline for later):

http://hbw.stickthemepark.com/ImagesHost/BG/example.zip
(ALT+F4 to close it)

EDIT: While I'm at it: The background seems to f*ck up sometimes. Any reason for that? The relative size is 320x200 even the game is 640x400. If that's the problem, is there any way to change it?
Title: Re:Cutscene problem.
Post by: Gilbert on Mon 01/03/2004 07:19:01
Try putting the codes into "player enters screen before fade in" instead and see if it changes anything.
Title: Re:Cutscene problem.
Post by: HillBilly on Mon 01/03/2004 16:22:04
Yeah, I get an error:


(Room 1 Script line 11)
Error: A text script run in the Players Enters Screen event caused the screen to be updated. If you need to use Wait(), so do it After Fadein.


Right, so i go and edit the code and remove all "Wait()" Actions. I try to test the game again, and get the same error. Here's the script I used:

StartCutscene (1);
GUIOff (0);
GUIOff (2);
SetCharacterView(EGO,5);
AnimateCharacterEx(EGO, 0, 12, 5, 0, 0);
DisplaySpeech (CELL , "RING");
DisplaySpeech (CELL , "...");
DisplaySpeech (CELL , "RING");
DisplaySpeech (CELL , "...");
DisplaySpeech (CELL , "RING"); <LINE 11
SetCharacterView(EGO,7);
AnimateCharacterEx(EGO, 0, 5, 0, 0, 1);
SetCharacterSpeechView(EGO, 6);
DisplaySpeech (EGO , "...Blah?");
SetCharacterView(EGO,8);
DisplaySpeech (CELL , "Blah.");
SetCharacterSpeechView(EGO, 6);
DisplaySpeech (EGO , "Blah?");
SetCharacterView(EGO,8);
DisplaySpeech (CELL , "Blah!");
DisplaySpeech (CELL , "Blah,");
DisplaySpeech (CELL , "Blah!!");
DisplaySpeech (CELL , "*click*");
SetCharacterView(EGO,7);
AnimateCharacterEx(EGO, 0, 5, 0, 1, 1);
SetCharacterView(EGO,9);
AnimateCharacterEx(EGO, 0, 4, 0, 0, 1);
SetCharacterSpeechView(EGO, 10);
DisplaySpeech (EGO , "Blah.");
SetCharacterView(EGO,11);
DisplaySpeech (EGO , "...");
SetCharacterSpeechView(EGO, 10);
DisplaySpeech (EGO , "Blah");
SetCharacterView(EGO,12);
AnimateCharacterEx(EGO, 0, 3, 0, 0, 0);
SetCharacterSpeechView(EGO, 13);
DisplaySpeech (EGO , "...");
DisplaySpeech (EGO , "Blah?!");
SetCharacterView(EGO,15);
DisplaySpeech (EGO , "...");
SetCharacterSpeechView(EGO, 14);
DisplaySpeech (EGO , "Blah...");
SetCharacterView(EGO,15);
DisplaySpeech (EGO , "...");
SetCharacterSpeechView(EGO, 14);
DisplaySpeech (EGO , "Blah");
SetCharacterView(EGO,15);
DisplaySpeech (EGO , "...");
SetCharacterSpeechView(EGO, 14);
DisplaySpeech (EGO , "Blah");
SetCharacterView(EGO,15);
DisplaySpeech (EGO , "...");
SetCharacterSpeechView(EGO, 14);
SetCharacterView(EGO,15);
DisplaySpeech (EGO , "Blah");
SetCharacterView(EGO,15);
DisplaySpeech (EGO , "...");
SetCharacterSpeechView(EGO, 10);
DisplaySpeech (EGO , "Blah");
DisplaySpeech (EGO , "...");
DisplaySpeech (EGO , "Blah");
GUIOn (0);
GUIOn (2);
Title: Re:Cutscene problem.
Post by: Pumaman on Mon 01/03/2004 22:21:34
Why are you passing 5 as the repeat parameter to AnimateCharacterEx?

What loop number is the sleeping animation?

Re-check the manual for AnimateCharacterEx, and make sure you are passing the parameters in the right order.
Title: Re:Cutscene problem.
Post by: a-v-o on Mon 01/03/2004 22:39:48
You should split your code into 2 parts and put the first part into "...before fadein":

StartCutscene (1);
GUIOff (0);
GUIOff (2);
SetCharacterView(EGO,5);

All other stuff like Animate... and Display... should be in "...after fadein" because they update the screen. You can then use Wait in the code.
Title: Re:Cutscene problem.
Post by: HillBilly on Tue 02/03/2004 17:19:13
Quote from: Pumaman on Mon 01/03/2004 22:21:34
Why are you passing 5 as the repeat parameter to AnimateCharacterEx?

Because I wanted the animation to repeat 5 times.

a-v-o, Thanks, that did the trick!  :D
Title: Re:Cutscene problem.
Post by: SSH on Tue 02/03/2004 17:26:46
Quote from: HillBilly on Tue 02/03/2004 17:19:13
Quote from: Pumaman on Mon 01/03/2004 22:21:34
Why are you passing 5 as the repeat parameter to AnimateCharacterEx?

Because I wanted the animation to repeat 5 times.

The repeat command is actually a boolean, not a counter. 1 means repeat forever, 0 means do it once. So for five repeats you  need the repeat parameter set to 0 and run the command 5 times with the blocking parameter set, or without blocking, you need to set a counter and use your repeatedly_execute to restart the animation.

Maybe CJ could rename the function prototypes of all functions with "int x" where x can only be 0 or 1 to be "bool x" instead? That would help avoid these kind of problems... or alternatively, RTFM!
;)
Title: Re:Cutscene problem.
Post by: HillBilly on Wed 03/03/2004 07:06:27
meh. It works, good enough for me.