A Hat in Time

A Hat in Time

Not enough ratings
How to Create a Title Screen Replacement!
By SamiSha
This guide will give a minor introduction over how to make a "title screen replacement" mod while also support the Title Replacement Mod.

See the template provided here: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2921548842
   
Award
Favorite
Favorited
Unfavorite
Introduction
Title Screen Replacement mods are mods that "replaces" the title menu with their own custom way, they provide a neat experience of freshening up the game a little bit more when you open it or go back to the main menu.

They are very simple, easy to make as the trick is to "load" the level when we are on the main title screen.

This guide will teach all the essentials that are required to set it up correctly.

By the end of it, you can make stuff like this one I made specifically for this guide:

https://youtu.be/LtYYMKsx_24
Setting Up the GameMod
Remember that by this point you at least have a map "ready" and know how to make them, if you don't know how to make maps, please follow this guide:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1332838649
What is important to highlight at least from that guide is to make sure the map contains a "PlayerStart" placed anywhere (that is far away from where you are setting up the title screen), if you don't have one and the map is loaded you will crash because the game cannot find a way to spawn Hat Kid.

The GameMod
The GameMod class will handle the title screen to be loaded upon going back to the menu, the script below does it for you already.

Make a file called
YOUR_CLASS_NAME_HERE.uc
And then paste the following code inside (original code by MrHomlesshobo)
class YOUR_CLASS_NAME_HERE extends GameMod; const TITLE_MAP_NAME = "replace_me"; event OnModLoaded() { if (`GameManager.GetCurrentMapFilename() == `GameManager.TitleScreenMapName) class'Worldinfo'.static.GetWorldInfo().Game.SetTimer(0.001, false, NameOf(SwitchMap), self); } function SwitchMap() { `GameManager.SoftChangeLevel(TITLE_MAP_NAME); }
Then replace YOUR_CLASS_NAME_HERE with the name of the file, and in TITLE_MAP_NAME input the name of the title screen map file name.

Once done, compile scripts! If you want to test the map IN GAME, then remember to cook too!



If compiling was successful, the name of the GameMod should appear top left.
UE3 and Gears for Breakfast Intros
When the game first opened, Unreal Engine 3 and Gears for Breakfast are shown to show credits intro, this sequence happens entirely kismet wise, the template provided for this guide already has it set up as accurately as possible to the original one.

They are essentially the first thing the player see as they are connected to a level loaded.



Both Logos allows skipping by pressing left click, similarly to the original Title Screen.

Here's how it looks inside the sequence:

Press Any Button!
Press Any Button! happens after the intro is finished and its a state to showcase the A Hat in Time logo.



It's important to note that the logo is not a HUD/UI element, but instead part of the scene as an interp actor of a plane texprop mesh that has material applied, the one in mind is:
Material'HatinTime_Titlescreen_Habboi.Materials.logo_placeholder'


In the editor a camera will be set in front of the game logo.



When the game logo loads too, "Titlescreen" parameter will be checked to start the game's music past the credit intros for UE3 and GfB icons.

Announcement Popup (DLC 1/2, Spotlights, Challenge Roads, Errors)
After going past the Any Button prompt multiple things happen on top of the menu being shown to select a save file.

Error Prompt:
This happens when the game crashed, using external softwares or using an integrated graphic cards, the game will start a conversation telling the player of issues and how to solve them, normally they are harmless but its a advised to follow them for the best A Hat in Time experience.

Example of an Error prompt that appears when you are using Integrated Graphic Cards on a Laptop:




Challenge Road and Spotlight Prompt:
When the save file menu is opened an announcement happens telling the player of new content for new mod spotlights to try out or a new Challenge Road, they are very straight forward and happens if it was inspected that the game is required to open them, this feature is contained in template provided with this guide.



Other
Game does cool neat stuff that normally you specify, I will not address how to make them as there's already a lot of guides on the Steam Guide section that are useful over how to make a level, but you can use the one in the template for an idea.
File Selection
Essentially the most important part of a title screen, the ability to get past the title screen and head on to playing the game, the main menu is a HUD element opened to be interacted with directly and upon selecting it, a command will forwarded to the kismet to go to the Space Ship.



It's important to note that the save file system is there to only "switch" between saves and this happens really fast when clicking left and right, clicking any save file only goes to the space ship.

This chunk of kismet stuff found in the template handles select a save file.

If you reach this part of the guide, then congrats! The title screen is complete and "playable" without disrupting the ability to soft lock the game entirely.

Music Tree
Music Tree should be set in the WorldInfo of the level, and should look something like this, you can also just use the one provided in the template as its already "ready" with handling these Music Parameters, these parameters are all handled in kismet, with the exception of one called "FileComplete" which is handled by the Save File Menu script.

The image below showcase how the MusicTree should look like, otherwise you can also follow up with the one found in the Content Package template!

Adding Randomizer Mod Support
This section focuses with this mod installed in mind:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2918772901
If you did the above correctly, then you are all set, Randomizer Mod works by capitalizing on a function that all mods use which is SoftChangeLevel() that is delayed by a frame (or basically 0.001 seconds).

SoftChangeLevel() opens a HUD which the Randomizer detects, extracts the map with the assumption it is a title screen replacement map and followed by blocking the map from "loading" because the Randomizer will handle everything from this point, the randomizer then grab all other maps that tried to do the same thing then picks one of them to showcase, achieving the affect of allowing multiple custom title screens from installing.

With that said, DO NOT USE CHANGELEVEL() OR CONSOLECOMMANDS, they will pretty much make the randomizer mod obsolete, if you get this issue, please forward it to me or talk with the modder who made that to add support!

These function and command are used primarily to remove the weird "loading" screen (which makes no sense for a title screen), however the randomizer does this too because it takes control, this is a nice optimization that should be an improvement for all mods out there!

So in short, use SoftChangeLevel().

Showcase Priority
1) First time installation of the Randomizer mod will make it iterate through all mods to make sure the player see all of them.
2) Any newly installed title screen will be prioritized to be showcased first too.
3) If all maps were seen at least once, then randomly select a map from the list
4) This map gets blacklisted in the next title screen gets open, this is done to avoid the player seeing the same map twice in the row.

Author Credit
At the top right, text will slide in and out to showcase which mod this is from and who's the author before sliding out after a few seconds.

The author part will not show up if the author is empty or specified as "Me", "Me" is the default in the ModInfo and because it wasn't made by you, YOU don't deserve to be credited.

To setup your name as the author of such mode, go to the ModInfo file and under author="Me" change it to your name!



Example of a title screen with an author prompt (top right):



So again, if author is valid:
[NAME OF THE MOD] by [AUTHOR NAME]
Otherwise:
[NAME OF THE MOD]
Closure
Title Screens are small, somewhat niche and are essentially only seen when the game is loaded, but they certainly make the modding communtiy really diverse in the content they provide, especially for those who want to amp their experiences, even in smallest things, especially mods that would either overhaul, upgrade or provide better experience of the base game.

Title Screens are really cool, I've known nothing about them literally 2 weeks ago from publishing this guide, I hope you find this guide helpful though.

If you have any questions, remember to comment down below!
1 Comments
mini_millian 64 10 Feb, 2023 @ 8:35am 
p p prity cool i meen :badgeseller: