Jump to content

Trails of Cold Steel 4 (Mod Request)


Recommended Posts

Posted

183169470_UVmapcomparison.png.30de8e6e744f8e8e3b23ed26e6b4fe04.png

 

Mod tools updated to 2.1.5, now with multiple UV support!  While this is most obvious with large layered meshes like Sharon's bandages in CS3 (see above), it actually impacts every character because facial expressions use this feature.  (Also, you can see it on the shoulder patches of the Thors uniform.)  Updating is highly recommended.  The new ed8pkg2gltf.py will create .uvmap files that are used by build_collada.py to map textures to their texcoords; be sure to backup and then re-extract your meshes to get the new .uvmap files.

Posted (edited)

 

On 3/1/2023 at 9:07 PM, amorrow28 said:


Sorry, I hadn’t noticed that in your previous post! Weird that I haven’t had those access errors but they’re harmless. It’s just me trying to clean up all the temporary files. In the next release I’ll move the commands around so that temporary files are removed at the end instead of right after use.

 

More importantly, any progress on Alfin’s little black dress?? ???

 

It took me a while to figure out why my previous attempts to add a mesh failed, but I did it, so here is some actual progress that is not just using a shortened towel! There is still more to do (like dealing with the sunburn on her neck, replacing the tights, reshaping the skirt, and lightening the button shadows).

 

Spoiler

315700961_Progress2023-03-1119_31.thumb.png.0b96f4c13270f6e54479311f85e4da25.png

 

Here is the file for this (very incomplete) version in case anyone wants to mess with it:

C_CHR063_C00.pkg  Edit: I should have put this in the Hajimari thread. I thought some of the pkg files were working across games, but now I am unsure.

 

Any design ideas are welcome.

Edited by NotAZebra
Posted
7 hours ago, mercury15882 said:

Is it possible to combine two or more character clothing files into a single .pkg ?

 

Depends on what you are asking.  Are you asking if you have two separate costumes that the user can choose between?  If so, I'm pretty sure the answer is no.

 

If you are asking if you can take elements from two different costumes and combine them into a single costume, then the answer is yes, although it is complicated.  You can see that @NotAZebra did it above with his Alfin in a little black dress outfit!

Posted

junaissad.png.327dfb87143888074278053d0a440bc0.png

 

Mod tools updated to 2.1.6, now with preservation of the original heirarchy matrices!  This is a feature that shouldn't even need to exist, but some models have heirarchy matrices that do not match properly-calculated inverted bind matrices for some reason.  Above you can see what happens when the matrices are incorrect in the photo above.  Thank you to @fakecheng for catching this error.

Posted (edited)

Most recent version:

 

Old

(Unfinished) CS3 pkg file for Musse‘s Astraia little black dress:

C_CHR013_C05.pkg  Obsolete and only for CS3

Update: Pulled the front of the dress up higher and kept buttons but in dark grey:

C_CHR013_C05.pkg  Obsolete and only for CS3

 

Preview (tights are changed by the Unskirt mod):

Spoiler

1720372911_Screenshot2023-03-1220_58_04.thumb.png.d01a04f49977b5e29d36648c772d70d0.png

313487593_Screenshot2023-03-1221_12_15.thumb.png.e0bfebbe6cef108b90c370cf5f669e6e.png

479939981_Screenshot2023-03-1221_12_20.thumb.png.37e1095fc723c186d7d89eef4016f6c3.png

In addition to keeping the white frill (a trivial edit), I tried something a little different at the top of the dress with Musse than with Alfin. It is worse (the texture is much harder to get right—which is why the bust of the dress looks like crap). If anyone can explain to me how to separate a vertex into two (for different faces) in the UV Editing view in Blender, it will be better, though.

 

 

Edited by NotAZebra
Updated pkg file
Posted
1 hour ago, NotAZebra said:

(Unfinished) CS3 pkg file for Musse‘s Astraia little black dress:

C_CHR013_C05.pkg 16.49 MB · 0 downloads

 

Preview (tights are changed by the Unskirt mod):

  Reveal hidden contents

1720372911_Screenshot2023-03-1220_58_04.thumb.png.d01a04f49977b5e29d36648c772d70d0.png

313487593_Screenshot2023-03-1221_12_15.thumb.png.e0bfebbe6cef108b90c370cf5f669e6e.png

479939981_Screenshot2023-03-1221_12_20.thumb.png.37e1095fc723c186d7d89eef4016f6c3.png

In addition to keeping the white frill (a trivial edit), I tried something a little different at the top of the dress with Musse than with Alfin. It is worse (the texture is much harder to get right—which is why the bust of the dress looks like crap). If anyone can explain to me how to separate a vertex into two (for different faces) in the UV Editing view in Blender, it will be better, though.

 

 

 

Here is a mini-tutorial!  (Assuming I understood you correctly.)


 

Quote

 

To demonstrate vertex separation, I'm going to work with this vertex:

 

Spoiler

629833520_2023-03-1220_42_03-Window.png.97418b8f2a8a624a6d6fe420400cb0dd.png

 

