In this topic, I will explain how to prepare and compile RCBot2 for both Linux and Windows.
Now in order to do this, you will require Python 3, Git as well as the compilers (GCC 5+ and Clang for Linux) and the MSVC compiler kit from Visual Studio 2015 or newer. And you will also need to have the HL2SDK, SourceMod and Metamod headers that are provided from my Github Repository.
Preparation:-
Before you start you will need to read this documentation from AlliedMods wiki page in order to compile it properly. You will find the requirements and tools you will need to install. (Python 2 is now EOLed and depreciated, so maybe best install Python 3.)
https://wiki.alliedmods.net/Building_SourceMod
Linux AMBuild installation:-
Now in order to use and install AMBuild, you will need to load the Linux Terminal Shell and type in this and to obtain AMBuild:-
(For Debian, Ubuntu and Linux Mint Distros)
To obtain AMBuild:-Code:$ sudo apt install python python-clang python-pip git gcc g++ clang clang++
Hint: For Linux rookies who get stuck if you want your Terminal to go back a folder type `cd ..`. It's recommended not to use or log in as a root user.
Now for using RCBot2 you could either use `$ sudo git clone https://github.com/APGRoboCop/rcbot2` or download the source code directly from there.
Once you have downloaded RCBot2 src code create a folder named "build" in the main /rcbot folder by typing `mkdir build` or if you using Linux Mint with a Cinnamon Desktop, simply right-click in the /rcbot folder window and click [Create New Folder] and name it "build"
Attachment 197
This method is easier and requires fewer clicks than having to type the directory for like `cd /rcbot2/build` or the full directory etc:-
Attachment 198
Compiling in Linux:-
Now say for example you want to compile RCBot2 for TF2 debug build what you need to do is type this in the Terminal located in /rcbot2/build like this:-
And hopefully, the RCBot2 package is compiled and ready!Code:$ python3 ../configure.py -s tf2 --mms_path ./alliedmodders/metamod-source --hl2sdk-root ./alliedmodders --sm-path ./alliedmodders/sourcemod --enable-debug
$ ambuild
Troubleshooting: If you cannot get AMBuild to compile or locate the SDKs properly try typing the full directory address like for example:
Windows AMBuild installation:-Code:$ python3 ../configure.py -s tf2 --mms_path /home/desktop/Dropbox/src/rcbot2/alliedmodders/metamod-source --hl2sdk-root /home/desktop/Dropbox/src/rcbot2/alliedmodders --sm-path /home/desktop/Dropbox/src/rcbot2/alliedmodders/sourcemod --enable-debug
https://wiki.alliedmods.net/Ambuild
Now in order to use install AMBuild you will need to install Visual Studio 2015 or later. The way to obtain AMBuild from git is similar to `git clone https://github.com/alliedmodders/ambuild` and `pip install ./ambuild` but as you noticed that "sudo" isn't used as that is mainly for Linux.
But before that in order to install Python 3 and have it loaded directly from Visual Studio Developer PowerShell, you can either install Chocolatey or Scoop. Personally, from my side, the Python 3 package from MS Store got some privilege flaws that make Python 3 hard to load and execute .py files.
https://scoop.sh/
https://chocolatey.org/
But for this tutorial, I will show you on using Scoop. Simply go to Start Menu and find and select [Developer PowerShell for VS]. Once you have opened the PowerShell, type these into the console:
(Type [Y] for Yes after that)Code:PS C:\> iwr -useb get.scoop.sh | iex
PS C:\> Set-ExecutionPolicy RemoteSigned -scope CurrentUser
Hopefully, both Git and Python will install properly. That way you can install AMBuild like so:-Code:PS C:\> scoop install git python
Compiling in Windows:-
And now it should be ready for RCBot2 src code to be compiled, but like before from the Linux Compiling step you may encounter some Troubleshooting issues. So to keep those to a minimum follow those steps. Type `cd` and the Folder Address like this for example if you got RCBot2 src code downloaded from a second HDD or USB Flash Drive - if not and from C:\ drive, ignore the second line if so:-
Don't forget to create /build folder in /rcbot2. Now say for example you want to compile RCBot2 for TF2 debug build what you need to do is type this in the Terminal located in /rcbot2/build like this:-Code:PS C:\> cd E:\rcbot2-master\build
PS C:\> e:
And hopefully, the RCBot2 package for Windows is compiled and ready!Code:PS E:\rcbot2-master\build python3 ../configure.py -s tf2 --mms_path ./alliedmodders/metamod-source --hl2sdk-root ./alliedmodders --sm-path ./alliedmodders/sourcemod --enable-debug
PS E:\rcbot2-master\build ambuild
Troubleshooting: If you cannot get AMBuild to compile using Developer PowerShell or locate the SDKs properly try typing the full directory address like for example:
Also if Developer PowerShell does not appear to work on your side you could try using [Developer Command Prompt for VS] to see if it will compile better with this app. The downside with this app is you will definitely need to use the `cd E:` as the PowerShell more or less automatically reassigns you to that destination folder and that it will not keep a backlog of the commands you had typed when you are finished with the Developer Command Prompt.Code:PS E:\rcbot2-master\build python3 ../configure.py -s tf2 --mms_path E:/rcbot2-master/alliedmodders/metamod-source --hl2sdk-root E:/rcbot2-master/alliedmodders --sm-path E:/rcbot2-master/alliedmodders/sourcemod --enable-debug
And before I forget be sure to keep AMBuild and Python 3 up-to-date. For keeping Python 3 up-to-date simply type `scoop update *` to keep the packages up-to-date. Of course, for Linux Computers like Debian or Ubuntu requires typing `sudo apt update` followed by `sudo apt upgrade`.