UDK: How to Prototype Quick Time Events in Kismet
May 31, 2012
UDK Scripting Series by Pete Bottomley:
Intro to Kismet
How to Pick Up and Place Item
How to Trigger Material Instances
How to Spawn Bots in Kismet - Part 1
How to Add Functionality to the Bot - Part 2
Bot Functionality Final Touches - Part 3
Bools - Puzzle Design and Interaction
Cinematics Introduction Part 1/2
Cinematics Introduction Part 2/2
Using Console Commands as Gameplay Elements
How to Prototype Quick Time Events in Kismet
This tutorial was created to show you how to prototype a quick time event setup. This would ideally only be used as a place holder whilst you test out ideas and a more script heavy approach would probably be better for games being professional developed. However, this system is done entirely inside of Kismet and works well for our purposes to test out ideas.
In this Quick Time Event video you'll learn:
Can't see the video? Watch it on WoLD YouTube Channel here
1. Firstly we need to add the actors to our scene that we will use in the sequence. In this example I have two camera actors found in Actor Classes - Common - Camera. I have a trigger volume to start the sequence but this could be any type of event you want to use. I also have a piece of concrete StaticMesh 'LT_Buildings2. SM. Mesh. S_LT_Buildings_ SM_BunkerWallB_STR' which will start to fall on the player and kill them unless they shoot it. I also have a particle emitter ParticleSystem 'FX_VehicleExplosions. Effects. P_FX_VehicleDeathExplosion' attached to it which will activate if the player shoots the concrete. We can attach the emitter by selecting the emitter and then locking the properties using the yellow lock icon at the top of the actor properties box. Then select the concrete block and in Attachment press the green arrow to input the actor into base. The two actors should now be attached to each other and in the viewport, see a green line attaching them. You also need to turn off Auto Activate in Emitter - Particle System Component.
Further down the sequence I also have a note found in Uncategorised in Actor Classes which we will use to teleport the player to after the event.
For this example, I also want the player to be holding a weapon so I added SkeletalMesh 'WP_LinkGun. Mesh. SK_WP_Linkgun_1P' as a skeletal mesh into the scene. Make sure it is the 1P and not the 3P as the later doesn't have as many bones to shoot a projectile from (although it's still possible to do).
2. The first step in Kismet is to add the event that will trigger the sequence. In this case we used the trigger volume.
I also added the sound cue SoundCue 'A_Character_BodyImpacts. BodyImpacts. A_Character_RobotImpact_ BodyExplosion_Cue' which is the sound of the floor breaking. This is not necessary but relevant to this demonstration.
3. The next part of Kismet we need to setup is to turn on Cinematic mode so that the player loses control over everything bar the input.
We add a Toggle Cinematic Mode from New Action - Toggle and also a Console Command from New Action - Misc. There is a Destroy action found in New Action - Actor which we have attached the floor piece to. The Toggle Hidden unhides the weapon that we added and also the large piece of concrete.
A property that you will need to change on the Toggle Cinematic Mode is un-ticking the Disable Input. This will allow the player to still hit buttons for the quick time events but not let them do anything else. I have also added the input in the console command 'God'. This will turn on God Mode so that when the player drops down outside of the sequence they won't die.
4. Now that we have the initial Cinematic setup we need to add the main Matinee sequences that will play our Quick time events.
The top Matinee is just a single group using a movement track with the concrete falling from the roof to the ground which hits the ground as the player does. If they don't destroy this block then it will kill the player. I have also used a delay on the input of 2.0 seconds so that it doesn't start playing until 2 seconds after the player has started falling. You can add this by right clicking on any black Kismet tab and select Set Active Delay.
The bottom Matinee is slightly more complex. We have the fall cam which is the initial camera which shows the player falling down the hole and then sliding down the walkway and then finishes. The only thing you need to worry about with these are that all the keys are correctly timed. I also have a weapon group which is the Skeletal Mesh (New Skeletal Mesh Group) with roughly the same movement track however after the fall the gun gets thrown away. Be sure to add a director group to the Matinee also with the focus on which camera you are looking at.
Something that you may have noticed on the Matinee picture is that there are 2 outputs, F and Kill. These are fired off an event track from the director group which will allow us to trigger other events at those times in the sequence.
As you can see, on both Play inputs there is a connection firing them off. These will both be fired from the 'Initial Trigger' that we first set up.
5. The next functionality we need to set up is the actual weapon firing behaviour which will spawn the projectile to shoot the concrete block falling.
Start off by adding a Toggle (LMB + T) and Hooking the Turn On back up to the 'Initial Trigger' at the start of the sequence. Next, we need to add a Key/Button Pressed Event. This can be found under New Event - Input - Key/Button Pressed.
The two properties that you need to change are the Input names (For this I assigned F) and also untick Enabled. This means that whenever we press F it will fire off an action when it is activated. Hook the Event tab of the Toggle into the new event we just created. This will turn the event on when the sequence starts.
Next, we need to add a switch with as many link outputs as you want the player to tab the key for in the quick time event. For example, if you want the player to press 'F' 6 times before the weapon un-jams, then you would have 6 links. You can add a switch by going to New Action - Switch - Switch and change its link count property to 6.
I also have a random switch in this sequence, however it is not hooked up. You can find these in New Action - Switch - Random. This will add a random element to your setup so that the player doesn't know exactly how many times they should press 'F' before it triggers off. An ideal setup for this would be to have the original switch with 6 links, and then on the 6th link, connect it up to a Random Switch. Give the random switch only a few links to choose from so that it isn't too difficult and make sure you check Looping on the Random Switch properties.
The Play Sound action (LMB + S) is the sound of the weapon jamming. This works as feedback to the player to show them that the weapon is jammed. The sound used in this example is SoundCue 'A_Weapon_RocketLauncher. Cue. A_Weapon_RL_ RocketLoaded_Cue'.
The two toggles in this section turn on the emitter that is attached to the concrete and it also hides the piece of concrete. Make sure you have the correct toggles matching the actors.
The Projectile Factory is what we can use to spawn the projectile that will destroy the falling rubble. You can find this action in New Action - Actor - Projectile Factory. In this example I assigned an archetype to the factory. Press the blue dropdown arrow in the Projectile Factory and select ActorFactoryArchetype. The Archetype Actor property underneath this needs something assigning to it. There are existing Archetypes that can be found in the Mobile section of UDK. You could use MobileProjectile 'KismetGame_Assets. Projectile. Blaster_01' for this example, however a lot of the sounds and particles are from Jazzy Jackrabbit and may not suit your gametype. If you right click on this Archetype in the Content Browser and Create a Copy in your custom package, you can then edit any properties you wish and assign that into the properties. Be sure to save your package if you're doing this.
Other properties to change in this Factory are the PS Template at the top. In this case I used ParticleSystem 'WP_RocketLauncher. Effects. P_WP_RockerLauncher_ Muzzle_Flash' however, any type of flash particle will work in this example. I also added the Bone Name lg_flash. If you find your weapon in the content browser (The 1P link rifle) it will open the AnimSet Editor. If you scroll down the Skeleton Tree you will see where all the different bones are positioned on the weapon. I chose lg_flash because it is based at the barrel end of the weapon but if you want your particle emitting from somewhere else on the weapon you can change this. Lastly, select the weapon in the scene and right click on the Spawn Point of the Factory and assign it here so that the particle fires from the weapon.
The last thing to set up is where the connections are ending. If you have used the same setup as me, from Link 6 of the switch you will need to create two links, one to the Spawn Projectile and one to the Turn On of the Toggle. We will create the other links later in the sequence so you don't have to worry about those for now.
6. Next we will create the on screen indications for the quick time events.
Fristly, we will start off with a Toggle (LMB+T) connected to a Delay (LMB+D) connected to a Gate (LMB+G). The Gates 'Out' should hook back round to the Toggle of the Toggle. The delay should have a time of around 0.2 (this is how quickly it flashes on screen). I also have a Play Sound (LMB+S) hooked up after the toggle which plays the sound SoundCue 'A_Interface.menu. UT3MenuCheckbox DeselectCue'. This is just a menu sound which create as a bleeping type effect. Now that we have a basic loop in place we need to add the thing we're looping.
I will explain both events but for now create a Draw Image event found in New Event - HUD - Draw Image. You should also note that nothing fires out of the Out of the events so you don't need to hook anything up to these.
Right click on the red Active Bool tab underneath and create a new Bool and hook that up to the Bool tab from the Toggle. Use the settings provided in the image above, however you can play around with these values you get it into the location on the screen you want it. I also used the Texture Texture2D'UDKHUD.reload' which creates the following texture to flash:
This shows the player that they need to tap F.
You also need to create the action New Action - Set Variable - Bool. The Value should be False and the Target should be the Bool that you have going from the Draw Image to the Toggle.
Connect the 'In' of the Bool and the Close of the Gate back up to the Finished of the Spawn Projectile Factory you created previously. This means that when the projectile has spawned and destroyed the concrete the image will stop flashing by closing the gate and also make sure it's off by default setting the Bool to false.
7. Now that we have the Shooting out of the way we need to set up the Jump at the end of the sequence.
Firstly, we will need a Toggle (LMB+T) hooked up to another Key/Button Pressed event. Similar to the projectile setup, you will also need a Switch. I have this example using Link 1 for ease of testing but you can use any amount of links you wish (you could also add a random switch to make it more random if you wish). Use the same properties for the Key/Button Pressed event as last time, assigning F to the Input Names section and also Disable the Event.
The next step is to create two Matinee sequences. One will be of the player falling off the edge and dying. The other will be if they make the Jump and jump the gap and grab on to the other side. The Jump Matinee should hook up to the Play of the link from the switch you are firing off. The Falling Matinee should hook up the Stop to the switch. This means that the falling will play by default unless the player presses the button and then jumps the gap.
The Falling Matinee is just a simple camera setup of the playing falling down. With the jump one, I added a few more Keys to show them jumping the gap and the grabbing on to the ledge and pulling themselves up, however these can both be as simple as you'd like them.
The gate section of the Jump is basically asking if the player got killed. From the Starting Matinee we created a Kill Event (see previous image), hook this up to the In of the Gate. The close should be hooked up to the Link of the Switch in the Spawn Projectile area which we mentioned in the last paragraph of section 5. This setup only gets called if the player hasn't shot down the concrete before it has hit them.
It's up to you what you want to happen if the player dies, in this example I have a Modify Health action (New Action - Actor - Modify Health) which gives 1000 damage as well as DmgType_Crushed. It also uses a Console Command (New Action - Misc - Console Command) which we can use to open the level again (or the main menu) by typing something like 'open Level01'. I also have a Remote Event (LMB+R) named Kill which hooks up back round to the Stop of the first Matinee we created to stop the Matinee from continuing to play showing the player sliding down the corridor.
8. Lastly, we need to create the quick time event which flashes to show the player to press F before they fall. We will use the Draw Text event this time.
This is the exact same setup as before but instead using Draw Text found in New Event - HUD - Draw Text. The properties can be set as following:
I used the MultiFont'UI_Fonts.MultiFonts.MF_HudMedium' in this case however if you want to import your own font you can right click in the Content Browser and select New MultiFont Imported From TrueType and choose the font you wish to import. More information can be found on the UDN. Be sure to save your package.
9. Lastly, we need to teleport the player to the end of the sequence so that they start across the gap.
Create a Teleport (New Action - Actor - Teleport) and create a Player variable (LMB+P) and be sure to turn off All Players in the property. Create another Toggle Cinematic Mode and hook the Target of the Player up to that also. Lastly create a Console Command action and type in 'God'. This will turn off God mode (which we turned on previously). The Destination of the Teleport should be the Note that you placed at the end of the sequence. The In of the Teleport should hook up to the Completed of the Jump Matinee you created in the Jump section.
Here is a large image of the entire sequence so you can see where all the wires match up to.
10. The main thing to keep in mind when doing these Quick Time Events is to create interesting scenarios for the player to get immersed in. All you really need is the Key/Button Pressed event but using Draw Text and Images on screen create an interesting element. Also adding longer Switches and introducing Random Switches will lead to some intense scenarios.
If you have any questions about Kismet and the tutorial post them on WoLD Forums here.
© 2008-2013. All articles on World of Level Design™ are copyrighted.
Preproduction Blueprint - How to Plan Your Game Environments and Level Designs
How to Plan Your Game Environments and Level Designs
- Ebooks (235+ pages)
- 18 videos (2+ hours)
- Instant Digital Download
(Save $12 w/Code)
Use Discount Code: blueprint12