-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworldorder.bat
207 lines (186 loc) · 5.98 KB
/
worldorder.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
if not exist "%__APPDIR__%chcp.com" (
set asset=CHCP.COM
goto Terminate
) else (@echo off & cls && "%__APPDIR__%chcp.com" 65001 >nul)
echo.
echo ==========================================================
echo DUKE NUKEM 3D: ALIEN WORLD ORDER Extraction Script
echo ==========================================================
echo Author: NightFright ^| Version: 1.55
echo ==========================================================
echo.
echo This script creates a standalone copy of "Alien World Order" for Raze.
echo Make sure that you have placed the script and all its associated files and
echo directories in your target folder (with Raze executable).
echo.
echo You will only get what is needed to play the new episode.
echo Any changes affecting the original four episodes will NOT be included!
echo.
echo.
echo.
(for /f "usebackq tokens=1,2,*" %%a in (`reg query "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Steam" /v UninstallString`) do set SteamPath32=%%c) >nul 2>&1
(for /f "usebackq tokens=1,2,*" %%a in (`reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam" /v UninstallString`) do set SteamPath64=%%c) >nul 2>&1
set steam=%SteamPath64%%SteamPath32%
set steam=%steam:\uninstall.exe=%
set raze=%cd%
echo Enter your Steam source directory or press [ENTER] to autodetect (%steam%):
set /p steam=
echo STEAM DIRECTORY SET!
echo.
echo Enter your Raze target directory or press [ENTER] to use current dir (%cd%):
set /p raze=
echo RAZE DIRECTORY SET!
echo.
set "src=%steam%\steamapps\common\Duke Nukem 3D Twentieth Anniversary World Tour"
set dest=%raze%\data
set temp=%dest%\temp
if exist "%src%" (
if not exist "%raze%\raze.exe" (
set asset=RAZE.EXE
goto Terminate
)
) else (
set asset=WORLD TOUR INSTALLATION
goto Terminate
)
if not exist "%dest%\7za.exe" (
set asset=7ZA.EXE
goto Terminate
)
:GrpPatch
choice /c YN /n /m "<OPTION 1/2> Copy over DUKE3D.GRP from World Tour and convert it to Atomic [Y/N]?"
if %errorlevel% equ 2 goto MapPatch
if %errorlevel% equ 1 goto Conversion1
:MapPatch
choice /c YN /n /m "<OPTION 2/2> Apply patch for 'Prima Arena' (E5L8.map) to add cut sections [Y/N]?"
if %errorlevel% equ 2 goto StartCopy
if %errorlevel% equ 1 goto Conversion2
:Conversion1
set ConversionMode=1
goto ConversionCheck
:Resume1
robocopy "%src%" "%dest%" DUKE3D.GRP /nfl /ndl /njh /njs /nc /ns /np
cd "%dest%"
ren DUKE3D.GRP worldtour.grp
bspatch worldtour.grp duke3d.grp wtatomic.bdf
del "%dest%\worldtour.grp"
echo DUKE3D.GRP copied, Atomic patch applied.
ping -n 3 localhost >nul
echo.
goto MapPatch
:Conversion2
set ConversionMode=2
goto ConversionCheck
:Resume2
robocopy "%src%\maps" "%dest%" E5L8.map /nfl /ndl /njh /njs /nc /ns /np
cd "%dest%"
bspatch E5L8.map E5L8A.map e5l8_uncut.bdf
md "%temp%\maps" >nul
move E5L8A.map "%temp%\maps" >nul
move E5L8.map "%temp%\maps\E5L8B.map" >nul
echo E5L8 patch applied. Backup saved as E5L8B.map.
ping -n 3 localhost >nul
goto StartCopy
:ConversionCheck
cls
echo.
if not exist "%dest%\bspatch.exe" (
set patchfile=BSPATCH.EXE
goto PatchError
)
if %ConversionMode% equ 1 (
if not exist "%dest%\wtatomic.bdf" (
set patchfile=BDIFF PATCH
goto PatchError
)
) else (
if not exist "%dest%\e5l8_uncut.bdf" (
set patchfile=BDIFF PATCH
goto PatchError
)
)
echo Please confirm process 'bspatch.exe' if a UAC notification appears.
ping -n 6 localhost >nul
if %ConversionMode% equ 1 (goto Resume1) else (goto Resume2)
:PatchError
echo %patchfile% *NOT* FOUND! Skipping conversion...
ping -n 3 localhost >nul
:StartCopy
cls
echo.
echo PROGRESS: ▓▒▒▒▒▒▒▒▒▒ 10%%
echo STATUS: SETUP COMPLETE! Commencing copy procedure...
ping -n 3 localhost >nul
cls
echo.
echo PROGRESS: ▓▓▒▒▒▒▒▒▒▒ 20%%
echo STATUS: Copying CON and ART files...
robocopy "%src%" "%temp%" *.con *.art /nfl /ndl /njh /njs /nc /ns /np
del "%temp%\USER.CON"
del "%temp%\GAME.CON"
ren "%temp%\USER_FIX.CON" USER.CON
ren "%temp%\GAME_FIX.CON" GAME.CON
ping -n 2 localhost >nul
cls
echo.
echo PROGRESS: ▓▓▓▒▒▒▒▒▒▒ 30%%
echo STATUS: Copying skyboxes...
robocopy "%src%\textures\skybox" "%temp%\skyboxes" /nfl /ndl /njh /njs /nc /ns /np /s
ping -n 2 localhost >nul
cls
echo.
echo PROGRESS: ▓▓▓▓▒▒▒▒▒▒ 40%%
echo STATUS: Copying maps...
robocopy "%src%\maps" "%temp%\maps" E5*.map /nfl /ndl /njh /njs /nc /ns /np
if exist "%temp%\maps\E5L8A.map" (
del "%temp%\maps\E5L8.map"
ren "%temp%\maps\E5L8A.map" E5L8.map
)
ping -n 2 localhost >nul
cls
echo.
echo PROGRESS: ▓▓▓▓▓▒▒▒▒▒ 50%%
echo STATUS: Copying music...
robocopy "%src%\music" "%temp%\music" E5*.ogg /nfl /ndl /njh /njs /nc /ns /np
ping -n 2 localhost >nul
cls
echo.
echo PROGRESS: ▓▓▓▓▓▓▒▒▒▒ 60%%
echo STATUS: Copying sounds...
robocopy "%src%\sound" "%temp%\sound" Pagoda_CheshireAlien*.ogg VO_*.ogg Wep_*.ogg /s /nfl /ndl /njh /njs /nc /ns /np >nul
ping -n 2 localhost >nul
cls
echo.
echo PROGRESS: ▓▓▓▓▓▓▓▒▒▒ 70%%
echo STATUS: Cleaning up...
del "%temp%\tiles009.art"
del "%temp%\music\E5L7_PluckYouPartTwo.ogg"
del "%temp%\sound\VO_E5L2_Duke_BeHere - ALT.ogg"
del "%temp%\sound\Wep_Flamethrower_Start.ogg"
for %%a in ("%temp%\skyboxes\BIGORBIT1" "%temp%\skyboxes\CLOUDYOCEAN" "%temp%\skyboxes\LA" "%temp%\skyboxes\MOONSKY1" "%temp%\skyboxes\REDSKY2") do rd /s /q "%%~a"
ping -n 2 localhost >nul
cls
echo.
echo PROGRESS: ▓▓▓▓▓▓▓▓▒▒ 80%%
echo STATUS: Creating data file "worldorder.grp"...
cd "%dest%"
7za a -mx0 worldorder.zip "%temp%\*" >nul
ren worldorder.zip worldorder.grp
ping -n 2 localhost >nul
cls
echo.
echo PROGRESS: ▓▓▓▓▓▓▓▓▓▒ 90%%
echo STATUS: Deleting temporary files...
rmdir "%temp%" /s /q
del "%dest%\*.exe"
del "%dest%\*.bdf"
ping -n 2 localhost >nul
cls
echo.
echo PROGRESS: ▓▓▓▓▓▓▓▓▓▓ 100%%
echo STATUS: ALL DONE! Closing script...
goto End
:Terminate
echo %asset% *NOT* FOUND! Terminating script...
:End
ping -n 4 localhost >nul