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.
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();
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
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.
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?
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
Or erase the ( and retype it.