Enabling mouse (for GUI clicks) during cutscene?

Started by Monsieur OUXX, Sun 16/02/2014 21:04:13

Previous topic - Next topic

Monsieur OUXX

I'd like the user to be able to use a GUI during cutscenes (with buttons that he could click on)
How would you do?

Even if it's not possible using built-in AGS functions, there could be plenty of workarounds (e.g. creating a fake mouse cursor using a moving label, updating its position using mouse.x/y, intercepting clicks using mouse.IsButtonDown, etc.) ... but I'd rather use the simplest solution!

Do you have anything to recommend?

=========

Side question : In the game settings, you have some options to skip the cutscenes (mouse only, keyboard only, etc... AND those options can be combined with "timer"). But when I look at the help of StartCutscene(...), the enumerated "skip" options don't correspond. There is no mention of the timer. Do they match the general options at all?
 

Crimson Wizard

#1
Quote from: Monsieur OUXX on Sun 16/02/2014 21:04:13
Side question : In the game settings, you have some options to skip the cutscenes (mouse only, keyboard only, etc... AND those options can be combined with "timer"). But when I look at the help of StartCutscene(...), the enumerated "skip" options don't correspond. There is no mention of the timer. Do they match the general options at all?
You are confusing skip speech and skip cutscene types. These are completely irrelevant sets of styles. AGS 3.3.0 made this more emphasised by introducing special enum for skipping speech (there was already one for skipping cutscene).
Skipping cutscene can't be bound to timer, because that makes no sense.

DoorKnobHandle

To answer the first part of your question, there aren't really 'cutscenes' in AGS - and a cutscene, as you describe it, with interactivity isn't really a cutscene anymore anyways, by definition. What you want to do is script your 'cutscene' in a non-blocking fashion and then code in your GUI interactivity as you would if the game was running normally.

Monsieur OUXX

Quote from: DoorKnobHandle on Sun 16/02/2014 21:26:47
What you want to do is script your 'cutscene' in a non-blocking fashion and then code in your GUI interactivity as you would if the game was running normally.

Yes, but I have constraints. The people who will be scripting the cutscenes might be undertrained with AGS, and introduce a lot of human mistakes while trying to figure out non-blokcing cutscene instructions. My goal is to let them script cutscenes as easily as possible.
I could argue philosophical approaches of what is a cutscene, but in this case, the GUI is not part of the game, but part of the debuging interface, therefore it is out of the game. The game must run normally, and the debug GUI work around it -- not the opposite.

Yet, you suggestion of using non-blocking cutscene instructions will be plan B in case I don't achieve that goal.
@CW: thanks for pointing out the difference between speechskip and cutscene skip. I think it's the second time I fall for that, and I forgot the trick inbetween.

 

Monsieur OUXX

I just tested the following and it works like a charm :

When you make the debug gui appear:
- pause game
- hide mouse (if needed)
- set the speech skip to "nothing'
- same thing for cutscene skip: "nothing'
- if you use "tweens" or timers : suspend all the timers currently going on (keep postponing them)
- set a boolean variable to flag that a complete game pause is currently happening (to be used by other modules relying on yours)

Then in the gui use repeatedly_execute_always to make it work (with keyboard and mouse)

When you close the debug gui :
- do all the opposite from above

I haven't found a caveat yet. Surely there is a catch, but this does the job well enough -- that is: without having to worry about anything else, especially third-party scripts. The only graphical glitch is that the current dialog line appears on top of the debug gui.

By the way, that addresses the absence of "complete pause" in AGS that someone raised a few days ago.
 

DoorKnobHandle

Well that pauses your game. From your original post you never mentioned you wanted the game to pause, I assumed you wanted to use a GUI while the game was playing. :p

Monsieur OUXX

Quote from: DoorKnobHandle on Sun 16/02/2014 23:43:06
Well that pauses your game. From your original post you never mentioned you wanted the game to pause, I assumed you wanted to use a GUI while the game was playing. :p

Agreed. It can or can not pause the game, the difficulty was to make sure not to interfere with cutscenes, especially while managing keyboard or mouse.
 

SMF spam blocked by CleanTalk