To separate the vertices, first switch to Edge selection mode (the three buttons next to Edit Mode in the upper left).  Select the edge that will come apart when you have separated the two faces that you want to separate.  (The vertices will be touching again at the end, do not worry.)  Go to Mesh->Split->Faces by Edges.

 

Spoiler

726670937_2023-03-1220_42_19-Window.png.200330f212bfce6379a79c08807ff766.png

 

Go back to vertex mode, and temporarily pull the vertex away.  (It should have only separated the vertices that are controlled only by that edge, but you might want to check the other vertices.  If those have separated, then select the faces around that vertex - while your temporary vertex is still pulled away - and use Mesh -> Merge -> Merge by Distance.)

 

Spoiler

461276006_2023-03-1220_45_26-Window.png.e82a295480f4bb756c902680b91cc88e.png

 

Now while your vertex is pulled away, look at your UV map.  Select the faces one at a time as well as together to figure out which point on the UV map is the vertex of interest.

 

Spoiler

412257330_2023-03-1220_54_05-Window.png.7782f2d25cc485bbd1e29ebcd34d758b.png

 

Here you can see I figured out which vertex is the one I want to move on the UV map (arrow).  Move the vertex on the UV map.

 

Spoiler

1943335031_2023-03-1220_54_23-Window.png.22eca7dc4b730d3054a5b405bd7bb9fb.png

 

Now you will want to move the actual vertex back to its proper position in 3D space.  Turn on snap to vertex at the top middle of the layout view.  (make sure the magnet is turned on, and the option is set to Vertex.)

 

Spoiler

157533216_2023-03-1220_55_06-Window.png.4965cb674314c9aa0002155ecc7befaf.png

 

Finally, move your vertex back into place.

 

Spoiler

1653417356_2023-03-1220_55_19-Window.png.691662785f3564dfe0d169aa99f800c1.png

 


 

 

I hope that helps!

Posted

  

16 hours ago, amorrow28 said:

 

Depends on what you are asking.  Are you asking if you have two separate costumes that the user can choose between?  If so, I'm pretty sure the answer is no.

 

If you are asking if you can take elements from two different costumes and combine them into a single costume, then the answer is yes, although it is complicated.  You can see that @NotAZebra did it above with his Alfin in a little black dress outfit!

Because I found that some of the character DDS files are actually shared when viewing the files, it would reduce file size if multiple characters' clothing could be combined into the same pkg. However, from what you said, it seems that this cannot be achieved.

 

================================================

 

When I tried to modify LAURA's 3D model, I found that the position of her thigh bone skeleton was too low, causing some strange movements, as shown in the picture below. Is there a way to write the modified skeleton (just the modified bone position) into the pkg file?

Spoiler

what I expected  

image.png.5a5ae96473f2d02a08f893768244abcf.png

 

the actual result

image.png.233823f4aa7104c2c1d7b7b6e7da98bb.png

 

Posted
5 hours ago, mercury15882 said:

  

Because I found that some of the character DDS files are actually shared when viewing the files, it would reduce file size if multiple characters' clothing could be combined into the same pkg. However, from what you said, it seems that this cannot be achieved.

 

This is already achieved in the assets.pka file.  We cannot do this for our mods unless we repack the .pka file, however.

 

5 hours ago, mercury15882 said:

 

================================================

 

When I tried to modify LAURA's 3D model, I found that the position of her thigh bone skeleton was too low, causing some strange movements, as shown in the picture below. Is there a way to write the modified skeleton (just the modified bone position) into the pkg file?

  Hide contents

what I expected  

image.png.5a5ae96473f2d02a08f893768244abcf.png

 

the actual result

image.png.233823f4aa7104c2c1d7b7b6e7da98bb.png

 

 

Yes, you can change the positions of the bones if you are using my mod tools.  However, if you do that, you will need to make custom animations, and there are a lot of custom animations per character, maybe 80 or more.  Doing this is beyond what I know, but you can ask at the Kiseki modding discord.

 

I would recommend not changing the bone positions.

Posted (edited)

cs4_juna_unskirt.png.66b6256ffb9cdd5508ce69302aba6b63.png

 

Here is my Trails of Cold Steel IV UnSkirt Mod, ported to the PKG format!

 

Upload replaced for Towa hot-fix, most current is v1.0a.

 

CS4_UnSkirtMod_PKG_version_1.0a.7z

 

 

This version of my mod does not require the use of 3DMigoto, as it replaces the pkg files that come with the game.  Who might want to use this, instead of the 3DMigoto version?

  1. Steam Deck / Linux players (and possibly Nintendo Switch players, see here!)
  2. Anybody who does not like 3DMigoto, or anybody who really likes Steam Overlay / Steam Input
  3. Anybody who finds the weird shader problems distracting, or who finds it annoying that costumes don't preview properly in the equip menu when using 3dmigoto

Since this version overwrites the pkg files that come with your game, PLEASE backup your files first.  You do not need to back up the .pka file, but consider backing up the {CS4}\data\dlc\asset\D3D11

 

This version does not include 3DMigoto.  Please see here for the same mod, using 3DMigoto instead.

 

How to use:

 

Quote

 

Open the Unskirt folder in my archive, then copy the "data" folder directly into your Trails of Cold Steel folder.  That is all.

 

Spoiler

