+ All Categories
Home > Documents > Introduction to Kismet

Introduction to Kismet

Date post: 14-Jan-2016
Category:
Upload: chelsey
View: 60 times
Download: 5 times
Share this document with a friend
Description:
Introduction to Kismet. Sai -Keung Wong Reference: Mastering Unreal Technology (MUT). Contents. What is Kismet? Examples. Introduction to Kismet. A visual scripting system Easy to use Programming experience is not required. Examples, Design simple queries/tasks for players - PowerPoint PPT Presentation
88
Introduction to Kismet Sai-Keung Wong Reference: Mastering Unreal Technology (MUT)
Transcript
Page 1: Introduction to Kismet

Introduction to Kismet

Sai-Keung Wong

Reference: Mastering Unreal Technology (MUT)

Page 2: Introduction to Kismet

Contents

• What is Kismet?• Examples

Page 3: Introduction to Kismet

Introduction to Kismet

• A visual scripting system• Easy to use• Programming experience is not required.• Examples,– Design simple queries/tasks for players– Turn on/off light sources– Change materials of a static mesh– Activate complex event sequences

Page 4: Introduction to Kismet

Introduction to Kismet

• A network of sequence objects ( 序列對象 )• Sequence Objects: – Define specific functions– Send signals to each other

• How to use?– Make sure you understand clearly your purposes– Then everything is easy to manage

Page 5: Introduction to Kismet

A simple example:Turn on/off a spotlight

• Purpose: – The player touches a trigger– Turn on a spotlight

• Need to do:– Add a trigger– Add a togglable spotlight– Add a point light with low intensity (dim)– Add a start position for the player– Use Kismet to define the event sequence for the trigger and

the spotlight

Page 6: Introduction to Kismet

• File -> New -> Additive• Create an additive brush (512x512x64)• Create the geometry using the additive brush• Create a point light– Place it at the center of the newly created

geometry and move upwards a bit– Change its intensity to 0.5– Change its radius to 480

A simple example:Turn on/off a spotlight

Page 7: Introduction to Kismet
Page 8: Introduction to Kismet

A simple example:Turn on/off a spotlight

• Add a trigger– Set it as visible– Press F4->Display->Hidden (don’t check it)

• Add a SpotlightToggleable ( 可開關 spotlight )。 – Content browser->actor->light->spotlight-

>SpotlightToggleable– After creating the spotlight, change its properties• Disable it (F4->light->lightcomponent->Enabled? NO)• Brightness : 4.0

Page 9: Introduction to Kismet
Page 10: Introduction to Kismet

• Now, create an event sequence using Kismet• Select the trigger– Open the Kismet editor– Right click (click right mouse button)->New event

using trigger_0->Touch

A simple example:Turn on/off a spotlight

Page 11: Introduction to Kismet
Page 12: Introduction to Kismet

• Go back to the level editor• Select the SpotlightToggleable• Go back to Kismet• Right click->New action->toggle->toggle• Then, right click

->New Object Var Using SpotlightToggleable

A simple example:Turn on/off a spotlight

Page 13: Introduction to Kismet
Page 14: Introduction to Kismet
Page 15: Introduction to Kismet

• Now, connect the sequence objects by dragging lines from the connectors– Press left mouse button at one connector and move the

cursor to another connector. Then release the left mouse button

• Connect “Touched” of “Tigger_0 Touch” to “Turn On” of “Toggle”

• Connect “UnTouched” of “Tigger_0 Touch” to “Turn Off” of “Toggle”

• Connect “Target” of “Toggle” to SpotlightToggleable_0• Save, build light maps and test the game level

A simple example:Turn on/off a spotlight

Page 16: Introduction to Kismet

A simple example:Turn on/off a spotlight

Page 17: Introduction to Kismet

• Test the game level• When the trigger is touched, the spotlight is

turned on. • But it is not turned off if the trigger is

untouched.• To solve the problem– Go back to kismet– Click “Tigger_0 Touch”

• Change “Max Trigger Count” to 0 (infinite)

• Save and test the game level

A simple example:Turn on/off a spotlight

Page 18: Introduction to Kismet

Max Trigger Count

Page 19: Introduction to Kismet

• Now, add a log action to show messages to players (Misc -> New Action -> Log)

A simple example:Turn on/off a spotlight

Page 20: Introduction to Kismet

• Input “Spotlight status is changed” in “Obj Comment” of “Log”. Save and test the game level

A simple example:Turn on/off a spotlight

Page 21: Introduction to Kismet

Messages

A simple example:Turn on/off a spotlight

Page 22: Introduction to Kismet

• Now, add a position for the player to start to play the game. Place it at a corner.

• In level editor– Right click->add actor->add PlayerStart

• Save and test

A simple example:Turn on/off a spotlight

Page 23: Introduction to Kismet

Sequence Object

• Input/Output connectors• Left connectors: usually for input signals– Only one input, called as “In”– Purpose: Activates other events

• Right connectors: usually for output signals

Page 24: Introduction to Kismet

Sequence Object

