Trails of Cold Steel 3 Custom Model Conversions

dfgged

Bridges
OP
Member
Joined
Dec 24, 2008
Messages
112
Trophies
1
Location
Somewhere
XP
382
Country
United States
The following is a guide I wrote for the kiseki modding discord. You can find a copy here and additional tools/guides for getting started here.

PC to Switch model conversions
After some diligent of trial and error testing, I'm pleased to introduce a new CS3 modding possibility: Custom models for the Nintendo Switch port. A massive thanks to eArmada8 in the Kiseki modding discord in particular for tailoring some of his tools to make this possible.
A quick overview and some caveats before we get started. A hacked Switch with custom firmware is required. (Switch Emulation may be a viable substitute but have yet to confirm this.) The process will consist of dumping a game asset bundle, converting a custom PC model PKG to be readable by the game engine, replacing the PC shaders with native Switch shaders, then inserting the finished conversion into the game with LayeredFS. Additionally, Switch models can't be properly extracted yet, so for those interested in making your own models/mods, you'll need to find/use PC models as your base. Now with all that in mind, lets get started.

Initial setup
1. Install Python 3. (Free on the windows store)
2. Make a folder to do your conversions inside, it'll make the CMD command lines easier to deal with. Trust me.
3. Grab the ed8 Injector tools, from it you'll need the install_zstandard.bat and all the Cold Steel and Hajimari scripts. Drag them into your Conversion folder. Run the zstandard installer.
4. Grab DBI for your Switch or use the homebrew appstore to install it
5. Lastly grab a PKG model you wish to convert. For this example, I'll be using C_CHR011_C56.pkg from the CS3 Restoration project and the inject model script to convert it into Juna's default outfit. This process is exactly the same as it is for the PC version, so you can follow that guide after you're done converting.

prep.png

Switch Assets.pka dumping
This process will work with either a physical or digital copy of CS3. I used a Physical, so first step was dumping the game card to SD or emuNAND. If you have a digital copy, move to the next step. Open your homebrew channel and select DBI. On the DBI main screen, select "Install from Gamecard". You'll then have the option of dumping to Nand, SD, or Auto. You'll need just over 7GB of free space to complete this process. Select whichever you wish, it will not affect future steps. Let the process finish, and after it's complete, you can take out your game card, and then exit and reopen DBI to refresh the application list. You will NOT need to leave the game installed to play, this is ONLY to be able to dump the file we need.

DBI starting.jpg
Now that we have a digitized copy of CS3, we can browse the game contents easily. back on the DBI main menu, we can select "Browse installed applications", TLoH: Trails of cold steel III, then with Application highlighted press +, and Expose contents via MTP. Now we can plug the Switch into a PC and navigate to This PC\Switch\The Legend of Heroes: Trails of Cold Steel III\romfs\data\asset\NX.
Inside this folder, you'll find your assets.pka bundle. Copy this to your work folder. After that's done copying, you are free to back out to the Switch main menu and Archive CS3 if you want to save SD card space while using a Physical copy.

assets path.png

PC Model Conversion
With all of the prep work done, we can now get to the asset conversion. A quick little tip for windows users just before starting, you can type "cmd" into the explorer address bar to open a command prompt window inside your work folder super easily!
1. We'll convert the target PKG asset XML file.
> python3 asset_xml_to_nx.py YOUR_MODEL_HERE.pkg
2. The model data is now Switch compatible, but the shaders are still from the PC. We need them to be Switch compatible or the game will crash when loading the model. For that, we'll use the shader replacement script.
> python3 aa_replace_shaders.py assets.pka YOUR_MODEL_HERE.pkg

cmd commands.png

3. Just like that, we're all done! This PKG is now fully compatible with the Switch and will load in game. To quickly demo it, I'll go ahead and extract Juna's default model, and then inject the PC model into it so that we can see it immediately in the prologue.
> python3 extract_pka.py assets.pka C_CHR011.pkg
> python3 aa_inject_model.py C_CHR011_C56.pkg C_CHR011.pkg

Setting up LayeredFS
Final steps here. We've just gotta make the folder structure on the Switch SD card so that the game engine can see what we've made and load it in place of the original assets. The filepath is similar to what they use on PC, but it's still platform specific.
1. Access your Switch SD card however you prefer. With DBI, you can select "Run MTP responder" for a quick and easy way to see the SD card contents. Or just go old school and turn off the switch to take the SD card out and use a card reader on your PC.

DBI MTP responder.png

2. Navigate to your Atmosphere folder, inside you'll either have or need to make the following folder structure:
> contents/01005420101DA000/romfs/data/asset/NX_us.zstd/
3. Inside the NX_us.zstd folder, place your newly converted PKG.

switch files.png

Test your conversion in game!
Now comes the moment of truth, open up CS3 and check your handiwork. The game should boot normally and should only crash if you missed a step AFTER you load into a save. I've not found the menu to crash even if a model is messed up. Here's the result of my little exercise above, Juna in a bathing suit in the beginning of the prologue! If you run into any issues like wobbly limbs or the shader replacement fails, you can follow the PC tutorials to fix them on the Switch all the same. Otherwise, happy gaming!

juna.jpg
 
  • Like
Reactions: mathew77

diadark

Member
Newcomer
Joined
Mar 6, 2021
Messages
5
Trophies
0
Age
34
XP
161
Country
Russia
Can anyone help me, what the problem might be?
I'm trying to port mods to a switch based on the guide in topic
I launched the bat file, install python, checked that it works in "cmd", dump Assets.pka by DBI.
But when trying to execute commands from "PC Model Conversion" (like "py asset_xml_to_nx.py YOUR_MODEL_HERE.pkg") there is some errors, when try double-click on .py files "cmd" instantly closes without displaying the shader replacement process. When starting the game, it gives an error, therefore the scripts do not work out.
Fixed by dumping via Yuzu

pic1.jpg.1369a3cdacd168e22a13963a96e2731f.jpg
 
Last edited by diadark,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    The Real Jdbye @ The Real Jdbye: no, cod sucks +1