Guide:Replacing strings: Difference between revisions

Added PAL instructions, updated command line arguments
(Updated setup instructions)
(Added PAL instructions, updated command line arguments)
Line 1:
This tutorial will walk you through the steps of using [[Sly String Toolkit]] to make mods that replace strings in Sly 2.
 
'''Note:''' The toolkit currently only works with Sly 2 NTSC and Sly 2 PAL. It will be updated in the future to work with Sly 3, and possibly other regions.
 
== Setup ==
 
First, download Sly String Toolkit from github [https://github.com/TheOnlyZac/sly-string-toolkit/releases here]. If you have git, you can also clone the latest version directly from the repo, but this guide is probably only accurate for the latest release version.
 
You will need to install Python 3.8 or higher from [https://www.python.org/downloads/ here] if you don't already have it. Then, open a command prompt and <code>cd</code> into the folder with the <code>main.py</code> script. Finally, run <code>pip install -r requirements.txt</code> to install the script dependencies. Now you're ready to generate a pnach file!
 
=== Example project ===
 
The string toolkit comes with asome sample projectinput files in the <code>exampleexamples</code> directory. There you will find a file called <code>stringstest.csv</code>. It contains two strings that replace the text on the title screen, "Press START button for New Game" and "Press SELECT button for Menu".
 
To generate the <code>.pnach</code> file, open a command prompt, cd toin the mainproject directory, and run this command:
 
<pre>
python main.py -i example/string.csv
</pre>
 
ThenThis copywill generate a <code>07652DD9.mod.pnach</code> fromfile in the <code>out</code> folder for the NTSC version. If you are playing on PAL version, add <code>--region pal</code> to the command. Then copy the pnach file to your <code>pcsx2/cheats</code> folder, enable cheats, and start Sly 2. You should see the new text on the title screen.
 
[[File:String Toolkit screenshot.png]]
Line 33:
 
Everything after the third column is ignored by the script, so you can use them for notes if you want. You can use the csv file from the example project as a base or make the file in Excel or Google Sheets, then export it as a CSV.
 
You can use the <code>test.csv</code> in the exampled folder as a template if you want.
 
=== String IDs ===
Line 50 ⟶ 52:
Once you are ready to test the mod, run the script with the following command:
 
<pre>python main.py -i <path_to_your_csv_file></pre>
 
The default region is NTSC. If you are playing on PAL, you can specify the region with the <code>-r</code> option as follows:
If you aren't familiar with the command line and don't know how to input the path to your csv file, just name it <code>strings.csv</code> and put it in the same folder as <code>main.py</code> script. Then simply run the script with:
 
<pre>python main.py <path_to_your_csv_file> -r pal</pre>
<pre>
python main.py
</pre>
 
This will generate a file called <code>07652DD9<nowiki><crc>.mod.pnach</nowiki></code> in the <code>out</code> folder. Place the pnach file in your <code>pcsx2/cheats</code> folder and enable cheats, and your custom strings should appear in game.
 
=== Setting the output directory ===
Line 65:
 
<pre>
python main.py -i <path_to_your_csv_file> -o <path_to_pcsx2_cheats_folder>
</pre>
 
Line 71:
 
<pre>
python main.py -i <path_to_your_csv_file> -o "C:\Users\Yourname\My Documents\PCSX2 1.6.0\cheats"
</pre>