unskirt.png.0526aa8b45e29d65af070693b620034c.png

 

 

Please note: You can use PKG mods and 3DMigoto mods together, but PKG mods will generally override 3DMigoto mods because 3DMigoto depends on identifying unmodified assets to know when to inject.

 

Enjoy!

Edited by amorrow28
Posted
On 3/13/2023 at 5:32 PM, amorrow28 said:

 

This is already achieved in the assets.pka file.  We cannot do this for our mods unless we repack the .pka file, however.

 

 

Yes, you can change the positions of the bones if you are using my mod tools.  However, if you do that, you will need to make custom animations, and there are a lot of custom animations per character, maybe 80 or more.  Doing this is beyond what I know, but you can ask at the Kiseki modding discord.

 

I would recommend not changing the bone positions.

I suppose this also means that I cannot add a mesh that uses bones that are not in the original model. Even if the build_collada.py script supported this (and it appears not to), the new bones would require new animations. Is that right?

Posted
56 minutes ago, NotAZebra said:

I suppose this also means that I cannot add a mesh that uses bones that are not in the original model. Even if the build_collada.py script supported this (and it appears not to), the new bones would require new animations. Is that right?


You can, but the new bones won’t do anything without animation.

Posted (edited)

--------Trails of Cold Steel 4 Juna Underwear Mod--------

CoverCS4.png.8ce21ce67a730fccae5849ee7ea2564f.png

 

Most of Juna's outfits are replaced with custom textures underwear.

 

Preview(with skirt):

Spoiler

WithSkirt1.png.fd0553bb2e464718a084e1c16581ade3.pngWithSkirt2.png.3007b2ee20d52722cd722a323125452c.pngWithSkirt3.png.51ab2ee312914fac5a7bff640964ba02.png

 

Preview(no skirt):

Spoiler

NoSkirt1.png.dae07eb28124ee50940ba1ff8af8f5aa.pngNoSkirt2.png.539a7e0852ea1347ecf92de8c325736f.pngNoSkirt3.png.6814fcf1eb1a4dc5347fe54f25ca74e7.png

 

C_CHR011_C60 only come with one version so it doesn't matter you use no skirt or with skirt version.

 

----------Download----------

JunaUDW_CS4.rar

 

Installation:

Put the pkg file from Main outfits into game install location\data\asset\D3D11.

Put the pkg file from DLC outfits into game install location\data\dlc\asset\D3D11 and replace.

Backup the file before replacing incase something go wrong.

 

Report to me if you find any issues.

 

You can find CS3 version here and Hajimari version here.

 

Huge thanks to @amorrow28 for create ED8 Mod Tools and troubleshooting when making underwear mod!

 

 

----------My Kiseki mods list----------

 

Kuro no Kiseki (Trails through Daybreak):

Underwear Kilika replace Van

Underwear Mod

Renna Grim Kitty Mod(Kuro 1)

Underwear Mod(DLC version)(Eng version only)

 

Kuro no Kiseki 2:

Underwear Kilika replace Van

Z-1 Queen Type B Panties Removal

Z-1 Queen Type A Chest X Removal

Underwear Mod All-In-One v1.1

Renna Grim Kitty Mod(Kuro 2)

 

Trails of Cold Steel 3:

Juna Underwear Mod

 

Trails of Cold Steel 4:

Juna Underwear Mod

 

Hajimari no Kiseki:

Juna Underwear Mod

Edited by fakecheng
Posted (edited)
On 3/13/2023 at 7:57 AM, amorrow28 said:
Spoiler

junaissad.png.327dfb87143888074278053d0a440bc0.png

 

Mod tools updated to 2.1.6, now with preservation of the original heirarchy matrices!  This is a feature that shouldn't even need to exist, but some models have heirarchy matrices that do not match properly-calculated inverted bind matrices for some reason.  Above you can see what happens when the matrices are incorrect in the photo above.  Thank you to @fakecheng for catching this error.

My current tool version is 2.16.

Possible bug: After using "ed8pkg2gltf.py" to export the contents of C_CHR019_C02.pkg, without making any modifications, I immediately used "build_collada.py," but "RunMe.bat" could not be generated. The same process was tested on other characters and "RunMe.bat" was generated successfully.

Edited by mercury15882
Posted
5 hours ago, mercury15882 said:

My current tool version is 2.16.

Possible bug: After using "ed8pkg2gltf.py" to export the contents of C_CHR019_C02.pkg, without making any modifications, I immediately used "build_collada.py," but "RunMe.bat" could not be generated. The same process was tested on other characters and "RunMe.bat" was generated successfully.


 

Yeah, that is not a bug in the decompiler, Angelica's skeleton is broken. L ArmPoint and R ArmPoint have matrices of [0,0,0,0][0,0,0,0][0,0,0,0][x,y,z,1] which is totally invalid.  Correct is [1,0,0,0][0,1,0,0][0,0,1,0][x,y,z,1]. Go into the heirarchy section and fine those two nodes, and change the 1st, 6th and 11th values from 0.0 to 1.0 and the model will build correctly.

 

Btw I have no idea how this could possibly happen if using software. I have to think Falcom coded those values by hand. ?

Posted
46 minutes ago, amorrow28 said:

