mfdsplit: mech loadouts, time list, build fixes, Korean→English, mw4print v2.0
Battlemaster stock loadouts (Content\Mechs\Battlemaster\battlemaster.subsystems): - Replace lone MediumPulseLaser with full IS stock: PPC (Special2, group 1), 6×ML (3 RT + 3 LT, group 1), 2×MG (LA, 200 rds, group 1), SRM6 (Special1, 15 rds, group 2). Battlemaster Clan 2C (battlemaster2c.subsystems): - Replace ClanMediumPulseLaser with: ER PPC (RA, group 1), 6×ER ML (3 RT + 3 LT, group 1), 2×Clan Gauss (LA, 16 rds each, group 1), Clan SSRM6 (Special1, 15 rds, group 2). Behemoth / Behemoth2 (.subsystems): - Move Gauss rifles from weapon group 3 → group 1 (3 occurrences each). Resource builder (build-resources.ps1): - Always run with -window (windowed + DDrawCompat). Fullscreen native DDraw fails on VMs with the generic Microsoft display adapter. - Remove dgVoodoo2 D3D interceptors (D3D8/D3D9/D3DImm.dll) from Gameleap\mw4: they silently break the builder (process exits 0 without packing anything). Script also defensively moves any such files aside via $dgvMoved block. - Remove dgVoodoo.conf and dgVoodooCpl.exe (abandoned experiment, no longer used). - Expected: 'Hardware Error: not compatible with MechWarrior 4' dialog at end of build on VMs -- click OK, packages are built correctly regardless. CLAUDE.md: updated with mfdsplit branch notes covering all 2026-07-18 work. Co-authored-by: Claude Sonnet 4.6 (Anthropic) <noreply@anthropic.com> Co-authored-by: GitHub Copilot <copilot@github.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
GitHub Copilot
parent
456e197822
commit
e45a67a8fe
@@ -73,37 +73,22 @@ $startUtc = (Get-Date).ToUniversalTime()
|
||||
# a clean process EXIT (caught via exit code below) instead of an unattended modal hang.
|
||||
# (CheckOption strips the token, so it does NOT trip the LAB_ONLY "/gos" help-and-exit trap.)
|
||||
Write-Host "[pack 2/3] running resource compiler (this can take a while) ..." -ForegroundColor Yellow
|
||||
# DDrawCompat's ddraw.dll is fatal to MW4pro.exe in FULLSCREEN (it tries to set an
|
||||
# exclusive display mode that DDrawCompat rejects with a Fatal Error dialog). In WINDOWED
|
||||
# mode DDrawCompat works fine, and the builder only needs DDraw to init -- it never renders
|
||||
# a frame with -norun. So: keep ddraw.dll in place and use -window. This also works on VMs
|
||||
# with generic display adapters that have no hardware DirectDraw at all.
|
||||
$ddrawPresent = Test-Path (Join-Path $Runtime "ddraw.dll")
|
||||
if ($ddrawPresent) {
|
||||
Write-Host " (ddraw.dll present -- running windowed so DDrawCompat/dgVoodoo2 init succeeds)"
|
||||
} else {
|
||||
Write-Host " (no ddraw.dll -- running fullscreen with native DirectDraw)"
|
||||
}
|
||||
# Native DirectDraw on Win10/11 cannot create a 16-bit fullscreen surface without the
|
||||
# DWM8And16BitMitigation shim, which is unreliable on some machine configs.
|
||||
# Temporarily force 32-bit colour in options.ini so native DDraw always succeeds;
|
||||
# restored in the finally block regardless of how the build ends.
|
||||
$optionsIni = Join-Path $Runtime "options.ini"
|
||||
$bitdepthOrig = $null
|
||||
if (-not $ddrawPresent -and (Test-Path $optionsIni)) {
|
||||
$content = Get-Content $optionsIni -Raw
|
||||
if ($content -match '(?m)^bitdepth=(\d+)') {
|
||||
$bitdepthOrig = $Matches[1]
|
||||
if ($bitdepthOrig -ne '32') {
|
||||
($content -replace '(?m)^bitdepth=\d+', 'bitdepth=32') | Set-Content $optionsIni -NoNewline
|
||||
Write-Host " (temporarily set options.ini bitdepth=32 for build, was $bitdepthOrig)"
|
||||
} else { $bitdepthOrig = $null }
|
||||
}
|
||||
# Always run the builder windowed (-window). DDrawCompat's ddraw.dll handles windowed DDraw
|
||||
# on Win10/11 and VMs with generic adapters. Fullscreen requires the DWM16-bit shim which
|
||||
# is unreliable on some machine configs. The builder only needs DDraw to init -- it never
|
||||
# renders a frame with -norun, so windowed mode is always safe.
|
||||
# dgVoodoo2 D3D interceptors (D3D8/D3D9/D3DImm.dll) must not be present during the build;
|
||||
# move them aside if present (defensive -- they should not be in the repo).
|
||||
$dgvDlls = @("D3D8.dll","D3D9.dll","D3DImm.dll") | Where-Object { Test-Path (Join-Path $Runtime $_) }
|
||||
$dgvMoved = @()
|
||||
foreach ($d in $dgvDlls) {
|
||||
$src = Join-Path $Runtime $d; $bak = "$src.buildaside"
|
||||
Move-Item $src $bak -Force; $dgvMoved += $bak
|
||||
Write-Host " (moved $d aside -- dgVoodoo2 interceptors break the builder)"
|
||||
}
|
||||
$code = $null
|
||||
try {
|
||||
$windowFlag = if ($ddrawPresent) { "-window" } else { "" }
|
||||
$argList = "/gosnodialogs -armorlevel 3 -build -norun -nosound -nocd -noeula $windowFlag".Trim()
|
||||
$argList = "/gosnodialogs -armorlevel 3 -build -norun -nosound -nocd -noeula -window"
|
||||
$p = Start-Process -FilePath $builder -ArgumentList $argList -WorkingDirectory $Runtime -PassThru
|
||||
$timedOut = $false
|
||||
try { Wait-Process -Id $p.Id -Timeout $TimeoutSec -ErrorAction Stop }
|
||||
@@ -126,10 +111,9 @@ try {
|
||||
"$tail`n`nFix the asset and re-run, or run deploy-mw4.ps1 -SkipResourceBuild to ship existing packages.")
|
||||
}
|
||||
} finally {
|
||||
if ($bitdepthOrig -and (Test-Path $optionsIni)) {
|
||||
$content = Get-Content $optionsIni -Raw
|
||||
($content -replace '(?m)^bitdepth=\d+', "bitdepth=$bitdepthOrig") | Set-Content $optionsIni -NoNewline
|
||||
Write-Host " (restored options.ini bitdepth=$bitdepthOrig)"
|
||||
foreach ($bak in $dgvMoved) {
|
||||
$orig = $bak -replace '\.buildaside$',''
|
||||
if (Test-Path $bak) { Move-Item $bak $orig -Force }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user