A Hat in Time

A Hat in Time

82 ratings
A Hat in Time Modding: Basic Kismet and Cinematics
By TheGreatAndPowerfulWeegee
This guide will go over using kismet to make buttons function, creating sequence events that normal actors can't handle alone, and creating your very own cinematics!
   
Award
Favorite
Favorited
Unfavorite
The Concept of Kismet


Kismet allows you to give your levels more life and function in a similar way to custom scripting. However, Kismet does not require needing to know how to code, although understanding basic programming principles such as variables can help when making much more complex Kismet sequences. Using nodes that function in various ways, you can do simple actions such as moving an object around, triggering a change in music, and even creating full mini-games. There are 5 basic node types that can be created:

  • Actions: Perform tasks and functions when receiving an output signal from an event.
  • Matinee: Creates timelines used for movement of objects.
  • Conditions: Performs Comparison operations when receiving an output signal from an event.
  • Variables: Specify and Store Values for use in Comparisons and Actions.
  • Events: Will send out an output signal when the task the event is specified for is done. If a player interacts with an NPC with an On Interaction Event, the event will send a signal to any nodes connected to it when the player presses E near that NPC.

When creating sequences, you can create nodes in two different ways. The main method is by right-clicking in the Kismet editor, which will bring up a drop-down menu of different nodes you can spawn. Alternatively, you can click the button in the top-left of the Kismet editor window that looks like a lightbulb to bring up a search for different Kismet nodes.


You can also create Comments in the editor by finding it under the drop-down menu. Normal comments work as basic text that you can use to label what is going on in a sequence or a segement of your kismet, just like in actual coding. Comments with Wrap on creates a box you can extend and surround Kismet Sequences in to section off different parts of your Kismet to create an organized system of connected nodes.





When you have an object selected in the editor viewport, you get the additional options in the Kismet editor dropdown allowing you to create a new Object or Event using that object. Events created from objects vary from what may trigger the event, and the options you have for available triggers varies depending on the object the event is being created for.








Targeting Players

Throughout your experience in Kismet, you will find yourself having to target the player for certain nodes to affect Hat Kid. For this reason, the editor has a node created to represent the player, known as the All Players variable. By default, this object, found by hovering over Variables, then hovering over Player, and clicking on the Player option. This will spawn a default All Players variable that can be hooked up to any target node (connection sockets colored magenta, the same color as the node).


While you can just hook this up to whatever you need to attack it to and have it work, unless you set your map to only work without co-op, your players might end up messing up or breaking your scripts just by having another player present. In addition, you might to just specifically target Player 1 or Player 2 (Hat Kid and Bow Kid, respectively) in the case you want to create a co-op map. For this reason, the All Players node has a new function that allows to make up for this conflicting problem.

To set an All players node to target a single player, you first have to un-tick the All Players property box under the Seq Var Player tab in the All Players node's properties. Doing so will set the node to target Player 0. Player 0 Targets Hat Kid, meaning all nodes hooked up to target Player 0 will only affect Hat Kid and not Bow Kid. If you want to target Bow Kid, all you have to do is set the Player Idx variable of the All Players node to 1. This will target only Bow Kid. Do keep in mind that not all nodes or functions will work on Bow Kid. For example, Bow Kid can't have the Rift Collapse motion trail effect applied to her through the Kismet Status Effect node, so there are some limitations.
Piecing things together: Making a working button
Now that we have gone over the basic components in Kismet sequences, we will now use what we know to make this Timmy (Hat_Player_CoPartner) disappear on the press of this button (Hat_Button). We will also want an Emitter where Timmy is for later, with the particle of your choice selected. I will be using the giant_ice_cube_break effect for this.


After we place our actors into the level, open up the Kismet window. Within here we will start by placing an On Interaction event, created while the button is selected in the viewport. We will also need to select the Timmy and create an object in a similar fasion. The object allows us to target what we want to apply our actions to, in this case Timmy. We will also want a Toggle Hidden node and a Toggle node. We should now have the following:





Now we will connect the Event to the Toggle Hidden's Hide socket, and also attach the CoPartner object with the Target socket on it as well. Now if you enter the level, the Timmy will disappear when you press the button! But just phasing out of existence is boring, so we're going to use the Toggle node to enable the emitter to add some particles to the magic act. Simply set the emitter as the target of the toggle and hook the Out socket of the Toggle Hidden to the Turn On socket of the Toggle node. The final result should look as shown (Comment is optional, but they look nice to me):


