How to get a cutscene to play in the beginning of the game?

Started by mabgamedesign, Wed 14/04/2021 04:01:12

Previous topic - Next topic

mabgamedesign

Hi! Sorry if this is a newb question, but I can't find the exact answer I need. How do I get a cutscene to play in the beginning of the game as an intro? How do I animate a cutscene in AGS? Or should I just import a video?

Khris

You can set one of your characters as the player character. Each character has a starting room, so AGS looks at the starting room of the initial player character and loads it.
Next, that room's "enters room before fadein" event is triggered / its script's room_Load function runs*. You can use that for additional setup beyond editor options.
Now AGS fades in the room, then triggers the "enters room after fadein" event / runs the room script's room_AfterFadein function*. This is where you would use commands like
Code: ags
  player.Walk(123, 45, eBlock);
  player.FaceDirection(eDirectionDown, eBlock);
  player.Say("Welcome to the game!");

to create the intro.

You can also use a movie, yes. Or do both. Animations are usually implemented by animating objects and characters.

If you use the StartCutscene() and EndCutscene() commands, the player can also skip over the cutscene.

I'd also advise you to give the player a chance to load a savegame first. You can put a bunch of hotspots in the first room and handle clicks on them to implement a menu, or use a GUI with actual buttons.
You can even detect if savegames exist, afaik, and directly run the intro if there are none.

* provided they are properly linked to the events as explained in the tutorial

SMF spam blocked by CleanTalk