-
Notifications
You must be signed in to change notification settings - Fork 12
Compiling the plugin
NOTE: If you have the Steam version of GTA SA, use the San Andreas Downgrader tool to bring it to v1.0
NOTE 2: You can download an already-compiled build of the plugin and save yourself the hassle of compiling it!
This requires you to be logged in to a GitHub account.
- Go to the Actions page
- Click the first item that appears in the "workflow runs" list
- Scroll down to "Artifacts" and click "sm64-san-andreas-release"
- Extract the zip's contents to your GTA SA "scripts" folder.
- Place the ROM on the GTA SA folder where gta_sa.exe is, and make sure the file name of the ROM is
sm64.us
(ORsm64.us.z64
if you have file extensions enabled)
If you can't click the release artifact, make sure you're logged in.
If you still wish to compile the plugin yourself, read on.
-
First, go to the Code::Blocks download page on FossHUB and select the 32-bit version:
-
Leave the component selection as is, and install
-
Click "Yes" when it asks you if you want to run Code::Blocks now
-
Ignore the compiler auto-detection and click OK
-
Minimize Code::Blocks for now.
-
Download the latest version of the mingw-w64 compiler on GitHub. SELECT THE FILE THAT SAYS "i686-(version)-release-posix-dwarf-msvcrt"
-
Open the downloaded 7z file with 7-Zip or WinRAR (I will be using the former), and extract or copy the mingw32 folder directly to the C:\ drive
-
Go back to Code::Blocks and open the compiler settings window (Settings > Compiler settings)
-
Make sure "Selected compiler" is GNU GCC Compiler.
-
Go to the "Toolchain executables" tab and make sure it looks exactly like this. Change the Compiler's installation directory, C compiler, C++ compiler and Linker for dynamic libs:
-
Click OK. Code::Blocks and the mingw-w64 compiler are now set up. Close Code::Blocks for now
- Go to this GitHub fork of plugin-sdk
- Click the green "Code" button and Download ZIP
- Open the zip, and extract or copy plugin-sdk-master to the C:\ drive as well, just like with mingw-w64
- Go inside the newly extracted C:\plugin-sdk-master
- Open the "installer-launcher" program
-
On "Setup Plugin-SDK environment variables", change the first two: Plugin-SDK folder, and GTA San Andreas folder. Use the "..." button to navigate to their locations
- Plugin-SDK folder: The folder where you extracted plugin-sdk. C:\plugin-sdk-master
-
GTA San Andreas folder: The folder where you installed GTA San Andreas. In case of Steam version it should be inside here:
C:\Program Files (x86)\Steam\steamapps\common
- Make sure to click the "Set" buttons afterwards
-
On "Create Plugin-SDK solution/workspace", select Code::Blocks from the dropdown list, and click Generate
-
You should now see this file in the plugin-sdk folder:
plugin.workspace
-
Re-open Code::Blocks, click "Open an existing project", then navigate to C:\plugin-sdk-master, and open the
plugin.workspace
file.- If Code::Blocks asked you if you want to associate file types and selected yes, you can open the plugin workspace file by double-clicking it
-
On the "Projects" pane in the left, right click plugin_sa and select Build options...
-
For "Release" and "Debug", disable all the "Have g++ follow the C++ language standard" checkboxes if any are checked:
-
Next, while still on the Project build options window, click "plugin_sa" on the top left.
- If you get a message asking if you want to apply changes, click Yes
-
Go to "Other compiler options" and write
-std=gnu++23
-
Now click OK at the bottom of the Project build options window to save all these changes
-
Returning to the "Projects" pane in the left, make sure plugin_sa is selected by double-clicking it:
-
Click the "+" icon on plugin_sa, "Resources", "shared", right-click "plugin.rc" and remove it from project. This file will not compile under mingw-w64 so we don't need it
-
For the build target. make sure "Release" is selected instead of "zDebug":
-
Click the gear icon on the left, or press CTRL+F9 to start building plugin_sa
- In case of errors, click "Build log" on the bottom (NOT "Build messages"), copy everything and report this to Issues, or contact me on the PC Port Central Discord at #mario-in-gta-sa
-
Assuming there are zero errors (warnings do not matter), close the plugin workspace
-
plugin-sdk for GTA SA is now compiled! For the final phase we move on to sm64-san-andreas.
- Go to this mod's GitHub page
- Click the green "Code" button and Download ZIP
- Open the ZIP and extract the sm64-san-andreas-master folder anywhere. Does not need to be directly in the C:\ drive
- Go inside the extracted folder and open
sm64-san-andreas.workspace
with Code::Blocks - The Projects tab on the left should now look like this:
- Double-click libsm64 to select it for compiling
- For the build target. make sure "Release" is selected instead of "Debug":
- Click the gear icon on the left, or press CTRL+F9
- Assuming there are zero errors (warnings do not matter), double-click the sm64-san-andreas project, right below libsm64, to select it.
- Repeat the build target steps but this time it should say "GTASA Release"
- Click the gear icon or CTRL+F9 again to compile the actual plugin itself
- If you see this, just click OK ignore it
- However just to make sure, head on over to your GTA SA install folder and create a folder named "scripts", if it doesn't exist, to avoid further trouble
- If you see this, just click OK ignore it
- Wait for compilation to finish
- If your GTA SA "scripts" folder looks like this, you're good to go!