Phase 3: Add FMOD modification guide and extraction script
- Added docs/FMOD_MODIFICATION_GUIDE_PHASE3.md with step-by-step FMOD Studio instructions - Added tools/ExtractBanks.ps1 for automated bank extraction workflow - Covers voice limits, ducking, enemy indicator improvements in FMOD
This commit is contained in:
103
tools/ExtractBanks.ps1
Normal file
103
tools/ExtractBanks.ps1
Normal file
@@ -0,0 +1,103 @@
|
||||
# HomuraHime Audio Mod - Bank Extraction Script
|
||||
# Run this after installing AssetRipper to extract FMOD banks
|
||||
|
||||
param(
|
||||
[string]$GamePath = "C:\apps\steam\steamapps\common\Homura Hime",
|
||||
[string]$OutputPath = "C:\projects\HomuraHime-Mods\extracted_assets",
|
||||
[string]$BackupPath = "C:\projects\HomuraHime-Mods\backup_banks_original"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
Write-Host "HomuraHime Audio Mod - Bank Extraction Script" -ForegroundColor Cyan
|
||||
Write-Host "=" * 50
|
||||
|
||||
# Check if AssetRipper exists
|
||||
$AssetRipperPath = "C:\projects\HomuraHime-Mods\tools\AssetRipper\AssetRipper.exe"
|
||||
if (-not (Test-Path $AssetRipperPath)) {
|
||||
Write-Host "[ERROR] AssetRipper not found at: $AssetRipperPath" -ForegroundColor Red
|
||||
Write-Host "Please install AssetRipper first (see docs/SETUP_PHASE1.md)" -ForegroundColor Yellow
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check if game path exists
|
||||
$GameDataPath = Join-Path $GamePath "HomuraHime_Data\StreamingAssets\FMOD\Desktop"
|
||||
if (-not (Test-Path $GameDataPath)) {
|
||||
Write-Host "[ERROR] Game FMOD banks not found at: $GameDataPath" -ForegroundColor Red
|
||||
Write-Host "Please verify game installation" -ForegroundColor Yellow
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "[INFO] Game path: $GameDataPath" -ForegroundColor Green
|
||||
|
||||
# Create directories
|
||||
$OutputBanksPath = Join-Path $OutputPath "StreamingAssets\FMOD\Desktop"
|
||||
$BackupBanksPath = $BackupPath
|
||||
|
||||
New-Item -ItemType Directory -Force -Path $OutputBanksPath | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path $BackupBanksPath | Out-Null
|
||||
|
||||
Write-Host "[INFO] Output path: $OutputBanksPath" -ForegroundColor Green
|
||||
Write-Host "[INFO] Backup path: $BackupBanksPath" -ForegroundColor Green
|
||||
|
||||
# List current banks
|
||||
$banks = Get-ChildItem -Path $GameDataPath -Filter "*.bank"
|
||||
Write-Host "[INFO] Found $($banks.Count) FMOD bank files" -ForegroundColor Cyan
|
||||
|
||||
# Step 1: Backup original banks
|
||||
Write-Host "`n[STEP 1] Backing up original banks..." -ForegroundColor Yellow
|
||||
foreach ($bank in $banks) {
|
||||
$dest = Join-Path $BackupBanksPath $bank.Name
|
||||
Copy-Item -Path $bank.FullName -Destination $dest -Force
|
||||
Write-Host " Backed up: $($bank.Name)" -ForegroundColor Gray
|
||||
}
|
||||
Write-Host "[OK] Original banks backed up" -ForegroundColor Green
|
||||
|
||||
# Step 2: Launch AssetRipper for extraction
|
||||
Write-Host "`n[STEP 2] Launching AssetRipper..." -ForegroundColor Yellow
|
||||
Write-Host " In AssetRipper:" -ForegroundColor Cyan
|
||||
Write-Host " 1. File -> Load -> Select HomuraHime_Data folder" -ForegroundColor Cyan
|
||||
Write-Host " 2. File -> Export -> Resources" -ForegroundColor Cyan
|
||||
Write-Host " 3. Export to: $OutputPath" -ForegroundColor Cyan
|
||||
Write-Host " 4. Wait for export to complete" -ForegroundColor Cyan
|
||||
Write-Host " 5. Close AssetRipper" -ForegroundColor Cyan
|
||||
|
||||
Start-Process $AssetRipperPath
|
||||
Write-Host "`n[PAUSE] Press Enter when AssetRipper export is complete..." -ForegroundColor Yellow
|
||||
Read-Host
|
||||
|
||||
# Step 3: Verify extraction
|
||||
$extractedBanksPath = Join-Path $OutputPath "StreamingAssets\FMOD\Desktop"
|
||||
if (Test-Path $extractedBanksPath) {
|
||||
$extractedBanks = Get-ChildItem -Path $extractedBanksPath -Filter "*.bank"
|
||||
Write-Host "[OK] Found $($extractedBanks.Count) extracted bank files" -ForegroundColor Green
|
||||
|
||||
# List key banks
|
||||
$keyBanks = @("SFX.bank", "Ambience.bank", "Master.bank", "Voice.bank")
|
||||
foreach ($keyBank in $keyBanks) {
|
||||
$found = $extractedBanks | Where-Object { $_.Name -eq $keyBank }
|
||||
if ($found) {
|
||||
Write-Host " [OK] $keyBank found ($([math]::Round($found.Length / 1MB, 2)) MB)" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host " [WARN] $keyBank not found" -ForegroundColor Yellow
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Write-Host "[ERROR] Extraction failed - path not found: $extractedBanksPath" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Summary
|
||||
Write-Host "`n" + "=" * 50
|
||||
Write-Host "Extraction Complete!" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
Write-Host "Next steps:" -ForegroundColor Yellow
|
||||
Write-Host " 1. Open FMOD Studio 2.02.x" -ForegroundColor Cyan
|
||||
Write-Host " 2. Open banks from: $extractedBanksPath" -ForegroundColor Cyan
|
||||
Write-Host " 3. Edit banks for voice limits, ducking, enemy cues" -ForegroundColor Cyan
|
||||
Write-Host " 4. See docs/FMOD_MODIFICATION_GUIDE_PHASE3.md for details" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
Write-Host "Current project structure:" -ForegroundColor Gray
|
||||
Write-Host " extracted_assets\StreamingAssets\FMOD\Desktop\ <- Edit these banks" -ForegroundColor Gray
|
||||
Write-Host " backup_banks_original\ <- Original banks (backup)" -ForegroundColor Gray
|
||||
Write-Host " modified_banks\ <- Create this folder for modified banks" -ForegroundColor Gray
|
||||
Reference in New Issue
Block a user