Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Goldie on Sun 01/03/2009 21:11:17

Title: A cutscene.[Solved]
Post by: Goldie on Sun 01/03/2009 21:11:17
I read the tutorial but I still don't understand how I would make this happen. My character enters the room where his village is but finds it burned down. I want to make my villian walk towards my character and scream, " HAHAHAHAHAHAHAHAHAHAHAHAHAHAHA!" and then run away. How would I do this.
Title: Re: A cutscene.
Post by: Joe on Sun 01/03/2009 21:42:11
I'll give you a shot:



    //after player has entered that room
    StartCutscene(eSkipESCOnly);//if you wat to make this scene skippable
   
    cVillian.Walk(x, y);//where x,y your coordinates
    cVillian.Say("HAHAHAHAHAHHA");
    cVillian.LockView(X);//where X you villian character running view
    cVillian.SetWalkSpeed(4);//To make you villian character run faster
    cVillian.Walk(x, y);//where x,y your coordinates
    cVillian.ChangeRoom(-1);
    cVillian.UnlockView();

    EndCutscene();

Title: Re: A cutscene.
Post by: Trent R on Sun 01/03/2009 23:09:39
Coding cutscenes is exactly the same as any normal scripting. The StartCutscene and EndCutscene commands allow the player to skip scenes (and please allow them, otherwise many ppl will dislike it and your game).


~Trent
Title: Re: A cutscene.
Post by: Goldie on Mon 02/03/2009 01:10:22
When I did what you said:
function room_FirstLoad()
{
//after cCDavy has entered Room 3
StartCutscene(eSkipESCOnly);

cOn.Walk(542, 230);
cOn.Say("HAHAHAHAHAHAHAHAHAHAHAHA!!!");
cOn.LockView(2);
cOn.SetWalkSpeed(4);
cOn.Walk(584, 0);
cOn.ChangeRoom(-1);
cOn.UnlockView();

I got an error message saying:

Error (line 28): Not enough parameters in call to function.
Title: Re: A cutscene.
Post by: Makeout Patrol on Mon 02/03/2009 05:58:05
Quote from: Goldie on Mon 02/03/2009 01:10:22
When I did what you said:
function room_FirstLoad()
{
//after cCDavy has entered Room 3
StartCutscene(eSkipESCOnly);

cOn.Walk(542, 230);
cOn.Say("HAHAHAHAHAHAHAHAHAHAHAHA!!!");
cOn.LockView(2);
cOn.SetWalkSpeed(4);
cOn.Walk(584, 0);
cOn.ChangeRoom(-1);
cOn.UnlockView();

I got an error message saying:

Error (line 28): Not enough parameters in call to function.

I don't see a problem in there. Which one is line 28?
Title: Re: A cutscene.
Post by: Trent R on Mon 02/03/2009 07:34:10
Well, I just quickly looked up each of those functions, and it appears that SetWalkSpeed requires both an x speed (you've set it to 4), and a y speed--which you've obviously forgotten.

If this ever pops up again on a function, right click it and choose 'go to definition'. If it's a custom function, it'll go to that spot in the script. If it's a built in function, it'll open up the manual. Either way, you can then see the number of parameters that you need, and can easily fix the problem.



~Trent
Title: Re: A cutscene.
Post by: Khris on Mon 02/03/2009 08:58:29
Or erase the ( and retype it.