I have to think Falcom coded those values by hand. ?

I have zero doubt about it after over half of the bugs I report to you are actually caused by Falcom handle their code in a way you can't expect ?.

Posted (edited)

Sharing costume transferred from DOA5, with body texture and mesh created by @holden_mcclure,

also thanks to @amorrow28 for providing the tutorials and tools that made these mods possible.

 

install:

Replace the relevant file in "The Legend of Heroes: Trails of Cold Steel IV\data\dlc\asset\D3D11".
*Make sure to backup the original file before replacing it.

 

Juna:

Spoiler

require DLC

this mod is replaced by "Juna's Swimsuit"

*v2 Add a transparent effect to the frayed edges of a pair of denim shorts.

aa.jpg.8ed9c6b4cd7daa07ea5cd7392520bb78.jpgC_CHR011_C65_v2.zip

Musse:

Spoiler

require DLC

this mod is replaced by "Qilin Dress"

image.png.258845425c461d0e7e36c3c9d3576d78.pngC_CHR013_C60.zip

Shirley

Spoiler

place the file at the following path.(replace her school uniform)

game folder\data\asset\D3D11\

test.png.ce59d76cf2e2682ee901573de915f59c.pngC_CHR031_C00.zip

I simply feel that she would look great in a Christmas outfit, so I made this MOD. :)

 

 

Edited by mercury15882
  • 3 weeks later...
Posted
14 hours ago, mercury15882 said:

You have written an extremely impressive and convenient program!


Thank you! Many people helped me and did a lot of research. And thank you for sharing mods, the mods make my work worthwhile. ?

  • 2 weeks later...
Posted

Mod tools updated to 2.2.0.  2 major quality-of-life features:

1. No more images section at the top of the metadata!  The build script will construct it when writing the collada file automatically now.  If the new build script is used on old metadata, it will just ignore the images section.

2. The pkg builder will now add only files that are actually used by the model (as listed in the auto-generated asset_D3D11.xml file), so it no longer matters if you leave behind old shaders or textures when making your mod.

Posted (edited)

Index of my CS4 tutorials and where to find my mod:

  Hide contents

My first post linking to Fairy Tail mod video and how I adapted for CS4:
https://www.loverslab.com/topic/166239-trails-of-cold-steel-4-mod-request/?do=findComment&comment=3730952
How to edit existing mods (and how to setup Blender):
https://www.loverslab.com/topic/166239-trails-of-cold-steel-4-mod-request/?do=findComment&comment=3757792
How to get a model into Blender (basic modding part 1):
https://www.loverslab.com/topic/166239-trails-of-cold-steel-4-mod-request/?do=findComment&comment=3767886
How to get a mod back into the game (basic modding part 2):
https://www.loverslab.com/topic/166239-trails-of-cold-steel-4-mod-request/?do=findComment&comment=3771501
How to work with textures in CS4:
https://www.loverslab.com/topic/166239-trails-of-cold-steel-4-mod-request/?do=findComment&comment=3779614

How to work with weights:
https://www.loverslab.com/topic/166239-trails-of-cold-steel-4-mod-request/?do=findComment&comment=3786873

How to use my modding toolset for making .pkg mods:

https://www.loverslab.com/topic/166239-trails-of-cold-steel-4-mod-request/?do=findComment&comment=4010707

How to transfer a costume from one character to another using my .pkg toolset:

{that's this tutorial}

 

If you don't care about tutorials and just want the mod I made, here it is:
https://www.loverslab.com/topic/166239-trails-of-cold-steel-4-mod-request/?do=findComment&comment=3775051

 

Info on how to use the nude mods with my mod here:
https://www.loverslab.com/topic/166239-trails-of-cold-steel-4-mod-request/?do=findComment&comment=3832221

 

 

tita_tutorial.png.eb90648ef9fd4b2313c0b012f483b72d.png

 

Tutorial time!  Today let's give Tita a swimsuit.  In this tutorial, I will use the ED8 modding toolset to take the swimsuit from Elise, and give it to Tita.  @NotAZebra wrote a basic tutorial on this that is geared towards nude modding, but someone at the discord asked for a more detailed instruction set so here it is!  (The finished model is available at the bottom of the post.)

 

Setup / Requirements:

Quote

Setup:
1. Install Python 3, if you don't have it already.  (Microsoft store, I'm using python 3.10 but any 3.xx should work.)
2. Install Blender (free!) in Steam.  Change to 3.33 LTS (right click Blender in steam, select Properties -> Betas -> 3.33 stable LTS).
3. Download DarkStarSword's plugin here (Right Click, Save As)
4. Install the plugin (Blender -> Edit menu at top -> Preferences -> Add-ons -> Install)
5. Also install the following two plugins: blender_lock_groups_with_vgmap.py and blender_delete_empty_vertex_groups.py (Right Click, Save As)

6. Obtain the latest version of ED8 Mod Tools and ED8 Inject Tools.  In this tutorial I am using mod tools v2.2.0 and inject tools v2.0.1.

 

You want to know how to get a model into Blender and through the compilation process in the first place.  Please try this tutorial here at least once, then come back:  https://www.loverslab.com/topic/166239-trails-of-cold-steel-4-mod-request/?do=findComment&comment=4010707.

 