Now when we enter in-game and press the button, Timmy will disappear in an ice explosion. He's still there, but he's invisible. If we wanted to make him gone forever we could use a Destroy mode, which will remove the object completely.

Math and Comparison in Kismet



Kismet has the ability to handle a variety of variables similar to actual coding. These variables can be used to perform mathematic functions, check if a value is greater, less than or equal to another, and then use these values within other nodes to influence the game in some way. The different variables available to you are shown above.

Setting Variables



Variables can be set by specifying the value to set the variable to either with another variable node or by changing the Value variable under the node's Seq Act Set Int tab. You can set a variable to a value to start with by selecting the variable's Int value property and entering the value you wish for the variable to start with.

Variable Math


You can use Addition, Subtraction, Multiplication, and Division on Integers and Floats using nodes found under the Math tab. The sockets A and B on each node are the two numbers used in the operation, Integer Result is the result of the operation, and Float Result is a Decimal version of the output if the answer is a decimal. If the output is a decimal, the integer socket will round the number.









Comparing Values



Integer comparisons come in two types: Simple and Compare Int. Simple Int will output equal or not equal depending on whether the input value equals the Expected property of the node. The other compare node, available to Booleans, Floats, Integers and Objects, will intake one or two values, one of which may be set by changing the node's Value A or Value B properties, and output depending on whether one value is less than, greather than, less than or equal to, greater than or equal to, or equal to the other value.
Sub-Sequences and "Custom" Nodes (WIP)

