diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 1de442941..2962a1af8 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -6,11 +6,19 @@ on:
- '**.js'
- '**.dfn'
- '**.scp'
+ - '**.txt'
+ - '**.html'
+ - '**.sln'
+ - '**.vcxproj'
pull_request:
paths-ignore:
- '**.js'
- '**.dfn'
- '**.scp'
+ - '**.txt'
+ - '**.html'
+ - '**.sln'
+ - '**.vcxproj'
jobs:
build:
@@ -18,8 +26,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
- - name: prepare automake
- run: chmod +x automake.sh
- - name: automake
- run: ./automake.sh
+ - uses: actions/checkout@v3
+ - name: Generate Makefiles
+ run: cmake make/cmake -DCMAKE_BUILD_TYPE=Release
+ - name: Building
+ run: cmake --build .
diff --git a/.github/workflows/windows_x64_build.yml b/.github/workflows/windows_x64_build.yml
index c0d456ee6..b1b052202 100644
--- a/.github/workflows/windows_x64_build.yml
+++ b/.github/workflows/windows_x64_build.yml
@@ -5,22 +5,31 @@ on:
- '**.js'
- '**.dfn'
- '**.scp'
+ - '**.txt'
+ - '**.html'
+ - '**.sln'
+ - '**.vcxproj'
pull_request:
paths-ignore:
- '**.js'
- '**.dfn'
- '**.scp'
+ - '**.txt'
+ - '**.html'
+ - '**.sln'
+ - '**.vcxproj'
+
jobs:
build:
runs-on: windows-latest
steps:
- name: checkout
- uses: actions/checkout@v2
- - name: setupt msvc console
+ uses: actions/checkout@v3
+ - name: setup msvc console
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: cmake and build
run: |
- cmake -G "NMake Makefiles" .
- nmake
+ cmake make/cmake -DCMAKE_BUILD_TYPE=Release -G"NMake Makefiles"
+ cmake --build . --config Release
diff --git a/.github/workflows/windows_x86_build.yml b/.github/workflows/windows_x86_build.yml
deleted file mode 100644
index 2b18ffb9d..000000000
--- a/.github/workflows/windows_x86_build.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-name: Windows x86 Build
-on:
- push:
- paths-ignore:
- - '**.js'
- - '**.dfn'
- - '**.scp'
- pull_request:
- paths-ignore:
- - '**.js'
- - '**.dfn'
- - '**.scp'
-jobs:
- build:
- runs-on: windows-latest
- steps:
- - name: checkout
- uses: actions/checkout@v2
- - name: setupt msvc console
- uses: ilammy/msvc-dev-cmd@v1
- with:
- arch: x86
- - name: cmake and build
- run: |
- cmake -G "NMake Makefiles" .
- nmake
diff --git a/.gitignore b/.gitignore
index 1c5db1f17..e72241a64 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,14 @@
+# Project unique Items
+
+[Bb]uild/
+
+
+
+
+# Created by https://www.toptal.com/developers/gitignore/api/c++
+# Edit at https://www.toptal.com/developers/gitignore?templates=c++
+
+### C++ ###
# Prerequisites
*.d
@@ -31,6 +42,27 @@
*.out
*.app
+# End of https://www.toptal.com/developers/gitignore/api/c++
+
+
+# Created by https://www.toptal.com/developers/gitignore/api/macos,windows,linux
+# Edit at https://www.toptal.com/developers/gitignore?templates=macos,windows,linux
+
+### Linux ###
+*~
+
+# temporary files which can be created if a process still has a handle open of a deleted file
+.fuse_hidden*
+
+# KDE directory preferences
+.directory
+
+# Linux trash folder which might appear on any partition or disk
+.Trash-*
+
+# .nfs files are created when an open file is removed but is still being accessed
+.nfs*
+
### macOS ###
# General
.DS_Store
@@ -60,59 +92,9 @@ Network Trash Folder
Temporary Items
.apdisk
-### Xcode ###
-# Xcode
-#
-# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
-
-## User settings
-xcuserdata/
-
-## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
-*.xcscmblueprint
-*.xccheckout
-
-## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
-build/
-DerivedData/
-*.moved-aside
-*.pbxuser
-!default.pbxuser
-*.mode1v3
-!default.mode1v3
-*.mode2v3
-!default.mode2v3
-*.perspectivev3
-!default.perspectivev3
-
-## Gcc Patch
-/*.gcno
-
-### Xcode Patch ###
-*.xcodeproj/*
-!*.xcodeproj/project.pbxproj
-!*.xcodeproj/xcshareddata/
-!*.xcworkspace/contents.xcworkspacedata
-**/xcshareddata/WorkspaceSettings.xcsettings
-
-### VisualStudioCode ###
-.vscode/*
-!.vscode/settings.json
-!.vscode/tasks.json
-!.vscode/launch.json
-!.vscode/extensions.json
-*.code-workspace
-
-# Local History for Visual Studio Code
-.history/
-
-### VisualStudioCode Patch ###
-# Ignore all local history of files
-.history
-.ionide
-
-# Support for Project snippet scope
-!.vscode/*.code-snippets
+### macOS Patch ###
+# iCloud generated files
+*.icloud
### Windows ###
# Windows thumbnail cache files
@@ -140,11 +122,73 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk
+# End of https://www.toptal.com/developers/gitignore/api/macos,windows,linux
+
+
+
+
+
+# Created by https://www.toptal.com/developers/gitignore/api/cmake,xcode,visualstudio,visualstudiocode
+# Edit at https://www.toptal.com/developers/gitignore?templates=cmake,xcode,visualstudio,visualstudiocode
+
+### CMake ###
+CMakeLists.txt.user
+CMakeCache.txt
+CMakeFiles
+CMakeScripts
+Testing
+Makefile
+cmake_install.cmake
+install_manifest.txt
+compile_commands.json
+CTestTestfile.cmake
+_deps
+
+### CMake Patch ###
+# External projects
+*-prefix/
+
+### VisualStudioCode ###
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+!.vscode/*.code-snippets
+
+# Local History for Visual Studio Code
+.history/
+
+# Built Visual Studio Code Extensions
+*.vsix
+
+### VisualStudioCode Patch ###
+# Ignore all local history of files
+.history
+.ionide
+
+### Xcode ###
+## User settings
+xcuserdata/
+
+## Xcode 8 and earlier
+*.xcscmblueprint
+*.xccheckout
+
+### Xcode Patch ###
+*.xcodeproj/*
+!*.xcodeproj/project.pbxproj
+!*.xcodeproj/xcshareddata/
+!*.xcodeproj/project.xcworkspace/
+!*.xcworkspace/contents.xcworkspacedata
+/*.gcno
+**/xcshareddata/WorkspaceSettings.xcsettings
+
### VisualStudio ###
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
-## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files
*.rsuser
@@ -349,9 +393,6 @@ PublishScripts/
*.nuget.props
*.nuget.targets
-# Nuget personal access tokens and Credentials
-# nuget.config
-
# Microsoft Azure Build Output
csx/
*.build.csdef
@@ -440,6 +481,15 @@ node_modules/
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
+# Visual Studio 6 auto-generated project file (contains which files were open etc.)
+*.vbp
+
+# Visual Studio 6 workspace and project file (working project files containing files to include in project)
+*.dsw
+*.dsp
+
+# Visual Studio 6 technical files
+
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
@@ -496,6 +546,9 @@ ASALocalRun/
# Local History for Visual Studio
.localhistory/
+# Visual Studio History (VSHistory) files
+.vshistory/
+
# BeatPulse healthcheck temp database
healthchecksdb
@@ -509,14 +562,23 @@ MigrationBackup/
FodyWeavers.xsd
# VS Code files for those working on multiple tools
+*.code-workspace
# Local History for Visual Studio Code
# Windows Installer files from build outputs
+*.cab
+*.msi
+*.msix
+*.msm
+*.msp
# JetBrains Rider
-.idea/
*.sln.iml
### VisualStudio Patch ###
# Additional files built by Visual Studio
+
+# End of https://www.toptal.com/developers/gitignore/api/cmake,xcode,visualstudio,visualstudiocode
+
+
diff --git a/CMakeLists.txt b/CMakeLists.txt
deleted file mode 100644
index c2eceb79a..000000000
--- a/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 3.12.3)
-
-project(UOX3 CXX C)
-
-set(CMAKE_CXX_STANDARD 17)
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
-set(CMAKE_CXX_EXTENSIONS OFF)
-set(CMAKE_CXX_FLAGS_RELEASE "-O2")
-
-add_executable(uox3
- source/uox3.cpp
- source/uox3.rc
-)
-
-target_link_libraries(uox3 uox)
-
-add_subdirectory(source)
-add_subdirectory(spidermonkey)
-add_subdirectory(zlib)
\ No newline at end of file
diff --git a/CMakeSettings.json b/CMakeSettings.json
deleted file mode 100644
index b2f65a37c..000000000
--- a/CMakeSettings.json
+++ /dev/null
@@ -1,53 +0,0 @@
-{
- "configurations": [
-
- {
- "name": "x86-Debug",
- "generator": "Ninja",
- "configurationType": "Debug",
- "buildRoot": "${projectDir}\\out\\build\\${name}",
- "installRoot": "${projectDir}\\out\\install\\${name}",
- "cmakeCommandArgs": "",
- "buildCommandArgs": "",
- "ctestCommandArgs": "",
- "inheritEnvironments": [ "msvc_x86" ],
- "variables": []
- },
- {
- "name": "x64-Debug",
- "generator": "Ninja",
- "configurationType": "Debug",
- "buildRoot": "${projectDir}\\out\\build\\${name}",
- "installRoot": "${projectDir}\\out\\install\\${name}",
- "cmakeCommandArgs": "",
- "buildCommandArgs": "-v",
- "ctestCommandArgs": "",
- "inheritEnvironments": [ "msvc_x64_x64" ],
- "variables": []
- },
- {
- "name": "x86-Release",
- "generator": "Ninja",
- "configurationType": "Release",
- "buildRoot": "${projectDir}\\out\\build\\${name}",
- "installRoot": "${projectDir}\\out\\install\\${name}",
- "cmakeCommandArgs": "",
- "buildCommandArgs": "",
- "ctestCommandArgs": "",
- "inheritEnvironments": [ "msvc_x86" ],
- "variables": []
- },
- {
- "name": "x64-Release",
- "generator": "Ninja",
- "configurationType": "Release",
- "buildRoot": "${projectDir}\\out\\build\\${name}",
- "installRoot": "${projectDir}\\out\\install\\${name}",
- "cmakeCommandArgs": "",
- "buildCommandArgs": "-v",
- "ctestCommandArgs": "",
- "inheritEnvironments": [ "msvc_x64_x64" ],
- "variables": []
- }
- ]
-}
\ No newline at end of file
diff --git a/README.md b/README.md
index 1e41e53bb..740fc525c 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@
**Ultima Offline eXperiment 3** - the original open source Ultima Online server emulator, allowing people to run their own, custom UO shards since 1997. Comes with cross-platform 64-bit support for **Windows**, **Linux**, **macOS**, and **FreeBSD**. News, releases, forums, additional documentation and more can be found at https://www.uox3.org
-Supported UO Client versions: **~4.0.0p** to **~7.0.91.15** (with encryption removed by [ClassicUO](https://www.classicuo.eu), [Razor](https://github.com/msturgill/razor/releases) or similar tools). For additional details on UO client compatibility, check https://www.uox3.org/forums/viewtopic.php?f=1&t=2289
+Supported UO Client versions: **~4.0.0p** to at least **~7.0.97.25** (with encryption removed by [ClassicUO](https://www.classicuo.eu), [Razor](https://github.com/msturgill/razor/releases) or similar tools). For additional details on UO client compatibility, check https://www.uox3.org/forums/viewtopic.php?f=1&t=2289
UOX3 relies on **SpiderMonkey v1.7.0** for its JS-based scripting engine, and on **zlib-1.2.11** for data compression matters, and comes bundled with specific, compatible versions of these.
@@ -16,200 +16,156 @@ Join the [UOX3 Discord](https://discord.gg/uBAXxhF) for support and/or a quick c
---
# How to compile UOX3...
-# ...under Linux, macOS, or FreeBSD
-## Step 1: Clone the UOX3 Git Repository
+## Step 1: Set up a Build Environment
+*First, set up a proper build environment with the various tools needed to clone and compile UOX3.*
- Using git and Terminal
-
-First step, open a new terminal and enter the commands below:
-
-1) Install prerequisites:
-
- * **Linux:** `sudo apt install git` - This will install git if not already installed (Ubuntu/Debian-based Linux variants). If you're using a non-Debian flavour of Linux, use the default package manager that comes with it to install git instead.
-
- * **macOS:** `xcode-select --install` - This will install git if not already installed, along with required make and gcc tools
-
- * **FreeBSD:** `pkg install git gmake` - This will install git and gmake if not already installed. Alternatively, build `git` and `gmake` via ports if desired.
-
-2) `git clone https://github.com/UOX3DevTeam/UOX3.git` - This will clone the stable master branch of the UOX3 git repository into a subdirectory of the current directory you're in, named UOX3. The latest verified compatible version of SpiderMonkey (v1.7.0) is also included, as well as a minimal set of files required to compile zlib-1.2.11.
-
-
- Checking out Other Branches
-
- If you'd rather grab another branch of the git repository, like the **develop** branch where most updates get pushed first before being merged into the master branch, you can use the following command *after* completing the previous step:
- `git checkout develop`
+ Install build tools
-
+ > * **Windows** - Download and install [Community Edition of Visual Studio 2017 or 2022](https://visualstudio.microsoft.com/downloads/).
+ > * * Be sure to also install **Desktop development with C++** via the Visual Studio Installer, along with the individual component titled **VC++ 2017 version 15.9 v14.16 latest v141 tools** (VS2017) or **MSVC v143 - VS 2022 C++ x64/x86 build tools** (VS2022). CMake is included for command-line builds.
+ > * **Linux (Debian-based)** - Run `sudo apt install build-essential cmake` in a Terminal: (or use your Linux distro's package manager)
+ > * **FreeBSD** - Run `pkg install cmake` in a Terminal. Alternatively, build `cmake` via ports if desired.
+ > * **macOS** - Download [Xcode](https://apps.apple.com/us/app/xcode/id497799835?mt=12) (for building with an IDE) via the App Store, and/or [CMake](https://cmake.org/download/) (for command-line builds)
- (macOS alternative) GitHub Desktop
-
- 1) Download and install the macOS version of [GitHub Desktop](https://desktop.github.com/).
- 2) Run GitHub Desktop and click **File->Clone Repository** from the menu.
- 3) Click the **URL** tab, enter **https://github.com/UOX3DevTeam/UOX3.git**, then provide a local path for where you want the UOX3 git repository cloned on your drive.
- 4) Hit the **Clone** button!
+ Install Git
+ > * **Windows/macOS** - Grab [GitHub Desktop](https://desktop.github.com) or your preferred git tool
+ > * **Linux** - Run `sudo apt install git` in a Terminal.
+ > * **FreeBSD** - Run `pkg install git` in a Terminal. Alternatively, build `git` via ports if desired.
-## Step 2: Compile UOX3
-
- Compiling with GNU Make and GCC (v9.x and above) or Clang
-
-You'll need a couple tools before you can compile UOX3 on Linux, like **GNU Make** (*v4.2.1* or higher recommended) and **gcc** (*v9.x* or higher recommended). Install these through your favourite package manager or through your flavour of Linux' variant of the following terminal command (example specific to Debian/Ubuntu Linux flavours):
-
-1) (Linux only) `sudo apt install build-essential`
+---
-Once these are in place, navigate to the **UOX3** project folder in your terminal and execute the following command from the project's root directory:
+## Step 2: Clone the UOX3 Git Repository
+*Next up, clone the UOX3 git repository, which also includes the latest verified compatible version of SpiderMonkey (v1.7.0) and a minimal set of files required to compile zlib-1.2.11.*
+
+ Using GitHub Desktop (Windows/macOS)
-`./automake.sh` - First compiles the SpiderMonkey JS library bundled with UOX3, then compiles the included zlib library, and finally compiles the actual UOX3 build, before copying the compiled binary to the **root** UOX3 project directory.
+ > 1. Run GitHub Desktop and click **File->Clone Repository** from the menu.
+ > 2. Enter **https://github.com/UOX3DevTeam/UOX3.git** in the URL tab, and provide a local path for storing the cloned repo on your drive.
+ > 3. Hit the **Clone** button to clone the stable master branch of UOX3 to the specified local path
- Special note for users of Debian/GCC versions below 9.x
-
- If your version of gcc is below 9.x, you'll need to add *-lstdc++fs* in *Makefile* to include the experimental filesystem library from c++17.
-
- Change the following line (~34) from
+ Using Command Line git
- `$(CXX) $(CXXFLAGS) -o $(TARGET) $^ $(LDFLAGS)`
-
- to
-
- `$(CXX) $(CXXFLAGS) -o $(TARGET) $^ $(LDFLAGS) -lstdc++fs`
+ > 1. Run `git clone https://github.com/UOX3DevTeam/UOX3.git` in a Terminal to clone the stable master branch of UOX3 into a subdirectory of the current directory you're in.
- Manual Instructions
-
- If you don't wish to rely on the automake.sh script, but want control over the process yourself, follow these steps (same as what automake.sh does):
-
- - `cd spidermonkey`
- ### Linux ###
- - `make -f Makefile.ref DEFINES=-DHAVE_VA_LIST_AS_ARRAY CC=gcc`
- - `ar -r libjs32.a Linux_All_DBG.OBJ/*.o`
- - `cp Linux_All_DBG.OBJ/jsautocfg.h ./`
- ### macOS ###
- - `make -f Makefile.ref DEFINES=-DHAVE_VA_LIST_AS_ARRAY CC=gcc`
- - `libtool -static -o libjs32.a -s Darwin_DBG.OBJ/*.o`
- - `cp Darwin_DBG.OBJ/jsautocfg.h ./`
- ### FreeBSD ###
- - `gmake -f Makefile.ref DEFINES=-DHAVE_VA_LIST_AS_ARRAY CC=clang`
- - `ar rcs libjs32.a FreeBSD_DBG.OBJ/*.o`
- - `cp FreeBSD_DBG.OBJ/jsautocfg.h ./`
-
- *Next up, compile a static library of the included zlib package:*
-
- - `cd ../zlib`
- - `make distclean`
- - `./configure`
- - `make`
+ (Optional) Checking out Other Branches
- *At this point, now cd to the root UOX3 project directory and build UOX3:*
+ > If you'd rather grab another branch of the git repository, like the **develop** branch where most updates get pushed first before being merged into the master branch, you can use the following command *after* completing the previous step:
+ `git checkout develop`
- - `cd ../source`
- - `make` (`gmake` under FreeBSD)
+ > GitHub Desktop users can change the active branch via the *Current Branch* dropdown menu in GitHub Desktop.
---
-Once done compiling, you will find the compiled uox3 binary in the root UOX3 directory. You can copy this binary to the directory you intend to run your UOX3 shard from, along with all the files and folders contained in the UOX3/data subdirectory.
-
-**It is recommended** to run your UOX3 shard from a separate, dedicated directory instead of the data directory in your local UOX3 git repository, to avoid potential git conflicts and accidental overwrites when pulling updates to UOX3 from GitHub in the future.
-
+## Step 3: Compile UOX3
+*Finally, compile UOX3 using the build environment you set up in Step 1.*
- Copying Required Files to Dedicated UOX3 Directory
-
-This is an example of how to copy all required files to a directory called UOX3 in your user account's home directory
-1) *navigate to root UOX3 project directory*
-2) `mkdir ~/UOX3`
-3) `cp uox3 ~/UOX3`
-4) `cp -r data/* ~/UOX3`
-5) `cd ~/UOX3`
+ Visual Studio 2022 (Windows), automake.sh (Linux/FreeBSD), XCode (macOS)
+ > * **Visual Studio 2022** - (Windows) Open *UOX3\make\VS2022\uox3.sln* (VS2022), choose *Release/Debug* from dropdown menu, and hit *Build -> Build UOX3*
+ > * **automake.sh** - (Linux/FreeBSD) Run `./automake.sh` in a Terminal, from the root of the cloned UOX3 repository. This compiles UOX3 with CMake, but in one command only. Use optional argument `-b debug` to create debug build, and/or `-o clean` to do a clean build
+ > * **XCode** - (macOS) Open *UOX3/make/XCode/uox3/uox3.xcworkspace*, select *Build*
-Once you have all the required files in place, you can follow the regular steps listed under **Installation and Setup > Configuring Your UOX3 Shard** in the UOX3 documentation (see docs folder, or visit https://www.uox3.org/docs/index.html#configureUOX3) to finish your UOX3 setup.
-
----
+
+ CMake (Any platform, manual instructions)
+
+ > If you don't wish to rely on the automake.sh script, but want control over the process yourself, follow these steps (same as what automake.sh does) in a Terminal. This also works on Windows/macOS as an alternative to compiling with IDEs:
+ > - Navigate to root of cloned UOX3 git repository, and execute these commands:\
+ > `cd make/cmake`\
+ > `mkdir build`\
+ > `cd build`\
+ > `cmake .. -DCMAKE_BUILD_TYPE=Release` (Windows/Linux/FreeBSD)\
+ > `cmake .. -DCMAKE_BUILD_TYPE=Release -G"Unix Makefiles"` (macOS)\
+ > `cmake --build . --config Release`\
+
+ > Replace "Release" with "Debug" in the above instructions to create a debug-build; delete **make/cmake/build** directory to do clean builds.
+
-# ...under Windows
-## Step 1: Clone the UOX3 Git Repository
-1) Download and install [GitHub Desktop](https://desktop.githubc.om). If you already have another tool for git installed, you can use that instead.
-2) Run GitHub Desktop (or your preferred git tool) and click **File->Clone Repository** from the menu.
-3) Click the **URL** tab, enter `https://github.com/UOX3DevTeam/UOX3.git`, then provide a local path for where you want the UOX3 git repository cloned on your drive.
-4) Hit the **Clone** button to clone the stable master branch of the UOX3 git repository to the specified local path, along with the latest verified compatible version of SpiderMonkey (v1.7.0).
+
+ GCC/make/gmake (Linux/FreeBSD, manual instructions)
+
+ > If you'd rather use GCC (v9.x or higher)/make (GNU Make 4.2.1 or higher) than CMake, you can follow these manual steps. Note that for FreeBSD, this approach requires installing **gmake** as an alternative to *make*: `pkg install gmake`
+
+ > First, navigate to **spidermonkey** directory and run these commands:\
+ > `make -f Makefile.ref DEFINES=-DHAVE_VA_LIST_AS_ARRAY CC=gcc` (Linux)\
+ > `ar -r libjs32.a Linux_All_DBG.OBJ/*.o` (Linux)\
+ > `cp Linux_All_DBG.OBJ/jsautocfg.h ./` (Linux)\
+ > `gmake -f Makefile.ref DEFINES=-DHAVE_VA_LIST_AS_ARRAY CC=clang` (FreeBSD)\
+ > `ar rcs libjs32.a FreeBSD_DBG.OBJ/*.o` (FreeBSD)\
+ > `cp FreeBSD_DBG.OBJ/jsautocfg.h ./` (FreeBSD)
+
+ > Next, head to the **zlib** directory:\
+ > `cd ../zlib`\
+ > `make distclean`\
+ > `./configure`\
+ > `make`
+
+ > Finally, head to **UOX3/source** directory:\
+ > `cd ../source`\
+ > `make` (Linux)\
+ > `gmake` (FreeBSD)
+
-## Step 2: Compile UOX3
-### Option A) Visual Studio 2017/2019 ([Free Community edition](https://visualstudio.microsoft.com/downloads/))
- Visual Studio 2017/2019
+ Visual Studio 2017 (Windows)
-*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](https://visualstudio.microsoft.com/downloads/) 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.*
+ > When using VS2017, static libraries of the dependency projects (SpiderMonkey and zlib) need to be compiled prior to the UOX3 project. However, after those sub-projects have been compiled once, they never need to be compiled again, and from that point on only the build instructions for UOX3 itself applies:
-***Note:*** You'll need to install **"Desktop development with C++"** via the Visual Studio Installer if you don't have it already, along with the option for this titled **MSVC v141 - VS 2017 C++ x64/x86 build tools (v14.16)**
+ > #### SpiderMonkey ####
+ > 1) Navigate to the **UOX3\spidermonkey\make\VS2017\jscript\** folder and open **jscript.sln** in VS2017.
+ > 2) Make sure you have **jscript** selected in the Solution Explorer, then select **Release** and **x64** (64-bit) in the Solution Configuration/Platform dropdown menus
+ > 3) Click **Build > Build jscript** from the menu.
+ > 4) Visual Studio will compile SpiderMonkey and create a **spidermonkey\make\VS2017\jscript\x64\Release\** (64-bit) folder with the compiled **jscript.lib** library file contained within. No further actions are necessary here, so you can close the SpiderMonkey VS Solution.
-#### SpiderMonkey ####
-1) Navigate to the **UOX3\spidermonkey** folder and open **SpiderMonkey.sln** in Visual Studio.
-2) 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
-3) Click **Build > Build js32** from the menu.
-4) 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.
+ > ### zlib ###
+ > 1) Navigate to the **UOX3\zlib\make\VS2017** folder and open **zlib.sln** in VS2017.
+ > 2) Select **Release** and **x64** (64-bit) in the Solution Configuration/Platform dropdown menus
+ > 3) Click **Build > Build zlib-static** from the menu.
+ > 4) Visual Studio will compile zlib and create a **zlib\x64\Release** (64-bit) folder with the compiled **zlib-static.lib** library file contained within. No further actions are necessary here, so you can close the zlib VS Solution.
-### zlib ###
-1) Navigate to the **UOX3\zlib** folder and open **zlib.sln** in Visual Studio.
-2) Select **Release** and either **x64** (64-bit) or **Win32** (32-bit) in the Solution Configuration/Platform dropdown menus
-3) Click **Build > Build zlib-static** from the menu.
-4) Visual Studio will compile zlib and create **zlib\x64\Release** (64-bit) or **zlib\x86\Release** (32-bit) folders with the compiled **zlib-static.lib** library file contained within. No further actions are necessary here, so you can close the zlib VS Solution.
+ > #### UOX3 ####
+ > 1) Navigate to the **UOX3\make\VS2017\** folder and open **uox3.sln** in VS2017.
+ > 2) Make sure you have **UOX3** selected in the Solution Explorer, then select **Release** and **x64** (64-bit) in the *Solution Configuration/Platform dropdown menus*, or via **Build -> Configuration Manager**.
+ > 3) Select **Build -> Build UOX3** to start compiling UOX3. When done, you'll find **UOX3.exe** in **UOX3\make\VS2017\Release\x64**.
-#### UOX3 ####
-1) Open **UOX3_Official.sln** from the **UOX3\source** folder.
-2) 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**.
-3) Select **Build -> Build UOX3_Official** to start compiling UOX3. When done, you'll find **UOX3.exe** either in **UOX3\source\Release\x64** (or **\x86**) or in **UOX3\source\Debug\x64** (or **\86**), depending on your choices in the previous step.
+ > From here on, if you wish to re-compile UOX3, just open the uox3.sln and hit rebuild.
+ > Note that if you wish to change from Release to Debug build, the sub-projects (SpiderMonkey and zlib) also need to be compiled for Debug mode prior to compiling UOX3.
- Adding SpiderMonkey/zlib references in Configuration Manager
+ (Troubleshooting) Adding SpiderMonkey/zlib references in Configuration Manager
-If VS give you link errors when attempting to build UOX3, references to SpiderMonkey or zlib might have gone missing! Try the following steps to add them back.
+ > If VS give you link errors when attempting to build UOX3, references to SpiderMonkey or zlib might have gone missing! Try the following steps to add them back.
-1) Right click on **UOX3_Official** in the Solution Explorer, and select Properties.
-2) With the desired configuration (ex: Release, x64) selected at the top of the panel, add references to SpiderMonkey and zlib in these sections:
- * *VC++ Directories >* **Include Directories** (add path to SpiderMonkey and zlib root folders)
- * *VC++ Directories >* **Library Directories** (add path to SpiderMonkey **Release\x64** or **Release\x86** folder, as well as zlib **\x64\Release** or **\x86\Release** folder, depending on desired configuration)
- * *VC++ Directories >* **Source Directories** (add path to SpiderMonkey and zlib root folders)
- * *Linker >* **Additional Library Dependencies** (add path to SpiderMonkey **Release\x64** or **Release\x86** folder, as well as zlib **\x64\Release** or **\x86\Release** folder, depending on desired configuration)
-Press apply!
-Repeat process for both Release and Debug configurations (chosen at top of panel), then retry the UOX3 build process!
+ > 1) Right click on **UOX3_Official** in the Solution Explorer, and select Properties.
+ > 2) With the desired configuration (ex: Release, x64) selected at the top of the panel, add references to SpiderMonkey and zlib in these sections:
+ > * *VC++ Directories >* **Include Directories** (add path to SpiderMonkey and zlib root folders)
+ > * *VC++ Directories >* **Library Directories** (add path to **spidermonkey\make\VS2017\jscript\x64\Release** folder, as well as **zlib\make\VS2017\x64\Release** folder)
+ > * *VC++ Directories >* **Source Directories** (add path to SpiderMonkey and zlib root folders)
+ > * *Linker >* **Additional Library Dependencies** (add path to **spidermonkey\make\VS2017\jscript\x64\Release** folder, as well as **zlib\make\VS2017\x64\Release** folder)
+ > Press apply!
+ > Repeat process for both Release and Debug configurations (chosen at top of panel), then retry the UOX3 build process!
-### Option B) Visual Studio 2017/2019 and CMake ([Free Community edition](https://visualstudio.microsoft.com/downloads/))
-
- Visual Studio 2017/2019 and CMake
-
-*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.*
-
-1) 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.
-2) 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.
-3) When Visual Studio is done switching to the new configuration, select **CMake > Build All** from the toolbar menu to start compiling UOX3.
-4) 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.
-5) Note that the **js32.dll** file must be copied to the same folder as UOX3.exe.
-
-
-
---
-# ...with Docker
-## Step 1: Clone the UOX3 Git Repository
-
- See steps above for appropriate platform for cloning the Git repository to the target of your choice
-## Step 2: Compile UOX3
+## UOX3 Compiled! Now what?
+Once done compiling, you can copy the compiled UOX3 binary/executable to the directory you intend to run your UOX3 shard from, along with all the files and folders contained in the UOX3/data subdirectory. Where you'll find the compiled UOX3 binary/executable depends on your platform and build method. Examples:
+ * **Windows** - (VS2022) Compiled UOX3.exe can be found in **UOX3/make/VS2022/x64/Release**
+ * **Linux/FreeBSD** - (automake.sh) Compiled uox3 binary can be found in **root UOX3 repository**
+ * **macOS** - (XCode) Compiled uox3 binary can be found in **UOX3\make\XCode\Build\Products\Release**
+ * **Either Platform** - (CMake, manual) Compiled uox3 binary can be found in **UOX3\make\cmake\build**
- Open a command prompt and navigate to the Git repository root. Using docker, execute a build of the image like so: `docker buildx build --progress=plain -t uox3 .`
-
----
-Once done compiling, 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.
+**It is recommended** to run your UOX3 shard from a separate, dedicated directory instead of the data directory 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 required files in place, you can follow the regular steps listed under **Installation and Setup > Configuring Your UOX3 Shard** in the UOX3 documentation (see docs folder, or visit https://www.uox3.org/docs/index.html#configureUOX3) to finish your UOX3 setup!
+Once you have all the required files in place, you can follow the regular steps listed under **Installation and Setup > Configuring Your UOX3 Shard** in the UOX3 documentation (see docs folder, or visit https://www.uox3.org/docs/index.html#configureUOX3) to finish your UOX3 setup.
diff --git a/source/uox3.ico b/assets/uox3.ico
similarity index 100%
rename from source/uox3.ico
rename to assets/uox3.ico
diff --git a/source/uox3.rc b/assets/uox3.rc
similarity index 93%
rename from source/uox3.rc
rename to assets/uox3.rc
index d3cdf73d4..8166ab0ff 100644
--- a/source/uox3.rc
+++ b/assets/uox3.rc
@@ -1,6 +1,5 @@
// Microsoft Visual C++ generated resource script.
//
-#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
@@ -35,18 +34,14 @@ IDI_MAINFRAME ICON "uox3.ico"
// TEXTINCLUDE
//
-1 TEXTINCLUDE
-BEGIN
- "resource.h\0"
-END
-2 TEXTINCLUDE
+1 TEXTINCLUDE
BEGIN
"#include ""windows.h""\r\n"
"\0"
END
-3 TEXTINCLUDE
+2 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
@@ -79,11 +74,11 @@ BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "UOX3"
- VALUE "FileVersion", "0.99.6-RC1"
+ VALUE "FileVersion", "0.99.6-RC2"
VALUE "InternalName", "UOX3.exe"
VALUE "OriginalFilename", "UOX3.exe"
VALUE "ProductName", "Ultima Offline eXperiment 3"
- VALUE "ProductVersion", "0.99.6-RC1"
+ VALUE "ProductVersion", "0.99.6-RC2"
END
END
BLOCK "VarFileInfo"
diff --git a/automake.sh b/automake.sh
index bcbb4591b..b187c0974 100755
--- a/automake.sh
+++ b/automake.sh
@@ -1,97 +1,66 @@
-#!/usr/bin/env sh
-if (( $# == 0 )); then
- # No parameters, all stages
- stage=0
-else
- stage="$1"
-fi
+#!/bin/sh
-if [ $stage -eq 0 ] || [ $stage -eq 1 ]; then
- echo "Building SpiderMonkey..."
- cd spidermonkey
- if [ "$(uname)" = "FreeBSD" ]
- then
- gmake -f Makefile.ref DEFINES=-DHAVE_VA_LIST_AS_ARRAY CC=clang
- else
- make -f Makefile.ref DEFINES=-DHAVE_VA_LIST_AS_ARRAY CC=gcc
- fi
-
- ev=$?
- if [ $ev -ne 0 ]; then
- echo "Unable to build SpiderMonkey! Exiting..."
- exit $ev
- else
- echo "Done building SpiderMonkey."
- fi
-
- echo "Creating JavaScript library..."
- if [ "$(uname)" = "Darwin" ] # macOS
- then
- libtool -static -o libjs32.a -s Darwin_DBG.OBJ/*.o
- cp Darwin_DBG.OBJ/jsautocfg.h ./
- elif [ "$(uname)" = "FreeBSD" ]
- then
- ar rcs libjs32.a FreeBSD_DBG.OBJ/*.o
- cp FreeBSD_DBG.OBJ/jsautocfg.h ./
- elif [ "$(expr substr $(uname -s) 1 5)" = "Linux" ]
- then
- # Linux
- ar -r libjs32.a Linux_All_DBG.OBJ/*.o
- cp Linux_All_DBG.OBJ/jsautocfg.h ./
- fi
-
- ev=$?
- if [ $ev -ne 0 ]; then
- echo "Unable to create JavaScript library! Exiting..."
- exit $ev
- else
- echo "Done creating JavaScript library."
- fi
- cd ..
- if [ $stage -eq 1 ]; then exit 0; fi
+# Support optional arguments:
+# -b debug
+# -o clean
+buildtype="Release"
+buildoption="Normal"
+while getopts ":b:o:" flag
+do
+ case "${flag}" in
+ b)
+ if [ ${OPTARG} = "debug" ] || [ ${OPTARG} = "Debug" ]
+ then
+ buildtype="Debug"
+ fi;;
+ o)
+ if [ ${OPTARG} = "clean" ] || [ ${OPTARG} = "Clean" ]
+ then
+ buildoption="Clean"
+ fi;;
+ esac
+done
+
+# if -o clean was provided, do a clean build
+if [ $buildoption = "Clean" ]
+then
+ echo "Preparing for clean build..."
+ rm -R make/cmake/build/
fi
-if [ $stage -eq 0 ] || [ $stage -eq 2 ]; then
- echo "Bulding zlib..."
- cd zlib
- make distclean
- ./configure && make
-
- ev=$?
- if [ $ev -ne 0 ]; then
- echo "Unable to build zlib! Exiting..."
- exit $ev
- else
- echo "Done building zlib."
- fi
- cd ..
- if [ $stage -eq 2 ]; then exit 0; fi
+echo "Creating Build directory"
+cd make/cmake
+mkdir -p build
+cd build
+
+echo "Creating Make Files"
+if [ "$(uname)" = "Darwin" ]
+then
+ # Mac OS X
+ cmake .. -DCMAKE_BUILD_TYPE=$buildtype -G"Unix Makefiles"
+else
+ cmake .. -DCMAKE_BUILD_TYPE=$buildtype
fi
-if [ $stage -eq 0 ] || [ $stage -eq 3 ]; then
- echo "Building UOX3..."
- cd source
- if [ "$(uname)" = "FreeBSD" ]
- then
- gmake
- else
- make
- fi
-
- ev=$?
- if [ $ev -ne 0 ]; then
- echo "Unable to build UOX3! Exiting..."
- cd ..
+echo "Building UOX3 ($buildtype)..."
+cmake --build . --config $buildtype
+
+ev=$?
+if [ $ev -ne 0 ]; then
+ echo "Unable to build UOX3 ($buildtype)! Exiting..."
+ cd ../../..
+ exit $ev
+else
+ if [ -f ./uox3 ]; then
+ cp uox3 ../../..
+ echo "Done! You should now find the compiled uox3 binary in the root UOX3 project directory. Copy this binary"
+ echo "to a separate directory dedicated to running your UOX3 shard, along with the contents of the UOX3/data directory,"
+ echo "to avoid potential git conflicts and accidental overwriting of data when pulling UOX3 updates in the future."
+ cd ../../..
+ rm -R make/cmake/build/
exit $ev
else
- if [ -f ./uox3 ]; then
- cp uox3 ..
- echo "Done! You should now find the compiled uox3 binary in the root UOX3 project directory. Copy this binary"
- echo "to a separate directory dedicated to running your UOX3 shard, along with the contents of the UOX3/data directory,"
- echo "to avoid potential git conflicts and accidental overwriting of data when pulling UOX3 updates in the future."
- else
- echo "uox3 program not found! Please review the build status."
- fi
+ echo "uox3 program not found! Please review the build status."
+ cd ../../..
fi
- cd ..
-fi
\ No newline at end of file
+fi
diff --git a/data/dfndata/npc/npclists/npclists_t2a_lands.dfn b/data/dfndata/npc/npclists/npclists_t2a_lands.dfn
index 1c6f44e3c..495ed663f 100644
--- a/data/dfndata/npc/npclists/npclists_t2a_lands.dfn
+++ b/data/dfndata/npc/npclists/npclists_t2a_lands.dfn
@@ -45,6 +45,12 @@ orcmage
orclord
}
+[NPCLIST Location_Orc_Fort_Savages]
+{
+savageshaman
+savagewarrior
+}
+
[NPCLIST Location_Terathan_Keep]
{
allterathans
diff --git a/data/dfndata/spawn/felucca/spawn_felucca_world_lostlands.dfn b/data/dfndata/spawn/felucca/spawn_felucca_world_lostlands.dfn
index addd28ebb..a41f02491 100644
--- a/data/dfndata/spawn/felucca/spawn_felucca_world_lostlands.dfn
+++ b/data/dfndata/spawn/felucca/spawn_felucca_world_lostlands.dfn
@@ -64,12 +64,12 @@ CALL=5
[REGIONSPAWN 6204]
{
NAME=Location_Orc_Fort
-NPCLIST=Location_Orc_Fort
-MAXNPCS=25
-X1=5201
-Y1=3609
+NPCLIST=Location_Orc_Fort_Savages
+MAXNPCS=15
+X1=5200
+Y1=3610
X2=5229
-Y2=3627
+Y2=3628
WORLD=0
MINTIME=18
MAXTIME=20
@@ -256,4 +256,17 @@ MAXTIME=40
CALL=2
}
-EOF
\ No newline at end of file
+[REGIONSPAWN 6217]
+{
+NAME=Location_Around_Orc_Fort
+NPC=savagerider
+MAXNPCS=15
+X1=5162
+Y1=3585
+X2=5273
+Y2=3637
+WORLD=0
+MINTIME=18
+MAXTIME=20
+CALL=5
+}
\ No newline at end of file
diff --git a/dlls/js32.dll b/dlls/js32.dll
deleted file mode 100644
index ffb445ace..000000000
Binary files a/dlls/js32.dll and /dev/null differ
diff --git a/docs/index.html b/docs/index.html
index 96d6fb542..b7dcc6780 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -22,12 +22,12 @@
Made it easier to find the Frequently Asked Questions section of the document
@@ -159,7 +167,7 @@
March 19th, 2021
November 13th, 2020
-
Added dos2unix instructions for Linux/MacOS users downloading default worldfiles/spawnfiles
+
Added dos2unix instructions for Linux/macOS users downloading default worldfiles/spawnfiles
November 7th, 2020
@@ -1025,8 +1033,8 @@
The Community Discord
Determines if support for the UOGateway Info Request Service is enabled.
-
CUOENABLED=0
- Determines if support for the ConnectUO Server Poll Packet request is enabled.
+
FREESHARDSERVERPOLL=0
+ Determines if support for the Freeshard Server Poll Packet request is enabled.
RANDOMSTARTINGLOCATION=0
@@ -1312,6 +1320,119 @@
The Community Discord
NPCFLAGUPDATETIMER=5
Interval in seconds between each time NPC flags are updated.
+
+
BLOODDECAYTIMER=3
+ Time in seconds it takes small blood splatter on ground spawned during combat to decay. Defaults to 3 seconds.
+
+
+
BLOODDECAYCORPSETIMER=210
+ Time in seconds it takes larger blood splatter on ground spawned upon death to decay. Defaults to half the duration of the default corpse decay timer.
+
+
+
+
+
+
+
Supported era values: core, t2a, uor, td, lbr, pub15, aos, se, ml, sa, hs, tol Note: A value of 'core' inherits whatever is set in CORESHARDERA
+
+
CORESHARDERA=pub15
+ Defines the "core" era of the shard. Defaults to pub15 (Publish 15).
+
+
any - determines which Item/NPC DFNs gets loaded, based on tags like GETT2A, GETPUB15
+
uor or later - enables bonus hit chance for archery via ARCHERYHITBONUS setting
+
pub15 or earlier - final combat damage value reduced by half
+
+
+
+
ARMORCALCULATION=core
+ Defines era to base armor calculations on
+
+
pub15 or earlier - different armor pieces contribute different percentage of the total Armor Rating
+
aos or later - each armor piece contribute to sum total of Physical Resistance, and other elemental resistance stats
+
+
+
+
STRENGTHDAMAGEBONUS=core
+ Defines era to base strength damage bonus on
+
+
uor or earlier - 20% damage bonus based on strength, capped at 200 strength
+
td or later - 35% damage bonus based on strength if 100 strength or more, otherwise 30% damage bonus
+
+
+
+
TACTICSDAMAGEBONUS=core
+ Defines era to base tactics damage bonus on
+
+
pub15 or earlier - bonus = Tactics skill + 50
+
aos or later - 68.75% damage bonus if GM Tactics, 62.5% bonus if below
+
+
+
+
ANATOMYDAMAGEBONUS=core
+ Defines era to base anatomy damage bonus on
+
+
uor or earlier - bonus = Anatomy / 5 vs NPCs, Anatomy / 2.5 vs Players
+
td or later - 30% damage bonus at GM anatomy, up to 20% below GM
+
ml or later - 50% + 5 damage bonus at GM anatomy, up to 50% below GM
+
+
+
+
LUMBERJACKDAMAGEBONUS=core
+ Defines era to base lumberjacking damage bonus on
+
+
uor or earlier - 35% damage bonus at GM skill, up to 25% below GM
+
td or later - 30% damage bonus at GM skill, up to 20% below GM
+
hs or later - 10% chance of 100% damage bonus
+
+
+
+
RACIALDAMAGEBONUS=core
+ Defines era to base racial damage bonus on
+
+
sa or later - Gargoyles gain +15% damage bonus per each 20 HP lost
+
+
+
+
DAMAGEBONUSCAP=core
+ Defines era to base damage bonus cap on
+
+
pub15 or earlier - No cap on damage bonus multiplier
+
aos or later - Total damage bonus multiplier capped at 300% higher than base damage
+
+
+
+
SHIELDPARRY=core
+ Defines era to base shield parry calculations on
+
+
t2a - chance to block is parryskill / 2. shield absorbs damage equivalent of AR/2 for melee, or equivalent of AR for archery
+
uor to pub15 - higher AR equals lower block chance, but more damage absorbed.
+
aos or later - chance to block dependent on parry skill vs bushido skill, with dex modifier
+
+
+
+
WEAPONPARRY=core
+ Defines era to base weapon parry calculations on
+
+
aos or later - chance to parry with weapon based on parry skill and bushido skill, with a dex modifier, 16.6% chance weapon will take damage from parrying
+
ml or later - chance to parry with weapon based on parry skill and bushido skill, with a dex modifier, 5% chance weapon will take damage from parrying, or 75% if opponent has mace
+
+
+
+
WRESTLINGPARRY=core
+ Defines era to base wrestling parry calculations on
+
+
tol or later - From 12.5% chance (at GM wrestling, increases with higher skill) that an NPC will parry an attack
+
+
+
+
COMBATHITCHANCE=core
+ Defines era to base combat hit chance calculations on
+
+
t2a to pub15 - hit chance based on attacker's skill vs defender's skill. No minimum chance to hit
+
uor to pub15 - Additional bonus hit chance for archery
+
aos to tol - hit chance based on attacker's skill (and hit chance increase) vs defender's skill (and defense chance increase). Minimum 2% chance to hit
+
+
@@ -1363,12 +1484,16 @@
The Community Discord
SELLBYNAME=0
- Determines if items are sold by their name, not just ID/Colour.
+ Determines if items are sold by their name, not just ID/Colour. Recommended to leave off.
SELLMAXITEMS=5
Maximum number of items that can be sold to a vendor at a time.
+
+
GLOBALRESTOCKMULTIPLIER=1
+ Global multiplier used to alter how many items NPC shopkeepers will restock. Defaults to 1, which means RESTOCK values in item definitions are taken at face value.
+
BANKBUYTHRESHOLD=2000
Defines the lower limit for when a purchase will withdraw money from bank instead of backpack
@@ -1492,6 +1617,35 @@
The Community Discord
BASICTOOLTIPSONLY=0
If enabled, tooltips will only show name and weight of items
+
+
+
SHOWREPUTATIONTITLEINTOOLTIP=1
+ If enabled, shows player's reputation title in tooltip. Defaults to 1
+
+
+
SHOWGUILDINFOINTOOLTIP=1
+ If enabled, shows player's guild info in tooltip. Defaults to 1
+
+
+
SHOWNPCTITLESINTOOLTIPS=1
+ If enabled, shows NPC titles in tooltip. Defaults to 1
+
+
+
SHOWNPCTITLESOVERHEAD=1
+ If enabled, shows NPC titles over their heads. Defaults to 1
+
+
+
SHOWINVULNERABLETAGOVERHEAD=1
+ If enabled, shows invulnerable tags over the head of characters. Defaults to 0
+
+
+
SHOWRACEWITHNAME=1
+ If enabled, shows a character's race along with their name. Defaults to 1
+
+
+
SHOWRACEINPAPERDOLL=1
+ If enabled, shows a character's race in the paperdoll. Defaults to 1
+
GLOBALITEMDECAY=1
Toggles decay on/off on a global scale. Does not remove decay flag from items, only stops them from decaying
@@ -1524,6 +1678,18 @@
The Community Discord
MAXPLAYERBANKITEMS=125
Sets max amount of items players can keep in their bank box.
+
+
MAXPLAYERPACKWEIGHT=40000
+ Sets max weight capacity in stones for player backpacks (including items in sub-containers). 40000 = 400.00 stones
+
+
+
MAXPLAYERBANKWEIGHT=160000
+ Sets max weight capacity in stones for player bankboxes (including items in sub-containers). 160000 = 1600.00 stones
+
+
+
FORCENEWANIMATIONPACKET=1
+ If enabled (default), forces the use of the new animation packet for playing various character animations for both NPCs in general and for player characters connected with client v7.0.0.0+
+
MAPDIFFSENABLED=0
If enabled, server will attempt to load diff files, and send "Enable Map-diff files" packet to client to also load these. Disabled by default.
@@ -1927,6 +2093,10 @@
The Community Discord
HIDESTATSFORUNKNOWNMAGICITEMS=1
Toggles whether item stats for unidentified magic items are hidden from tooltips
+
+
CASTSPELLSWHILEMOVING=0
+ Toggles whether spells can be cast while moving, without ever having to stop!
Follow the steps below for your preferred platform if you wish to download and compile the UOX3 source directly from GitHub yourself.
-
Windows Users
-
Step 1 - Clone the UOX3 Git Repository
-
-
-
-
-
Download and install GitHub Desktop. If you already have another tool for git installed, you can use that instead.
-
Run GitHub Desktop (or your preferred git tool) and click File->Clone Repository from the menu.
-
Click the URL tab, enter https://github.com/UOX3DevTeam/UOX3.git, then provide a local path for where you want the UOX3 git repository cloned on your drive.
-
Hit the Clone button to clone the stable branch of the UOX3 git repository to the specified local path, along with the latest verified compatible version of SpiderMonkey (v1.7.0).
-
-
-
-
-
If you'd rather grab another branch of the git repository, like the develop branch where most updates get pushed first before being merged into the master branch, you can click the Current branch dropdown menu in GitHub Desktop and select the branch you wish to check out. If you're out to do some code development, or just want to get at the latest possible changes, be sure to select the develop branch instead of the main/master one!
-
-
-
Step 2 - Compile UOX3
-
-
+
Follow the steps below for your preferred platform if you wish to download and compile the UOX3 source directly from GitHub yourself. These instructions are also available in UOX3's GitHub repository.
+
+
Step 1: Set up a Build Environment
+ First, setup a proper build environment with the various tools needed to clone and compile UOX3.
+
+
-
This option will let you use Visual Studio solution/project files to compile both UOX3, SpiderMonkey and zlib 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.
-
Note: You'll need to install "Desktop development with C++" via the Visual Studio Installer if you don't have it already, along with the option for this titled MSVC v141 - VS 2017 C++ x64/x86 build tools (v14.16)
-
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.
-
-
zlib
-
-
Navigate to the UOX3\zlib folder and open zlib.sln in Visual Studio.
-
Select Release and either x64 (64-bit) or Win32 (32-bit) in the Solution Configuration/Platform dropdown menus
-
Click Build > Build zlib-static from the menu.
-
Visual Studio will compile zlib and create zlib\x64\Release (64-bit) or zlib\x86\Release (32-bit) folders with the compiled zlib-static.lib library file contained within. No further actions are necessary here, so you can close the zlib 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.
-
-
-
-
-
If VS give you link errors when attempting to build UOX3, references to SpiderMonkey or zlib might have gone missing! Try the following steps to add them back.
-
-
Right click on UOX3_Official in the Solution Explorer, and select Properties.
-
With the desired configuration (ex: Release, x64) selected at the top of the panel, add references to SpiderMonkey and zlib in these sections:
VC++ Directories >Include Directories (add path to SpiderMonkey and zlib root folders)
-
VC++ Directories >Library Directories (add path to SpiderMonkey Release\x64 or Release\x86 folder, as well as zlib \x64\Release or \x86\Release folder, depending on desired configuration)
-
VC++ Directories >Source Directories (add path to SpiderMonkey and zlib root folder)
-
Linker >Additional Library Dependencies (add path to SpiderMonkey Release\x64 or Release\x86 folder, as well as zlib \x64\Release or \x86\Release , depending on desired configuration)
+
Be sure to also install Desktop development with C++ via the Visual Studio Installer, along with the individual component titled VC++ 2017 version 15.9 v14.16 latest v141 tools (VS2017) or MSVC v143 - VS 2022 C++ x64/x86 build tools (VS2022). CMake is included for command-line builds.
-
Press apply!
-
Repeat process for both Release and Debug configurations (chosen at top of panel), then retry the UOX3 build process!
-
-
+
Linux (Debian-based) - Run sudo apt install build-essential cmake in a Terminal: (or use your Linux distro's package manager)
+
FreeBSD - Run pkg install cmake in a Terminal. Alternatively, build cmake via ports if desired.
+
macOS - Download Xcode (for building with an IDE) via the App Store, and/or CMake (for command-line builds)
-
-
+
+
-
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.
-
+
+
Windows/macOS - Grab GitHub Desktop or your preferred git tool
+
Linux - Run sudo apt install git in a Terminal.
+
FreeBSD - Run pkg install git in a Terminal. Alternatively, build git via ports if desired.
-
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.
+ Next up, clone the UOX3 git repository, which also includes the latest verified compatible version of SpiderMonkey (v1.7.0) and a minimal set of files required to compile zlib-1.2.11.
+
+
-
First step, open a new terminal and enter the following commands:
-
-
(Linux)sudo apt install git - This will install git if not already installed (Ubuntu/Debian-based Linux variants). If you're using a non-Debian flavour of Linux, use the default package manager that comes with it to install git instead.
-
(macOS)xcode-select --install - This will install git if not already installed, along with required make and gcc tools
-
git clone https://github.com/UOX3DevTeam/UOX3.git - This will clone the stable branch of the UOX3 git repository into a subdirectory of the current directory you're in, named UOX3. The latest verified compatible version of SpiderMonkey (v1.7.0) is also included, as well as a minimal set of files required to compile zlib-1.2.11.
-
-
-
-
-
If you'd rather grab another branch of the git repository, like the develop branch where most updates get pushed first before being merged into the master branch, you can use the following command *after* completing the previous step: git checkout develop
-
+
+
Run GitHub Desktop and click File->Clone Repository from the menu.
+
Enter https://github.com/UOX3DevTeam/UOX3.git in the URL tab, and provide a local path for storing the cloned repo on your drive.
+
Hit the Clone button to clone the stable master branch of UOX3 to the specified local path
-
-
+
+
-
-
Download and install the macOS version of GitHub Desktop.
-
Run GitHub Desktop and click File->Clone Repository from the menu.
-
Click the URL tab, enter https://github.com/UOX3DevTeam/UOX3.git, then provide a local path for where you want the UOX3 git repository cloned on your drive.
-
Hit the Clone button!
-
+
+
Run git clone https://github.com/UOX3DevTeam/UOX3.git in a Terminal to clone the stable master branch of UOX3 into a subdirectory of the current directory you're in.
+
+
+
+
+
If you'd rather grab another branch of the git repository, like the develop branch where most updates get pushed first before being merged into the master branch, you can use the following command after completing the previous step: git checkout develop
+
GitHub Desktop users can change the active branch via the Current Branch dropdown menu in GitHub Desktop.
+
+
+
Step 3: Compile UOX3
+ Finally, compile UOX3 using the build environment you setup in Step 1.
+
+
+
+
+
Visual Studio 2022 - (Windows) Open UOX3\make\VS2022\uox3.sln (VS2022), choose Release/Debug from dropdown menu, and hit Build -> Build UOX3
+
automake.sh - (Linux/FreeBSD) Run ./automake.sh in a Terminal, from the root of the cloned UOX3 repository. This compiles UOX3 with CMake, but in one command only. Use optional argument -b debug to create debug build, and/or -o clean to do a clean build.
+
XCode - (macOS) Open UOX3/make/XCode/uox3/uox3.xcworkspace, select Build
+
-
Step 2 - Compile UOX3
-
-
+
+
-
You'll need a couple tools before you can compile UOX3 on Linux, like GNU Make (4.2.1 or higher recommended) and gcc (v9.x or higher recommended). Install these through your favourite package manager or through your flavour of Linux' variant of the following terminal command (specific to Debian/Ubuntu Linux flavours):
+
If you don't wish to rely on the automake.sh script, but want control over the process yourself, follow these steps (same as what automake.sh does) in a Terminal. This also works on Windows/macOS as an alternative to compile with IDEs:
Once these tools are in place, navigate to the UOX3 project directory in your terminal and execute the following commands from the project's root directory, in order:
-
-
./automake.sh - First compiles the SpiderMonkey JS library bundled with UOX3, then compiles the included zlib library, and finally compiles the actual UOX3 build, before copying the compiled binary to the root UOX3 project directory.
-
+
Replace "Release" with "Debug" in the above instructions to create a debug-build; delete make/cmake/build directory to do clean builds.
+
-
-
+
+
+
+
If you'd rather use GCC (v9.x or higher)/make (GNU Make 4.2.1 or higher) than CMake, you can follow these manual steps. Note that for FreeBSD, this approach requires installing gmake as an alternative to make: pkg install gmake
+
+
First, navigate to spidermonkey directory and run these commands:
+ make -f Makefile.ref DEFINES=-DHAVE_VA_LIST_AS_ARRAY CC=gcc (Linux)
+ ar -r libjs32.a Linux_All_DBG.OBJ/*.o (Linux)
+ cp Linux_All_DBG.OBJ/jsautocfg.h ./ (Linux)
+ gmake -f Makefile.ref DEFINES=-DHAVE_VA_LIST_AS_ARRAY CC=clang (FreeBSD)
+ ar rcs libjs32.a FreeBSD_DBG.OBJ/*.o (FreeBSD)
+ cp FreeBSD_DBG.OBJ/jsautocfg.h ./ (FreeBSD)
+
+
Next, head to the zlib directory:
+ cd ../zlib
+ make distclean
+ ./configure
+ make
+
+
Finally, head to UOX3/source directory:
+ cd ../source
+ make (Linux)
+ gmake (FreeBSD)
+
+
-
If your version of gcc is below 9.x, you'll need to add -lstdc++fs in Makefile to include the experimental filesystem library from c++17.:
+
If your version of gcc is below 9.x, you'll need to add -lstdc++fs in Makefile to include the experimental filesystem library from c++17.:
Change the following line (~34) from $(CXX) $(CXXFLAGS) -o $(TARGET) $^ $(LDFLAGS)
to $(CXX) $(CXXFLAGS) -o $(TARGET) $^ $(LDFLAGS) -lstdc++fs
-
-
-
-
-
If you don't wish to rely on the automake.sh script, but want control over the process yourself, follow these steps (same as what automake.sh does):
-
-
cd spidermonkey
-
make -f Makefile.ref DEFINES=-DHAVE_VA_LIST_AS_ARRAY CC=gcc
-
Linux
-
-
ar -r libjs32.a Linux_All_DBG.OBJ/*.o
-
cp Linux_All_DBG.OBJ/jsautocfg.h ./
-
-
macOS
-
-
ar rcs libjs32.a Darwin_DBG.OBJ/*.o
-
cp Darwin_DBG.OBJ/jsautocfg.h ./
-
-
Next up, compile a static library of the included zlib package:
-
-
cd ../zlib
-
make distclean
-
./configure
-
make
-
-
At this point, now cd to the root UOX3 project directory and build UOX3:
-
-
cd ../source
-
make
-
-
-
-
Once this process is done, you will find the compiled uox3 binary in the root UOX3 directory. You can copy this binary to the directory you intend to run your UOX3 shard from, along with all the files and folders contained in the UOX3/data/ subdirectory.
-
-
It is recommended to run your UOX3 shard from a separate, dedicated directory instead of the data directory in your local UOX3 git repository, to avoid potential git conflicts and accidental overwrites when pulling updates to UOX3 from GitHub in the future.
-
-
+
+
-
This is an example of how to copy all required files to a directory called UOX3 in your user account's home directory
-
-
navigate to root UOX3 project directory
-
mkdir ~/UOX3
-
cp uox3 ~/UOX3
-
cp -r data/* ~/UOX3
-
cd ~/UOX3
-
+
When using VS2017, static libraries of the dependency projects (SpiderMonkey and zlib) need to be compiled prior to the UOX3 project. However, after those sub-projects have been compiled once, they never need to be compiled again, and from that point on only the build instructions for UOX3 itself applies:
+
+
SpiderMonkey
+
+
Navigate to the UOX3\spidermonkey\make\VS2017\jscript folder and open jscript.sln in VS2017.
+
Make sure you have jscript selected in the Solution Explorer, then select Release and x64 (64-bit) in the Solution Configuration/Platform dropdown menus
+
Click Build > Build jscript from the menu.
+
Visual Studio will compile SpiderMonkey and create a spidermonkey\make\VS2017\jscript\x64\Release (64-bit) folder with the compiled jscript.lib library file contained within. No further actions are necessary here, so you can close the SpiderMonkey VS Solution.
+
+
zlib
+
+
Navigate to the UOX3\zlib\make\VS2017 folder and open zlib.sln in VS2017.
+
Select Release and x64 (64-bit) in the Solution Configuration/Platform dropdown menus
+
Click Build > Build zlib-static from the menu.
+
Visual Studio will compile zlib and create a zlib\x64\Release (64-bit) folder with the compiled zlib-static.lib library file contained within. No further actions are necessary here, so you can close the zlib VS Solution.
+
+
UOX3
+
+
Navigate to the UOX3\make\VS2017 folder and open uox3.sln in VS2017.
+
Make sure you have UOX3 selected in the Solution Explorer, then select Release and x64 (64-bit) in the Solution Configuration/Platform dropdown menus, or via Build -> Configuration Manager.
+
Select Build -> Build UOX3 to start compiling UOX3. When done, you'll find UOX3.exe in UOX3\make\VS2017\Release\x64.
Once done compiling, you can copy the compiled UOX3 binary/executable to the directory you intend to run your UOX3 shard from, along with all the files and folders contained in the UOX3/data subdirectory. Where you'll find the compiled UOX3 binary/executable depends on your platform and build method. Examples:
+
+
Windows - (VS2022) Compiled UOX3.exe can be found in UOX3/make/VS2022/x64/Release
+
Linux/FreeBSD - (automake.sh) Compiled uox3 binary can be found in root UOX3 repository
+
macOS - (XCode) Compiled uox3 binary can be found in UOX3\make\XCode\Build\Products\Release
+
Either Platform - (CMake, manual) Compiled uox3 binary can be found in UOX3\make\cmake\build
+
+
It is recommended to run your UOX3 shard from a separate, dedicated directory instead of the data directory in your local UOX3 git repository, to avoid potential git conflicts and accidental overwrites when pulling updates to UOX3 from GitHub in the future.
Any contributions that involve making changes to UOX3 can either be posted in the Submissions - Fixes & Improvements section of the UOX3.org forums, or can be submitted as a Pull Request on UOX3's GitHub page, for those familiar with that workflow. Do note that any such contributions will be reviewed for quality and fit with the project before being accepted and merged into the core UOX3 project.
If it so happens, that your code or script contribution is not approved for inclusion in the core UOX3 project, you can still post it as custom additions/tweaks in other parts of the UOX3.org forums, for other users to download! Alternatively, if your changes are extensive enough, you can do what many others have done before you and branch off the main UOX3 project to create something entirely new and exciting!
-
+
A Note about Coding Styles and Practices
+
Before venturing on a grand coding adventure, pause for a moment and take a peek at the UOX3 Style Guide for Code (WIP). Sticking closely to the guidelines in that document increases the chance that one's code submissions can be included/merged into the main UOX3 codebase, and also helps ensure that all (new, if not all old) code follows a consistent style. This makes it easier to read and understand the codebase.
@@ -5273,6 +5411,10 @@
Available NPC AI types
Passive AI that doesn't fight back or react to being attacked.
8 - AI_BANKER
Bankers give players access to their bank boxes when saying the word "bank" nearby. Tip: This can also be used on players to ALWAYS give them access to their bankbox ;)
+
10 - AI_CASTER
+ Same as AI_FIGHTER, but will try to stay at casting range.
+
11 - AI_EVIL_CASTER
+ Same as AI_EVIL, but will try to stay at casting range.
17 - AI_PLAYERVENDOR
Used by playervendors placed by players at their houses to sell items to other players.
32 - AI_PET_GUARD
@@ -6430,6 +6572,10 @@
Manage Event Decorations
def=[defense] or [lowdef highdef]
Set Physical-resist/defense value - either fixed or random range
+
+
defbonus=[minDefenseBonus maxDefenseBonus]
+ Set defense/physical resistance bonus applied on top of standard def (maxDefenseBonus is optional, but if specified, randomizes). Should be applied after the def tag.
+
detectinghidden=[skillpoints] or [lowskill highskill]
Set Detecting Hidden skill (0 - 1000)
@@ -6446,6 +6592,10 @@
Manage Event Decorations
elementresist=[fire cold energy poison]
Set Element-resist stats (0 - 1000 for each stat)
+
+
erbonus=[fire cold energy poison]
+ Set elemental resistance bonus applied on top of standard elementresist. Should be applied after the elementresist tag.
+
emotecolour=[color]
Set the default colour (in hex or decimal) for the NPC's emote text
@@ -6526,6 +6676,10 @@
Manage Event Decorations
get=[npcSectionID]
Inherit properties from NPC defined by npcSectionID in NPC DFNs
+
+
gett2a/gettd/getuor/getlbr/getpub15/getaos/getse/getml/getsa/gettol=[npcSectionID]
+ Inherit properties from NPC defined by npcSectionID in NPC DFNs, based on selected era in expansion settings of uox.ini
+
gold=[gold] or [mingold maxgold]
Set the amount of gold this NPC carries - either fixed or random range
@@ -7021,6 +7175,10 @@
Manage Event Decorations
def=[defense]
Set physical resist/armor rating value of item. Primarily used with wearables like clothes, armour, etc.
+
+
defbonus=[minDefenseBonus maxDefenseBonus]
+ Set defense/physical resistance bonus applied on top of standard def (maxDefenseBonus is optional, but if specified, randomizes). Should be applied after the def tag.
+
dex=[statpoints]
Minimum dexterity required to equip item
@@ -7049,10 +7207,18 @@
Manage Event Decorations
elementresist=[fire cold energy poison]
Set fire, cold, energy and poison resistance values (0 - 1000, where 1000 = 100.0)
+
+
erbonus=[fire cold energy poison]
+ Set elemental resistance bonus applied on top of standard elementresist. Should be applied after the elementresist tag.
+
get=[itemSectionID]
Inherit properties of item with specified itemSectionID from item DFNs
+
+
gett2a/gettd/getuor/getlbr/getpub15/getaos/getse/getml/getsa/gettol=[itemSectionID]
+ Inherit properties from Item defined by itemSectionID in Item DFNs, based on selected era in expansion settings of uox.ini
+
glow=[0/1]
Attaches a hidden lightsource to the item to make it appear to glow
Another nice (German) website focusing on providing custom artwork for UO shards. Amongst other things, it has some very nice animated item artwork (including a moving water-mill).
@@ -10932,6 +11098,7 @@
How it Got Started
Grimson Programmer, 07/06/2005, 0.98.3-0
ShadowBranch Daniel Moree, Programmer, 11/06/2005, 0.98-3.0
+
Sydius Chris Ogden, Programmer, 04/08/2005, 0.98-3.0
// Display remaining uses left in a tooltip, based on item's UsesLeft tag
-function onTooltip( myObj )
+function onTooltip( myObj, pSocket )
{
var tooltipText = "";
var usesLeft = myObj.GetTag( "UsesLeft" );
@@ -7067,15 +7067,20 @@
January 9th, 2022
Prototype
SpawnRegion GetSpawnRegion( spawnRegionNum );
+
SpawnRegion GetSpawnRegion( x, y, worldNum, instanceID );
Purpose
-
Returns SpawnRegion object for specified spawnRegionNum.
+
Returns SpawnRegion object for specified spawnRegionNum, or for specified set of coordinates
Example of usage
// Returns SpawnRegion object for spawn region #1 from spawns.dfn
var spawnRegion = GetSpawnRegion( 1 );
+pUser.TextMessage( "The name of this SpawnRegion is: " + spawnRegion.name );
+
+// Returns SpawnRegion object for spawn region at specified coordinates:
+var spawnRegion = GetSpawnRegion( pUser.x, pUser.y, pUser.worldnumber, pUser.instanceID );
pUser.TextMessage( "The name of this SpawnRegion is: " + spawnRegion.name );
@@ -8740,7 +8745,7 @@
January 9th, 2022
Purpose
-
Get/Set the time in milliseconds until specified timer expires for a Character object
+
Get a timestamp for when timer will run out, or set the time in milliseconds until specified timer expires for a Character object
Notes
@@ -8755,7 +8760,7 @@
January 9th, 2022
Timer.SPELLTIME // Time until spell cast is completed. Can be set to 0 to interrupt
Timer.SPELLRECOVERYTIME // Time until player has recovered from casting a spell
Timer.ANTISPAM // Time until next speech message can be sent (for anti spam purposes)
-Timer.CRIMFLAG // Time until criminal flag runs out
+Timer.CRIMFLAG // Time until criminal flag runs out (should be set after criminal flag itself)
Timer.MURDERRATE // Time until next murder count decay
Timer.PEACETIMER // Time until character can re-enter combat after being affected by peacemaking
Timer.FLYINGTOGGLE // Time until next time flying ability can be toggled for gargoyles
@@ -8773,10 +8778,12 @@
January 9th, 2022
Example of usage
-
// Get remaining time in milliseconds before criminal flag expires
-var criminalTimer = myChar.GetTimer( Timer.CRIMFLAG );
+
// Get a timestamp for when criminal flag expires, and spit out milliseconds left
+var criminalTimestamp = myChar.GetTimer( Timer.CRIMFLAG );
+myChar.TextMessage(( myTarget.GetTimer( Timer.CRIMFLAG ) - GetCurrentClock() ).toString() );
-// Set time from now in milliseconds that criminal flag will last
+// Set time from now in milliseconds that criminal flag will last, after making character a criminal
+myChar.criminal = true;
myChar.SetTimer( timer.CRIMFLAG, 3000 );
@@ -10478,7 +10485,7 @@
January 9th, 2022
Purpose
-
Adds a gump on the current gump (ie any image in the gumps part of InsideUO). A fourth parameter - hue - is optional, and can be used to set the color of the gump.
+
Adds a gump on the current gump (ie any image in the Gumps-tab of a tool like UOFiddler). A fourth parameter - hue - is optional, and can be used to set the color of the gump.
Example of usage
@@ -10499,7 +10506,7 @@
January 9th, 2022
Purpose
-
Adds a gump on the current gump (ie any image in the gumps part of InsideUO). Same as AddGump, but with an additional parameter for hue/color.
+
Adds a gump on the current gump (ie any image in the Gumps-tab of a tool like UOFiddler). Same as AddGump, but with an additional parameter for hue/color.
Example of usage
@@ -12977,8 +12984,10 @@
January 9th, 2022
Example of usage
-
// Get remaining time in milliseconds until next time player can use an object
-var objectDelay = mySock.GetTimer( Timer.SOCK_OBJDELAY );
+
// Get timestamp for when player can next use an object, and spit out remaining time in milliseconds
+Get a timestamp for when criminal flag expires, and spit out milliseconds left
+var objectDelayTimestamp = myChar.GetTimer( Timer.SOCK_OBJDELAY );
+myChar.TextMessage(( myTarget.GetTimer( Timer.SOCK_OBJDELAY ) - GetCurrentClock() ).toString() );
// Set time from now in milliseconds until next time player can use another item
mySock.SetTimer( timer.SOCK_OBJDELAY, 3000 );
@@ -13529,7 +13538,7 @@
Flag/Boolean Types
.criminal(bool, true/false)
- Get/Set whether the character is flagged as a criminal
+ Get/Set whether the character is flagged as a criminal. If set to true, default criminal timer is applied, as defined in the uox.ini setting CRIMINALTIMER. Can override with .SetTimer( Timer.CRIMFLAG, timeInMilliseconds ) after flag has already been set to true.
.dead(bool, true/false)
@@ -13549,7 +13558,7 @@
Flag/Boolean Types
.innocent(bool, true/false)
- Get/Set whether character is flagged as innocent
+ Get/Set whether character is flagged as innocent. If set to false, default criminal timer is applied, as defined in the uox.ini setting CRIMINALTIMER.
.name(text, max 127 characters)
Get/Set name of character
+
+
.origin(text, max 127 characters)
+ Get/Set origin (expansion, era) of character
+
.sectionID(text, max 127 characters)
Section ID from DFNs that object originated from
@@ -14865,6 +14878,10 @@
Text Types
.name2(text, max 127 characters)
Get/Set secondary name of item - used in relation to magical items whose names get revealed upon successful use of Item Identification
+
+
.origin(text, max 127 characters)
+ Get/Set origin (expansion, era) of item
+
.sectionID(text, max 127 characters)
Section ID from DFNs that object originated from
This style provides a common, shared set of (lightweight) guidelines for anyone who wishes to contribute source code and/or scripts to the UOX3 project, in order to help ensure that those contributions follow a standardized approach not only for code style, but also for conventions and practices used in the project. This also improves the maintainability of the project in the future.
+
The UOX3 code base has historically been a hodgepodge of different styles and approaches, written by people with varying programming skills over a period of more than 20 years, and that history highlights the need for a standard that can be followed when working on the project.
+
These guidelines are not meant to be understood as hard requirements, yet the closer to the guidelines that new contributions adhere to, the easier it will be to review any changes in context of the current code base and - if accepted - merge those contributions in.
Above all else, please take to heart the general guidelines listed below and follow them as best you can:
+
+
Write understandable, self-documenting code - Give sensible, descriptive names to classes, functions and variables that clarify their purpose, rather than short and ambiguous names that say nothing about what they are for.
+
Add comments where needed - Use comments to leave hints for the reader of your code if the code is not self-explanatory for the average programmer. If the code you write is so advanced and complex that no one else can understand it by reading it, then comments are crucial for anyone else to be able to maintain it if/once you've lost interest in the project and moved on (as happens).
+
Be consistent with existing code - Make life easy for anyone who needs to read or maintain your code in the future, by adopting the coding style, conventions and practices most commonly used in the project. If the existing code offers two alternatives on how to proceed in this context, choose one of the two; don't introduce a third option.
+
Avoid making unnecessary, sweeping style changes - If possible, avoid making sweeping changes throughout the entire code base that forces everyone else to adopt your own preferred style. Not only is it quite an assumption to make that everyone else on the project will prefer your style, it may also cause problems for anyone who wishes to merge their code changes with yours; instead of comparing differences in a few functions in a few files, they now potentially have thousands of differences to go through!
+
If unsure, ask - If you're unsure if a change would conflict with the guidelines laid out in this Style Guide, don't hesitate to bring it up in Discord or on the UOX3 Community forums to get a second opinion - preferably before you make the change!
+
+
If you have identified a need for a change that conflicts with the above points, or with anything else in this Style Guide, create a new topic on the Communtiy Forums and state your case, or bring it up in the Discord chat. None of these "rules" are etched in stone, they can (and should) be challenged, updated and added to when appropriate.
Currently, any new code written for UOX3 should target C++11 to C++17, and aim to be cross-platform conforming across Windows, Linux and macOS platforms, when compiled using VS2017-2022, GCC/G++ v8-9 and/or CMake v?. Avoid using features specific to C++20 or newer, to not introduce additional compiler dependencies and requirements.
UOX3 aims to be cross-platform conformant across (at least) 64-bit Windows, Linux and macOS platforms, with feature parity between each platform. Implementations specific to any one particular platform should be avoided if possible, though there might be exceptions for special cases where platform-specific handling is unavoidable - such as when dealing with console and/or networking.
+
Any code being contributed that does not compile, run and function the same on all the above-mentioned platforms will probably not be approved for inclusion in UOX3 until/unless necessary changes have been made to comply with the above.
Always prefer self-descriptive names (skillUsageDelay instead of skUseDel, itemCount instead of ic)
+
Filenames
+
If creation of new source files is necessary, use camelCase when naming the files to make the name more readable in a list of other, perhaps similarly named files. Try to stick close to existing naming practice.
+
Classes/Methods/Functions
+
Use PascalCase for class/function/method names.
+
Variables and Parameters
+
Use camelCase for variables, non-method class/struct members and function/method parameters.
This Style Guide makes no differentiation between functions and methods for the purpose of comment blocks.
+
+
Comment blocks should be added for any new functions or methods added, should describe the purpose of the function/method and provide any extra context that is relevant for future maintainers of the code. For the sake of making the maintenance of comments more manageable, adopt a minimalistic approach where only relevant details are included:
+
//o-----------------------------------------------------------------------------------------------o
+//| Function - CSocket::AddTrigWord()
+//o-----------------------------------------------------------------------------------------------o
+//| Purpose - Adds trigger word to list of trigger words detected in player's speech
+//o-----------------------------------------------------------------------------------------------o
+
Getters/setters that have been grouped together should be commented together, where possible:
Pay attention to grammar, spelling and punctuation, even in comments
+
Variables in general should have names that are descriptive enough that they'd not need comments, but if comments are needed - add them!
+
For global variables, try to always add a comment to explain what it's used for, and potentially why it needs to be a global variable
+
Don't remove comments added by other maintainers unless the comments in question are no longer relevant/accurate
+
If the use of magic numbers is necessary, add context for the magic number via comments
+
When deciding what to comment or not, try to think from the perspective of people maintaining the code after you're gone. Is it likely that someone will need some extra context to understand your code? Add a comment.
Make liberal use of const. Any member function that does not modify its object should be const. Any function parameter that references an object, but doesn't actually change it, should be passed as a const reference.
+
For function parameters passed by value, const has no effect on the caller, and is not needed
+
When declaring something as const, follow this pattern: const int *foo (const comes first)
Write short functions, whenever possible. Sometimes it makes sense for a function to be a bit longer, but if the code in a function exceeds ~40 lines, start thinking about whether it could be broken up.
+
Short functions are easier to read, easier to test, easier to debug, and easier to modify.
Group getters and setters for class members together in pairs; put the getter for X next to the setter for X. Avoid spreading them out to different sections of a file. Grouping them up makes the code easier to read, maintain and debug:
Declare local variables when you need to use them, and not a moment sooner. The narrower the scope for a variable, and the closer it is declared to where it is actually used, the easier it becomes to read and understand the code for future code maintainers (or yourself a month from now).
+
If possible initialize variables as they are declared, instead of declaring and then assigning values to them separately, so whoever reads the code can see at a glance both the type and value the variable was initialized to.
+
Example:
+
// Not ideal
+std::string myString;
+myString = "Hello";
+
+// Better
+std::string myString = "Hello";
+
+// Preferred
+auto myString = "Hello"s; // note the 's' at the end
+
+
+
Exception: If the variable is an object, and it's used in a for-loop, declare it outside the for-loop so the constructor and destructor of the object doesn't get invoked multiple times as it loops.
Use the autokeyword when declaring variables to automatically deduct the variable type based on the initializer. Same can be done with return types for functions. Examples:
+
// Using auto with a variable
+auto myChar = "Hello"; // type is const char* pointer to const char[5] array
+auto myString = "Hello, World!"s; // type is std::string (note the 's' at the end)
+auto myVar = GetMyVarValue(); // type depends on what GetMyVarValue() returns
+
+// Using auto with functions
+auto CItem::SetRegion( UI16 newValue ) -> void
+{
+ regionNum = newValue;
+ UpdateRegion();
+}
+auto CItem::GetRegionNum( void ) const -> UI16
+{
+ return regionNum;
+}
Use the UOX3-defined type aliases like UI16, SI32, etc. for different integer types where possible, to increase readability and maintainability of the code. These are defined as follows:
+
using R32 = float;
+using R64 = double;
+using UI08 = std::uint8_t; // 0 to 255
+using SI08 = std::int8_t; // -128 to 127
+using UI16 = std::uint16_t; // 0 to 65535
+using SI16 = std::int16_t; // -32768 to 32767
+using UI32 = std::uint32_t; // 0 to 4294967295
+using SI32 = std::int32_t; // -2147483648 to 2147483647
+using UI64 = std::uint64_t; // 0 to 18446744073709551615
+using SI64 = std::int64_t; // -9223372036854775808 to 9223372036854775807
+
Use C++-style casts, and avoid C-style casts. Example:
+
Always use braces with if & else statements, even for one liners, to prevent easy mistakes by future maintainers
+
if( something )
+{
+ // one liner
+}
+
+
Exception to the previous point: Braces can be skipped for one-liners that are intended to return early, continue/break a loop, etc. In those cases, try to leave an empty line after the early return/continue/break and the rest of the code in the function/method in question