Adding Loose Files and References - Kizari/Flagrum GitHub Wiki
Flagrum 1.4.7's update now allows you to add loose files, new archives, and references to your mods, enabling you to use files that were not previously in memory during gameplay. In this tutorial, we will be discussing how to add music files to Final Fantasy XV using Flagrum as an example of these features.
Prerequisites:
Before proceeding with this tutorial, it is assumed that you have some familiarity with the following Flagrum guides:
This guide will make use of Flagrum's `Mod Manager` to build the mod, and though little script editing knowledge is required, this tutorial will touch on techniques covered in all three of the guides listed above.
Final Fantasy XV uses archives like zip folders, that contain groups of similar data. These archives, or Earcs, when loaded, pull the files into memory to be used on demand. However, files that are within unloaded Earcs are inaccessible. This is especially important when creating your own new archives of data for the game, adding custom loose files such as music, or trying to utilize existing files that are typically unloaded such as DLC files.
This is why the game uses references. A reference acts as a link between archives and files, so when one archive is loaded, the referenced Earcs or files become loaded as well, allowing them to be utilized in game when requested.
In this tutorial, we will be using Flagrum to add loose music files, change a script to load the new music, and add a reference so the music will be accessible when called.
The first step in this process is to locate and prepare the files you are wanting to add to the game and the scripts that will access them. In this example, we will be adding two new background songs to the game.
The songs we will be adding will play on the title screen. We will be changing the path away from bgm_title.max and bgm_title_noct.max without removing or replacing the original music files. If we already knew which script we wanted to add our files to, we can begin our mod. Otherwise, we can do a simple search for the files, which returned the following script:
After exporting the file, open it in an editor and find where the file sets the background music or add your own SequenceActionSetBgmset
or similar music node to your file.
We will be adding our music as a loose file into the same folder as the original files, so we can just keep most the path the same and replace the file name.
Repeat this process for any additional files or scripts that you want to modify.
The next steps assume that you already have the files you would like to add to the game. We have used AudioMog to prepare our music and convert it back into a .mab file for the game. This isnt an audio conversion guide, however do note the game ends the filepath with .max and .sax instead of the format of the filetype, which is win.sab and win.mab
With the script edited and the files ready to be added to the game, we are ready to start building our mod.
Start your mod by replacing or adding the script you edited in the prior steps.
Next, since we are using music that is outside of an Earc, we will be using the "Add Loose File" button and selecting the music files we have prepared.
After selecting your music, you will be prompted to choose where you would like to save the files while the mod is active. We will be using the same folder as the other background music files.
Repeat this process for any additional files you are adding.
Now we will add a reference to our loose music files inside the Earc that has our script edits in it. This will allow the game to know where to load the music files from.
Start by finding the Earcs in the Mod Manager that contain your edited files with the new paths, then click on the "Add Reference" button.
You will be prompted to enter the URI of the file you are referencing. The URI should start with data://
followed by the file path you entered into the scripts. In our example, the URI would be data://sound/resources/20001Music2/jp/piano_prelude.max
.
Repeat this process for any additional files you are referencing.
Note: When adding files within an Earc instead, the process is similar to adding a reference. You will be prompted to enter a path before selecting your file. If you are referencing existing files in other Earcs, use the "Reference Archive" option and find the file you are accessing from the Asset Explorer window.
Congratulations on successfully adding new music to Final Fantasy XV using Flagrum's Mod Manager! You should now be able to hear your custom music playing in the title screen of the game.
While this example was a simple overview of the new features Flagrum 1.4.7, adding only loose files and references to Earcs. The same techniques can be used for adding and referencing all other file types, such as textures, models, or scripts. By utilizing these new features of Flagrum's Mod Manager, you can create more unique and personalized game experiences. Good luck adding and accessing your new files for your mods!