- Joined
- Oct 2, 2010
- Messages
- 74
Making Cinematics Skippable
Introduction:
In this tutorial, you will learn how to enable the player to skip a cinematic that has already begun by pressing the "Esc" key using only GUI triggers.
This tutorial assumes that you know how to create a cinematic already.
This tutorial assumes that you know how to create a cinematic already.
Why do I need this?:
Well, think about it this way. If you just lost a game, you damn sure don't want to have to go trough the 8 minute beginning cinematic all over again, do you? I know I wouldn't. In fact, I'd rather do anything else but that.
So what can we find in an ordinary cinematic?:
Well a cinematic is usually a trigger that, for the most part, sticks to using actions of these types: Camera, Cinematic, and Unit.
Important:
Make sure your cinematic is finished before you make it skippable, because it will look a bit more diluted when we're done.
This is the cinematic I prepared for this tutorial.
This is the cinematic I prepared for this tutorial.
-
Example Cinematic
-
Events
-
Map Initialization
-
-
Conditions
-
Actions
-
Cinematic - Turn on cinematic mode for [All players]
-
Cinematic - Disable user control for [All players]
-
Cinematic - Fade in over 2.00 seconds using texture [White Mask] and color [0.00%, 0.00%, 0.00%] with 0.00% transparency
-
Camera - Apply Camera 1 for [Player 1] over 0.00 seconds
-
Unit - Order [Unit 1] to Move To [Region 1]
-
Wait 2.00 Seconds
-
Cinematic - Send transmission to [All players] from [Unit 1] named Superman: Play no sound and display It's a bird. it's a plane. No! Its superman. Modify duration: add 4.00 seconds and Do not wait
-
Wait 4.00 Seconds
-
Cinematic - Send transmission to [All players] from [Unit 2] named Lex Luthor: Play no sound and display Your going down superman. Modify duration: add 3.00 seconds and Do not wait
-
Wait 3.00 Seconds
-
Unit - Order [Unit 2] to Laser beam [Unit 1]
-
Wait 1.00 Seconds
-
Unit - Order [Unit 2] to attack [Civilian]
-
Wait 1.00 Seconds
-
Unit - Kill Civilian
-
Wait 2.00 Seconds
-
Cinematic - Fade out over 2.00 seconds using texture [White Mask] and color [0.00%, 0.00%, 0.00%] with 0.00% transparency
-
Wait 2.00 Seconds
-
Camera - Reset camera for [Player 1] over 0.00 seconds
-
Cinematic - Turn off cinematic mode for [All players]
-
Cinematic - Enable user control for [All players]
-
Cinematic - Fade in over 2.00 seconds using texture [White Mask] and color [0.00%, 0.00%, 0.00%] with 0.00% transparency
-
Quest - Create a Requirement quest titled Kill Luthor with description Kill the villain using icon path ReplaceableTextures\Units\Lex luthor
-
-
Getting Started:
It is very important that after the player skips the cinematic, everything in the map acts as it would have, regardless of whether or not the cinematic was fully viewed.
How do we do that? Well, we create a trigger that does it for us.
(I am going to name this trigger "The Kill Switch")
Look at the end result of the cinematic. What do you see?
This is what you should see:
[Unit 1] is now in Region 1.
[Unit 1] lost life because it was hit by Luthor's laser beam.
[Civilian] is now dead.
[Unit 2] has lower mana because it used the laser beam.
[Quest] "Kill Luthor" has been discovered.
[Cinematic] The cinematic mode gets turned off, the camera is reset, and user control has been re-enabled.
Now we need to create a trigger that does this instantly.
And here it is:
Just look at what happens in the original cinematic, and make the killswich act accordingly.
How do we do that? Well, we create a trigger that does it for us.
(I am going to name this trigger "The Kill Switch")
Look at the end result of the cinematic. What do you see?
This is what you should see:
[Unit 1] is now in Region 1.
[Unit 1] lost life because it was hit by Luthor's laser beam.
[Civilian] is now dead.
[Unit 2] has lower mana because it used the laser beam.
[Quest] "Kill Luthor" has been discovered.
[Cinematic] The cinematic mode gets turned off, the camera is reset, and user control has been re-enabled.
Now we need to create a trigger that does this instantly.
And here it is:
-
Example Cinematic Kill Switch
-
Events
-
Conditions
-
Actions
-
Cinematic - Fade out over 2.00 seconds using texture [White Mask] and color [0.00%, 0.00%, 0.00%] with 0.00% transparency
-
Wait 2.00 Seconds
-
Unit - Move [Unit 1] (instantly) to [Region 1]
-
Unit - Set Life of [Unit 1] to [[Maximum Life of [Unit 1]] - 75.00]
-
Unit - Add a 0.00 second Generic expiration timer on [Civilian] (This kills the unit without leaving leaks behind)
-
Unit - Set Mana of [Unit 2] to [[Maximum Mana of [Unit 2]] - 100.00]
-
Quest - Create a Requirement quest titled Kill Luthor with description Kill the villain using icon path ReplacebleTextures\Units\Lex luthor
-
Camera - Reset camera for [Player 1] over 0.00 seconds
-
Cinematic - Turn off cinematic mode for [All players]
-
Cinematic - Enable user control for [All players]
-
Cinematic - Fade in over 2.00 seconds using texture [White Mask] and color [0.00%, 0.00%, 0.00%] with 0.00% transparency
-
-
Just look at what happens in the original cinematic, and make the killswich act accordingly.
Laying The Ground Work:
Now you need a Boolean Variable with the name of the trigger_Is_On
So: Example_Cinematic_Is_On
If this variable is true, then the cinematic is running right now.
If this variable is false, then the cinematic is not running right now.
That is the outline, so now let's put it to practice by adding it to the 2 triggers we have.
Add an Event that starts the Example Cinematic Kill Switch when the player presses the "Esc" Key, and a Condition that only allows the Kill Switch to run while Example Cinematic is running.
If you will look up at the trigger for a second time, you can see that I have added these elements already.
So: Example_Cinematic_Is_On
If this variable is true, then the cinematic is running right now.
If this variable is false, then the cinematic is not running right now.
That is the outline, so now let's put it to practice by adding it to the 2 triggers we have.
-
Example Cinematic
-
Events
-
Map Initialization
-
-
Conditions
-
Actions
-
Cinematic - Turn on cinematic mode for [All players]
-
Cinematic - Disable user control for [All players]
-
Cinematic - Fade in over 2.00 seconds using texture [White Mask] and color [0.00%, 0.00%, 0.00%] with 0.00% transparency
-
Set Example_Cinematic_Is_On = True
-
Camera - Apply Camera 1 for [Player 1] over 0.00 seconds
-
Unit - Order [Unit 1] to Move To [Region 1]
-
Wait 2.00 Seconds
-
Cinematic - Send transmission to [All players] from [Unit 1] named Superman: Play no sound and display It's a bird. it's a plane. No! Its superman. Modify duration: add 4.00 seconds and Do not wait
-
Wait 4.00 Seconds
-
Cinematic - Send transmission to [All players] from [Unit 2] named Lex Luthor: Play no sound and display Your going down superman. Modify duration: add 3.00 seconds and Do not wait
-
Wait 3.00 Seconds
-
Unit - Order [Unit 2] to Laser beam [Unit 1]
-
Wait 1.00 Seconds
-
Unit - Order [Unit 2] to attack [Civilian]
-
Wait 1.00 Seconds
-
Unit - Kill Civilian
-
Wait 2.00 Seconds
-
Cinematic - Fade out over 2.00 seconds using texture [White Mask] and color [0.00%, 0.00%, 0.00%] with 0.00% transparency
-
Wait 2.00 Seconds
-
Set Example_Cinematic_Is_On = False
-
Camera - Reset camera for [Player 1] over 0.00 seconds
-
Cinematic - Turn off cinematic mode for [All players]
-
Cinematic - Enable user control for [All players]
-
Cinematic - Fade in over 2.00 seconds using texture [White Mask] and color [0.00%, 0.00%, 0.00%] with 0.00% transparency
-
Quest - Create a Requirement quest titled Kill Luthor with description Kill the villain using icon path ReplaceableTextures\Units\Lex luthor
-
-
-
Example Cinematic Kill Switch
-
Events
-
Player - Player 1 (Red) skips a cinematic sequence
-
-
Conditions
-
[Example_Cinematic_Is_On] Equal to True
-
-
Actions
-
Cinematic - Fade out over 2.00 seconds using texture [White Mask] and color [0.00%, 0.00%, 0.00%] with 0.00% transparency
-
Set Example_Cinematic_Is_on = False
-
Wait 2.00 Seconds
-
Unit - Move [Unit 1] (instantly) to [Region 1]
-
Unit - Set Life of [Unit 1] to [[Maximum Life of [Unit 1]] - 75.00]
-
Unit - Add a 0.00 second Generic expiration timer on [Civilian] (This kills the unit without leaving leaks behind)
-
Unit - Set Mana of [Unit 2] to [[Maximum Mana of [Unit 2]] - 100.00]
-
Quest - Create a Requirement quest titled Kill Luthor with description Kill the villain using icon path ReplacebleTextures\Units\Lex luthor
-
Camera - Reset camera for [Player 1] over 0.00 seconds
-
Cinematic - Turn off cinematic mode for [All players]
-
Cinematic - Enable user control for [All players]
-
Cinematic - Fade in over 2.00 seconds using texture [White Mask] and color [0.00%, 0.00%, 0.00%] with 0.00% transparency
-
-
Add an Event that starts the Example Cinematic Kill Switch when the player presses the "Esc" Key, and a Condition that only allows the Kill Switch to run while Example Cinematic is running.
If you will look up at the trigger for a second time, you can see that I have added these elements already.
Finishing the Product:
There's one more problem that we need to solve before the Example Cinematic is by all means "Skippable".
The problem is that if the player presses the "Esc" Key at the beginning, or in the middle of the cinematic, The Kill Switch trigger will do it's thing, but the cinematic will not know that it's supposed to stop, and it will keep on running as if nothing happened, which could possibly lead to many bugs in your map.
Now you can get around this problem, and I'm going to show you how.
(Credits to Maker for helping me here)
The outline goes like this:
You are going to have to add an If / Then / Else function, after each Wait action, of the cinematic trigger. This will result in the cinematic to realize whether it is going to continue or skip the cinematic.
The If / Then / Else Function:
This trigger action is designed to allow the map maker to add a condition in the middle of the trigger, and tell the trigger that
If the condition is met, Then it should do something, and if it is not, then it should do something else.
If: Example_Cinematic_Is_On equal to False,
Then: Skip remaining actions,
Else [Nothing]
So like I said, you add an If / Then / Else function, after each Wait action.
The problem is that if the player presses the "Esc" Key at the beginning, or in the middle of the cinematic, The Kill Switch trigger will do it's thing, but the cinematic will not know that it's supposed to stop, and it will keep on running as if nothing happened, which could possibly lead to many bugs in your map.
Now you can get around this problem, and I'm going to show you how.
(Credits to Maker for helping me here)
The outline goes like this:
You are going to have to add an If / Then / Else function, after each Wait action, of the cinematic trigger. This will result in the cinematic to realize whether it is going to continue or skip the cinematic.
The If / Then / Else Function:
This trigger action is designed to allow the map maker to add a condition in the middle of the trigger, and tell the trigger that
If the condition is met, Then it should do something, and if it is not, then it should do something else.
If: Example_Cinematic_Is_On equal to False,
Then: Skip remaining actions,
Else [Nothing]
So like I said, you add an If / Then / Else function, after each Wait action.
-
Example Cinematic
-
Events
-
Map Initialization
-
-
Conditions
-
Actions
-
Cinematic - Turn on cinematic mode for [All players]
-
Cinematic - Disable user control for [All players]
-
Cinematic - Fade in over 2.00 seconds using texture [White Mask] and color [0.00%, 0.00%, 0.00%] with 0.00% transparency
-
Set Example_Cinematic_Is_On = True
-
Camera - Apply Camera 1 for [Player 1] over 0.00 seconds
-
Unit - Order [Unit 1] to Move To [Region 1]
-
Wait 2.00 Seconds
-
If [Example_Cinematic_Is_On] equal to [False] then [Skip Remaining Actions] Else [Do nothing]
-
Cinematic - Send transmission to [All players] from [Unit 1] named Superman: Play no sound and display It's a bird. it's a plane. No! Its superman. Modify duration: add 4.00 seconds and Do not wait
-
Wait 4.00 Seconds
-
If [Example_Cinematic_Is_On] equal to [False] then [Skip Remaining Actions] Else [Do nothing]
-
Cinematic - Send transmission to [All players] from [Unit 2] named Lex Luthor: Play no sound and display Your going down superman. Modify duration: add 3.00 seconds and Do not wait
-
Wait 3.00 Seconds
-
If [Example_Cinematic_Is_On] equal to [False] then [Skip Remaining Actions] Else [Do nothing]
-
Unit - Order [Unit 2] to Laser beam [Unit 1]
-
Wait 1.00 Seconds
-
If [Example_Cinematic_Is_On] equal to [False] then [Skip Remaining Actions] Else [Do nothing]
-
Unit - Order [Unit 2] to attack [Civilian]
-
Wait 1.00 Seconds
-
If [Example_Cinematic_Is_On] equal to [False] then [Skip Remaining Actions] Else [Do nothing]
-
Unit - Kill Civilian
-
Wait 2.00 Seconds
-
If [Example_Cinematic_Is_On] equal to [False] then [Skip Remaining Actions] Else [Do nothing]
-
Cinematic - Fade out over 2.00 seconds using texture [White Mask] and color [0.00%, 0.00%, 0.00%] with 0.00% transparency
-
Wait 2.00 Seconds
-
If [Example_Cinematic_Is_On] equal to [False] then [Skip Remaining Actions] Else [Do nothing]
-
Set Example_Cinematic_Is_On = False
-
Camera - Reset camera for [Player 1] over 0.00 seconds
-
Cinematic - Turn off cinematic mode for [All players]
-
Cinematic - Enable user control for [All players]
-
Cinematic - Fade in over 2.00 seconds using texture [White Mask] and color [0.00%, 0.00%, 0.00%] with 0.00% transparency
-
Quest - Create a Requirement quest titled Kill Luthor with description Kill the villain using icon path ReplaceableTextures\Units\Lex luthor
-
-
Important:
Careful not to use the If / then / else multiple function, because even though it might work just as well as this one, it can become a large mess.
Credits: Maker, for helping me finish the product properly.
And I wish you good luck.
Credits: Maker, for helping me finish the product properly.
And I wish you good luck.
Last edited: