Setting up cutscenes?

Started by Armageddon, Sun 14/08/2011 06:58:04

Previous topic - Next topic

Armageddon

Hello everyone! I am making the very first part of my game, the intro. And I was wondering, how do I disable all GUIs, Mouse Cursors, and the Player character? I am a super noob coder and it took me thirty minutes to get an object to animate with a VIEW. :P

Also how would I make it change to another room after a certain event happens, like someone gets done talking or an animation os done playing? ???

EDIT: Also how do I make a sound play at a certain frame of a VIEW?

Bogdan

#1
Quote from: Armageddon on Sun 14/08/2011 06:58:04
Hello everyone! I am making the very first part of my game, the intro. And I was wondering, how do I disable all GUIs, Mouse Cursors, and the Player character? I am a super noob coder and it took me thirty minutes to get an object to animate with a VIEW. :P

Also how would I make it change to another room after a certain event happens, like someone gets done talking or an animation os done playing? ???

EDIT: Also how do I make a sound play at a certain frame of a VIEW?

To disable any GUI or cursor, you have to make them invisible with this commands:
Code: ags
Mouse.Visible = false;
          Nameofthegui.Visible = false;

If you want to make them visible again do this:
Code: ags

Nameofthegui.Visible = true;
Mouse.Visible = true;

If you want you player character to not appear on the screen you can do this when he is changing room:
Code: ags

cCharactername.ChangeRoom (1, -100, -100);

or do this:
Code: ags

cCharacter.x = -100;
cCharacter.y = -100;

if you want to put sound into the view, in view editor every frame has a sound option. Before you put the sound you must have a sound file in Sound folder, and that sound file must be called "Sound1", or "Sound2" etc.
if you want to set up a cutscene
Code: ags
 StartCutscene ();

and use this at the end
Code: ags
 EndCutscene ();

Use that if you want that player can skip cutscene.

Armageddon

Thanks! I'll try them out tomorrow.

monkey0506

If you're using AGS 3.2 or higher then you can take advantage of the new audio system which allows you to import your audio files directly via the editor, which are then represented by the new script type AudioClip. It's significantly nicer than dealing with the old audio system. :=

Anyway, there's actually a Sound property associated with view frames. The old style audio system used sound files based on the integer number that you assign into the textbox, but with the new audio system it gives a drop-down list of all the available audio files (regardless of type since you can define your own types and name them whatever you want).

StartCutscene also requires a parameter that defines the skip type for the cutscene (such as eSkipESCOnly, which means the cutscene can be skipped by pressing the ESC key). The values should appear when you're typing the function, and are of course listed in the manual. ;)

Oh, and Bogdan has written "Mouse.Visible" which is technically valid, but I recommend against using that because "Mouse.x" is not valid. "mouse" works with all of the mouse properties and functions, "Mouse" works with all of them except the x and y properties. Just some food for thought.

silverwolfpet

Here's a trick I used at some point. Dunno if it's cool or just plain stupid, but it worked for me faster than any other thing.

I created a GUI with the same dimensions as the game's resolution (minus a pixel or two), I made it clickable and chose an "invisible color" for it (and it's border as well). You know, made it transparent.

That way, I can make things happen in the game and give the player the feeling that he is still in control, even though he cannot click on anything or move any character. Works in a thriller game  :P ;D

If you add a
mouse.Visible = false;
you got yourself a perfect "cutscene moment" in which the player notices that he can't do anything.

SMF spam blocked by CleanTalk