Cutscenes events...

Started by edmundito, Mon 25/04/2005 19:26:33

Previous topic - Next topic

edmundito

Hey, is there any way to check if a cutscene is running? This would be for the case that every time there is a cutscene you want to do something like turn an object/character off or change or hide the cursor.

For example, I have a StartCutscene(eSkipetcetc); in a bunch of places, but now I've decided that everytime that hapens I want to change the cursor to look like um... let's say a cookie (a biscuit in non-American). I would have to add a ChangeImageCursor() or whatever before or after every startcutscene and end cutscene, and that's a lot more lines of code!

How can one avoid this? is there a funciton I missed? if not, can one be made? or can we have thing added to on_event() like eStartCutscene and eEndCutscene?

strazer

#1
There's an undocumented game.in_cutscene variable. Is that what you're looking for?

Edit:

Hm, reading over your post again, probably not.
Does putting the StartCutscene and EndCutscene commands in custom functions work?

Code: ags


function myStartCutscene(CutsceneSkipType skiptype) {

  // do stuff, turn off some GUIs etc.
  StartCutScene(skiptype);

}


function myEndCutscene() {

  EndCutscene();
  // do stuff, turn on some GUIs etc.

}


function some_interaction() {

  myStartCutscene(eSkipAnyKeyOrMouseClick);

  // the cutscene

  myEndCutscene();

}


Edit 2:

I like the on_event suggestion, btw.

edmundito

Yep, that's what I usually do... and I kind of forgot this time. But that would mean going around and replacing every StartCutscene() and EndCutscene in every script, which isn't much in this game, but some people might not be so lucky.

Pumaman

While we're on the subject, I'm planning some sort of  on_event_always  for a future version to allow you to capture various events that you can't at present.

So what events would people want from it?
* OnStartCutscene
* OnEndCutscene
* OnStartDisplaySpeech?
* OnEndDisplaySpeech?

Anythign else?

edmundito

man, it would be cool if you could manipulate what happens before/after every method call but that would be getting into something kind of like aspect-oriented programming.

strazer

I don't know what events can't be implemented using the current system, but I think BeginDialog and EndDialog would be very useful.
Search the tracker page for "event" to see all prior suggestions.

SMF spam blocked by CleanTalk