Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: The Almighty Metroid on Thu 16/10/2008 18:15:06

Title: Cut scenes
Post by: The Almighty Metroid on Thu 16/10/2008 18:15:06
ok it's me again...

How do I Make the cutscene happen after they chose 1 of the 3 dialog choices? I wanted for
SCREAM AND RUN she changes speed and runs then dies. I wanted for ATTACK to shoot and you die. I wanted for BACK OFF SLOWLY AND RETURN TO SHIP for you to back off and
run through the next room.
thanks 8)
Metroid
Title: Re: Cut scenes
Post by: on Thu 16/10/2008 18:21:04
Once again, the run-script command is your friend. Just call it from the dialog line that activates the scene. You may want to disable "say" for that line maybe, since you are writing "actions" instead of sentences.
Title: Re: Cut scenes
Post by: The Almighty Metroid on Thu 16/10/2008 18:30:26
ok but i just need to know how to get the cutscene after dialog choice how would i run a script for each choice ???
Title: Re: Cut scenes
Post by: Matti on Thu 16/10/2008 18:34:11
Quote from: Ghost on Thu 16/10/2008 18:21:04
Once again, the run-script command is your friend.

Just look it up in the manual.
Title: Re: Cut scenes
Post by: The Almighty Metroid on Thu 16/10/2008 18:42:14
ok noone is really helping...
I JUST NEED A SCRIPT.

(BY THE WAY I DID CHECK THE MANUAL.)
Title: Re: Cut scenes
Post by: Akatosh on Thu 16/10/2008 19:11:40
Obviously not. It's explained in the tutorial, which you should complete first.
Title: Re: Cut scenes
Post by: abstauber on Thu 16/10/2008 19:12:45
Quoterun-script X
Runs global script function "dialog_request", with X passed as the single parameter. This allows you to do more advanced things in a dialog that are not supported as part of the dialog script. The "dialog_request" function should be placed in your game's global script file, as follows:

 function dialog_request (int xvalue) {
   if (xvalue == 1) {
    // your code here
   }
   else if (xvalue == 2) {
    // other code here
   }
 }


What the manual wants to tell you is, that you need the function dialog_request in your GlobalScript.asc.
So just copy and paste this function the end of your game script. and add the code.

In the dialogs, you use these function with run-script, as ghost already told you.


Here's a sample dialog:
@S
Metroid: How works run-script?
Matti: Look it up.
return
@1 // You've chosen: Control you emotions and be nice
run-script 1
stop
@2 // You've chosen: Freak out and hope someone still helps
run-script 2
stop

Here's the sample function

function dialog_request (int xvalue) {
   if (xvalue == 1) {
    // be nice (this is a comment btw.
      cMetroid.Say ("Thank you, I'll look again");
      cMetroid.Looksthingsup();
   }
   else if (xvalue == 2) {
    // not beeing nice
     cMetroid.CapsLock();
     cMetroid.Say ("i just need a script."):
     cMetroid.Kick (eScreenInFront);
     cMetroid.ChangeRoom(6,6,6);
   }
}

Something like that will do  ;D
Title: Re: Cut scenes
Post by: The Almighty Metroid on Thu 16/10/2008 19:21:53
.
Title: Re: Cut scenes
Post by: The Almighty Metroid on Thu 16/10/2008 21:01:30
so is this right?

dialog:
// Dialog script file
@S  // Dialog startup entry point
Samus: What to do?
return
@1
run-script 1
stop
@2
run-script 2
stop
@3
run-script 3
stop


Script:
function hHotspot1_Look()
{
Display(" oh my gosh... an omega Metroid...");
dOmega.Start();
}
function dialog_request(int xvalue){
   if (xvalue == 1){
     StartCutscene (eSkipESCOnly);
     cSamus.Walk(198, 148, eBlock);
     Display("The metroid scoops you up and eats you.");
     cSamus.ChangeRoom(6, 300, 175);
     EndCutscene();
   }
   else if (xvalue == 2){
     StartCutscene (eSkipESCOnly);
     cSamus.Walk(198, 148, eBlock);
     Display("The metroid scoops you up and eats you.");
     cSamus.ChangeRoom(6, 300, 175);
     EndCutscene();
   }
   else if (xvalue == 3){
     StartCutscene (eSkipESCOnly);
     cSamus.Walk(318, 171, eBlock);
     Display("Your the one that got away. You got back to your ship and live to tell the tale");
     cSamus.ChangeRoom(7, 7, 160);
     EndCutscene();
   }
  }   

is that right????
Title: Re: Cut scenes
Post by: TwinMoon on Thu 16/10/2008 22:03:20
Quote from: The Almighty Metroid on Thu 16/10/2008 21:01:30
is that right????

Dunno. Does it work?

(put the dialog request bit in the global script, btw)
Title: Re: Cut scenes
Post by: abstauber on Thu 16/10/2008 22:13:25
Quote from: The Almighty Metroid on Thu 16/10/2008 21:01:30
function hHotspot1_Look()
{
Display(" oh my gosh... an omega Metroid...");
dOmega.Start();
}
....

[parrot]global script, global script, braawk[/parrot]

Seriously, there's only this one function for the whole game. So you'd better keep tracks of the numbers  ;)
Title: Re: Cut scenes
Post by: Khris on Fri 17/10/2008 00:13:38
And, if you're going to call exactly the same code after option 1 and 2, you don't need to put it in there twice, just call "run-script 1" for both dialog choices.