Please understand that this is an advanced skill and you should already know how to use Blender and make basic modifications; I recommend also learning how to make basic texture modifications although this is not strictly needed.  Also, I highly recommend understanding the basics of skeletal animation and weight transfer, or parts of this tutorial will seem like black magic and troubleshooting will be difficult.  If you've never watched the Fairy Tail modding video, watch itPlease note these older tutorials use 3dmigoto; you can skip all the parts that are not relevant (frame dumping, splitting buffers, etc - basically anything that is not in Blender).

 

Step 1:  Preparing the recipient model

 

Quote

 

First, let's get the models we need.  See here for a list of models in CS4.  First I'm going to get Tita (C_CHR027.pkg) from assets.pka by running extract_pka.py.

 

Spoiler

820067759_2023-04-3018_10_54-C__ProgramFiles_WindowsApps_PythonSoftwareFoundation.Python.3_10_3_10_3056.0_x6.png.38bae17480ffa1a516ebe704a69093dc.png

 

NOTE: For Elise's swimsuit (C_CHR043_C65.pkg) from Trails into Reverie, I'm cheating as I have a version already modified for CS4 that I got from the Kiseki modding discord.  You can use the version from Hajimari no Kiseki (or Trails into Reverie when that comes out), but you will need to replace the shaders with CS4 shaders.  Or just stick to the models available in CS4, or do this mod in Hajimari instead, etc.  Or (HIGHLY RECOMMENDED) - join the Kiseki modding discord server and try the amazing Costume Restoration Mod that I got this from, it adds ~100 costumes to CS4, activated by custom DLC scripts!

 

Put both C_CHR027 and C_CHR043_C65.pkg into a folder with ed8pkg2gltf.py and lib_fmtibvb.py, and run ed8pkg2gltf.py.  It will decompile both models.

 

Spoiler

502367706_2023-04-3018_11_43-Tutorial.png.bdd53a0a3793a3e008170e01749c4f70.png

 

Let's examine Tita (the recipient model) first.  You can see she has 13 submeshes, and one of them (the shadow) overlaps the rest.

 

Spoiler

842557005_2023-04-3018_13_38-Blender.png.c4df3d3e3271d2b39f31e80cfda6683d.png

 

Let's figure out which meshes we will delete - basically the entire body.  Mesh 12 is the shadow, so we will keep that (but delete it in Blender).  Meshes 6-11 we will just delete.  Mesh 5, which is the skirt, lapel and hair ribbon - we want to keep just the ribbon.

 

Spoiler

738112922_2023-04-3018_14_16-Blender.png.a6d92b600097ae6f3221e997ec01b3dd.png

 

Let's get rid of 6 through 11.  You can just delete the .fmt/.ib/.vb and .uvmap files, but make sure to keep the .material and .vgmap files (in a different folder).  I just stuffed all of them into a backup folder, in case I wanted parts of them later.  (The screenshot shows me also getting rid of 12, but that was an accident; I forgot it was the shadow and I restored it later.)

 

Spoiler

569626737_2023-04-3018_15_13-meshes.png.e47757e2daa9b8a30ae4a25729d839c4.png

 

You will want all the .vgmaps available in one place, so if you moved the meshes like I did, copy the .vgmap files into that backup folder.  (Copy, do not move - the original meshes still need those files!)

 

Spoiler

155548450_2023-04-3018_17_05-meshes.png.93f4e16861bfe2936bf99c531a0bd8ba.png

 

For mesh 5, I'll select and delete the parts I don't need in Blender.  (Make sure to export the buffers after!  File->Export->Raw Buffers)

 

Spoiler

2067895995_2023-04-3018_17_18-Blender.png.0d15f4d682d77ecea7df87ed0fa78b41.png

 

 

 


Step 2: Copying assets from the donor model

 

Quote

 

Ok, on to the swimsuit!  Here I have imported all of Elise (the donor model).

 

Spoiler

1402183207_2023-04-3018_18_01-Window.png.d76bd336ef6ed12e15a8253277fc400b.png

 

Figure out what you are keeping, and delete the rest.  Here I figured out I am keeping 1, 2 and 8.

 

Spoiler

452669791_2023-04-3018_18_52-Blender.png.b0f7aa9bad179bb3d1fbb6910d7fcace.png

 

IMPORTANT: We are now going to copy over the meshes that we will use (1,2,8), and rename them.  Do not do this in Blender, because Blender will not save all the files you need (.uvmap and .material are not preserved by Blender).  I am renaming polySurface5865_01 to polySurface4820_06, polySurface5865_02 to polySurface4820_07, and polySurface5865_08 to polySurface4820_08.  Rename all 6 files for each mesh (.fmt, .ib, .material, .uvmap, .vb and .vgmap).  (NOTE: If you are an experienced modder and have used other tools with vgmaps, you may be used to vgmaps being discarded at the time of asset repacking.  We are NOT repacking - we will compile a new model, and my tool is designed to read the vgmaps.  That means they can be changed, and they can be copied from other models.  BUT they are still just maps, and the nodes they represent must already exist in the skeleton!)
 

Spoiler

 

