Update Creating Mods

Downforce Agent
2025-02-22 13:05:07 -05:00
parent a36bb1704d
commit 8c0ed78346

@@ -27,9 +27,16 @@ The above commands will extract to the current working directory. All of the Wip
## Creating .FSTAR Files
For storing mods, Firestar uses the common ZIP format with the FSTAR file extension. The contents of the ZIP are dumped directly over top of the original assets at build time when the user selects "Deploy" and then psp2psarc is called to re-bundle the assets together.
### Patching Capabilities
To solve mod conflicts, older versions of Firestar used a "delete.txt" file as shown above. Since version 1.3 this has been replaced by the [FScript patching system](Using-FScript). FScripts are run after a mod has been extracted and allow you to patch any file inside of the assets before the next mod is processed. This is useful if you want to modify part of a large file, without creating an entire copy of it that would overwrite any mods underneath it. FScript also natively supports using java-diff-utils to run diff patches, and includes binary editing capability. To learn more, please read [Using FScript](Using-FScript).
Firestar will execute the file named "fscript" at the root of your FSTAR package, if it exists.
### Auto-Generate a Mod File
Firestar has a built-in tool to create FSTAR files. First, create a folder containing your data/ directory, and any other files Firestar needs such as your delete.txt. Then click "Tools" and then "Generate New Mod from Folder...", and select the folder your mod files are in.
**This feature does not account for files needed by FScripts.** If you include a file in your mod's patch instructions that is not in the player's highest priority PSARC, **your mod will fail to install.** Scroll down to "Specifying Dependencies" for information on how to fix this.
### Manually Using a ZIP Archiver
Place your modified files inside of a new ZIP folder, ensuring that their path precisely matches the path of the originals you are replacing, including placing them in an all-encompasing data/ folder and not the ZIP root. Like so:
@@ -46,22 +53,36 @@ Now write in your mod's metadata in JSON format. For example:
If you need to know what your `loaderversion` is, you can find it in the console output when you start Firestar:
![](https://files.worlio.com/users/bonkmaykr/http/git/embed/2024-06-30_15-25.png)
Ah, but what is that "delete.txt" file? That's the delete list, and as the name suggests, Firestar will use this file to delete the files in the final PSARC that conflict with your mod if it is being installed.
```
audio/music/01/music_stereo.fft
audio/music/02/music_stereo.fft
audio/music/03/music_stereo.fft
audio/music/04/music_stereo.fft
audio/music/05/music_stereo.fft
audio/music/06/music_stereo.fft
audio/music/07/music_stereo.fft
audio/music/08/music_stereo.fft
audio/music/09/music_stereo.fft
audio/music/10/music_stereo.fft
audio/music/11/music_stereo.fft
audio/music/FEDemoMusic/frontend_stereo.fft
audio/music/FEMusic/frontend_stereo.fft
```
Place this file in the root of your ZIP if there are any files that need to be disposed of in order for your mod to work.
Now, save your zip with the **.fstar** extension, and import it into Firestar. Ta-da!
### Specifying Dependencies
Sometimes, the FScript or diff patches in your mod require the presence of a file that the user might not have dumped in their ~/.firestar folder. You should tell Firestar about any game updates and DLC that your mod relies on, and what files to copy if it can find them. Firestar will alert the user if it can't find a required file and abort the installation, with a friendly suggestion to dump the PSARCs and try again.
Now, save your zip with the **.fstar** extension, and import it into Firestar. Ta-da!
To do this, use the `requires` and `extracts` variables in your mod's metadata. `requires` holds a list of each PSARC needed, by filename. `extracts` tells Firestar which files to grab from them. Both of these are arrays of the Java type `String`.
Example:
```
"requires": [
"data2.psarc"
],
"extracts": [
"data/plugins/music/Definition.xml",
"data/plugins/languages/american/entries.xml",
"data/plugins/languages/danish/entries.xml",
"data/plugins/languages/dutch/entries.xml",
"data/plugins/languages/english/entries.xml",
"data/plugins/languages/finnish/entries.xml",
"data/plugins/languages/french/entries.xml",
"data/plugins/languages/german/entries.xml",
"data/plugins/languages/italian/entries.xml",
"data/plugins/languages/japanese/entries.xml",
"data/plugins/languages/norwegian/entries.xml",
"data/plugins/languages/polish/entries.xml",
"data/plugins/languages/portuguese/entries.xml",
"data/plugins/languages/russian/entries.xml",
"data/plugins/languages/spanish/entries.xml",
"data/plugins/languages/swedish/entries.xml"
]
```
**You cannot require only one of many possible PSARCs** (for example, having *either* data.psarc *or* data2.psarc, with the latter taking priority). If you require an asset, pull it from the newest PSARC it's contained in. This unfortunately means if you make a mod that modifies a file in data2, but could hypothetically work with the base game, the user still needs to have data2 installed. More granular controls over the `requires` conditions are planned for feature level 2.