By this point, you may have noticed that there is a marked off perimeter around the Kismet workspace. (The workspace refers to the box where all of your kismet goes within the kismet editor. If you drag around at maximum zoom out, you'll find that the lighter box turns dark with a border. Everything within the darker area would be considered outside of the workspace.) Your Kismet is limited into this space, however you are free to move thing into the darker outside. When you save and leave your map, however, any Kismet nodes found outside of the workspace area will be moved into said area, pushing it into bounds as minimal as possible, which may layer it over other kismet. However, it is extremely unlikely that you will ever have enough Kismet to fill in the entire workspace.

However, there does come a larger issue that comes with having large kismets even while only occupying a small fraction of the workspace: slowdowns. Having the editor try to load a bunch of nodes tends to give it trouble to keep up, especially when you reach points where your Kismet reaches thousands of nodes. The delay can cause issues with editing, selection, and in general is just really annoying.

In addition to these, you may be copying and pasting the same sequence of Kismet nodes over and over on every
Mini Missions

Mini-missions are ways to create mini-objectives that make up a part of or your whole level's goal. Ranging from races to raising your diva status, mini missions allow you to add a little more challenge to your levels.

The base node has several properties to use. You can choose to make these missions activate one-time only, Completable only once or only trigger if a comparison or parameter has been met. These options can be found under the node's Activation tab.

To choose a mini-mission, you click on the blue arrow next to the Mini-mission property under the Mission tab. When you have a mission selected, you will be able to click an arrow to the left of the Mini Mission property, which is now in bold, to expand the properties of that mini-mission. The missions you can select are as follows:

Collect

Collect Missions can be used to require the player to collect X amount of a Collectible object. The amount to be collected can be set within the properties of the misison. You can use this to create missions to collect, say, 100 Pons (Hat_Collectible_EnergyBits). You can also pair it with a Timer Mission from a seperate node to add a time limit to the collect-a-thon.

Mail Delivery

Within the Mail Delivery properties you can set how many NPCs you need to give mail to. Mail must be delivered to 'Hat_NPC_SnatcherMinion_Mail' actors. You can change the skeletal mesh used if you don't want them to be Minions, but you may need to manually fix animation trees used and other aspects of their properties for them to behave correctly.

For the mail cart, you will need to give the player the Hat_Collectible_BadgePart_Scooter_Subcon badge, which can not be just placed on the ground. You may have to use Kismet or a chest to give it to the player, where it will replace the scooter badge.

Time Limit

Time limit missions set a timer (set under the Time Limit Property under the Time tab) that you must complete the mission within to complete. You can set a delay to when the timer starts using the Intro Time property, for say you play a cinematic before the timer starts. Under the Gameplay tab you can set the timer to kill the player when time runs out or stop when the Time Piece is collected.

By default, the timer will display as white text towards the top of the screen, a style that would have been used in the Beta Game's Beta Hero Challenge. Under the Visuals tab, you can choose to set it to a death timer, which will change the timer to be the same one used in Train Rush. You can also toggle whether you want the announcer to warn you about the time limit. Finally, you can simply hide the timer to keep the player guessing as to how much time they have left.

Under the Music tab, you can enter Music Parameters to be used as the timer ticks down. This is how Train rush had the music speed up over time. You can change up how drastic the change in pitch is using the settings found under this tab.

Parade

Parades behave exactly the same as in The Big Parade. You can set how long before Penguin NPCs will throw collectibles using the Throw Collectible Interval property. You can also change the HUD used, but that won't work well unless you create a custom one yourself.

If you expand the Wave Info Property, you can customize your parades to your liking. With it you can set how long each phase lasts as well as what objects need to be activated before progressing. You are not able to modify how many phases there are, however.

Diva

The Diva mission follows the exact same premise as Picture Perfect; raising popularity for a fan club. There are no settings to modify for this mode, as it likely would not be ideal to use a different HUD element, unless you have your own custom version in mind.

Greeting Spots can be found as the actor 'Hat_DivaGreetSpot.' These greeting spots require an NPC to be specified as a Target NPC for it to attract any fans. The amount of fans earned from each Greet Spot will increase exponentially as more and more fan spots are met. The amount of NPCs in each greet spot will also influence how many individual fans you will earn, which is run through the exponential growth rate formula as you progress.

Camera Penguins, known in the game as 'Hat_NPC_CameraSnapper,' don't have any specific settings, other than how many pons are given when taking a photo, set in the Energy Orbs Reward property under the Hat NPC Camera Snapper tab. Camera shot seem to count as 10 fans.

Through Experimentation, I found that you can achieve Max Diva using 22 Greet spots, each with 4 NPCs. As per good level design it is alway good to have more than just that to make it less stressful on the player to find every singe spot. 14 Cameras will achieve the same effect. Do keep in mind that the speed in collecting diva matters, as dashing through 15 cameras may not give you the same amount of diva as taking each one individually.

Kitten Hunt

Kitten Hunt is a depreciated mode that was once a Mafia town mission before being replaced by Cheating the Race. All of the code has been disabled and therefore without going into the files and removing code from comments/removing the depreciated command, you cannot access it.

Objectives

Objectives seems to lack settings or any sort of control, and therefore I was not able to figure out what it's purpose is. I will change this text when I find out it's status.

Race

Race is as the name suggests: A race. This race is not exactly the same as Cheating the Race however. You can set where the player starts and how long they have, but the rest may not be functional from what I have found so far.

Mini Mission: Task Master
This section is seperate from the rest of the mini missions section due to the 8000 character limit per section to steam guides.

Task Master

Task Master is the mini mission used to handle task missions, which are primarily used in-game for the level Ship Shape and the Cruisin' for a Bruisin Death Wish. This section will go into detail on it as it is set up differently from other mini missions.

To start making a Task Master mini-mission, you will first need to place some of the following in your level:

  • Hat_Stackable Actors (Optional). There are several different stackable actors ranging from drinks to seals. You can choose to use these for carry tasks or not have any carrying tasks at all.
  • Hat_InteractPoint_TaskMaster. These Interact points will act as both locations to place down your carrying tasks and "freebie" tasks that don't require carrying objects (Such as the 3 garden tasks at the bottom of the Merseal).

Making a "Freebie" Task


Single-Interaction Tasks or "Freebie" tasks are tasks that only require touching them to complete. You only see these freebies 3 times in Ship Shape, which are all 3 of the garden tasks. They will show up in Yellow rather than red like carrying tasks do.


The only actor you need to create these "freebie" tasks is to place a Hat_InteractPoint_TaskMaster. By default they will already have the proper configuration to function. All you need to do is set the actor as a "Task Actor" within the Mini Mission node in your Kismet. You can do this by selecting the Interact Point within the viewport, and then clicking the green arrow next to the "Task Actors" property under the "Hat Mini Mission Task Master" tab, found by expanding the Mini Mission Property under the Mission tab in the Mini Mission node (uneccessarily long I know).

Making a Carry Task


Carrying tasks are created in a similar way to Single-Interaction Tasks, with the exception of having additional setup steps. Delivery tasks involve placing both a Hat_DeliveryPoint actor to represent where the object will be thrown, and one of the many actors extending from Hat_CarryObject_Stackable, such as Hat_Stackable_Drinks for example.



Place the Delivery Point actor where you want to deliver to, and then place the Stackable Actor of your choice where you want the player to pick up the objects to be delivered. If you look at the Stackable Actor's properties, you will see a property under the Hat Carry Object Stackable tab within the Pick Up Task dropdown, called Next Task. Under this you want to specify the Delivery Point you want the actor to be delivered to.

Finally, all you have to do is specify both the Delivery Point and the Stackable actor under the Task Actors list in the Task Master Minimission Node in your Kismet. Then, your task should appear the next time you play your Task Master mission!

Changing up Task Master Settings

Apart from adding and removing tasks, this sub-section will go over how you can change up how the carrying tasks function.

Mission Modes

There are three different modes you can choose from when making task master missions: Survival, Single Task, and Score Target. You can change which mode the node uses through the Mission Mode property, above where you set your Task Actors under the Hat Mini Mission Task Master tab.
  • Survival is the mode used for the Cruisin' for a Bruisin Death Wish, where you have to complete as many tasks as possible.
  • Single Task will automatically spawn any and all tasks to start at once. This is used in Act 1 where every individual task such as helping the hurt seal are within their own mini mission, and on completion enable the time piece shard to appear.
  • Score Target is the original mode used for ship shape, where you go around completing tasks while trying to keep the Captain from getting to angry, which ends once you reach a certain amount of tasks completed.
Under that same tab, you can set how many tasks to complete the Score Target mode, Whether you want a specific task to be the first task to spawn, and other features like general difficulty.

Task Spawning and Time Limits

These two tabs allow you to change how tasks are spawned and how long you have to complete them. Under the Task Spawning tab, you can set how fast they spawn, the maximum amount of tasks that can spawn, and various other variables. Under the Time Limits tab, you can set how long you have to complete a task (in seconds) by default. You can also disable time limits altogether, which is very useful when you want to have a casual task mission or single task missions.

Pressure

The Pressure tab handles how the lose condition - The Captain's anger - is handled and how much stress is gained or reduced when you complete tasks, fail tasks, or leave tasks idle. You can "turn off" pressure by setting just about all of these variables to 0 so that the captain won't show up at all. To hide him from the HUD, you can toggle the "Show HUD" property under the Hat MIni Mission Task Master tab, making it seem like pressure is not present if you want to make a more relaxed mission.

There are various other properties and tabs to look into, but do not impact gameplay in a significan way, and therefore is up to you to experiment with! Some of these categories include Sounds and Music, Radio Messages, and the various properties not covered in all the other tabs.
Status Effects

Status effects are states in which the player receives a buff or debuff in stats or performs an action. These Effects may be added and removed on command as seen fit. Each Status effect has its own duration, which varies between each one. This duration can be overridden by a custom length using the Override Duration property under the Hat Seq Act Status Effect tab.

Shops

Shops allow you to sell collectibles, dyes, remixes, and other items for a currency. You can use any event to trigger opening a shop, but I would recommend activating it from an On Interaction event from your vender of choice. To use it, you should specify the Target to be the Player and the Merchant to your NPC selling items.












To create your shop, click on the blue arrow by the Shop Inventory Property under the Hat Seq Act Open Shop tab. This will create the shop inventory, where you can set what currency you want your NPC to use, whether Energy Bits (Pons) or even a custom currency. You can also set a camera to be used instead of looking at the merchant's face using the Override View Camera property.




To add an item to the shop, click the green plus next to the Items for Sale property. This will create a new object that will be sold for how much you set your Item cost to be. You can prevent purchasing an item again by ticking the Prevent Re Purchase checkbox. You can sell as many items as you wish, but more than 3 will start displaying items off the edge of the shop window.
Basic Cinematic Work

Basic cinematic scenes can be created by changing the camera used and using a matinee on a camera for movement. Cameras can be created in one of three ways: By placing a CameraActor into the level and positioning it as needed, by clicking on the arrow in the top-left of the viewport, and clicking the button all the way at the bottom of the list named "Add camera actor here," or by clicking the "Create Camera Actor at current camera Location" button when inside a matinee. This will place a camera and position it to show exactly what you see in the viewport when you placed it, making precisely lining up cameras easier. Some methods may be easier when planning ahead, and others can be useful when setting up more than one camera angle.











Changing the Camera


You can change the camera the player sees though using the Set Camera Target node, with the Target socket being the player and the Cam Target socket being the camera to switch to. You can switch back to the player by setting the Cam Target to also be the player. You can make the camera change non-instantaneous by changing the blend time to however long you wish for the transition to be.







Using Cameras in Matinees


Cameras work in matinees in the same way as moving objects, covered in the First Level guide, but with some additional options and changes. To start, instead of using an Empty group, you use a Camera Group. Here you will get two tracks to work with: One for Movement and another for FOV. You can also click on the image of a camera on your group, and it will turn yellow, and put you in the same view as the camera. When you're creating new Keys onto the timeline, you can use this button to move to where you want the camera to end up, allowing you to create a moving camera without having to manually translate and rotate it.



Director Groups: Chaining Cameras in one Matinee


When using several cameras in one matinee, it can become troublesome to time exactly when to switch the camera. In cases like this there is an additional type of group available known as director groups. These groups will allow you to specify when in your matinee to switch to a specific camera being used. This can be used for when you are using several cameras in one timeline.




Mission Intros


You can give players a look of the level before being thrown into it by using a Mission Intro node. To do this you need to hook up the Start output socket to a Matinee using a Director group. The Mission Intro node should also be activated by a Level Loaded event. You can change the music that will be played during the intro by selecting a music track in the Music Track property of the node under the Music tab. You can also choose to mute Sound Effects and music if you do not want any sounds in your intro.

Under the node's Mission Intro tab, you can change the duration of the intro, hide the player from the cameras used in your intro, or have the intro end by having Hat Kid fall from the sky like she does in Mafia Town. You can even start the cinematic with an Intruder Alert by ticking the associated property.
Changing Levels

In the case that you want to include a transition to another level, you can use the Change Scene node. Simply specify the map name to change to (which must be within the maps folder of your mod) within the node's Map Name property under the Hat Seq Act Change Scene tab. However, this will not work within the editor; You will need to test it with the level cooked, as you are not able to change between levels within the editor itself.
129 Comments
fish 12 May @ 10:30am 
welp. figured it out. i was using a version of task master from a different mod.
fish 12 May @ 9:10am 
do you have any idea why my task master mini mission works in the editor, but not when i test the cooked level?
TheGreatAndPowerfulWeegee  [author] 5 Oct, 2024 @ 12:55am 
each camera should connect to it's own singular purple node on the matinee. If you choose to use set camera target nodes, you should have one set camera target node for each camera and use a delay to time the switching between cameras. (either through a kismet node that can add a delay, or right-clicking the squares on the kismet nodes that you use to connect kismet together, and adding a delay through that)
Erfinda 2 Oct, 2024 @ 1:32pm 
i do have both cameras in the matinee and have a director track where it should switch to camera b after three seconds, but as of now it only shows camera a. Not sure what i'm supposed to do with camera b outside of the matinee inside of kismet, if i use it in a second set camera target next to the one for camera a it only shows camera b so do i need to connect the camera actors only to their camera nodes on the matinee or do i need to connect both cameras to the one set camera target?
TheGreatAndPowerfulWeegee  [author] 1 Oct, 2024 @ 2:08pm 
Do you have a director group/track in your matinee? The director is what allows you to change between camera actors within the matinee, and without it you won't be able to do so. Each Camera should have its own Camera Group in the matinee as well, as the director chooses between these groups. By making a second group, you will also have an additional object node on your matinee to connect the camera object to in the Kismet. You can see an example of a Matinee with 2 camera groups under the Cinematic Work section under the Director Group subheading.
Erfinda 30 Sep, 2024 @ 1:38pm 
I'm trying to make an intro cutscene for my current mod which has two cameras involved but it never switches to the second camera. Do i need two matinees or something? Also don't know what exactly to do with the second camera in kismet, do i need to connect it to the same set camera target or create a new one and if yes, where do i connect it to make it work? Only have it connected to the one matinee which should switch to the second camera at three seconds and i've been trying to make it work since an hour now but nothing worked as of now.
UnDrew 9 Jun, 2023 @ 8:05am 
This doesn't seem to be mentioned in the guide, but delivery points need to be manually assigned a Delivery Task object to work.
EmberPC (Viia) 25 Feb, 2021 @ 11:15am 
how do i make a time piece appear when the player selects the right choice in a conversation? im legit mad and i need help
TheGreatAndPowerfulWeegee  [author] 5 Apr, 2020 @ 12:11pm 
The difference would be that you perform these checks and actions upon the button press event, and maybe even use the Released (stepping off the button) part of the event as well to prevent it from continuing!
TheGreatAndPowerfulWeegee  [author] 5 Apr, 2020 @ 12:10pm 
I believe time-based buttons are the same actor. The key differences is that for one, the different color is most likely a material instance (the same material but with a parameter like color changed) applied to the existing material, and that the timing is handled through kismet. If you would like 2 players to have to step on seperate buttons, you will have to handle the logic through Kismet. This could be through using gates, booleans and conditions or a variety of other methods. You'll have to experiment through kismet and try out the various control nodes to find what you think will work best for your case, but there are many solutions to what you want to do.