-
Notifications
You must be signed in to change notification settings - Fork 3
/
CreateMod_GTAVC.bat
192 lines (164 loc) · 6.84 KB
/
CreateMod_GTAVC.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
@echo off
setlocal
cd %~dp0
SET windowTitle=Paradox's Mod Builder:
TITLE %windowTitle% Getting Ready...
REM ****************************** CONFIGURATION - DO NOT EDIT ANYTHING OUTSIDE THIS SECTION ******************************
:: GTA Vice City Install Path (e.g: C:\Games\GTA Trilogy\GTA Vice City - Definitive Edition). Not required if autoinstall = false.
SET installdir=
:: Mod Staging Directory. This is where your mod files reside. You can leave it as is.
SET stagingdir=%~dp0staging
:: Mod PAK Name. A higher number means higher priority over other mods. You can leave it as is.
SET pakname=999-CustomModVC_P
:: Skip Compiling Scripts. Set to true to skip compiling game scripts and build the PAK file with the staging data as-is.
SET skipcompile=false
:: Skip PAK Building. Set to true to skip packing the mod into a PAK.
SET skippak=false
:: Auto-Install Mod. Automatically copies the mod to your game install directory after building if set to true.
SET autoinstall=true
REM ******************************************** END OF CONFIGURATION SECTION *********************************************
SET originaldata=%stagingdir%\Gameface\Content\OriginalData
SET moddir=%installdir%\Gameface\Content\Paks\~Mods
goto initcheck
:ascii
cls
echo.
echo ____
echo ^/ ^/
echo ^/ ^/
echo ^/ ^/ _______________
echo ^/ ^/ ^/ \
echo ____ ^/ ^/ ^/ \
echo \ \ ^/ ^/ ^/ ____________^/
echo \ \ ^/ ^/ ^/ ^/
echo \ \ ^/ ^/ ^| ^/
echo \ \ ^/ ^/ ^| ^|
echo \ \ ^/ ^/ ^| ^|
echo \ \ ^/ ^/ ^| \
echo \ \_^/ ^/ \ \_____________
echo \ ^/ \ \
echo \ ^/ \ ^/
echo \___^/ \________________^/
echo.
echo --------------------------------------------------------
echo Paradox's GTA VC Definitive Mod Builder
echo Github: github.com/maega ^| Twitter: @ParadoxEpoch
echo --------------------------------------------------------
echo.
exit /B 0
:initcheck
call :ascii
echo Game Install Path: %installdir%
echo Mod Staging Path: %stagingdir%
echo.
if "%installdir%" == "" if "%autoinstall%" == "true" goto errdirconfig
if not exist "%installdir%\" if "%autoinstall%" == "true" goto errdirconfig
if not exist "%moddir%\" if "%autoinstall%" == "true" mkdir "%moddir%"
if not exist "%originaldata%\ViceCity\data\miss2.exe" if not "%skipcompile%" == "true" goto errnocompiler
if not exist "%originaldata%\ViceCity\Scripts\main.sc" if not "%skipcompile%" == "true" goto errnoscript
echo *** Tasks: ***
if not "%skipcompile%" == "true" echo - Compile Game Scripts
if not "%skippak%" == "true" echo - Build mod into Unreal Engine PAK
if "%autoinstall%" == "true" echo - Install mod into game installation folder
echo.
echo If this all looks good, press any key to begin...
pause>nul
REM **************************************************************************
REM ************************** COMPILE SCRIPTS *****************************
REM **************************************************************************
:compile
if "%skipcompile%" == "true" goto buildpak
call :ascii
TITLE %windowTitle% Compiling Game Scripts...
echo Compiling GTA Vice City Game Scripts...
cd %originaldata%\ViceCity\data
miss2.exe -miami -f ..\Scripts\main.sc -close
if ERRORLEVEL 1 goto errcompile
xcopy /Y /D ..\Scripts\main.scm .\
echo Cleaning up staging directory...
del LogFile.txt full_script_text.txt
cd ..\Scripts
del alpha_text.txt command_usage.txt main.scm main_text.txt missiontextkeys.txt
del ordered_commands.txt variable_info.txt variable_usage.txt GTAVCSaveInfo.dat
cd %~dp0
REM **************************************************************************
REM ***************************** BUILD PAK ********************************
REM **************************************************************************
:buildpak
if "%skippak%" == "true" goto installpak
call :ascii
TITLE %windowTitle% Building PAK...
echo Building PAK file for Unreal Engine...
echo.
echo "%stagingdir%\*.*" "..\..\..\*.*" > filelist.txt
utils\UnrealPak.exe "%~dp0%pakname%.pak" -create="%~dp0filelist.txt" -compress
if ERRORLEVEL 1 goto errbuildpak
echo.
echo Cleaning up...
del filelist.txt
:installpak
if not "%autoinstall%" == "true" goto end
TITLE %windowTitle% Installing Mod...
echo Installing Mod...
xcopy /Y /D "%pakname%.pak" "%moddir%\"
del "%pakname%.pak"
goto end
:end
call :ascii
TITLE %windowTitle% All Done!
if "%autoinstall%" == "true" echo All done! Your mod has been installed to your game installation folder as %pakname%.pak.
if not "%autoinstall%" == "true" echo All done! Your mod has been created as %pakname%.pak.
echo.
echo Have fun!
echo Press any key to exit . . .
pause>nul
exit
REM **************************************************************************
REM ******************************* ERRORS *********************************
REM **************************************************************************
:errdirconfig
TITLE %windowTitle% Error!
echo You have not set the path to your GTA Vice City installation files. Please edit this script and add a valid path.
echo Check the README for more information
echo.
echo Press any key to exit . . .
pause>nul
exit
:errnocompiler
TITLE %windowTitle% Error!
echo ERROR: "staging\Gameface\Content\OriginalData\ViceCity\data\miss2.exe" is missing!
echo Script compiler could not be found. Please make sure you are using the correct game build in the staging dir!
echo You need to extract the OriginalData folder from one of the Switch release NSPs into staging\Gameface\Content\
echo Check the README for more information
echo.
echo Press any key to exit . . .
pause>nul
exit
:errnoscript
TITLE %windowTitle% Error!
echo ERROR: "staging\Gameface\Content\OriginalData\ViceCity\Scripts\main.sc" is missing!
echo Main script could not be found. Please make sure you are using the correct game build in the staging dir!
echo You need to extract the OriginalData folder from one of the Switch release NSPs into staging\Gameface\Content\
echo Check the README for more information
echo.
echo Press any key to exit . . .
pause>nul
exit
:errcompile
TITLE %windowTitle% Error!
echo.
echo ERROR: Failed to compile game scripts!
echo Something went wrong with the R* script compiler. I've opened the compiler's LogFile.txt for more information.
notepad LogFile.txt
echo.
echo Press any key to exit . . .
pause>nul
exit
:errbuildpak
TITLE %windowTitle% Error!
echo.
echo ERROR: Failed to build PAK file!
echo.
echo Press any key to exit . . .
pause>nul
exit