A Hat in Time

A Hat in Time

Playable2D Niko
Don  [developer] 17 Oct, 2024 @ 10:59am
FAQ & NOTES ON CREATING 2D PLAYABLES
CAN I USE THIS TO MAKE MY OWN 2D PLAYABLES?
Yes!

CAN I USE CODE AND MATERIAL WORK FOR MY OWN MOD?
Yes!
I don't own Niko's assets so can't give any permission on those.


󠀡󠀡
󠀡󠀡

USING FILES TLDR
  1. Download mod files.
  2. Create copies of Classes and change their names for your mod.
  3. Have "Don_Player2D_Content.upk" package from Content folder.
  4. Preferably import your character textures to your own package.
  5. Place your assets into the Player2D class and set the FrameData.
  6. Have fun?

USING 2D PLAYABLE FILES
Download the mod and get mod files from
C:\Program Files (x86)\Steam\steamapps\workshop\content\253230 folder name is "3350310800" Workshop ID

And either create a local copy of it and place it in
C:\Program Files (x86)\Steam\steamapps\common\HatinTime\HatinTimeGame\Mods
or only copy the Classes and Content folder (or contents inside) into your own mod.

CLASSES
Change the file name for (can change the other ones if you need to)
Don_Player2D_Niko Don_Player2D_Niko_GameMod Don_Player2D_PlayerIcon_Niko

The file names are formatted like this
Prefix_Player2D_Character

Prefix_: Username or whatever tag you’d want to use to help differentiate it from any other files possibly named the same in any other mod.
Base Game uses the prefix “Hat_” for example.

_Character: Character name to help tell what character it is.


IMPORTANT NOTE!!!
File names and asset names CANNOT use special characters in them for example
!, -, ?, ö. á, space (use underscore _ instead), and generally anything that isn't plain English text.

So each file would be like
Prefix_Player2D_Character Prefix_Player2D_Character_GameMod Prefix_Player2D_Character_PlayerIcon

and inside those files update the class name to the file name. (at the top)
So for example file name ”Prefix_Player2D_Character” should have the class changed to
OLD: class Don_Player2D_Niko extends Don_Player2D_Base_Restrict; NEW: class Prefix_Player2D_Character extends Don_Player2D_Base_Restrict;
󠀡󠀡

Inside the GameMod and GhostPlayerTracker classes at the top are CONST variables that you will need to update to match the name of the new class name.
OLD CONST CLASS_PLAYER2D = Class'Don_Player2D_Niko'; NEW CONST CLASS_PLAYER2D = Class'Prefix_Player2D_Character';

Inside the Player2D class you will need to update the following variables down at the defaultproperties to match the new file names.
ObjectiveActorClass = class'Don_Player2D_Niko_PlayerIcon’ PlayerVisualClass(0) = class'Don_Player2D_Niko’

Also inside the Player2D class
("Don_Player2D_Niko" / "Prefix_Player2D_Character")
You will need to update the GameMod class reference in function
static function ConvertGhostPartyPlayer(Hat_GhostPartyPlayer gp) { local Don_Player2D_Niko_GameMod GameMod; Super.ConvertGhostPartyPlayer(gp); foreach class'WorldInfo'.static.GetWorldInfo().AllActors(class'Don_Player2D_Niko_GameMod', GameMod) { if(GameMod != None) GameMod.SetupNewOnlinePlayer2D(gp); break; } }

CONTENT
From the Content folder you should only really need the “Don_Player2D_Content.upk” package.
This package holds all the material work for 2D Playables.

I would recommend importing all your own playable related assets to your own package just like I’ve done in "Don_Player2D_Niko_Content.upk"
In this package I have all the animation textures.


PLAYER CLASS TEXTURES
Inside the GetPlayer2DTexture function is where you set the textures
for each player state.

function is static so that other classes can access, mainly Don_Player2D_GhostPlayerTracker.

iPlayerState: int so that other classes can access.
TextureFront: Front side texture
TextureBack: Backside texture
Note: If texture is None then the default texture and animation will be the Idle state animation when displaying that side (Front or Back).
You can use the same textures for different states, do remember that Front and Back textures should match in frames, unless if you're setting one or the other None.

vFrameData: Vect(HorizontalFrames, VerticalFrames, Speed)
  • HorizontalFrames: How many flipbook frames from left to right
  • VerticalFrames: How many flipbook frames from top to bottom
    Frame counting starts from left top most frame.
    [x] [_]
    [_] [_]

  • Speed:
  • 0 = Default animation speed
  • over 0 like 1.4 = Flipbook speed 1.4 when animation playing
    (this only applies if there is more than 1 animation frame, otherwise it will display the 1 frame)

  • below 0 like -1 or -0.1 = Freeze frame on frame 1 (-1) or frame 0 (-0.1)
  • (frame count starts from 0)

static function GetPlayer2DTexture( int iPlayerState, Out Texture2D TextureFront, Out Texture2D TextureBack, Out Vector vFrameData) { switch (iPlayerState) { case ePlayerState_Idle: TextureFront = FRONT_SIDE_TEXTURE; TextureBack = BACKSIDE_TEXTURE; vFrameData = vect(2, 1, 0); break;

󠀡󠀡All ANIMATION STATES
  • ePlayerState_Idle
  • ePlayerState_IdleHurt
  • ePlayerState_Walking
  • ePlayerState_Running
  • ePlayerState_CrouchIdle
  • ePlayerState_CrouchMove
  • ePlayerState_Jumping
  • ePlayerState_JumpDive
  • ePlayerState_JumpingSprint
  • ePlayerState_JumpTwirl
  • ePlayerState_Falling
  • ePlayerState_LandRecoil
  • ePlayerState_Wallhang
  • ePlayerState_WallSlideUp
  • ePlayerState_WallSlideDown
  • ePlayerState_Hookshot
  • ePlayerState_Attack
  • ePlayerState_Hurt
  • ePlayerState_Throw
  • ePlayerState_Sitting
  • ePlayerState_ClimbLR
  • ePlayerState_ClimbRL
  • ePlayerState_SwimmingIdle
  • ePlayerState_SwimmingForward
  • ePlayerState_Dance // Smug Dance
  • ePlayerState_BatIdle // Dance with Bat Weapon
  • ePlayerState_NPCKiss // Keyboard 4 or Dpad Down
  • ePlayerState_NPCTease // Keyboard 1 or Dpad Up
  • ePlayerState_ItemGet
  • ePlayerState_Scared
  • ePlayerState_Thinking
  • ePlayerState_Surprised
  • ePlayerState_ClosetIdle // Vanessa's Manor Closet
Last edited by Don; 4 Nov, 2024 @ 8:23am
< >
Showing 1-3 of 3 comments
Don  [developer] 18 Oct, 2024 @ 6:29am 
Reserved.
Don  [developer] 28 Dec, 2024 @ 11:54am 
For modding the A Hat in Time - Modding Tools is used.
The graphic design work for this mod was done with Affinity Designer
and coding done with Notepad++; with Unreal Script syntax highlighter.
Don  [developer] 30 Dec, 2024 @ 2:33am 
This only uses 2 angles, Front side and Back side
< >
Showing 1-3 of 3 comments
Per page: 1530 50