• Example: Toggle (開關)– Has many inputs, depended on the functions of

the sequence object• Example, Condition – Has many outputs– Inputs (squares) & Outputs (triangles)

at the bottom Purpose: interact with variables

Page 25: Introduction to Kismet

Types of Sequence Object

• Event (事件)• Actions (動作)• Variables (變量)• Condition (條件)• Matinee

Page 26: Introduction to Kismet

Events (事件) • Activate a signal to start a sequence• Something occurs in the game levels• Examples: – Players touch an object– Players toggle a trigger– Etc.

Page 27: Introduction to Kismet

Actions (動作) • Associate with event sequences• Perform certain tasks, e.g.– Change materials of an object– Change the value of a variable– Teleport a player to other place

Page 28: Introduction to Kismet

Variables

• Variables (變量) • Store data• Can be modified in a sequence• Example,– Use a variable to represent a player– Use a variable to represent a teleporter

Page 29: Introduction to Kismet

Variable Types

• Boolean :红色; • Integer :青色; • Object (對象):紫色; • String (字符串):綠色; • Vector (矢量):黄色; • Union (聯合体(無類型)):白色

Page 30: Introduction to Kismet

Conditions (條件) • For testing purpose• Based on the results, control the flow a

sequence

Page 31: Introduction to Kismet

Matinee

• Matinee • Control Matinee sequence

Page 32: Introduction to Kismet

Kismet Sequence Flow

• Event and action sequences – An event sequence calls an action sequence– An action sequence calls another action sequence– Etc.

• There must be a starting point for activating other sequences

• Action sequences cannot be activated themselves on their own.

Page 33: Introduction to Kismet

Sound

• Touch a trigger– Turn on a light source– Play a sound clip• In Kismet• Right click->new action->sound->play sound• Connect “Out” of “Toggle” to “Play” of “Play Sound”

Page 34: Introduction to Kismet
Page 35: Introduction to Kismet

Content browser->sound cues->select a sound clipIn Kismet, “use selected object in content browser for “Play Sound” object. Save and test.

Page 36: Introduction to Kismet

Sound• Assign two sounds for “Touched” and

“UnTouched”, respectively.

Page 37: Introduction to Kismet

Kismet: Changing Materials

• Change the material of an object– Content browser->static mesh->select a static

mesh– Go back to level editor– Place the static mesh– Content browser->create

MaterialInstanceConstant

Page 38: Introduction to Kismet

Kismet: Changing Materials

Page 39: Introduction to Kismet

Create and assign a material as the parent of the newly created MaterialInstanceConstant

Page 40: Introduction to Kismet

Define a scalar parameter named as “MaterialControl”. Set its value as 1.

Page 41: Introduction to Kismet

Kismet: Changing Materials• Assign the newly created MaterialInstanceConstant

to the static mesh

Page 42: Introduction to Kismet

Kismet: Changing Materials

• Now, • Create a Kismet sequence to change material

of the static mesh– Create a “touch” trigger event for the trigger

Page 43: Introduction to Kismet

• Right click->new action->material Instance->Set ScalarParam

Kismet: Changing Materials

Page 44: Introduction to Kismet

1. Create two “Set ScalarParam”.2. Set the Scalar value of one as 1.0

and another as 0.0.3. Set the Param Name as

“MaterialControl”.4. Set the Mat Inst as the newly

created MaterialInstanceConstant

Kismet: Changing Materials

Page 45: Introduction to Kismet

Kismet: Changing Materials

Page 46: Introduction to Kismet

Kismet: Changing Materials

• Save and test

Page 47: Introduction to Kismet

• Delay action

Touch the triggerto change the material.

After 3 seconds,the material is changedback automatically.

Page 48: Introduction to Kismet

Kismet: Changing Materials

• Level startup event

Page 49: Introduction to Kismet

Simple Example: Spawn

• actor 的 spawning (生成)• Examples, create enemies– Spawn enemies on demand– Spawn static meshes

Page 50: Introduction to Kismet

Simple Example: Spawn

• Add navigation points– Actor->pathnode– Add around five.

• Then we will assign them to the factory spawn points

Page 51: Introduction to Kismet

Simple Example: Spawn

• Create a trigger• In Kismet, Create New Event using Trigger_0 >

Used (使用)事件。 (press E to use in game)

Page 52: Introduction to Kismet

Simple Example: Spawn

• Right click at an empty region next to “Trigger”

• New Action > Actor > Actor Factory 。 • Connect “Trigger”::Used to Actor Factory ::Out

Page 53: Introduction to Kismet

Simple Example: Spawn

• Now, define the type of the actor when spawn

• Select Actor Factory– At the property dialogue of Factory– Click “create New Object”• Select ActorFactoryRigidBody (刚体 Actor 组件工

厂)。

Page 54: Introduction to Kismet
Page 55: Introduction to Kismet

Simple Example: Spawn

• b. uncheck bBlockActors (阻挡 Actor )

• c. select StaticMesh (静态网格物体) in content Browser

• Now, set the spawn position• a. Actor Factory->SpawnPoints->Add New

