Hi all,
I'm scripting the following feature : When the player enters a room for the first time, the corresponding cutscene (yes, there is a one-time cutscene in that room) will be played or not, depending on a variable set in advance.
Completely skipping the cutscene (that is, not calling the cutscene instructions at all) is not the best solution, because then, I'd have to manually set up the room (variables, characters positions,etc.) to look exactly like it would look if the cutscene had been played.
I think the best way to do it is to play the cutscene but force-skip it as soon as it starts, by script.
The thing is, I don't know how to trigger a key press :-D (*shame*) I couldn't find it in the manual (even though I remember having stumbled on the relevant article one billion times, when I didn't need it).
So how do I make my game press Escape 'by itself'?
I don't think you can do that; I'm only aware of the SkipUntilCharacterStops(CHARID) command.
When I was coding a module that would allow using a Gamepad instead of the mouse, I was looking for a way to simulate a keypress to get rid of Display boxes and couldn't find anything.
I'm curious to what article you're referring though, maybe I missed this the entire time.
Quote from: Khris on Sat 20/04/2013 00:43:11
I'm curious to what article you're referring though, maybe I missed this the entire time.
Maybe I dreamed. Or maybe I dreamt. I guess we'll never know which one.
However that would be an interesting feature to have, because in many point n' clicks, some cutscenes are shown only once (e.g. when the character tries some action that will fail -- the first time, the game shows the entire sequence, then only the unfortunate conclusion)
I am almost done writing the prologue to my game which is very cutscene-heavy.
I decided to go for a state machine approach.
So I defined an enum for the game states, i.e. eAfterIntro, eAfterCutscene1, etc. A global variable holds the current state.
A state transition is usually caused by a cutscene, so at the end of the cutscene, I switch from one game state to the next.
Whenever I enter a room where a cutscene has an effect, I use the room_load() function to set up the room according to the current state.
There are some conditions that are untouched by this, i.e. if a character has picked up a specific item, so I let AGS handle those.
Currently this has mainly benefited me for debugging, since I can easily jump to a specific part of the game by setting its state and the rooms are set up according to that.
I have no skipping at the moment, but if I did, I would skip the scene, switch the state and reload the room.
For me that works well, since my cutscenes are sequential. If your case is more complex, with the player being able to run cutscenes in any order, this might not work as well.
Quote from: Cerno on Sat 20/04/2013 12:25:55
I am almost done writing the prologue to my game which is very cutscene-heavy. I decided to go for a state machine approach.
(...)
I use the room_load() function to set up the room according to the current state.
That's what I'm doing too. And that's precisely why I'm trying to avoid having to set up any state manually, and risk setting it up differently from how the cutscene just before ends.