707627885_2023-04-3018_18_55-Blender.png.58fb77920016d286ff7cb5b39ef513a2.png

 

 

707627885_2023-04-3018_18_55-Blender.png.58fb77920016d286ff7cb5b39ef513a2.png

 

1019348436_2023-04-3018_18_57-Blender.png.9f3a8aa4727c19329e2e4281d94c8066.png

 

Now we need to evaluate the weight groups, to make sure the donor model meshes are compatible with the recipient skeleton.  We will do this for each mesh.  First, in object model, go to Object Data Properties (the upside down green triangle icon) on the side bar, vertex groups, and select Lock groups using VGMap (this is one of the plugins above).  Select all the recipient vgmaps from the backup folder.
 

Spoiler

303877682_2023-04-3018_19_10-Blender.png.ebef8279b08cab4f85f4f8afeaff807b.png

 

860746941_2023-04-3018_19_29-Blender.png.71fa350be24a68c11c0b7a7f97dbb89a.png

 

Before scanning for missing groups, go ahead and delete any unneeded groups by going to the same menu and selecting Delete empty (unlocked) vertex groups.

 

Spoiler

272310015_2023-04-3018_19_56-Blender.png.3ada7ebdb85027210e34006ca79db6e8.png

 

Looking through the list, almost every bone is available from Tita's skeleton, but LeftChest and RightChest are missing.  (Tita's model does not have breast physics.)  We will have to remove those from the swimsuit model.

 

Spoiler

1403002225_2023-04-3018_20_26-Blender.png.85742debbd94fb722a5e96b52e756dc2.png

 

Looking at Elise's skeleton (import the gltf), you can see that the parent of LeftChest and RightChest is Spine2.  (and looking at Tita's skeleton, you can see those bones are absent)  NOTE: Do not edit or work with the meshes in the gltf, you will be wasting your time!  Just use the gltf to see the skeleton!

 

Spoiler

Elise:

1892858143_2023-04-3018_22_13-Blender.png.c6a504962bd9665ff4430f549a18ac8b.png

 

Tita:

1340523959_2023-04-3018_24_14-Blender.png.3367225bd2431da3fbdceb7e87a69cb8.png

 

This is our goal, moving the weight of LeftChest and RightChest to Spine 2.  Then we should be able to safely delete LeftChest and RightChest.

 

Spoiler

2108531153_2023-04-3018_25_58-Blender.png.4e5e8982c64875a458da41f539de5016.png

 

Unlock all the weight groups.  In the sidebar, click Modifier Properties (the wrench icon), then Add Modifier, then Vertex Weight Mix.  Set A to the bone we keep (Spine2), B to the bone we will delete (RightChest), set Vertex Set to VGroup A or B, set Mix Mode to Add.  Repeat for Left Chest.  Apply the modifiers (it is in the drop down menu next to the camera icon).

 

Spoiler

433091384_2023-04-3018_24_45-Blender.png.92d2d7fa375a8948bdf432362559c41b.png

 

496110176_2023-04-3018_30_27-Blender_D__Tutorial_C_CHR027_untitled.blend.png.7b2bbcfc4f14a2c91936a79d677c5f59.png

 

Check in weight paint mode to make sure that Spine2 has the weight.  Now it is safe to delete the weight groups.  Delete both groups.

 

Repeat for each mesh you are transferring.  So I did this 3 times for the swimsuit, necklace and body (all three had LeftChest and RightChest).

 

 

Step 3: Connecting the recipient and donor meshes

 

Quote

 

Next, let's connect the body to the head.  I'm going to go through this quickly because I've detailed this in the Kuro Shizuna bikini tutorial and it's the same process - if this version is too fast then look at that tutorial.  (and yes, this version expects you to either know the process or read about it in my other tutorial because it is just too tedious to write twice.)

 

