An OpenMW mod that lets you play the whole Elder Scrolls III: Morrowind as a top-down isometric game — with full online co-op or MMO modes.
C++
A package without the bundled mods; the see-through circle no longer dark; README for players
pw-tf27df72f8f9ba
diff --git a/README.md b/README.mdindex c434fe8..a8031cc 100644--- a/README.md+++ b/README.md@@ -1,6 +1,91 @@+<p align="center"><img src="isowind/windows/logo.png" alt="Isowind" width="380"></p>+Isowind=======+Morrowind, seen from above. Isowind is a modified [OpenMW](https://openmw.org) that plays The Elder Scrolls III:+Morrowind as a top-down, isometric game, with an optional pixel art look and online play with friends. It is the+whole of Morrowind (Tribunal and Bloodmoon too), your own copy of it. Isowind brings none of the game's files.++What it is+----------++* **A top-down camera.** You play from above: W is always up the screen, and you aim weapons and spells at the mouse+ cursor while your legs run the way you move. The mouse wheel zooms; F7 switches to Morrowind's third and first+ person views and back.+* **Seeing yourself through walls.** Walls, roofs and trees between you and the camera open up in a soft circle+ around you. Indoors, rooms are shown like a dollhouse: the near walls stop at waist height, and the ceiling and the+ floor above are left out.+* **Two looks.** *Pixel art* draws the world at low resolution, with chunky pixels, retro textures built from+ your own Morrowind files, banded light and hard shadows. *Normal* is Morrowind's usual graphics.+* **Made for a mouse or a controller.** The menus switch to suit whichever you are using. A controller gets its own+ menus, an on-screen keyboard, and quick keys on the bumpers.+* **Multiplayer.** A port of [TES3MP](https://tes3mp.com). Host a server from the launcher, as co-op (one shared+ world) or MMO (everyone has their own loot, quests and companions; enemies respawn; there are parties). A+ character can go between single-player and servers that allow it, and keeps everything gained in both.++How it works+------------++Isowind is a fork of OpenMW 0.51, with these parts:++* **The engine** (`apps/`, `components/`, `files/shaders/`) adds the top-down camera and the cutaway: shaders cut a+ circle out of whatever is in front of the player, and a second pass draws what was cut away, see-through, into+ that circle. It also adds the controller menus, the minimap that turns with the view, and TES3MP's multiplayer+ client.+* **The server** (`apps/openmw-mp`) is TES3MP's server, ported to this engine. Its Lua CoreScripts are in+ `isowind/server`, with Isowind's MMO rules, parties, private companions and portable characters added.+* **The Isowind mod** (`isowind/mod`, an `.omwscripts` content file) is OpenMW Lua: the controls, aiming, the+ view switch, the hover rings and the interface tweaks.+* **The looks** are two OpenMW profiles (`isowind/profiles/pixelart`, `normal`), each with its own `openmw.cfg`,+ `settings.cfg` and post-processing chain. The pixel art textures are made on your own computer, from your own+ Morrowind files, the first time you play that look (`isowind/tools/retro_textures.py`).+* **The launcher** (`Isowind.exe`, or `isowind.sh` on Linux) picks the look and the character, joins or hosts+ servers, and runs the engine with the right profile.++First time setup+----------------++**You need** Morrowind (the Game of the Year edition, from Steam or GOG) installed, and 64-bit Windows 10 or 11 or+64-bit Linux (the Steam Deck works too). Morrowind doesn't need to be run first, or have mods installed.++1. **Download** `Isowind.zip` from the [Releases](https://github.com/pw-tf/isowind/releases) page and unzip the whole folder somewhere you can+ write to, such as your Desktop or `D:\Games\Isowind` (not Program Files).+2. **Run `Isowind.exe`.** Windows may warn that the app is unrecognised (it isn't signed): click *More info*, then+ *Run anyway*.+3. **Press Play.** The first time, Isowind sees that OpenMW doesn't know where Morrowind is yet. It says so and+ opens the **OpenMW launcher**, which starts its **first-run wizard**:+ 1. Choose your language and *Next*.+ 2. Choose **Existing installation**. Morrowind is already installed, and the wizard only needs to find it.+ 3. Pick your Morrowind in the list. Steam and GOG installs are usually found. If yours isn't listed, press+ *Browse...* and select `Morrowind.esm` in Morrowind's `Data Files` folder. On Steam that is usually+ `C:\Program Files (x86)\Steam\steamapps\common\Morrowind\Data Files`.+ 4. On *Import Settings*, leave **Import Settings From Morrowind.ini** and **Import Add-on and Plugin+ Selection** ticked. The bitmap fonts option can stay off.+ 5. *Finish*. In the OpenMW launcher, check on the **Data Files** page that `Morrowind.esm`, `Tribunal.esm` and+ `Bloodmoon.esm` are ticked, and tick any that aren't. If Morrowind has never been run, its `Morrowind.ini`+ may not list them yet. Then close the launcher. You don't need to press its own Play.+4. **Back in `Isowind.exe`, pick a look and press Play again.** The first time you play the pixel art look, Isowind+ builds its low-res textures from your Morrowind files. That takes a minute, and later starts are immediate.+5. Choose **New character**, or a character you already have, and play.++You can open the OpenMW launcher again at any time with the *OpenMW Launcher* button in `Isowind.exe`, to change+the Morrowind folder, mods or other options. Your saves are shared with any normal OpenMW you have.++**On Linux**, unpack the folder and run `./isowind.sh` from a terminal (or `./isowind.sh gui` for a launcher+window). It finds Morrowind in Steam's usual places and sets OpenMW up by itself. If it can't, run it as+`MORROWIND=/path/to/Morrowind ./isowind.sh`, giving the folder with `Data Files` in it. The pixel art look needs+Python 3.++**Playing online:** keep to Morrowind, Tribunal and Bloodmoon, with no other mods on in the OpenMW launcher, because+a server only lets in players whose game files match its own. Type the server's address under *Multiplayer* in+`Isowind.exe` and press *Join*, or press *Host a server* to run one. `README.txt` in the package covers hosting,+parties, portable characters and the controls in full.++**If something goes wrong:** the game's log is `profiles\pixelart\openmw.log` (or `profiles\normal\openmw.log`).+If saving fails, Windows Defender's *Controlled folder access* may be stopping `engine\openmw.exe` from writing to+Documents: allow it under Windows Security > Ransomware protection.+Building on Windows-------------------@@ -53,6 +138,7 @@ the players stay, and only the ban list goes back to empty.|-------------------------|------------------------------------------------------------------------------------------------|| `-SkipDependencies` | Doesn't check or re-extract the dependency downloads. Use it on every build after the first. || `-NoLto` | No link-time optimisation: the final link takes a minute or two instead of ten to twenty. The game runs a little slower, so it is for working on the code, not for a release. |+| `-NoMods` | Packages without the bundled third-party mods, in `<root>\dist\nomods\Isowind` and `<root>\dist\nomods\Isowind.zip`: plain OpenMW with Isowind on top, as released on GitHub. Needs no GitHub CLI login. || `-SkipLauncher` | Doesn't build `Isowind.exe`. || `-SkipPackage` | Doesn't run `make_package.ps1`. || `-Clean` | A fresh build folder instead of keeping the existing one. |diff --git a/apps/openmw/mwrender/ghostlayer.cpp b/apps/openmw/mwrender/ghostlayer.cppindex 65d8dd8..459ae05 100644--- a/apps/openmw/mwrender/ghostlayer.cpp+++ b/apps/openmw/mwrender/ghostlayer.cpp@@ -8,6 +8,7 @@#include <components/sceneutil/depth.hpp>#include <components/sceneutil/nodecallback.hpp>+#include <components/sceneutil/shadow.hpp>#include "vismask.hpp"@@ -111,6 +112,10 @@ void main()// What can turn see-through (statics and objects; the terrain for the objects merged into it far off, though// the ground itself never does), and the lightscamera->setCullMask(Mask_Scene | Mask_Static | Mask_Object | Mask_Terrain | Mask_Lighting | Mask_Sun);+ // The shadows are worked out for the main view, above the scene this pass draws: without maps of its own+ // its shaders would find everything in shadow, lit by the ambient light alone (a dark ring around the+ // opening). Unshadowed instead, as the water's passes are+ SceneUtil::ShadowManager::instance().disableShadowsForStateSet(*camera->getOrCreateStateSet());camera->getOrCreateStateSet()->merge(*mPassState);camera->addChild(mScene);}diff --git a/components/shader/shadervisitor.cpp b/components/shader/shadervisitor.cppindex 365d9be..453f53a 100644--- a/components/shader/shadervisitor.cpp+++ b/components/shader/shadervisitor.cpp@@ -624,6 +624,8 @@ namespace ShaderdefineMap["alphaFunc"] = std::to_string(reqs.mAlphaFunc);defineMap["additiveBlending"] = reqs.mAdditiveBlending ? "1" : "0";+ // (Isowind: the top-down camera's see-through ghost keeps a blended surface's own alpha, cutaway.glsl)+ defineMap["alphaBlend"] = reqs.mAlphaBlend ? "1" : "0";osg::ref_ptr<osg::StateSet> removedState;if ((removedState = getRemovedState(*writableStateSet)) && !mAllowedToModifyStateSets)diff --git a/files/shaders/compatibility/objects.frag b/files/shaders/compatibility/objects.fragindex 3da8823..f4166af 100644--- a/files/shaders/compatibility/objects.frag+++ b/files/shaders/compatibility/objects.frag@@ -164,6 +164,13 @@ vec2 screenCoords = gl_FragCoord.xy / screenRes;#endifgl_FragData[0].a = alphaTest(gl_FragData[0].a, alphaRef);+#if @alphaToCoverage+ // The top-down camera's see-through ghost draws with an opacity of its own (applyCutawayAlpha below), which would+ // make solid what alpha-to-coverage only fades out, the gaps between leaves (black in Morrowind's own textures):+ // its pass leaves those out instead+ if (cutawayGhostPass > 0.5 && gl_FragData[0].a < 0.5)+ discard;+#endif#if @normalMapvec4 normalTex = texture2D(normalMap, normalMapUV + offset);@@ -275,7 +282,7 @@ vec2 screenCoords = gl_FragCoord.xy / screenRes;#endif// The top-down camera's see-through ghost (lib/util/cutaway.glsl) keeps its own opacity- gl_FragData[0].a = applyCutawayAlpha(gl_FragData[0].a);+ gl_FragData[0].a = applyCutawayAlpha(gl_FragData[0].a, @alphaBlend == 1);applyShadowDebugOverlay();}diff --git a/files/shaders/lib/util/cutaway.glsl b/files/shaders/lib/util/cutaway.glslindex c782653..fc4084b 100644--- a/files/shaders/lib/util/cutaway.glsl+++ b/files/shaders/lib/util/cutaway.glsl@@ -198,10 +198,13 @@ vec4 applyCutaway(vec3 viewPos, bool terrain)return vec4(covers, covers * (1.0 - around), 0.0, debugTint);}-// The ghost's pass draws what it keeps this opaque; anywhere else alpha is what it was-float applyCutawayAlpha(float alpha)+// The ghost's pass draws what it keeps this opaque; anywhere else alpha is what it was. A blended surface keeps its+// own alpha in the ghost too (blended: the clear parts of leaves, black in Morrowind's own textures, would turn solid)+float applyCutawayAlpha(float alpha, bool blended){- return cutawayGhostPass > 0.5 ? cutawayLayerAlpha : alpha;+ if (cutawayGhostPass < 0.5)+ return alpha;+ return blended ? cutawayLayerAlpha * clamp(alpha, 0.0, 1.0) : cutawayLayerAlpha;}vec3 applyCutawayColour(vec3 colour, vec4 cut)diff --git a/isowind/linux/isowind-launcher.py b/isowind/linux/isowind-launcher.pyindex 949edfe..9e24389 100755--- a/isowind/linux/isowind-launcher.py+++ b/isowind/linux/isowind-launcher.py@@ -289,7 +289,10 @@ CREDITS = ("GNU General Public License v3 (licenses/GPL-3.0.txt). Isowind's changes are under the same license; ""the source is in the source folder.\n\n""TES3MP - tes3mp.com - by David Cernat, Stanislav Zhukov and contributors. The multiplayer code in Isowind is "- "ported from it, and the server runs its CoreScripts. GNU General Public License v3.\n\n"+ "ported from it, and the server runs its CoreScripts. GNU General Public License v3.\n\n")++# Listed only when the package has them (make_package.ps1 -NoMods, and package.sh given no mods, make one without)+MOD_CREDITS = ("BUNDLED MODS\n""Rafael's Shader Pack - by Rafael, with Phal, Hrnchamd, Dexter and Wazabear. GNU General Public License v3 ""(mods/RafaelsShaderPack/LICENSE). Includes SMAA by Jorge Jimenez, Jose I. Echevarria, Belen Masia, "@@ -313,7 +316,9 @@ CREDITS = ("Pop000100, R-Zero, Remiros, revenorror, RubberMan, Sataniel, Stuporstar, vtastek and Wollibeebee. ""Texture atlases for faster drawing (mods/ProjectAtlas).\n\n""Expansion Delay 1.3 - by Half11. Tribunal's assassins and Bloodmoon's rumours wait until later "- "(mods/ExpansionDelay).\n\n"+ "(mods/ExpansionDelay).\n\n")++LIBRARY_CREDITS = ("LIBRARIES (used by OpenMW)\n""OpenSceneGraph (OpenSceneGraph Public License), Bullet Physics (zlib), MyGUI (MIT), SDL 2 and SDL_image ""(zlib), OpenAL Soft (LGPL 2.1), FFmpeg (LGPL 2.1), LuaJIT (MIT), RakNet (BSD), Recast & Detour (zlib), "@@ -597,7 +602,8 @@ class Launcher(tk.Tk, Styled):centre(dialog, 560, 520)text = tk.Text(dialog, wrap='word', bg=PANEL, fg=SAND, relief='flat', bd=0, font=self.small_font,padx=8, pady=8, highlightthickness=0)- text.insert('1.0', CREDITS)+ text.insert('1.0', CREDITS + (MOD_CREDITS if os.path.isdir(os.path.join(ROOT, 'mods')) else '')+ + LIBRARY_CREDITS)text.configure(state='disabled')text.place(x=16, y=16, width=510, height=438)scroll = tk.Scrollbar(dialog, command=text.yview, bg=PANEL, troughcolor=BACK, activebackground=HOVER,diff --git a/isowind/linux/package.sh b/isowind/linux/package.shindex 569ed09..f926610 100755--- a/isowind/linux/package.sh+++ b/isowind/linux/package.sh@@ -5,6 +5,9 @@## package.sh BUILD_DIR OUT_DIR [BUNDLED_MODS_DIR]#+# Without BUNDLED_MODS_DIR the package goes without the mods, made for OpenMW alone (isowind/tools/strip_mods.py, as+# make_package.ps1 -NoMods does), as for a public release.+## Needs linuxdeploy on PATH (it copies in every library that isn't part of the base system, so the folder runs on# other distributions too).#@@ -95,5 +98,7 @@ chmod +x "$OUT/isowind.sh"if [ -n "$MODS" ] && [ -d "$MODS" ]; thencp -r "$MODS" "$OUT/mods"else- echo "warning: no bundled mods given; the profiles expect them in mods/, and servers require their plugins" >&2+ # Without the bundled mods (as for a public release): the profiles, the server's plugin list and the readme made+ # for OpenMW alone+ python3 "$I/tools/strip_mods.py" "$OUT"fidiff --git a/isowind/tools/strip_mods.py b/isowind/tools/strip_mods.pynew file mode 100644index 0000000..3a88810--- /dev/null+++ b/isowind/tools/strip_mods.py@@ -0,0 +1,123 @@+#!/usr/bin/env python3+"""Makes an Isowind package folder one without the bundled third-party mods: OpenMW's own look with Isowind's on top,+for a public release (the mods' licences don't all allow passing them on). Run on the package, after it's assembled:++ strip_mods.py PACKAGE_DIR++make_package.ps1 -NoMods and package.sh (when it's given no mods) do. It takes out the mods folder; from both looks'+profiles the mods' data folders and plugins, the shader pack's post-processing and settings and the settings that+lean on them; from the server the mods' plugins it requires of players; and from the readme the list of mods. Each+change has to find what it changes, so the script stops (and says what) rather than leave a mod half in when the+profiles change."""++import os+import re+import shutil+import sys++# What a look's profile has for the mods, and what it has instead+PROFILE_SETTINGS = [+ # Rafael's Shader Pack: no post-processing but Isowind's own selection ring, which Lua adds+ (r"^# Rafael's Shader Pack:.*\n(?:#.*\n)*",+ "# No post-processing shaders but Isowind's top-down selection ring, which Lua adds\n"),+ (r"^chain = (?:HBAO|VAIO).*\n", "chain =\n"),+ # (the pack tonemapped; OpenMW's gamma is 1.0 anyway)+ (r"^# The shader pack tonemaps.*\n", ""),+ # Weapon Sheathing's meshes aren't there: OpenMW's default+ (r"^# Weapon Sheathing:.*\nweapon sheathing = true\n", ""),+ # Water reflections were left to the pack's wet world: OpenMW's default+ (r"^# Reflect only the sky:.*\nreflection detail = 0\n", ""),+]++README_MODS = (r"^Included mods \(in the mods folder.*?the profiles load them\.\n",+ "Isowind comes without other mods: add the ones you like in the OpenMW Launcher. A multiplayer server\n"+ "lets in only players whose plugins match its own (server\\CoreScripts\\data\\requiredDataFiles.json).\n")+++def fail(message):+ print(f'strip_mods.py: {message}', file=sys.stderr)+ sys.exit(1)+++def read(path):+ with open(path, encoding='utf-8', newline='') as f:+ text = f.read()+ return text.replace('\r\n', '\n'), '\r\n' in text+++def write(path, text, crlf):+ with open(path, 'w', encoding='utf-8', newline='') as f:+ f.write(text.replace('\n', '\r\n') if crlf else text)+++def replace(path, pattern, replacement, flags=re.MULTILINE):+ text, crlf = read(path)+ text, count = re.subn(pattern, lambda match: replacement, text, flags=flags)+ if count == 0:+ fail(f"{path} has no {pattern!r} to change (did it change?)")+ write(path, text, crlf)+++def strip_profile(profile):+ # openmw.cfg: Isowind's own data folders and scripts only+ cfg = os.path.join(profile, 'openmw.cfg')+ text, crlf = read(cfg)+ kept, skipping_comment, dropped = [], False, 0+ for line in text.split('\n'):+ if line.startswith('# Bundled mods'):+ skipping_comment = True+ continue+ if skipping_comment and line.startswith('#'):+ continue+ skipping_comment = False+ if line.startswith('data="../../mods/') or (line.startswith('content=') and+ line != 'content=isowind.omwscripts'):+ dropped += 1+ continue+ kept.append(line)+ if dropped == 0:+ fail(f'{cfg} has no mods in it to take out (did it change?)')+ write(cfg, '\n'.join(kept), crlf)++ settings = os.path.join(profile, 'settings.cfg')+ for pattern, replacement in PROFILE_SETTINGS:+ replace(settings, pattern, replacement)+ text, _ = read(settings)+ if re.search(r'shader pack|sheathing', text, re.IGNORECASE):+ fail(f'{settings} still mentions a mod after the changes')++ # The shader pack's own settings+ yaml = os.path.join(profile, 'shaders.yaml')+ if os.path.exists(yaml):+ os.remove(yaml)+++def strip_server(package):+ required = os.path.join(package, 'server', 'CoreScripts', 'data', 'requiredDataFiles.json')+ # The note on the plugins Isowind ships, then each plugin after Bloodmoon's (with the comma before it)+ replace(required, r"^// Isowind also ships plugins.*\n(?://.*\n)*", '')+ replace(required, r',\n\s*\{"(?!Morrowind\.esm|Tribunal\.esm|Bloodmoon\.esm)[^"]+": \[[^\]]*\]\}', '')+ text, _ = read(required)+ if re.search(r'\.esp"', text, re.IGNORECASE):+ fail(f'{required} still requires a plugin after the changes')+++def main():+ if len(sys.argv) != 2:+ fail('give the package folder (the one with profiles, server and README.txt in it)')+ package = sys.argv[1]+ if not os.path.isfile(os.path.join(package, 'README.txt')):+ fail(f'{package} is not an Isowind package (no README.txt)')++ mods = os.path.join(package, 'mods')+ if os.path.isdir(mods):+ shutil.rmtree(mods)+ for look in ('pixelart', 'normal'):+ strip_profile(os.path.join(package, 'profiles', look))+ strip_server(package)+ replace(os.path.join(package, 'README.txt'), README_MODS[0], README_MODS[1], re.MULTILINE | re.DOTALL)+ print(f'{package}: without the bundled mods')+++if __name__ == '__main__':+ main()diff --git a/isowind/windows/Isowind.cs b/isowind/windows/Isowind.csindex d6e07a9..0f89a61 100644--- a/isowind/windows/Isowind.cs+++ b/isowind/windows/Isowind.cs@@ -238,7 +238,8 @@ class LauncherForm : Formstatus.Text = "First time? Press Play to set up your Morrowind installation.";}- // Who made what Isowind is built from and ships with, and under which terms. The full texts are in licenses\.+ // Who made what Isowind is built from and ships with, and under which terms. The full texts are in licenses\. The+ // bundled mods are listed only when the package has them (make_package.ps1 -NoMods makes one without).const string Credits ="Isowind is a modified OpenMW with a multiplayer port of TES3MP. It needs your own copy of The Elder Scrolls III: " +"Morrowind (Bethesda Softworks); none of the game's files are included.\r\n\r\n" +@@ -247,7 +248,9 @@ class LauncherForm : Form"GNU General Public License v3 (licenses\\GPL-3.0.txt). Isowind's changes are under the same license; " +"the source is in the source folder.\r\n\r\n" +"TES3MP - tes3mp.com - by David Cernat, Stanislav Zhukov and contributors. The multiplayer code in Isowind is " +- "ported from it, and the server runs its CoreScripts. GNU General Public License v3.\r\n\r\n" ++ "ported from it, and the server runs its CoreScripts. GNU General Public License v3.\r\n\r\n";++ const string ModCredits ="BUNDLED MODS\r\n" +"Rafael's Shader Pack - by Rafael, with Phal, Hrnchamd, Dexter and Wazabear. GNU General Public License v3 " +"(mods\\RafaelsShaderPack\\LICENSE). Includes SMAA by Jorge Jimenez, Jose I. Echevarria, Belen Masia, " +@@ -271,7 +274,9 @@ class LauncherForm : Form"Pop000100, R-Zero, Remiros, revenorror, RubberMan, Sataniel, Stuporstar, vtastek and Wollibeebee. " +"Texture atlases for faster drawing (mods\\ProjectAtlas).\r\n\r\n" +"Expansion Delay 1.3 - by Half11. Tribunal's assassins and Bloodmoon's rumours wait until later " +- "(mods\\ExpansionDelay).\r\n\r\n" ++ "(mods\\ExpansionDelay).\r\n\r\n";++ const string LibraryCredits ="LIBRARIES (used by OpenMW and its launcher)\r\n" +"OpenSceneGraph (OpenSceneGraph Public License), Bullet Physics (zlib), MyGUI (MIT), SDL 2 and SDL_image " +"(zlib), OpenAL Soft (LGPL 2.1), FFmpeg (LGPL 2.1), LuaJIT (MIT), Qt 6 (LGPL 3, for the OpenMW launcher and " +@@ -300,7 +305,7 @@ class LauncherForm : FormMultiline = true,ReadOnly = true,ScrollBars = ScrollBars.Vertical,- Text = Credits,+ Text = Credits + (Directory.Exists(Path.Combine(root, "mods")) ? ModCredits : "") + LibraryCredits,Bounds = new Rectangle(16, 16, 528, 438),BackColor = Panel,ForeColor = Sand,diff --git a/isowind/windows/build.ps1 b/isowind/windows/build.ps1index 3bf792e..d32b2b9 100644--- a/isowind/windows/build.ps1+++ b/isowind/windows/build.ps1@@ -22,6 +22,8 @@# .\build.ps1 -SkipDependencies don't check or re-extract OpenMW's dependency downloads (faster once they're there)# .\build.ps1 -SkipLauncher no Isowind.exe# .\build.ps1 -SkipPackage no dist\Isowind.zip+# .\build.ps1 -NoMods the package without the bundled mods, for a public release: dist\nomods\Isowind.zip+# (bundled-mods isn't fetched; see make_package.ps1)# .\build.ps1 -NoLto no link-time optimisation: the final link takes a minute or two instead of ten to# twenty (the game runs a little slower; for working on it, not for a release)# .\build.ps1 -Configuration Debug -VsVersion 2026@@ -34,6 +36,7 @@ param([switch]$SkipDependencies,[switch]$SkipLauncher,[switch]$SkipPackage,+ [switch]$NoMods,[switch]$NoLto)@@ -180,7 +183,10 @@ if (-not $SkipPackage) {else {# The bundled mods are third-party and kept out of git: the "bundled-mods" release holds them, as for the Linux CI$mods = Join-Path $root 'bundled-mods'- if (-not (Test-Path $mods)) {+ if ($NoMods) {+ & $package -NoMods+ }+ elseif (-not (Test-Path $mods)) {$zip = Join-Path $root 'bundled-mods.zip'Write-Host "Fetching the bundled mods (bundled-mods.zip from the repository's bundled-mods release)..."# (the repository is private, so this needs GitHub's CLI, logged in: gh auth login)@@ -192,7 +198,7 @@ if (-not $SkipPackage) {Expand-Archive -Path $zip -DestinationPath $mods -ForceRemove-Item $zip -Force}- & $package+ if (-not $NoMods) { & $package }}}diff --git a/isowind/windows/make_package.ps1 b/isowind/windows/make_package.ps1index dd01169..c27b39b 100644--- a/isowind/windows/make_package.ps1+++ b/isowind/windows/make_package.ps1@@ -3,12 +3,22 @@# openmw-launcher, openmw-wizard) and Isowind.exe; build.ps1 beside this script does all of that and then this.# Packaging again keeps the test characters in dist\Isowind (the server's data) and backs them up in <root>\backups# first; the zip is always clean.+#+# .\make_package.ps1 the package with the bundled mods: dist\Isowind and dist\Isowind.zip+# .\make_package.ps1 -NoMods without them, for a public release (their licences don't all allow passing them on):+# OpenMW's own look with Isowind's on top, the server requiring only Morrowind and its+# expansions (isowind\tools\strip_mods.py, which needs Python 3). Into+# dist\nomods\Isowind and dist\nomods\Isowind.zip, so the usual package and the test+# characters in it stay as they are; bundled-mods isn't needed.++param([switch]$NoMods)$ErrorActionPreference = 'Stop'$src = (Resolve-Path (Join-Path $PSScriptRoot '..\..')).Path # the repository$root = Split-Path -Parent $src$release = Join-Path $src 'MSVC2022_64\Release'-$dist = Join-Path $root 'dist\Isowind'+$distRoot = if ($NoMods) { Join-Path $root 'dist\nomods' } else { Join-Path $root 'dist' }+$dist = Join-Path $distRoot 'Isowind'# Isowind's own files (the mod, pixel art shader and palettes, profiles, server scripts, readme), shared with the# Linux and Android builds$isowind = Join-Path $src 'isowind'@@ -33,9 +43,13 @@ Add-Type -AssemblyName System.IO.Compression, System.IO.Compression.FileSystem# there is nothing yet but the server's defaults.$backups = Join-Path $root 'backups'$serverData = Join-Path $dist 'server\CoreScripts\data'-$backupFrom = [ordered]@{ 'server/CoreScripts/data' = $serverData } # folder in the zip = folder here-$documents = [Environment]::GetFolderPath('MyDocuments')-if ($documents) { $backupFrom['saves'] = Join-Path $documents 'My Games\OpenMW\saves' }+$backupFrom = [ordered]@{} # folder in the zip = folder here+# (none for the package without the mods: it's for a release, not played from)+if (-not $NoMods) {+ $backupFrom['server/CoreScripts/data'] = $serverData+ $documents = [Environment]::GetFolderPath('MyDocuments')+ if ($documents) { $backupFrom['saves'] = Join-Path $documents 'My Games\OpenMW\saves' }+}$backup = @()foreach ($name in $backupFrom.Keys) {if (-not (Test-Path $backupFrom[$name])) { continue }@@ -45,7 +59,7 @@ foreach ($name in $backupFrom.Keys) {})}$hostSettings = Join-Path $dist 'server\tes3mp-server.cfg'-if (Test-Path $hostSettings) { $backup += [pscustomobject]@{ File = $hostSettings; Entry = 'server/tes3mp-server.cfg' } }+if (-not $NoMods -and (Test-Path $hostSettings)) { $backup +=[pscustomobject]@{ File = $hostSettings; Entry = 'server/tes3mp-server.cfg' } }$defaults = 'banlist.json', 'requiredDataFiles.json' | ForEach-Object { "server/CoreScripts/data/$_" }if ($backup | Where-Object { $_.Entry -notin $defaults -and $_.Entry -notlike '*/.gitkeep' }) {New-Item -ItemType Directory -Force $backups | Out-Null@@ -74,7 +88,7 @@ foreach ($layout in 'openmw_layers.xml', 'openmw_settings_window.layout', 'openmMirror (Join-Path $isowind 'mod') (Join-Path $dist 'mod')# Bundled mods (credited in Isowind.exe's Licenses and README.txt) with only the options Isowind uses, kept in# bundled-mods (mod\add-mods is where new ones are dropped to look at); the profiles list their data folders.-Mirror (Join-Path $root 'bundled-mods') (Join-Path $dist 'mods')+if (-not $NoMods) { Mirror (Join-Path $root 'bundled-mods') (Join-Path $dist 'mods') }# Mirrored, so textures built while testing the package (Bethesda-derived) never end up in it.Mirror (Join-Path $isowind 'pixelart') (Join-Path $dist 'pixelart')@@ -112,6 +126,15 @@ if (-not $launcherExe) { throw 'No Isowind.exe: build it first (build.ps1)' }Copy-Item $launcherExe $dist -ForceCopy-Item (Join-Path $isowind 'README.txt') $dist -Force+# Without the bundled mods: the profiles, the server's plugin list and the readme made for OpenMW alone+if ($NoMods) {+ $python = (Get-Command py -ErrorAction SilentlyContinue), (Get-Command python -ErrorAction SilentlyContinue) |+ Where-Object { $_ } | Select-Object -First 1+ if (-not $python) { throw 'Python 3 is needed for the package without the mods (strip_mods.py): install it from python.org' }+ & $python.Source (Join-Path $isowind 'tools\strip_mods.py') $dist+ if ($LASTEXITCODE -ne 0) { throw 'strip_mods.py failed (above)' }+}+# Source: OpenMW is GPL v3, so ship the changes (against the openmw-0.51.0 tag) and this project's own code.$source = Join-Path $dist 'source'New-Item -ItemType Directory -Force $source | Out-Null@@ -152,7 +175,7 @@ The top-down mod (Lua) and shaders are in the mod and pixelart folders as they a# Zip: only what the package is made of, under an Isowind folder (not whatever else ended up in dist\Isowind, such# as a copy unzipped there to play, or what playing and hosting from it left: the launcher's last choices in# profiles\, the host's tes3mp-server.cfg, crash dumps in server\).-$zip = Join-Path $root 'dist\Isowind.zip'+$zip = Join-Path $distRoot 'Isowind.zip'if (Test-Path $zip) { Remove-Item $zip -Force }# The server's data from the repository as git has it (the empty folders, the ban list, the plugin list), not the# package folder's, which has the players, cells and world of whoever tested it@@ -166,8 +189,10 @@ if ($LASTEXITCODE -ne 0 -or $cleanData.Count -eq 0) {}$archive = [IO.Compression.ZipFile]::Open($zip, 'Create')try {- foreach ($item in 'engine', 'licenses', 'mod', 'mods', 'pixelart', 'profiles\pixelart', 'profiles\normal',- 'server\CoreScripts', 'server\tes3mp-server-default.cfg', 'source', 'Isowind.exe', 'README.txt') {+ $items = 'engine', 'licenses', 'mod', 'mods', 'pixelart', 'profiles\pixelart', 'profiles\normal',+ 'server\CoreScripts', 'server\tes3mp-server-default.cfg', 'source', 'Isowind.exe', 'README.txt'+ if ($NoMods) { $items = $items | Where-Object { $_ -ne 'mods' } }+ foreach ($item in $items) {$path = Join-Path $dist $item$files = if (Test-Path $path -PathType Container) { Get-ChildItem $path -Recurse -File } else { Get-Item $path }foreach ($file in $files) {@@ -178,7 +203,10 @@ try {}foreach ($file in $cleanData) {$entry = 'Isowind/server/' + $file.Substring('isowind/server/'.Length)- [IO.Compression.ZipFileExtensions]::CreateEntryFromFile($archive, (Join-Path $src $file), $entry, 'Optimal') | Out-Null+ $from = Join-Path $src $file+ # (the plugin list as strip_mods.py made it, without the mods)+ if ($NoMods -and $file -like '*/requiredDataFiles.json') { $from = Join-Path $serverData 'requiredDataFiles.json' }+ [IO.Compression.ZipFileExtensions]::CreateEntryFromFile($archive, $from, $entry, 'Optimal') | Out-Null}} finally { $archive.Dispose() }"Package: $dist"