Guide:Replacing strings: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(Updated setup instructions)
(Added PAL instructions, updated command line arguments)
Line 1: Line 1:
This tutorial will walk you through the steps of using [[Sly String Toolkit]] to make mods that replace strings in Sly 2.
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. It will be updated in the future to work with Sly 3, and possibly other regions.
'''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.


== Setup ==
== 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.
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.
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 ===
=== Example project ===


The string toolkit comes with a sample project in the <code>example</code> directory. There you will find a file called <code>strings.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".
The string toolkit comes with some sample input files in the <code>examples</code> directory. There you will find a file called <code>test.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 to the main directory, run this command:
To generate the <code>.pnach</code> file, open a command prompt in the project directory and run this command:


<pre>
<pre>
python main.py -i example/string.csv
python main.py example/string.csv
</pre>
</pre>


Then copy <code>07652DD9.mod.pnach</code> from the <code>out</code> folder to your <code>pcsx2/cheats</code> folder, enable cheats, and start Sly 2. You should see the new text on the title screen.
This will generate a <code>.pnach</code> file 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]]
[[File:String Toolkit screenshot.png]]
Line 33: 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.
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 ===
=== String IDs ===
Line 50: Line 52:
Once you are ready to test the mod, run the script with the following command:
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>
<pre>python main.py <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.mod.pnach</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.
This will generate a file called <code><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 ===
=== Setting the output directory ===
Line 65: Line 65:


<pre>
<pre>
python main.py -i <path_to_your_csv_file> -o <path_to_pcsx2_cheats_folder>
python main.py <path_to_your_csv_file> -o <path_to_pcsx2_cheats_folder>
</pre>
</pre>


Line 71: Line 71:


<pre>
<pre>
python main.py -i <path_to_your_csv_file> -o "C:\Users\Yourname\My Documents\PCSX2 1.6.0\cheats"
python main.py <path_to_your_csv_file> -o "C:\Users\Yourname\My Documents\PCSX2 1.6.0\cheats"
</pre>
</pre>