Download presentation
Presentation is loading. Please wait.
Published bySophia Iris McGee Modified over 9 years ago
1
Introduction to Kismet Sai-Keung Wong Reference: Mastering Unreal Technology (MUT)
2
Contents What is Kismet? Examples
3
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
4
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
5
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
6
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
8
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
10
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
12
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
15
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
17
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
18
Max Trigger Count
19
Now, add a log action to show messages to players (Misc -> New Action -> Log) A simple example: Turn on/off a spotlight
20
Input “Spotlight status is changed” in “Obj Comment” of “Log”. Save and test the game level A simple example: Turn on/off a spotlight
21
Messages A simple example: Turn on/off a spotlight
22
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
23
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
24
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
25
Types of Sequence Object Event (事件) Actions (動作) Variables (變量) Condition (條件) Matinee
26
Events (事件) Activate a signal to start a sequence Something occurs in the game levels Examples: – Players touch an object – Players toggle a trigger – Etc.
27
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
28
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
29
Variable Types Boolean :红色; Integer :青色; Object (對象):紫色; String (字符串):綠色; Vector (矢量):黄色; Union (聯合体(無類型)):白色
30
Conditions (條件) For testing purpose Based on the results, control the flow a sequence
31
Matinee Control Matinee sequence
32
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.
33
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”
35
Content browser->sound cues->select a sound clip In Kismet, “use selected object in content browser for “Play Sound” object. Save and test.
36
Sound Assign two sounds for “Touched” and “UnTouched”, respectively.
37
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
38
Kismet: Changing Materials
39
Create and assign a material as the parent of the newly created MaterialInstanceConstant
40
Define a scalar parameter named as “MaterialControl”. Set its value as 1.
41
Kismet: Changing Materials Assign the newly created MaterialInstanceConstant to the static mesh
42
Kismet: Changing Materials Now, Create a Kismet sequence to change material of the static mesh – Create a “touch” trigger event for the trigger
43
Right click->new action->material Instance- >Set ScalarParam Kismet: Changing Materials
44
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
46
Save and test
47
Delay action Touch the trigger to change the material. After 3 seconds, the material is changed back automatically.
48
Kismet: Changing Materials Level startup event
49
Simple Example: Spawn actor 的 spawning (生成) Examples, create enemies – Spawn enemies on demand – Spawn static meshes
50
Simple Example: Spawn Add navigation points – Actor->pathnode – Add around five. Then we will assign them to the factory spawn points
51
Simple Example: Spawn Create a trigger In Kismet, Create New Event using Trigger_0 > Used (使用)事件。 (press E to use in game)
52
Simple Example: Spawn Right click at an empty region next to “Trigger” New Action > Actor > Actor Factory 。 Connect “Trigger”::Used to Actor Factory ::Out
53
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 组件工厂)。
55
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)
56
Simple Example: Spawn
57
Assign positions to spawn points. – Select a pathnode – Then in factory property dialogue, click “use selected object in content browser” at spawn point
58
Simple Example: Spawn Create an integer variables and connect it to Log and ModifyObjectList. Save and test.
59
Simple Example: Spawn Press ‘E’ to use a trigger. Static meshes are created Display messages
60
The objects can be destroyed. Create a trigger for destroy Simple Example: Spawn
61
Kismet Sequence Comments ObjComment (对象注释)属性
62
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,
63
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 。
64
Example: Changing Lights Select Object List (对象列表)变量 In property dialogue ObjList (对象列表)属性 ->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
66
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.
67
Example: Changing Lights
68
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)
69
Example: Changing Lights
70
Assign different colors to light sources
71
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)
72
Example: Changing Lights Click “Delay” and set the duration. Connect Toggle::Out-Delay::Start-Toggle::TurnOff
73
Example: Changing Lights Copy and paste Toggle-Delay-Toggle for four times. Select them and CTRL-C and then CTRL-V
75
Connect Tigger_1::Touched - Toggle 0 ::TurnOn Toggle i ::Out – Toggle i+1 ::TurnOn
76
Example: Changing Lights Now, add toggleable lights to toggle::target. Select a toggleable light In Kismet, at Toggle::target, right click->New Object Var Using xxxToggleable_?
77
Save and test. Make sure the triggers are visible.
78
Example: Changing Lights Can you lit the light sources in cycles forever?
79
Save and test. Make sure the triggers are visible. Easy right?
80
Then what happen if the trigger can be activated infinite times?
81
Example: Changing Lights Try switch.
82
Link to Activated: Indices, starting from 1 (not Zero).
83
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
84
Teleports Variable::player Save and test.
85
Teleports
88
Summary Learn Kismet Change materials Toggle lights Understand the logic sequence of the tasks Build the sequences Use “Log” sequences for the debugging purpose
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.