OpenKH / OpenKh

Kingdom Hearts libraries, tools, game engine and documentation
https://openkh.dev
Apache License 2.0
291 stars 83 forks source link

[FEATURE] - Allow Custom MDLX Filenames in KH2MapStudio 🙏 #986

Closed Shinobz closed 6 months ago

Shinobz commented 8 months ago

So I've recently discovered that KH2MapStudio supports custom filenames for:

All of this is doable by simply typing the name of the file into the associated scripts and pressing "compile". Then, when you save the .ARD file, it will automatically search for a file with that name - and if it is found, it will use it. This is incredibly useful for very large projects, such as my own (KH 358/2 Days Final Mix), where the number of files required to swap out would be astronomical, and it is far easier to just patch/load new properly named files into the game for organization's sake.

However, the only thing KH2MapStudio is currently missing for custom filename compatibility - is the ability to spawn custom named MDLX files.

I've already gone thru the trouble of adding newly named models to the game using the OpenKH KH2ObjentryEditor: image

^For example, I added a Player model as well as a Friend/Party model for some members of Organization XIII ("P_XEMNAS" and "F_XEMNAS"; "P_MARLUXIA" and "F_MARLUXIA", etc.)

I then verified they can be spawned and used on a world-specific basis using the OpenKH KH2SystemEditor: image

I cannot currently call these MDLX's to spawn using the OpenKH KH2MapStudio, because it has a pre-determined list of ONLY models which were pre-existing in KH2FM by their exact name... I've searched high and low to see if there is any sort of remedy to this, such as maybe updating the list KH2MapStudio uses to include the names of my new MDLX files, (maybe something like a hashpair list) but this list is nowhere to be found and from what I've gathered it is actually a built-in part of the tool's code... The result is that when I type in the custom filenames, there is no option to select in the drop-down list and if I leave it typed there without selecting from the drop-down list, it will ignore the change leaving the previously selected MDLX to spawn: image

^My alternative for now is just to do the traditional file swapping methods, so instead of "F_XEMNAS", I'm using "P_NM000" (Jack Skellington), and doing this for every character I make while keeping track of it all in a notepad document so I can remember all of the files I've swapped out by now.

This is becoming quite exhausting, though I will carry on swapping out MDLX files if it remains necessary... but I'd really appreciate it if as a feature we could receive the ability to spawn these new MDLX files that weren't present before, the same way we can add new Maps/Ards, Missions, and FMV's.

I can think of a few solutions for implementing this:

Thank you very much for your time and consideration!

-O'Shinobi ツ

Shinobz commented 6 months ago

After months, I figured out that all I had to do to get custom MDLX names working, was to update the 00objentry file within the extracted game folder... I only had it updated in my VFS folder for CrazyCatz00's Dynamic Loader, copying that file to my extraction folder and re-opening it in MapStudio did the trick! No more trying to remember which "P_EX1084561247564915_RAW_RTN_TSURU_51651494651984_NM" is Xemnas... now he's just known as "P_XEMNAS".

I give my best regards to those trying to solve this in the future... I'd still recommend improving this model-reading system to something a bit easier such as just pulling the model list from /obj in the extracted game folder instead of relying on an updated 00objentry...