-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmakeMod.bat
327 lines (281 loc) · 8.12 KB
/
makeMod.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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
@echo off
set COMPILEDIR=%CD%
set IWDNAME=codjumper.iwd
set IWDNAME2=codjumper_misc.iwd
color f0
title "MOD COMPILER @ EMZ"
set /p revision=<log\REV.txt
for %%* in (.) do set modname=%%~n*
:MAKEOPTIONS
cls
:MAKEOPTIONS
echo REVISION: %revision%
if not exist log mkdir log
echo ________________________________________________________________________
echo.
echo Please select an option:
echo 1. Build Fast File
echo 2. Build Fast File Without *.gsc
echo 3. Build IWD File
echo 4. Start Game
echo 5. Dedicated Server
echo 6. Asset Manager
echo 7. RGB Converter
echo 8. Update From SVN (Tortoise SVN)
echo 9. Commit To SVN (Tortoise SVN)
echo.
echo 0. Exit
echo.
echo ________________________________________________________________________
echo.
echo Mod Name = %modname%
echo.
echo ________________________________________________________________________
echo.
set /p make_option=:
set make_option=%make_option:~0,1%
if "%make_option%"=="1" goto build_ff
if "%make_option%"=="2" goto build_ff_no
if "%make_option%"=="3" goto build_iwd
if "%make_option%"=="4" goto STARTGAME
if "%make_option%"=="5" goto dedicated
if "%make_option%"=="6" goto STARTASSET
if "%make_option%"=="7" goto STARTRGB
if "%make_option%"=="8" goto UPDATE
if "%make_option%"=="9" goto COMMIT
if "%make_option%"=="0" goto FINAL
goto :MAKEOPTIONS
:dedicated
echo %date% - %time% Dedicated Mode >> log\LOG.TXT
cd ..\..\
START cod4x17a_dedrun.exe +set dedicated 2 +exec cj.cfg +set fs_game mods/%modname% +map mp_shipment +gametype cj +set net_port 21337
START iw3mp.exe allowdupe +set fs_game mods/%modname% +connect 127.0.0.1:21337
cd %COMPILEDIR%
goto :MAKEOPTIONS
:build_iwd
cls
cd
echo ________________________________________________________________________
echo.
echo Building %IWDNAME%:
if exist %IWDNAME% del %IWDNAME%
7za a -r -tzip %IWDNAME% images > NUL
7za a -r -tzip %IWDNAME2% weapons > NUL
7za a -r -tzip %IWDNAME2% sun > NUL
7za a -r -tzip %IWDNAME2% sound > NUL
echo.
echo %date% - %time% %IWDNAME% Completed >> log\LOG.TXT
echo.
echo ________________________________________________________________________
echo.
pause
goto :MAKEOPTIONS
:build_ff
cls
cd
echo ________________________________________________________________________
echo.
echo Building mod.ff:
echo Deleting old mod.ff file...
if exist mod.ff del mod.ff
if exist preGSC.exe START preGSC.exe -nopause -outfold emz -d
echo Copying Default Assets
cd ..\..\
if not exist defaultassets mkdir defaultassets
cd defaultassets
xcopy ui ..\raw\ui /SYI > NUL
xcopy ui_mp ..\raw\ui_mp /SYI > NUL
xcopy maps ..\raw\maps /SYI > NUL
xcopy english ..\raw\english /SYI > NUL
xcopy common_scripts ..\raw\common_scripts /SYI > NUL
xcopy codescripts ..\raw\codescripts /SYI > NUL
xcopy character ..\raw\character /SYI > NUL
cd ..\mods\%modname%
echo Copying rawfiles...
xcopy shock ..\..\raw\shock /SYI > NUL
xcopy images ..\..\raw\images /SYI > NUL
xcopy materials ..\..\raw\materials /SYI > NUL
xcopy sound ..\..\raw\sound /SYI > NUL
xcopy soundaliases ..\..\raw\soundaliases /SYI > NUL
xcopy fx ..\..\raw\fx /SYI > NUL
xcopy mp ..\..\raw\mp /SYI > NUL
xcopy mp ..\..\zone_source\mp /SYI > NUL
xcopy weapons\mp ..\..\raw\weapons\mp /SYI > NUL
xcopy xanim ..\..\raw\xanim /SYI > NUL
xcopy xmodel ..\..\raw\xmodel /SYI > NUL
xcopy xmodelparts ..\..\raw\xmodelparts /SYI > NUL
xcopy xmodelsurfs ..\..\raw\xmodelsurfs /SYI > NUL
xcopy ui ..\..\raw\ui /SYI > NUL
xcopy ui_mp ..\..\raw\ui_mp /SYI > NUL
xcopy english ..\..\raw\english /SYI > NUL
xcopy vision ..\..\raw\vision /SYI > NUL
xcopy rumble ..\..\raw\rumble /SYI > NUL
xcopy animtrees ..\..\raw\animtrees /SYI > NUL
xcopy fonts ..\..\raw\fonts /SYI > NUL
xcopy sun ..\..\raw\sun /SYI > NUL
echo Copying source code...
xcopy emz ..\..\raw\emz /SYI > NUL
xcopy maps ..\..\raw\maps /SYI > NUL
echo Copying MOD.CSV...
xcopy mod.csv ..\..\zone_source /SYI > NUL
echo Compiling mod...
cd ..\..\bin
linker_pc.exe -language english -compress -cleanup mod
cd %COMPILEDIR%
copy ..\..\zone\english\mod.ff
echo New mod.ff file successfully built!
echo.
echo %date% - %time% MOD.FF Completed >> log\LOG.TXT
echo.
set /a revision=%revision% + 1
echo %revision% > log\REV.TXT
echo ________________________________________________________________________
echo.
pause
goto :MAKEOPTIONS
:build_ff_no
cls
cd
echo ________________________________________________________________________
echo.
echo Building mod.ff:
echo Deleting old mod.ff file...
del mod.ff
if exist preGSC.exe START preGSC.exe -nopause -outfold emz -d
echo Copying Default Assets
cd ..\..\
if not exist defaultassets mkdir defaultassets
cd defaultassets
xcopy ui ..\raw\ui /SYI > NUL
xcopy ui_mp ..\raw\ui_mp /SYI > NUL
xcopy maps ..\raw\maps /SYI > NUL
xcopy english ..\raw\english /SYI > NUL
xcopy common_scripts ..\raw\common_scripts /SYI > NUL
xcopy codescripts ..\raw\codescripts /SYI > NUL
xcopy character ..\raw\character /SYI > NUL
cd ..\mods\%modname%
echo Copying rawfiles...
xcopy shock ..\..\raw\shock /SYI > NUL
xcopy images ..\..\raw\images /SYI > NUL
xcopy materials ..\..\raw\materials /SYI > NUL
xcopy sound ..\..\raw\sound /SYI > NUL
xcopy soundaliases ..\..\raw\soundaliases /SYI > NUL
xcopy fx ..\..\raw\fx /SYI > NUL
xcopy mp ..\..\raw\mp /SYI > NUL
xcopy weapons\mp ..\..\raw\weapons\mp /SYI > NUL
xcopy xanim ..\..\raw\xanim /SYI > NUL
xcopy xmodel ..\..\raw\xmodel /SYI > NUL
xcopy xmodelparts ..\..\raw\xmodelparts /SYI > NUL
xcopy xmodelsurfs ..\..\raw\xmodelsurfs /SYI > NUL
xcopy ui ..\..\raw\ui /SYI > NUL
xcopy ui_mp ..\..\raw\ui_mp /SYI > NUL
xcopy english ..\..\raw\english /SYI > NUL
xcopy vision ..\..\raw\vision /SYI > NUL
xcopy rumble ..\..\raw\rumble /SYI > NUL
xcopy animtrees ..\..\raw\animtrees /SYI > NUL
xcopy fonts ..\..\raw\fonts /SYI > NUL
xcopy sun ..\..\raw\sun /SYI > NUL
echo Copying source code...
xcopy maps\createfx ..\..\raw\maps\createfx /SYI > NUL
echo Copying MODNOGSC.CSV...
xcopy mod_nogsc.csv ..\..\zone_source /SYI > NUL
cd ..\..\zone_source
del mod.csv
ren mod_nogsc.csv mod.csv
cd ..\mods\%modname%
echo Renaming MOD_NOGSC.CSV to MOD.CSV...
echo Compiling mod...
cd ..\..\bin
linker_pc.exe -language english -compress -cleanup mod
cd %COMPILEDIR%
copy ..\..\zone\english\mod.ff
echo New mod.ff file successfully built!
echo.
echo %date% - %time% NOGSC - MOD.FF Completed >> log\LOG.TXT
echo.
set /a revision=%revision% + 1
echo %revision% > log\REV.TXT
echo ________________________________________________________________________
echo.
pause
goto :MAKEOPTIONS
:STARTGAME
cls
echo ________________________________________________________________________
echo.
echo Write Map Name:
echo.
set /p make_opt=:
echo.
echo.
echo Map Name: %make_opt%
echo.
echo ________________________________________________________________________
echo.
echo.
echo Write Game Type:
echo.
set /p make_optgt=:
echo.
echo.
echo Game Type: %make_optgt%
echo.
echo ________________________________________________________________________
echo.
echo %date% - %time% Play Game >> log\LOG.TXT
cd ..\..\
START iw3mp.exe allowdupe +g_gametype %make_optgt% +set fs_game mods/%modname% +developer 2 +devmap %make_opt%
cd %COMPILEDIR%
goto :MAKEOPTIONS
:STARTASSET
cls
echo %date% - %time% Asset Manager >> log\LOG.TXT
cd ..\..\bin
START asset_manager.exe
cd %COMPILEDIR%
goto :MAKEOPTIONS
:STARTRGB
cls
set /p r=Red:
set /p g=Green:
set /p b=Blue:
set /a r=%r%
set /a g=%g%
set /a b=%b%
set /a divider=255
set /a floats=3
set /a rd=r/divider
set /a gd=g/divider
set /a bd=b/divider
set ro=%rd%.
set go=%gd%.
set bo=%bd%.
:work
set /a r=(r-rd*divider)*10
set /a g=(g-gd*divider)*10
set /a b=(b-bd*divider)*10
set /a rd=r/divider
set /a gd=g/divider
set /a bd=b/divider
set /a floats=floats-1
if "%floats%"=="0" goto clean_up
set ro=%ro%%rd%
set go=%go%%gd%
set bo=%bo%%bd%
goto work
:clean_up
echo %ro% %go% %bo%
echo %date% - %time% RGB Converted : %ro% %go% %bo% >> log\LOG.TXT
echo %ro% %go% %bo%| clip
echo Copied to clipboard.
TIMEOUT /T 2 > NUL
goto :MAKEOPTIONS
:UPDATE
echo UPDATING
TortoiseProc.exe /command:update /path:"%CD%" /closeonend:0
goto :MAKEOPTIONS
:COMMIT
echo COMMITTING
TortoiseProc.exe /command:commit /path:"%CD%" /closeonend:0
goto :MAKEOPTIONS
:FINAL