Item for 5 times. (5 items)

Page 56: Introduction to Kismet

Simple Example: Spawn

Page 57: Introduction to Kismet

• Assign positions to spawn points.– Select a pathnode– Then in factory property dialogue, click “use

selected object in content browser” at spawn point

Page 58: Introduction to Kismet

Simple Example: Spawn

• Create an integer variables and connect it to Log and ModifyObjectList. Save and test.

Page 59: Introduction to Kismet

Simple Example: Spawn

• Press ‘E’ to use a trigger.• Static meshes are created• Display messages

Page 60: Introduction to Kismet

• The objects can be destroyed. • Create a trigger for destroy

Simple Example: Spawn

Page 61: Introduction to Kismet

Kismet Sequence Comments

• ObjComment (对象注释)属性

Page 62: Introduction to Kismet

Example: Changing Lights • In level editor. Use additive brushes.• Create two geometries using additive brushes• Add a trigger and a light source• Add some static meshes of interpActor, i.e.

InterpActor_0, InterpActor_1, InterpActor_2, InterpActor_3, InterpActor_4,

Page 63: Introduction to Kismet

Example: Changing Lights

• Select the trigger• In Kismet• Right click->New Event Using Trigger_0->Touch• Right click->New Action > Toggle > Toggle Hidden 。

• Right next to the newly created “Toggle Hidden (开关隐藏)” , Right click->New Variable > Object > Object List 。

Page 64: Introduction to Kismet

Example: Changing Lights

• Select Object List (对象列表)变量In property dialogueObjList (对象列表)属性 ->Add New Item (添加新项目) for five times. So there are five items.Input the followings:

[0]: interpActor_0 [1]: interpActor_1 [2]: interpActor_2 [3]: interpActor_3 [4]: interpActor_4

Page 65: Introduction to Kismet
Page 66: Introduction to Kismet

Example: Changing Lights

• Now, connect the lines such as follows:

• Now, the static meshes can be hidden.• Save and test.• Add “log” action for debug if necessary.

Page 67: Introduction to Kismet

Example: Changing Lights

Page 68: Introduction to Kismet

Example: Changing Lights

• Now, we lit a set of light sources one by one.• In level editor• Create five toggleable light sources.– Disable them. Light->lightcomponent->Enabled? NO– Assign different colors.

Light-> lightcomponent->lightcolor

• Create a trigger.• Note: the static meshes are selected and

hidden (Hide Selected)

Page 69: Introduction to Kismet

Example: Changing Lights

Page 70: Introduction to Kismet

Example: Changing Lights

• Assign different colors to light sources

Page 71: Introduction to Kismet

Example: Changing Lights

• Now, lit the light sources one by one• Each light source is lit for 1 second and then disabled.• Select the second trigger• In Kismet• Right click->New Event Using Trigger_1->Touch.

– Make sure it’s Max Trigger Count = 1• Right click->New Action->Toggle->Toggle• Right click->New Action->Misc->Delay• Right click->New Action->Toggle->Toggle• Note: copy and paste (CTRL-C, CTRL-V)

Page 72: Introduction to Kismet

Example: Changing Lights

• Click “Delay” and set the duration.

• Connect Toggle::Out-Delay::Start-Toggle::TurnOff

Page 73: Introduction to Kismet

Example: Changing Lights

• Copy and paste Toggle-Delay-Togglefor four times.Select them and CTRL-C and then CTRL-V

Page 74: Introduction to Kismet
Page 75: Introduction to Kismet

• Connect Tigger_1::Touched - Toggle0::TurnOn

Togglei::Out – Togglei+1::TurnOn

Page 76: Introduction to Kismet

Example: Changing Lights

• Now, add toggleable lights to toggle::target.Select a toggleable lightIn Kismet, at Toggle::target, right click->New Object Var Using xxxToggleable_?

Page 77: Introduction to Kismet

Save and test.

Make surethe triggersare visible.

Page 78: Introduction to Kismet

Example: Changing Lights

• Can you lit the light sources in cycles forever?

Page 79: Introduction to Kismet

Save and test.

Make surethe triggersare visible.

Easy right?

Page 80: Introduction to Kismet

• Then what happen if the trigger can be activated infinite times?

Page 81: Introduction to Kismet

Example: Changing Lights • Try switch.

Page 82: Introduction to Kismet

Link to Activated: Indices, starting from 1 (not Zero) .

Page 83: Introduction to Kismet

Teleports

• In Level editor• Create some triggers• Create a teleporter at each trigger– Actor->Navigation point->teleporter-

>UTTeleporter• Create a particle system

at each teleporter

Page 84: Introduction to Kismet

Teleports

Variable::player

Save and test.

Page 85: Introduction to Kismet

Teleports

Page 86: Introduction to Kismet
Page 87: Introduction to Kismet

Teleports

Page 88: Introduction to Kismet

Summary

• Learn Kismet• Change materials• Toggle lights• Understand the logic sequence of the tasks• Build the sequences• Use “Log” sequences for the debugging

purpose


Recommended