-
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
-
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 mingw-w64 compiler on SourceForge
-
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 plugin-sdk's GitHub page
- 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
- To create the Code::Blocks Plugin-SDK workspace, replace tools\premake\premake5.exe with this version, otherwise it won't work
- Also download this zip file and extract inside the C:\plugin-sdk-master folder so that plugin-sdk can compile without errors on mingw-w64
- 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.
-
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, 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!