Guide:Replacing strings: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(Added navbox)
(Changed wording, fixed typos)
Line 7: Line 7:
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 and Sly 2 PAL. It will be updated in the future to work with Sly 3.
'''Note:''' The toolkit currently only works with Sly 2 (NTSC and PAL). It will be updated in the future to work with Sly 3.


{{To do|Add instructions for how to use Live Edit to update the strings in real time.}}
{{To do|Add instructions for how to use Live Edit to update the strings in real time.}}
Line 29: Line 29:
</pre>
</pre>


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.
This will generate a <tt>.pnach</tt> file in the <tt>out</tt> 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 strings on the title screen.


[[File:String Toolkit screenshot.png|480px]]
[[File:String Toolkit screenshot.png|480px]]
Line 36: Line 36:


=== Making a CSV file ===
=== Making a CSV file ===
To make your own string replacement mods, you will need to make a csv file (a spreadsheet) with all the custom strings you want. Each row should have the following format:
To make your own string replacement mods, you will need to make a CSV file (a spreadsheet) with all the custom strings you want. Each row should have the following format:


<code><string id>,<string>,<optional target address></code>
<code><string id>,<string>,<optional target address></code>
Line 43: Line 43:
*<code><optional target address></code> is the address to write the string to. If not specified, it will be written with the rest of the strings in a block at the address specified by the <code>-a</code> option.
*<code><optional target address></code> is the address to write the string to. If not specified, it will be written with the rest of the strings in a block at the address specified by the <code>-a</code> option.


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 example CSV as a template, or make a spreadsheet in Excel or Google Sheets and 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 ====
Every string in the game has a unique ID. You will need to know the ID of any string you want to replace. Fortunately, the game stores all these strings in a large table, which we have compiled into [https://docs.google.com/spreadsheets/d/1W-20RZ1hBz7ZtgRBKCNkH84MxkYsoqesDEBGv8l5BdA/edit?usp=sharing this spreadsheet]. However, the sheet is incomplete and will be expanded in the future.
Every string in the game has a unique ID. You will need to know the ID of any string you want to replace. Fortunately, the game stores all these strings in a large table, which we have dumped into [https://docs.google.com/spreadsheets/d/1W-20RZ1hBz7ZtgRBKCNkH84MxkYsoqesDEBGv8l5BdA/edit?usp=sharing this spreadsheet].


Find the string in the string table you want to replace, and in your spreadsheet put that ID in the first column. In the second column, put the string you want to replace it with.
Find the string in the string table you want to replace, and in your spreadsheet put that ID in the first column. In the second column, put the string you want to replace it with.


For example, if you want to replace the string "WE'LL BE RIGHT BACK!" on the pause menu (which has ID 309) with "SLY MODDING IS FUN!", your csv should look like this:
For example, if you want to replace the string "WE'LL BE RIGHT BACK!" on the pause menu (which has ID 309) with "MODDING IS FUN!", your csv should look like this:


<pre>
<pre>
309,SLY MODDING IS FUN!
309,MODDING IS FUN!
</pre>
</pre>


==Generating the mod PNACH==
==Generating the mod PNACH==


Once you are ready to generate the PNAC file for the mod, run the script with the following command:
When you are ready to generate the PNACH file, run the script with the following command:


<pre>python main.py <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:
The default region is NTSC. You can specify the region with the <code>-r</code> option like this:


<pre>python main.py <path_to_your_csv_file> -r pal</pre>
<pre>python main.py <path_to_your_csv_file> -r pal</pre>
Line 78: Line 76:
</pre>
</pre>


Your PCSX2 folder directory probably looks something like this: <tt>C:\Users\Yourname\My Documents\PCSX2 1.6.0\cheats</tt>. So, you can run the script as follows (with quotation marks around the directory):
Your PCSX2 folder folder is probably something like this: <tt>C:\Users\Yourname\My Documents\PCSX2 1.6.0\cheats</tt>. So, you can run the script as follows (with quotation marks around the directory):


<pre>
<pre>