Rev 408 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 408 | Rev 412 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #!/bin/sh |
1 | #!/bin/sh |
2 | 2 | ||
3 | # Duke Nukem 3D High Resolution Pack Extractor v0.4.2 2012-10-19 |
3 | # Duke Nukem 3D High Resolution Pack Extractor v0.4.3 2012-11-06 |
4 | # |
4 | # |
5 | # Author: LeoD |
5 | # Author: LeoD |
6 | # License: ISC license : http://opensource.org/licenses/isc-license.txt |
6 | # License: ISC license : http://opensource.org/licenses/isc-license.txt |
7 | # |
7 | # |
8 | # This script extracts a working copy of your local Duke Nukem 3D High |
8 | # This script extracts a working copy of your local Duke Nukem 3D High |
Line 18... | Line 18... | ||
18 | 18 | ||
19 | DEF_TOP=UNDEFINED |
19 | DEF_TOP=UNDEFINED |
20 | SET_VERSION=YES # [YES|NO] |
20 | SET_VERSION=YES # [YES|NO] |
21 | EXTRACT_COMMENTED_FILES=NO # [YES|NO] |
21 | EXTRACT_COMMENTED_FILES=NO # [YES|NO] |
22 | DUKEPLUS_POLYMOST_COMPATIBILTY_APPROACH=polymost # [none|polymost|polymer|mixed] |
22 | DUKEPLUS_POLYMOST_COMPATIBILTY_APPROACH=polymost # [none|polymost|polymer|mixed] |
- | 23 | ATTRITION_POLYMOST_COMPATIBILTY_APPROACH=polymost # [none|polymost|polymer|mixed] |
|
23 | 24 | ||
24 | ask() |
25 | ask() |
25 | { |
26 | { |
26 | echo -n "$@" '[y/N] ' ; read ans |
27 | echo -n "$@" '[y/N] ' ; read ans |
27 | case "$ans" in |
28 | case "$ans" in |
Line 293... | Line 294... | ||
293 | # Some people prefer unusual setups ... |
294 | # Some people prefer unusual setups ... |
294 | zip -rq9 ${EXTRACTDIR}/polymost_hrp_update_polymer_maphacks.zip *.mhk |
295 | zip -rq9 ${EXTRACTDIR}/polymost_hrp_update_polymer_maphacks.zip *.mhk |
295 | } # create_polymost_mhk() |
296 | } # create_polymost_mhk() |
296 | 297 | ||
297 | 298 | ||
298 | # I really don't know yet if this will become necessary, or if it doesn't make |
299 | # I really don't know yet if this will become necessary, or if it does make |
299 | # sense at all, but at least the files involved are listed. |
300 | # sense at all, but at least the files involved are listed. |
300 | dukeplus_polymost_compatibility() |
301 | dukeplus_polymost_hrp_compatibility() |
301 | { |
302 | { |
302 | # dukeplus.def expects some files to be present in the HRP |
303 | # dukeplus.def expects some files to be present in the HRP |
303 | # |
304 | # |
304 | # model "highres/sprites/characters/1405_duke.md3" { // all OK, no action required |
305 | # model "highres/sprites/characters/1405_duke.md3" { // all OK, no action required |
305 | # skin { pal 0 surface 0 file "highres/sprites/pickups/0057_jetpack.png" } |
306 | # skin { pal 0 surface 0 file "highres/sprites/pickups/0057_jetpack.png" } |
Line 333... | Line 334... | ||
333 | SPRE="${EXTRACTDIR}/highres/sprites" |
334 | SPRE="${EXTRACTDIR}/highres/sprites" |
334 | PATCHTYPE=$1 |
335 | PATCHTYPE=$1 |
335 | 336 | ||
336 | case "$PATCHTYPE" in |
337 | case "$PATCHTYPE" in |
337 | polymer) |
338 | polymer) |
338 | echo " # Using \"Polymer approach\")" |
339 | echo " # (Using \"Polymer approach\")" |
339 | cp -pi $SPR/firstperson/2510_devastator.md3 "$SPRE/firstperson" |
340 | cp -pi $SPR/firstperson/2510_devastator.md3 "$SPRE/firstperson" |
340 | cp -pi $SPR/firstperson/2510_devastator.png "$SPRE/firstperson" |
341 | cp -pi $SPR/firstperson/2510_devastator.png "$SPRE/firstperson" |
341 | cp -pi $SPR/firstperson/2510_devastator_s.png "$SPRE/firstperson" |
342 | cp -pi $SPR/firstperson/2510_devastator_s.png "$SPRE/firstperson" |
342 | cp -pi $SPR/firstperson/2510_devastator_g.png "$SPRE/firstperson" |
343 | cp -pi $SPR/firstperson/2510_devastator_g.png "$SPRE/firstperson" |
343 | cp -pi $SPR/firstperson/2524_pistol.md3 "$SPRE/firstperson" |
344 | cp -pi $SPR/firstperson/2524_pistol.md3 "$SPRE/firstperson" |
Line 350... | Line 351... | ||
350 | cp -pi $SPR/firstperson/duke_hand_d.png "$SPRE/firstperson" |
351 | cp -pi $SPR/firstperson/duke_hand_d.png "$SPRE/firstperson" |
351 | cp -pi $SPR/firstperson/duke_hand_n.png "$SPRE/firstperson" |
352 | cp -pi $SPR/firstperson/duke_hand_n.png "$SPRE/firstperson" |
352 | cp -pi $SPR/firstperson/duke_hand_s.png "$SPRE/firstperson" |
353 | cp -pi $SPR/firstperson/duke_hand_s.png "$SPRE/firstperson" |
353 | ;; |
354 | ;; |
354 | polymost) |
355 | polymost) |
355 | echo " # Using (\"Polymost approach\")" |
356 | echo " # (Using \"Polymost approach\")" |
356 | #cp -pi $SPR/firstperson_polymost/2510_devastator.md3 "$SPRE/firstperson" |
357 | #cp -pi $SPR/firstperson_polymost/2510_devastator.md3 "$SPRE/firstperson" |
357 | #cp -pi $SPR/firstperson_polymost/2510_devastator.png "$SPRE/firstperson" |
358 | #cp -pi $SPR/firstperson_polymost/2510_devastator.png "$SPRE/firstperson" |
358 | ##cp -pi $SPR/firstperson/2510_devastator_s.png "$SPRE/firstperson" |
359 | ##cp -pi $SPR/firstperson/2510_devastator_s.png "$SPRE/firstperson" |
359 | #cp -pi $SPR/firstperson_polymost/2510_devastator_g.png "$SPRE/firstperson" |
360 | #cp -pi $SPR/firstperson_polymost/2510_devastator_g.png "$SPRE/firstperson" |
360 | cp -pi $SPR/firstperson_polymost/2524_pistol.md3 "$SPRE/firstperson" |
361 | cp -pi $SPR/firstperson_polymost/2524_pistol.md3 "$SPRE/firstperson" |
Line 367... | Line 368... | ||
367 | #cp -pi $SPR/firstperson/duke_hand_d.png "$SPRE/firstperson" |
368 | #cp -pi $SPR/firstperson/duke_hand_d.png "$SPRE/firstperson" |
368 | #cp -pi $SPR/firstperson/duke_hand_n.png "$SPRE/firstperson" |
369 | #cp -pi $SPR/firstperson/duke_hand_n.png "$SPRE/firstperson" |
369 | #cp -pi $SPR/firstperson/duke_hand_s.png "$SPRE/firstperson" |
370 | #cp -pi $SPR/firstperson/duke_hand_s.png "$SPRE/firstperson" |
370 | ;; |
371 | ;; |
371 | mixed) |
372 | mixed) |
372 | echo " # Using (\"Mixed approach\")" |
373 | echo " # (Using \"Mixed approach\")" |
373 | echo " # Not applied / Not yet implemented" |
374 | echo " # Not applied / Not yet implemented" |
374 | ;; |
375 | ;; |
375 | none) |
376 | none) |
376 | echo " Not applied" |
377 | echo " Not applied" |
377 | #echo " # Not yet implemented" |
378 | #echo " # Not yet implemented" |
Line 379... | Line 380... | ||
379 | *) |
380 | *) |
380 | echo " # Bad parameter" |
381 | echo " # Bad parameter" |
381 | ;; |
382 | ;; |
382 | esac |
383 | esac |
383 | 384 | ||
384 | } # dukeplus_polymost_compatibility() |
385 | } # dukeplus_polymost_hrp_compatibility() |
- | 386 | ||
- | 387 | ||
- | 388 | attrition_polymost_hrp_compatibility() |
|
- | 389 | { |
|
- | 390 | # attr_hrp.def expects some files to be present in the HRP |
|
- | 391 | # |
|
- | 392 | # model "highres/sprites/firstperson/2524_pistol.md3" { // most/mer : same MD3 + same skin til r295 |
|
- | 393 | # skin { pal 0 file "highres/sprites/firstperson/2524_pistol.png" } // up to DP2.30 DNE/IMP only |
|
- | 394 | # glow { file "highres/sprites/firstperson/2524_pistol_g.png" } // up to DP2.30 DNE/IMP only |
|
- | 395 | ||
- | 396 | SPR="highres/sprites" |
|
- | 397 | SPRE="${EXTRACTDIR}/highres/sprites" |
|
- | 398 | PATCHTYPE=$1 |
|
- | 399 | ||
- | 400 | case "$PATCHTYPE" in |
|
- | 401 | polymer) |
|
- | 402 | echo " # (Using \"Polymer approach\")" |
|
- | 403 | ;; |
|
- | 404 | polymost) |
|
- | 405 | echo " # (Using \"Polymost approach\")" |
|
- | 406 | cp -piu $SPR/firstperson_polymost/2524_pistol.md3 "$SPRE/firstperson" |
|
- | 407 | cp -pi $SPR/firstperson_polymost/2524_pistol.png "$SPRE/firstperson" |
|
- | 408 | cp -pi $SPR/firstperson_polymost/2524_pistol_g.png "$SPRE/firstperson" |
|
- | 409 | cp -pi $SPR/firstperson/2530_clip.md3 "$SPRE/firstperson" |
|
- | 410 | #cp -pi $SPR/firstperson/2532_cliphand.md3 "$SPRE/firstperson" |
|
- | 411 | ##cp -pi $SPR/firstperson/2532_cliphand.png "$SPRE/firstperson" |
|
- | 412 | #cp -pi $SPR/firstperson/duke_hand_d.png "$SPRE/firstperson/2532_cliphand.png" |
|
- | 413 | ;; |
|
- | 414 | mixed) |
|
- | 415 | echo " # (Using \"Mixed approach\")" |
|
- | 416 | cp -piu $SPR/firstperson_polymost/2524_pistol.md3 "$SPRE/firstperson" |
|
- | 417 | cp -pi $SPR/firstperson_polymost/2524_pistol.png "$SPRE/firstperson" |
|
- | 418 | cp -pi $SPR/firstperson_polymost/2524_pistol_g.png "$SPRE/firstperson" |
|
- | 419 | cp -pi $SPR/firstperson/2530_clip.md3 "$SPRE/firstperson" |
|
- | 420 | #cp -pi $SPR/firstperson/2532_cliphand.md3 "$SPRE/firstperson" |
|
- | 421 | ##cp -pi $SPR/firstperson/2532_cliphand.png "$SPRE/firstperson" |
|
- | 422 | #cp -pi $SPR/firstperson/duke_hand_d.png "$SPRE/firstperson/2532_cliphand.png" |
|
- | 423 | cp -pi $SPR/firstperson/2544_rpg.md3 "$SPRE/firstperson" |
|
- | 424 | cp -pi $SPR/firstperson/2544_rpg_d.png "$SPRE/firstperson/2544_rpg.png" |
|
- | 425 | cp -pi $SPR/firstperson/2544_rpg_n.png "$SPRE/firstperson" |
|
- | 426 | cp -pi $SPR/firstperson/2544_rpg_s.png "$SPRE/firstperson" |
|
- | 427 | cp -pi $SPR/firstperson/duke_hand_d.png "$SPRE/firstperson" |
|
- | 428 | cp -pi $SPR/firstperson/duke_hand_n.png "$SPRE/firstperson" |
|
- | 429 | cp -pi $SPR/firstperson/duke_hand_s.png "$SPRE/firstperson" |
|
- | 430 | cp -pi $SPR/firstperson/muzzle_flash_01.png "$SPRE/firstperson" |
|
- | 431 | cp -pi highres/common/transp.png "${EXTRACTDIR}/highres/common" |
|
- | 432 | ;; |
|
- | 433 | none) |
|
- | 434 | echo " Not applied" |
|
- | 435 | #echo " # Not yet implemented" |
|
- | 436 | ;; |
|
- | 437 | *) |
|
- | 438 | echo " # Bad parameter" |
|
- | 439 | ;; |
|
- | 440 | esac |
|
- | 441 | ||
- | 442 | } # attrition_polymost_hrp_compatibility() |
|
385 | 443 | ||
386 | 444 | ||
387 | parse_defs() |
445 | parse_defs() |
388 | { |
446 | { |
389 | echo "$1" |
447 | echo "$1" |
Line 514... | Line 572... | ||
514 | if [ "${HRPTYPE}" = "polymost" ] || [ "${HRPTYPE}" = "polymost_override" ] ; then |
572 | if [ "${HRPTYPE}" = "polymost" ] || [ "${HRPTYPE}" = "polymost_override" ] ; then |
515 | echo "### Creating Polymost maphacks ... ###" |
573 | echo "### Creating Polymost maphacks ... ###" |
516 | create_polymost_mhk |
574 | create_polymost_mhk |
517 | 575 | ||
518 | echo "### DukePlus<>Polymost HRP compatibility patch ... ###" |
576 | echo "### DukePlus<>Polymost HRP compatibility patch ... ###" |
519 | dukeplus_polymost_compatibility $DUKEPLUS_POLYMOST_COMPATIBILTY_APPROACH |
577 | dukeplus_polymost_hrp_compatibility $DUKEPLUS_POLYMOST_COMPATIBILTY_APPROACH |
- | 578 | ||
- | 579 | echo "### Attrition<>Polymost HRP compatibility patch ... ###" |
|
- | 580 | attrition_polymost_hrp_compatibility $ATTRITION_POLYMOST_COMPATIBILTY_APPROACH |
|
520 | fi |
581 | fi |
521 | 582 | ||
522 | echo "### Parsing DEF file hierarchy ... ###" |
583 | echo "### Parsing DEF file hierarchy ... ###" |
523 | if [ "$EXTRACT_COMMENTED_FILES" = "YES" ] ; then |
584 | if [ "$EXTRACT_COMMENTED_FILES" = "YES" ] ; then |
524 | echo " # Extract commented textures and models: $EXTRACT_COMMENTED_FILES" |
585 | echo " # Extract commented textures and models: $EXTRACT_COMMENTED_FILES" |