Step 2: Compile UOX3
Option A) Visual Studio 2017/2019 (Free Community edition) (v15.9.22+)
This option will let you use Visual Studio solution/project files to compile both UOX3 and SpiderMonkey with Visual Studio's default VC++ compiler. Note that you can download the Free Community Edition of Visual Studio if you don't have it already. This approach also embeds SpiderMonkey directly inside UOX3 for a slightly larger (~1-2MB) executable, instead of requiring a separate DLL file, and comes with options for compiling either
32-bit or 64-bit (default) versions of UOX3.
SpiderMonkey
- Navigate to the UOX3\spidermonkey folder and open SpiderMonkey.sln in Visual Studio.
- Make sure you have js32 selected in the Solution Explorer, then select Release and either x64 (64-bit) or Win32 (32-bit) in the Solution Configuration/Platform dropdown menus
- Click Build > Build js32 from the menu.
- Visual Studio will compile SpiderMonkey and create spidermonkey\Release\x64 (64-bit) or spidermonkey\Release\x86 (32-bit) folders with the compiled js32.lib library file contained within. No further actions are necessary here, so you can close the SpiderMonkey VS Solution.
UOX3
- Open UOX3_Official.sln from the UOX3\source folder.
Make sure you have UOX3_Official selected in the Solution Explorer, then select either Release or Debug, and either x64 (64-bit) or Win32 (32-bit) in the Solution Configuration/Platform dropdown menus, or via Build -> Configuration Manager.
Select Build -> Build UOX3_Official to start compiling UOX3. When done, you'll find UOX3.exe in either UOX3\source\Release\x64 (or \x86) or UOX3\source\Debug\x64 (or \x86), depending on your choices in the previous step.
Option B) Visual Studio 2017/2019 and CMake (Free Community edition) (v15.9.22+)
This option requires installing the Visual Studio toolset named
Linux development with C++ and the component called
Visual C++ tools for CMake and Linux. Use the Visual Studio Installer to modify your install of Visual Studio if you don't already have these installed! This approach compiles SpiderMonkey to a separate DLL (
js32.dll) file that needs to live inside the same folder as the main UOX3 executable, and currently only supports compiling a
32-bit version of UOX3.
- Start Visual Studio and use File > Open > CMake and select CMakeLists.txt in the root project folder (Example: D:\UOX3). Don't open the similarly named file in the source folder directly.
- After Visual Studio is done loading the project and has generated some necessary files, select CMake > Change CMake Settings > UOX3 from the toolbar menu, and select either x86-Debug or x86-Release depending on what kind of build you want to make - or do this using the Solution Configuration select menu.
- When Visual Studio is done switching to the new configuration, select CMake > Build All from the toolbar menu to start compiling UOX3.
- When done, you'll find UOX3.exe and js32.dll in a subfolder named out of the root project folder, more specifically /UOX3/out/build/x86-Debug or x86-Release, based on the selected configuration.
- Note that the js32.dll file must be copied to the same folder as UOX3.exe!
Step 3: Copy Compiled Files
Once this process is done, you can copy your new
UOX3.exe (and if using CMake,
js32.dll) file from the appropriate output folders (depending on which method and configuration you used) to the root folder of your actual UOX3 project. You'll also need to copy the files and folders contained within the
data subfolder of the UOX3 repository, if you don't already have these.
It is recommended to run your UOX3 shard from a separate, dedicated folder instead of the data folder in your local UOX3 git repository, to avoid potential git conflicts and accidental overwrites when pulling updates to UOX3 from GitHub in the future.
Once you have all the files in place, you can follow the regular steps listed under
Installation and Setup > Configuring Your UOX3 Shard to finish your UOX3 setup!
Note that if you want to execute UOX3 from within Visual Studio 2017, you'll need to provide a copy of
js32.dll (from
UOX3\Spidermonkey\debug or \release) in
UOX3\source\debug or
\release folders, as well as specify the working directory under
Project -> Properties -> Configuration Properties -> Debugging -> Working Directory for either Debug or Release configuration (selectable from dropdown at top of window)