CAP 211 -
Interactive Design and Game Development
Mastering Unreal Technology, Chapter 9
This lesson discusses Kismet. Objectives important to
- Sequence objects
- Sequence flow
- Simple sequences
- Intermediate sequences
Chapter 9 takes us to some tutorials on Kismet, the scripting system that is part of Unreal Editor. As you have seen already, Kismet uses a visual interface that includes sequence objects which perform specific functions.
Tutorial 9.1: Triggering lights
This tutorial begins on page 499.
- Open DM-CH_09_KLightSound_Start.ut3. The images in the text for this tutorial are not as clear as we mignt like, so look at the image here as needed.
- Follow the instructions to add a Trigger to the level.
Open the properties of the trigger, and find its bHidden property (in the Display category). Note that the default value of this property is true (checked). Normally, triggers are hidden in the game. Turn off the bHidden property to make it easier to see what happens next.
- Create a PointLightToggleable object as instructed, and turn off its bEnabled property to have the light turned off when the level starts.
- Open the Kismet editor, which should be empty for this level.
- It would help to have two monitors at this point. Select the trigger object in Unreal Editor, then right-click in the Kismet window. A context sensitive menu will appear. The text has a typo here: select New Event Using Trigger_0, Touch. This object will watch for a player touching something. It is not linked to that thing yet. (This object is the hexagon in the image shown here.)
- Follow the instructions in the text to create an action object which, in this case, will toggle the value of a variable. Note the instruction for moving an object in the Kismet window: ctrl-drag it. (This object is the rectangle in the image shown here.)
- To create the third Kismet object you need, go back to Unreal Editor and select the light object you made.
Create a new Kismet Variable object as instructed. This one holds the value of a property of the light object. (This is the round object shown in the image above.)
Drag a line from the target port of the toggle object to the variable object. (It has no ports.) Note that the line will have an arrow that points back to the target port. This enables the toggle object to change the value held by the Variable object.
- The text does not quite match our version of the editor, but it is close enough to follow. Drag a line from the Touched port of the trigger object to the Turn On port of the toggle object. Note that this will turn on the light when the trigger is touched, but it will not turn the light off.
- Build all and save with your initals in the filename, so you can increment it if needed. Test the level as instructed, but be careful. This level has no walls. If you past the edge of the floor, your character will fall to its death.
The text pauses between tutorials to discuss some facts about sequence objects.
Question 1: What are the five types of sequence objects described in the text?
A Kismet sequence will start with an event, which typically fires an action.
Tutorial 9.2: Simultaneous actions
This tutorial begins on page 513. Open the file you saved at the end of the tutorial above.
- Begin with the file saved above.
- Open Kismet. Select the Touch event. It is the only event in the sequence so far. The properties of the selected objects are shown in the lower left corner of the Kismet editor. Find the MaxTriggerCount property and set it to 0. This will not keep the event from happening, as you might think. It means that there is no maximum number of times the event can happen. (Note the default value. By default this event could only happen once in the level.)
- Keep an open mind for minute. Turn off the CastShadows property of the light, and you will see the room lit up again. This choice effectively tells the light not to cast a shadow with the lampshade (or anything else). This means that the light will pass through the lampshade.
- Change the color of the light as instructed. The text is correct, that the button with the magnifying glass icon opens the Color Chooser. Note that when you hover over it, the pop up help says that it shows the Generic Browser. It does not.
The button with the icon of an arrow lets you pick a color from the scene.
- Change the Falloff value of the light. You will recall from 3DS Max lights that a falloff defines an area in which a light stops being effective.
- Change the scale of the light as instructed.
- Click Build All to see what the scene really looks like at this point.
- Save incrementally.
Tutorial 9.3: Kismet and material instances
- Open the level file specified in the text. Pan the camera in the Perspective viewport to the right and you will see the red sphere mentioned in this step.
- The text tells you to create a new trigger object. Remember that you have to open the Actor Classes browser first, and select Trigger from the list. (It is not necessary to select a subtype for the trigger.)
Set the bHidden property as you have before so the trigger is visible in the game.
- With the trigger selected, open the Kismet editor. Follow the directions in the text to create a new event in Kismet. (Be aware that the name of your trigger may not match the name given in the text.)
Set the MaxTriggerCount property and bAimToInteract properties as instructed.
Question 2: What is the purpose for changing each of these properties?
- The text explains the logic for the exercise. We want to be able to change the light to blue, and have it turn red again after a delay.
In substep A, create a new action object that will set a ScalarParam of a MaterialInstance.
In substep B, open the Generic Browser, and use it to open the custom package for this exercise.
Select the material indicated. It is the second mat_redbluePulsar material in the package.
In substep C, go back to the Kismet window. Select the action object, and change its parameter as instructed. Note, the icon shown in this step is wrong. The button you click looks
like a left arrow.
In substep D, change the parameter name as intructed.
Carry out the remaining substeps.
- The text suggest you test the level at this point. Do that, then continue with the substeps.
In substep A, duplicate the action object. This will make a duplicate object already configured like the first one.
Question 3: What is the keyboard command to duplicate the action object?
In substep B, move the new object as specified.
In substep C, change the ScalarParam to 0, which will turn the sphere red.
In substep D, create a new action sequence object for a delayed action.
In substep E, configure the delay object.
substep F, connect the objects as specified.
- The problem with the program code you have made so far is that the sphere stays blue if you exit the level within two seconds of using the trigger.
Substep A is on page 525. It is easy to miss, since it is between two pictures. Create a new event as instructed that stands for the level starting.
In substep B, connect the new event to the in port of the action that turns the sphere red. This shows that you can have more than one sequence object connected to the same port on another object.
- Save and test the level.
Tutorial 9.4: Spawning actors in Kismet
- Open the level file specified in the text. Read the description of the room in the text, and confirm that you are in the right level.
- In the following steps, the text has confused Trigger_0 and Trigger_1. It tells you to click the leftmost trigger in the scene, which it refers to as Trigger_0. It is actually Trigger_1. To make this easier, reverse the postions of the two triggers, then all will be well.
- If you have changed the trigger positions as I noted above, continue with the instructions in the text.
- Continue with the instructions in the text, creating an Actor Factory object in Kismet.
- Configure the Actor Factory object as indicated in the flawed text.
In substep A, the icon is wrong again. It should look like a down arrow, and the popup label for it says Create a New Object (not Add New Object).
In substep B, use the Generic browser to open the only package file for this chapter, which is KismetContent, not KismetSpawn. Select the specified mesh, which actually is in that package.
- Follow the instructions to create ten spawn points at the locations already created in the scene. In substep B, once again the icon in the text is wrong. The actual icon looks like a cyan plus sign.
Continue with the rest of the exercise through step 11. Test the level and save with a new name.
The text describes adding comments to your Kismet sequences. You will do this in the next tutorial.
Tutorial 9.5: Commenting
- Open the file specified in the text. Read the desrcription of the scene and make sure you have opened the right file.
- Open the Kismet Editor window. Enter the comment as instructed. Note the purpose of this short tutorial. You are entering comments in the programming area to serve as a plan for your program. This is usually called writing the program in pseudocode..