Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: edmundito on Mon 25/04/2005 19:26:33

Title: Cutscenes events...
Post by: edmundito on Mon 25/04/2005 19:26:33
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?
Title: Re: Cutscenes events...
Post by: strazer on Mon 25/04/2005 21:06:22
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?



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.
Title: Re: Cutscenes events...
Post by: edmundito on Mon 25/04/2005 23:46:42
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.
Title: Re: Cutscenes events...
Post by: Pumaman on Tue 26/04/2005 20:00:32
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?
Title: Re: Cutscenes events...
Post by: edmundito on Tue 26/04/2005 20:20:34
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.
Title: Re: Cutscenes events...
Post by: strazer on Wed 27/04/2005 02:35:55
I don't know what events can't be implemented using the current system, but I think BeginDialog and EndDialog (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=380) would be very useful.
Search the tracker page for "event" to see all prior suggestions.