First, scale the model, since Elise is taller than Tita.  Select all three meshes (swimsuit, necklace, body).  Object -> Transform -> Scale, then pull the mesh until neck lines up with the head (I use the chin here to make sure I'm accurate).  Then apply your changes (Object -> Apply -> Scale).


 

Spoiler

2098738508_2023-04-3019_10_50-Blender_D__Tutorial_C_CHR027_untitled2.blend.png.d78021d76958911fa4a1ce89181ad916.png

 

886057444_2023-04-3019_11_07-Blender_D__Tutorial_C_CHR027_untitled2.blend.png.5304cfad31f481446e845bbf04fa1ad4.png

 

Tita's face has overlap with the neck, so here you can see I'm deleting part of Tita's mesh 3 that I do not need.  (Do not forget to export your modifications to mesh 3!  I forgot, and my first draft had 2 necks.)

 

Spoiler

2029841101_2023-04-3019_12_59-Blender_D__Tutorial_C_CHR027_untitled2.blend.png.4c820334dd07905de3e95bc9a22f648b.png

 

Now I will move the vertices from mesh 8 (body, including neck) so that they are at the same place as mesh 3 (head, including face).  Be sure to turn on Snap To Vertex.  Move the vertices at the edge of mesh 8 to connect to mesh 3.

 

Spoiler

1164112322_2023-04-3019_13_44-Blender_D__Tutorial_C_CHR027_untitled2.blend.png.dc17007ec0b44c83c87e5bf0fdc78c99.png

 

Make sure the vertex weights at the edge of mesh 8 are identical to the weights at the edge of mesh 3.  DO NOT SKIP THIS STEP!!!  (Again, I go through this step-by-step in my Shizuna bikini tutorial.)

 

 

Step 4: Copying materials from the donor model (textures and shaders)

 

Quote

 

Now we need to edit the metadata and assign the materials.  First, open up the material files in the recipient mesh, and make a list of the materials you will keep and those you will delete.  For example, mesh 0 from Tita is "new_face2_collada", which you can see when you open polySurface4820_00.material.  Also open the material files from the donor meshes to see what you will be adding.

 

Spoiler

882408300_2023-04-3019_32_13-D__Tutorial_C_CHR027_meshes_polySurface4820_00.material-Notepad.png.95c88baa156c4971816e5bf3e8a21238.png

 

This is my final list:
 

Spoiler
Keep:
    "material": "new_face2_collada"
    "material": "chr027_kami01_collada"
    "material": "new_faceparts_collada"
    "material": "new_face_collada"
    "material": "new_eyes_collada"
    "material": "chr027_uwagi_collada"
    "material": "kage01"

Delete:
    "material": "chr027_zubon_collada"
    "material": "chr027_hada01"
    "material": "chr027_kinzoku_collada"
    "material": "chr027_renzu"
    "material": "chr027_haori_collada"
    "material": "chr027_monyou"

Add:
    "material": "chr043_mizugi"
    "material": "chr043_mizugi1"
    "material": "chr043_hada"

 

 

Open up metadata.json in your recipient folder (Tita folder, C_CHR027).  Remove the unneeded sections.  You can see I've highlighted them here (they are collapsed).  I am using Notepad++, but if you are new to editing JSON, I HIGHLY recommend using a dedicated JSON editor like jsoneditoronline.org.  If you mess up even a single comma or bracket, python will reject your JSON and your build will fail!

 

Spoiler

1107759073_2023-04-3019_35_49-D__Tutorial_C_CHR027_metadata.json-Notepad.png.e9ebee1fc245ce13758a35a86479f01d.png

 

Paste in the new materials from the donor model.

 

Spoiler

849918185_2023-04-3019_43_22-_D__Tutorial_C_CHR027_metadata.json-Notepad.png.972329b40b7250dcbccdc06979732def.png

 

Each material comes with 2 shaders and a number of textures.  Copy those from the donor to the recipient.  For example, chr043_mizugi uses ed8_chr.fx#1CF5534294A8B908C228317E7652D936, so copy that file from Elise's build folder (C_CHR043_C65\C_CHR043_C65) to Tita's build folder (C_CHR027\C_CHR027).  Note that shaders are NOT in the shaders folder!  (that folder is for a special dummy shader used by the compiler, not for the real shaders)  Also copy the textures.

 

Note if you are going to modify any textures, they need to have new unique names, or CS4 will pull the original texture from assets.pka.  I changed the swimsuit color to match Tita's eyes, so I renamed chr043_c65_03_conv.dds to swimsuit_blue.dds as you can see in the image above.

 

 

Step 5: Building the model

 

Quote

 

Make sure you have the compiler files in your folder, and run build_collada.py, then run RunMe.bat.

 

Spoiler

161700640_2023-04-3019_46_57-C_CHR027.png.d0cc788b73226c0fb40c261d3a711ddf.png

 

1125688579_2023-04-3019_54_53-CommandPrompt.png.68f870171387ec87c58931c1254a4621.png

 

Test your new package.  If all went well, you have a new mod!

 

Spoiler

204117106_2023-04-3020_31_17-TheLegendofHeroes-TrailsofColdSteelIV_SteamEnabled_GoGInited.png.1b4052cc08d3bbe10b35326db6877290.png

 

 

 

 

Step 6: Making a DLC package
 

Quote

 

Since this is a new costume for Tita, it would be nice to have it as an installable DLC package so that we do not have to replace an existing costume to use it.

 

Note that the steps here work for CS3, CS4 and Trails into Reverie, but only if a costume menu exists for the character.  So while I could make a DLC package for Tita in CS3, it would be useless since she does not appear in the costume menu.

 

Also note, inevitably mods will start to conflict with each other if ID numbers overlap.  That is a disadvantage of this method, so mod authors should be prepared to change their mods if those mods conflict with popular mods.

 

First, download my DLC table tools package here: (latest version always at my github)

 

dlc_tables_v1.0.1.zip

 

To make a DLC, we will need to recreate this folder structure:

 

Trails of Cold Steel IV
+---data
    +---dlc
        +---asset
        ¦   +---D3D11
        ¦           C_CHR027_C65.pkg
        +---chr
        ¦   +---chr
        ¦       +---chr027_c65
        ¦               chr027_c65.inf
        +---text
            +---0018
                +---dat
                ¦       t_attach.tbl
                ¦       t_dlc.tbl
                ¦       t_item.tbl
                +---dat_en
                        t_attach.tbl
                        t_dlc.tbl
                        t_item.tbl

 

First, the .pkg itself must be factored for DLC.

 

Optional:  Tita's original C_CHR027.pkg has one image that is BC1 instead of BC7 - which means it must be converted to BC7 or be flipped upside down before compiling.  This was not an issue before, since the game will preferentially pull the image from assets.pka to improve performance, so we were not getting the upside down texture.  Since we are preparing a proper dlc though, let's fix that.  Open chr/images/chr027_eyes_a.dds in Paint.NET or GIMP, and save as BC7 UNORM, overwriting the original.

 

Let's convert the .pkg to DLC.  I'm going to rename the PKG to C_CHR027_C65 since that doesn't exist (and all the other C65's are swimsuits).  Rename the build folder from C_CHR027 to C_CHR027_C65.

 

