User:Pixloen/FPANModding/HA6: Difference between revisions

From Mizuumi Wiki
Jump to navigation Jump to search
m (fixed minor grammatical errors)
Line 261: Line 261:


=== Adding CSS Visuals ===
=== Adding CSS Visuals ===
Unfortunately, UNICLR's CSS is mostly hardcoded so anything other than Character portraits (left and right of the screen) cannot be modded.
To add portraits, head to <code>grpdat/CSel/chara</code>, and copy/paste a .pat. These .pats will require minimal effort.
To add these portraits, head to <code>grpdat/CSel/chara</code>, and copy/paste a .pat.


'''Steps to take'''
'''Steps to take'''
* Rename the file to correspond to the character project name
* Rename the file to correspond to the character project name
* Edit the dds file using the easy .pat guide
* Edit the dds file using the easy .pat guide
For the table that has all the small icons, this process is somewhat different between games, all of which require .pat editing. This won't go into detail about the pat editing itself, just the basics on what needs to be done. Look at DamienIsPoggers .pat documentation for details on all of the .pat parameters
Lumina is easier, so lets start with that.
'''Steps to take'''
*Get the file names csel00.pat at <code>grpdat/Csel/</code>
*So the very first thing you'll need to make 2 "Objects" which have UVs set to the icon of the character, and the characters name in the file.
*After that, just copy the "Sprite" data from everything that has "chr000" and make new sprites with it
*Change the PRID in the sprites name "icon_chr000" from the layer with Arcueid's icon object to the new icon object.
*Change the "chr000" in the name to the new character's project name.
*In all the sprites named "name_chr000", change the PRID in the layers that have Arcueid's name object to the new name object.
*Change the "chr000" in the name to be the new character's project name.
*In CSelAnim.ini in the same folder, copy and paste this template.
<pre>
[000]
icon = icon_chr000
position_x = -30
position_y = 178
delay = 88
on_1p = cursor_0_1p
on_2p = cursor_0_2p
on_1p_2p = cursor_0_3p
</pre>
Change the number on the first line to the new character's number id and change the chr000 to the new character's project name.
The positions is the position of the icon relative to the center top of the screen. The delay is how many frames before it appears on screen, and the on_ is the curser box that surrounds the icon when being hovered over. Just keep the 0 if the icon is on the left side of the screen and make the 0 a 1 if its on the right side of the screen.
Now that were done with Lumina, lets do Uni, which is a bit harder. Creating the sprites is the same process as Lumina (although with Uni, csel00.pat is used for when Londrekia is unlocked and csel01.pat is when he's not), but there's a bit more work that needs to go into this. First off, the animation for the icons coming in. In Uni, the icons coming in is just one long animation of all of the icons coming in. Although I am unsure on how to do edit this due to the names being quirky and not messing around with it enough, but I believe the are '''''not hardcoded''''' despite popular belief. The table itself isn't made up of all the icons doing their own thing though, but instead its one big sprite that just hangs around. This is the last sprite of the animation (sprite 23), when they light up, it becomes it's own icon. Speaking of it's own icon, you have to edits it's placement directly in the .pat. Uni doesn't have a CselAnim.ini. But besides from these, and instead of searching for chr000, search for hyd instead, if you follow the guide above, it should work.
Dfc is weird I am not sure how those work honestly.


== Troubleshooting ==
== Troubleshooting ==

Revision as of 19:44, 26 January 2023


If pixloen feels like it, documentation on backgrounds, music, grpdat and stages may or may not be written on separate pages. hey maybe there'll actually be a full documentation on French bread modding

Credits

feel free to write your own name/notes/whatever


contributions
pixloen Color wrote base page with some odd workarounds currently downloading every raito instrument as you read this

Introduction

This guide is a general how-to and reference page for modding UNICLR & MBTL characters. WIP and based on experience / trial & error, but also just a page so I can get used to mediawiki and such. MBAACC uses different versions of software and a different format and won't be covered here.

When finished this will contain enough information so that you don't struggle and die when you enter maincord's #modding-tl channel.

Assumed Knowledge

  • Basic understanding of file structures
  • Basic understanding of batch files
  • Basic understanding of programming

Note that French Bread uses Squirrel for most functions, but such code can be easily understood if you have JS, LUA, C and etc. experience

Tools & Other Guides

Basic Tools

  • Hantei-chan, a HA6 editor
  • CGlib, .cg extractor
  • CGTool, .cg compiler
  • A basic text editor such as Notepad++. Regular Notepad is fine but may be harder to use.
  • A hex editor. HxD is used commonly.
  • .pat editor / visualizer. None are public, but you can use HA6 + hex editor as a close enough replacement.
  • DDS decomp/compression tool. Found in the .pat cut-ins guide.

Game Specific Injectors / Extractors

MBTL

UNICLR

Written Guides & Documentation


Setting Up The Modding Environment

Game files are located in a place like ...SteamLibrary/steamapps/common/UNDER NIGHT In-Birth Exe Late[st], or ...SteamLibrary/steamapps/common/MELTY BLOOD TYPE LUMINA This is commonly referred to as the game's directory or root folder. (REMEMBER THIS!)

Follow this guide for extracting MBTL files. For UNICLR, simply download UNIST Unpacker, head to the /d folder in the game's directory, place UNIST unpacker there, and drag every file onto the unpacker.exe.Once you're done extracting, the unpacked / out folder's contents can be dragged to the root folder.

Install the injector / _English patch file and now the game's code will read files from the unpacked folders instead of the archives. Editing the new folders will create changes in the game respectively.

Basic Character File Structure

Head to /data and you'll see a folder for every character. You can either edit these or make new characters (more info down below). Every character folder in modern French Bread games have some variation of these files:

Name File Comment
Project / System character_0.txt Contains a list of files to load. Usually references the .ha6, the .cg and the .pat.
CommandTable character_cmd_0.txt Contains the move list.
MoveTable character_mv_0.txt Contains the move logic and specific code for unique moves or projectiles.
Sound Effect List character_se_0.txt Contains the location of sound effects found in ROOTFOLDER/se
Hantei-kun Project File character.ha6 Stores move animations, hitboxes and hit data.
CG character.cg Stores character sprites.
Pattern character.pat Stores images that aren't sprites. Incl. effects such as sword swipes or wings, or MBTL cut-ins.
Base files BaseData.LST / _temp.ha6 / _temp.LST Usually files that don't mention character name / number. Haven't tested what they do but I presume it's a necessity for the character to function.

In short, the CommandTable gives a character inputs which are assigned to patterns in the Hantei-kun Project File, which can feed information to the MoveTable. The MoveTable can then create new functions.

Character_0.txt

This text file contains a list of files to load for the character, as well as character project name. Self-explanatory.

An example .txt from Akatsuki's folder.

 
[System]
ProjectName=Aka
[DataFile]
FileNum= 3
File00=_temp.HA6
File01=Aka.HA6
File02=../BaseData.HA6
[BmpcutFile]
FileNum= 
File00=Aka.cg
[PAniFile]
FileNum= 1
File00=Aka_ef00.pat

Character_cmd_0.txt

This text file contains all unique moves that this character can do. Note that it only has the move commands in the list and does not contain any actual framedata or graphics. However, conditions such as timing, move followups and inputs can be applied here. Moves 5A, 5B, 5C, 2A, 2B, 2C, j.A, j.B and j.C are universal across all characters.

Special moves are listed as Skills, and normals are listed as Atk_Std, Atk_Cro, and Atk_Air for Standing, Crouching and Air normals respectively. EX moves that take meter such as 236C are listed as 236EX, and Super attacks such as Infinite Worth and Arc Drive are listed with SP.

In MBTL, character move commands must start with cmd.. Examples include


Skill_0202EX = {},	
Skill_0202BorC = {},
Skill_0202A = {},	

Atk_Std6B = {},
Atk_Std6C = {},	
Atk_Air2C = {},
Atk_Air6C = {},

Skill_J0202A = 
	{
		command = ["0202","2+A+B"],
		flags = [ "lastdelay" ],
		
		CmdCheck = {
			HeightLimit = def_POS_AirDashLimitHeight,
			SkillType="SpecialDouji",
		}
	},

Skill_41236SP_ABC = {}, //Last Arc and Infinite Worth's need both (input)SP AND (input)SP_ABC
Skill_41236SP = {},     //Don't know why but they do

Despite the names containing motions, these commands can have different inputs if desired. Inside the curly braces many functions and variables can be set.

List of Variables

List of Things That Can be Set (incomplete)
Function Name Comment
command = [x, y] Sets the command that this move is registered to. Multiple inputs can be set, such as command = [2A+B, 0202]
num = def_CN_Atk_AddCommandn Used to create moves such as 6CC. Each AddCommand has a unique number n to differentiate.
name = "Cmd_x" Sets the name of the move that will be looked up in the .ha6, or something like that.
UpdateTable = {name = ______} Updates the pattern that is used from the .ha6, and the MoveTable.
flags = Sets flag conditions? Havent experimented and not too sure
CmdCheck = {} Adds conditions that must be fulfilled in order for the move to register. Commonly used for conditions such as having less that 5 fireballs on screen or being on a certain pattern/move.

Character_mv_0.txt

This is where the bulk of the code is stored, and hence this section will not cover everything. You'll have to do a lot of trial and error.

The MoveTable lists every move + functions for Skills.

Editing Moves

Editing Skills

List of Variables

Editing .ha6

The HanteiKun File, also known as HA6 can either be edited using hex or more commonly Hantei-chan. Everything there is very self-explanatory, so here are a few tips that you may or may not know. TEMPORARY, WILL WRITE FULL INDEPTH GUIDE


Editing .cg

Sprite Tips

Editing .pat

The .pat files are the files that hold the animations for the effects such as Hyde's red and black slashes, Neco's Vtuber model, and basically anything that isn't a 2d pixelated sprite. These aren't required for a character to function, and if the effects are already sprites such as Ragna's drive snakes or Yu's sword smear frames, those can just be put in the .cg file and used as a normal sprite. But since the .cg requires all the images to be indexed, stuff like Hazama's chains or literally any of the Eff3D textures in BlazBlue would go into the .pat.


Basics and limitations of the .pat file

The .pat files have quite a few limitations to their parameters that might get a little confusing to work with. For starters, interpolation will only happen to layers that have the same number on the next sprite. For example, layer 0 will only interpolate to the layer 0 of the next sprite called in the .ha6. Layer 0 will not interpolate to any other layer number. And on the topic of layers, Uni, Dfc, and BBTag all have a max layer count of 40, while Lumina has a max layer count of 80 (idk about Actress Again and earlier, but those are presumably 40 too). If you put a .pat with a layer number of 40 or higher or a sprite with more than 40 layers in general into UNI and Dfc, nothing will happen except some of the layers not appearing in game, but if you put a .pat that has a layer number of 40 or higher at all into BBTag, the game will crash upon loading the .pat, but this isn't BBTag modding, this is fpan modding. Some more limitations of .pats that you should keep in mind is that images must be a .dds file with either DXT1 compression, DXT5 compression, or no compression at all, and if it does compression, you will need to further compress it with a compression tool made by u4ick. It is also recommended to make the .dds files width and height multiples of 256 due to the next limitation, the UVs. UVs in .pats are weird, cause instead of being on a by pixel basis, every unit in the UV is the width/height (depending on if the unit is on the X axis or Y axis) of the image divided by 256 pixels. So if the X coordinate of the UV was 8 units, on an image of a width of 2048, that would be 64 pixels in, but if say the Y coordinate was 8 on an image with a height of 1024, that would be 32 pixels down.


"Blocks" of a .pat file

While although not required to be in this order, as these are only like this for organizational purposes, the .pat file is split into 4 "blocks" of sorts, with the first block containing the "Sprite" data, which is every parameter that starts with P_ and PR. This is where you make the actual sprites that will be shown in-game and all of the properties that will be interpolated. This is basically the AT (animation data) of a .ha6 file. Then up next is the "Object" or "Particle" data, which is every parameter that starts with PP. These are where you make the pieces that will go into a sprite. None of the data here gets interpolated. Then is the "Shape" data, which is every parameter that starts with VE or VN. This is where all that data that is used to make the special shapes that aren't just flat planes such as the green sphere in Aoko's Last Arc being a "Sphere Shape" or the web in Byakuya's Infinite Worth being made up of multiple "Ring Shapes". This data won't be interpolated either. And last but not least, the "Page" or "Texture" data, which is every parameter that starts with PG. This is what takes up 80% of the file as it is the images itself.

Editing Sound Effects

Replacing Files

Assigning Sounds

Adding New Characters

= Making Them Selectable

Now on the CSS

Head to D:\SteamLibrary\steamapps\common\UNDER NIGHT In-Birth Exe Late[st]\System\BtlCharaTbl.txt

//Section from UNICLR
Chara_Table <-
{
	// ƒLƒƒƒ‰ƒZƒŒƒNƒg—p”z’u 99 ‚ªƒ‰ƒ“ƒ_ƒ€A•K‚¸‚QŽŸŒ³”z—ñ‚É‚È‚é‚悤‚É
	// E”z—ñ‚Í“à•”‚Ì’l‚Å‚·AƒAƒCƒRƒ“‚̈ʒu‚ªˆÚ“®‚µ‚½‚è‚Í‚µ‚Ü‚¹‚ñB
	// E“¯‚¶ƒLƒƒƒ‰”ԍ†‚ª”z’u‚³‚ê‚Ä‚¢‚é‚Æ‚½‚Ô‚ñ³í‚É“®ì‚µ‚È‚¢
	// E’·‚³‚O‚Ì”z—ñ‚ª‚ ‚é‚Æ—Ž‚¿‚é
	// E”z—ñ”‚͏cx‰¡‚ª100–¢–ž‚É‚È‚é‚悤‚É
	SelectTable = 
	[
		[ 24,12,08,02,00,99,01,03,09,13,21 ],  // ‚±‚Ì—ñ‚ª‰ŠúˆÊ’u
		[ 11,10,06,04,16,18,17,05,07,15,14 ],
	],
	SelectDefault = [ 0, 1 ],  // ‰ŠúˆÊ’u 1P 2P

	// ‹­§‚Ńtƒ‰ƒO‚𗧂ĂéŽd—l ¦ƒZ[ƒuƒf[ƒ^‚ªã‘‚«‚³‚ê‚é
	_FileType = 0, //
	//_SecretFlag = 0, // ƒNƒŠƒA
	// _SecretFlag = (1<<0), // ƒGƒ‹ƒgƒiƒ€‚ªŽg‚¦‚é

	// ‰æ–ʏ㕔ƒƒbƒZ[ƒWA‘SŠp16•¶Žš‚Ü‚Å
	AcVsMes0 = "‰SŽÒ—ûK’†I",
	AcVsMes1 = "—“üŠ½Œ}I ’§íŽÒ‹‚ށI",
	AcVsMes2 = "ƒ‰ƒCƒoƒ‹•åW’†I",


	Status = [],
};

This section of code handles the cursor selection. 99 is random and every other number corresponds to a character. -1 corresponds to null or unselectable.

Player 1 and Player 2's cursors start at character 00 and 01 respectively (defined by SelectDefault) When a player inputs directions, the cursor switches to the character corresponding to the direction. For example, moving left on 00 will set the character to 02, etc. If you want to add characters around the vanilla UNI characters, you can set up something like this (using characters 25 and 26 as an example)

SelectTable = 
	[
		[ -1,24,12,08,02,00,99,01,03,09,13,21 ], // character -1/null is to the left of 24/Phonon, so pressing left on Phonon will wrap around to character 21/Mika
		[ 26,11,10,06,04,16,18,17,05,07,15,14 ], // character 26 is to the left of 11/Eltnum, so pressing left on Eltnum will select character 26.
                [ -1,25,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 ], // character 25 is underneath 11, so pressing down on Eltnum will select character 25.
	],
// Note that these characters' CSel icons will not appear in relative positions because this handles cursor logic; not visual placement

Adding CSS Visuals

To add portraits, head to grpdat/CSel/chara, and copy/paste a .pat. These .pats will require minimal effort.

Steps to take

  • Rename the file to correspond to the character project name
  • Edit the dds file using the easy .pat guide


For the table that has all the small icons, this process is somewhat different between games, all of which require .pat editing. This won't go into detail about the pat editing itself, just the basics on what needs to be done. Look at DamienIsPoggers .pat documentation for details on all of the .pat parameters Lumina is easier, so lets start with that.

Steps to take

  • Get the file names csel00.pat at grpdat/Csel/
  • So the very first thing you'll need to make 2 "Objects" which have UVs set to the icon of the character, and the characters name in the file.
  • After that, just copy the "Sprite" data from everything that has "chr000" and make new sprites with it
  • Change the PRID in the sprites name "icon_chr000" from the layer with Arcueid's icon object to the new icon object.
  • Change the "chr000" in the name to the new character's project name.
  • In all the sprites named "name_chr000", change the PRID in the layers that have Arcueid's name object to the new name object.
  • Change the "chr000" in the name to be the new character's project name.
  • In CSelAnim.ini in the same folder, copy and paste this template.
[000]
icon = icon_chr000
position_x = -30
position_y = 178
delay = 88
on_1p = cursor_0_1p
on_2p = cursor_0_2p
on_1p_2p = cursor_0_3p

Change the number on the first line to the new character's number id and change the chr000 to the new character's project name. The positions is the position of the icon relative to the center top of the screen. The delay is how many frames before it appears on screen, and the on_ is the curser box that surrounds the icon when being hovered over. Just keep the 0 if the icon is on the left side of the screen and make the 0 a 1 if its on the right side of the screen.


Now that were done with Lumina, lets do Uni, which is a bit harder. Creating the sprites is the same process as Lumina (although with Uni, csel00.pat is used for when Londrekia is unlocked and csel01.pat is when he's not), but there's a bit more work that needs to go into this. First off, the animation for the icons coming in. In Uni, the icons coming in is just one long animation of all of the icons coming in. Although I am unsure on how to do edit this due to the names being quirky and not messing around with it enough, but I believe the are not hardcoded despite popular belief. The table itself isn't made up of all the icons doing their own thing though, but instead its one big sprite that just hangs around. This is the last sprite of the animation (sprite 23), when they light up, it becomes it's own icon. Speaking of it's own icon, you have to edits it's placement directly in the .pat. Uni doesn't have a CselAnim.ini. But besides from these, and instead of searching for chr000, search for hyd instead, if you follow the guide above, it should work.


Dfc is weird I am not sure how those work honestly.

Troubleshooting

A lot of bugs and errors can cause some glitch messes with your character / mods. Here are a few I've dealt with and some ideas for solutions.

My character freezes! / Can't Input Anything!

Caused usually by a error in the MoveTable. Check formatting for any missed comments. Also, check that variables, skills and functions are defined before they are used.

When I do a move my character gets cloned!

Caused by a spawn effect/projectile error. Spawning a pattern that doesn't exist causes the projectile/effect to set itself to pattern 0, or the idle animation. Check that the patterns you spawn are in the HA6, and that the names match that of the MoveTable.

My character turns invisible when airdashing / jumping / when hit!

Caused by Hanteichan being a nuisance and crashing while saving, corrupting the HA6 file. Nothing you can do other than save backups constantly. Usually happens when you copy and paste frames too much, so save every time before you intend to copy a frame.

The game doesn't load / gets stuck in a loop before battle!

Most likely caused by a faulty .pat or project file.

My character's grab glitches out the opponent / sticks the opponent!

Caused by incorrect .txt encoding. The UNICLR/MBTL engine use japanese characters to define types of grabs, which can be corrupted if you save with the wrong encoding. French bread uses ANSI / UTF-8. CORRECT ME IF I AM WRONG ABOUT THIS

For those using VSC, I'm afraid that I can't find a suitable encoder. Notepad and Notepad++ can save in UTF-8 which makes the Japanese characters unreadable, but still works with the engine.

My character crashes the game!

The big one. There are a few causes which I only know so few.

  • Loading character slots past (28 on MBTL) will crash the game.
  • Faulty scripts
  • Can't find HA6/HA6 is corrupt
  • .pat is corrupt

There are plenty more but these are the ones that I know of.