Skip to content

Importing Contents Of AssetBundles

DeathWeasel1337 edited this page Dec 10, 2020 · 3 revisions

KoikatsuModdingTools can import contents of existing asset bundles (.unity3d files) to a format that Unity can use. This feature is built for use with an external tool, UtinyRipper. This is intended primarily as a way to convert mods that you've created in the past (for example with SB3UGS) to a format that KoikatsuModdingTools can use.

To dump the contents of an asset bundle, open your Koikatu\Koikatu_Data\Managed folder. Create a folder within it called Export or something, purely for organization, and place the .unity3d file you want to extract within. Next, open up UtinyRipper then drag and top the Managed folder itself in to the UtinyRipper window. It's important to drag the Managed folder in to UtinyRipper so that the MonoBehavior data can be extract properly. Open the folder and you should see several folders such as Scripts, Shader, Mesh, Prefab, Texture2D, etc. if you did it properly.

Next, open KoikatsuModdingTools and create a folder inside your Mods folder, then drag and drop all of the folders in to it. Click back to Unity and the assets will be imported. It is likely that the Shader and Scripts folder will have been deleted, this is expected behavior as this import process will rewrite the imported assets to use the scripts and shaders used by KoikatsuModdingTools rather than the ones extracted by uTinyRipper.

Finally, set up your project. If you're converting an existing zipmod you've created in the past, copy your manifest.xml file to the folder you created within the Mods folder. Copy characustom list files to List/Maker/ and the folder containing your studio list files to List/Studio/. Configure the assets to compile to the proper asset bundles (see example projects for instructions and example setup). With that done, build asset bundles and then build zipmod to rebuild your mod. Hopefully everything works properly, but if it didn't see below.

Notes

If UtinyRipper says "Import [Warning]: Unable to read MonoBehaviour, because definition for script x wasn't found" then you didn't drag and drop the Managed folder in to the window properly. UtinyRipper needs access to all those .dll files as well as the .unity3d file to properly extract MonoBehavior data.

UtinyRipper seems to be unable to read the contents of the ChaClothesComponent MonoBehavior and will crash. If you need to import clothing files, extract the .unity3d file itself without the entire Managed folder to prevent MonoBehavior data from being extracted. Alternatively, edit the .unity3d file with SB3UGS and remove the ChaClothesComponent from every clothing item, save the file, extract the modified file, and restore the edit file to the original afterwards. This way will allow UtinyRipper to extract everything else, for example DynamicBone data which is a pain to configure manually. Either way requires the ChaClothesComponent MonoBehavior to be set up manually afterwards. Please let me know if you find a better workaround.

UtinyRipper extracts meshes in .asset format which is not editable, as far as I know. If you already have meshes in another format you can use those instead, just place them within your project folder. Unity supports a wide variety of file types including .obj, .fbx, and .blend. If you don't have the mesh data in a usable format and need to make edits to the mesh, SB3UGS can export .fbx files from asset bundles.

Clone this wiki locally