Spoiler

2023-07-2908_31_24-Window.png.c7a2931a92160bc24b6c1e2a3ee6c8d5.png

 

Edit metadata.json.  Change the name to "chr027_c65" and the pkg_name to "C_CHR027_C65".

 

Spoiler

2023-07-2908_31_44-Window.png.c77f30cdad75f15fe1eb54531f9440c3.png

 

Edit C_CHR027_C65/asset_D3D11.xml.  Change the asset symbol to "C_CHR027_C65" and the cluster path of the .dae.phyre to "data/D3D11/dlc/chr/chr/chr027_c65/chr027_c65.dae.phyre". (Be sure to get the path correct!  Notice how the directory, minus the D3D11, matches the location of .inf file in the folder tree above.)

 

Spoiler

2023-07-2908_32_16-Window.png.c8b90f84bef55d60d2ffd2b07f220a92.png

 

Run build_collada.py, then run RunMe.bat, as before.  Now you should get a C_CHR027_C65.pkg.  That file goes into {CS4}/data/dlc/asset/D3D11.

 

Spoiler

2023-07-2908_37_15-Window.png.df8a01d35fd345ff0012b520910d61fb.png

 

The next file in the tree is {CS4}/data/dlc/chr/chr/chr027_c65/chr027_c65.inf.  I just copied chr027.inf from {CS4}/data/chr/chr/chr027 and renamed it.

 

Finally, you need the three tables in the text folder, t_attach.tbl, t_dlc.tbl and t_item.tbl.  You will also need a unique DLC IDs and a unique item ID.


Copy dlc_id_checker.py and item_id_checker.py into your Trails of Cold Steel IV folder (the root folder with the bin and data folders in it).  Run dlc_id_checker.py, and pick a number that is not in use and close to the range of numbers there.  The easiest is to pick something slightly above the upper number.  (Here you see I've picked the number 18, because I know it works on my install.)
 

Spoiler

2023-07-2908_45_53-Window.png.a1217ba9424eb97335499c86227a245c.png

 

2023-07-2908_46_11-Window.png.b3dd426ee5430d4114ceae13986f9ae3.png

 

Repeat with item_id_checker.py, grabbing enough ID numbers for all your items.  Since this package will only have a single item (the swimsuit), I only need one unique ID.  I ended up with 3888.  (Note that you cannot just use a crazy high number, the game will refuse to accept it.  I tried 8000 and it ignored my item.)

 

Spoiler

2023-07-2908_47_12-Window.png.08d6fd6a86370f1bc29aa0b8888f454b.png

 

Now put C_CHR027_C65.pkg in a folder with make_dlc_tbls.py and the .csv files.  Run make_dlc_tbls.py.  It will ask you a bunch of questions.  For which game, answer "3" for CS3.  When it asks item type, answer "193" for costume (or just press enter).

 

Spoiler

2023-07-2909_05_01-Window.png.74f664bce4189e3e42f9c57253b33502.png

 

2023-07-2909_05_11-Window.png.0d9a60c196f791269359e13c3216a645.png

 

It will generate the .tbl files.  Notice that it also generates a bunch of .json files, saving all your answers.  That way, the next time you run the script, it will make the .tbl files without asking for any input.  If you want to change any of your answers, edit the .json files in a text editor such as Notepad, or a JSON editor such as https://jsoneditoronline.org/

 

Put the .dat files in {CS4}/data/dlc/0018/dat and {CS4}/data/dlc/0018/dat_en.  (Note that the numbered folder is the same as the DLC ID, with leading zeros so that it is always 4 digits.  Note that CS3 and Reverie have slightly different structures compared to CS4, just look in the existing folders to see examples.)

 

Test your DLC!

 

Spoiler

2023-07-2909_26_14-TheLegendofHeroes-TrailsofColdSteelIV_SteamEnabled_GoGInited.png.adfabc83d15a0181b2b887c410adf28c.png

 

2023-07-2909_26_38-TheLegendofHeroes-TrailsofColdSteelIV_SteamEnabled_GoGInited.png.797731e35bb0ce5a415f3098a28545a4.png

 

Congrats!  You now have your own custom DLC!

 

 

Here is the final mod: (along with swimsuits I made for Estelle and Renne for Trails into Reverie, backported!)

 

Spoiler

skyswim.png.4667a734488d6c5db22ea37c228d2168.png

 

SkySwimsuitsCS4.7z

 

 

Enjoy!  And as always, if you make something you like, I hope you share.  :)

Edited by amorrow28

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...