PhysixCat

gzd_launcher

Jul 6th, 2019 (edited)
763
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 14.04 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. # GZDoom launching script
  3. # Author: PhysixCat
  4.  
  5. # This is a bash script for easy launching of GZDoom on GNU/Linux or Mac
  6. # It allows you to select combos of WADs without much regard for load order
  7. # This script assumes that the user has the DOOM Complete Wadsmoosh
  8. # This comes included in my retro FPS repository
  9. # https://mega.nz/#F!GtEQTISJ!CCJGyPEEEsZasc1PMXicUA
  10. # If the original WADs are preferred, just default to them in the script
  11. # --------------------------------------------------------------------------------
  12.  
  13. # User should change these to their own Doom directory
  14. iwad_path="$HOME/Vidya/Native/Doom/IWADS"
  15. pwad_path="$HOME/Vidya/Native/Doom/PWADS"
  16. config_path="$HOME/.config/gzdoom"
  17. config_file="$config_path/gzdoom.ini"
  18. # If using a dev build, specify path
  19. gzd_path="$HOME/Vidya/Native/Doom/gzdoom_build/gzdoom/build/gzdoom"
  20. [[ -z "$gzd_path" ]] && gzd_path="gzdoom"
  21.  
  22. # Show available PWADS/IWADS
  23. printf '\e[1m%s\e[0m\n' "GZDoom launching script"
  24. printf '%s\n' "--------------------------------------------------------------------------------"
  25. printf '\n\e[1m%s\e[0m\n' "PWADS/Maps"
  26. ls --color -F -I 'in compendium' "$pwad_path/Maps"
  27. printf '\n\e[1m%s\e[0m\n' "PWADS/TotalConversions"
  28. ls --color -F "$pwad_path/TotalConversions"
  29. printf '\n\e[1m%s\e[0m\n' "IWADS/"
  30. ls --color -F -I 'doom_complete.pk3' -I 'voices.wad' "$iwad_path"
  31. printf '\n%s\n\n' "--------------------------------------------------------------------------------"
  32.  
  33. # Ask user for desired map
  34. read -r -p 'Enter WAD to play (leave blank for DOOM Complete):'$'\n> ' map
  35.  
  36. blacklist_tc=( 'ashes2063' 'blade_of_agony.pk3' 'golden_souls2.pk3' 'paranoid.pk3' 'pirates.zip' 'rekkr.zip' 'strange_aeons.pk3' 'wolfendoom.zip' 'aliens' )
  37. blacklist_iwad=( 'strife' 'heretic' 'hexen' 'hexdd' 'chex3' 'square.pk3' )
  38. blacklist_doom=( 'doom' 'doom2' 'tnt' 'plutonia' )
  39.  
  40. case $map in
  41.     strife|heretic|hexen|hexdd|freedoom1|freedoom2|chex3|square.pk3|doom|doom2|tnt|plutonia)
  42.         iwad="$map"
  43.         printf '\n%s' "Selected $iwad as IWAD"
  44.         ;;
  45.     masterlevels|nerve)
  46.         iwad='doom2'
  47.         ;;&
  48.     sigil)
  49.         iwad='doom'
  50.         ;;&
  51.     strife)
  52.         prepatch='voices'
  53.         ;;&
  54.     heretic)
  55.         prepatch='hr_sprite_fix10.zip'
  56.         ;;&
  57.     doom|doom2|tnt|plutonia|masterlevels|nerve|sigil)
  58.         printf '\n%s' "The Doom Complete WADSmoosh already includes this..."
  59.         ;;
  60.     chex3|square.pk3)
  61.         printf '\n%s' "It will be loaded without any additional PWADs"
  62.         ;;
  63.     strife|heretic|hexen|hexdd)
  64.         extra=( 'fancyworld_v2.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' 'healthwarning.pk3' 'fullscrn_huds' 'dmgdirov.pk3' 'autoautosave' )
  65.         printf '\n%s' "It will be loaded with some additional PWADs"
  66.         ;;
  67.     *)
  68.         # This is the default IWAD. If you want another, just change it here
  69.         iwad='doom_complete.pk3'
  70.         #iwad='doom'
  71.         #iwad='doom2'
  72.         #iwad='freedoom2'
  73.         #iwad='miniwad'
  74.         #iwad=tnt
  75.         ;;&
  76.     ashes2063|blade_of_agony.pk3|golden_souls2.pk3|paranoid.pk3|pirates.zip|rekkr.zip|strange_aeons.pk3|wolfendoom.zip|aliens)
  77.         printf '\n%s' "Using $map as PWAD. It is a total conversion" "It will be loaded with some additional PWADs"
  78.         ;;
  79. esac
  80.  
  81. [[ "$iwad" == "$map" ]] && unset map
  82.  
  83. if [[ " ${blacklist_iwad[*]} " != *" $iwad "* && " ${blacklist_tc[*]} " != *" $map "* ]]; then
  84.     # Report on assigned map, add postpatches
  85.     case $map in
  86.         '')
  87.             if [[ " ${blacklist_doom[*]} " != *" $iwad "* ]]; then
  88.                 printf '\n%s' "No PWADs selected" "Defaulted to $iwad"
  89.             fi
  90.             ;;
  91.         ayy|aaliens)
  92.             map='aaliens'
  93.             postpatch='d2_sprite_fix_aaliens'
  94.             printf '\n%s' "Ancient Aliens by skillsaw"
  95.             ;;
  96.         sunlust)
  97.             postpatch='d2_sprite_fix_sunlust'
  98.             printf '\n%s' "Sunlust by Ribbiks & dannebubinga"
  99.             ;;
  100.         av)
  101.             printf '%s\n' "Alien Vendetta"
  102.             iwad='doom2'
  103.             autopatch=( '-deh' 'AV.DEH' )
  104.             ;;
  105.         64)
  106.             map='consolation_64.pk3'
  107.             printf '%s\n' "Doom 64 maps from Consolation Prize"
  108.             ;;
  109.         bootcamp)
  110.             unset map
  111.             finalpatch=( 'hd_bootcamp.zip' 'hd_bootcamp_voices.pk3' )
  112.             ;;
  113.  
  114.         *)
  115.             printf '\n%s' "Using $map as PWAD" "Using $iwad as IWAD"
  116.             ;;
  117.     esac
  118.  
  119.     printf '\n%s\n' "--------------------------------------------------------------------------------"
  120.     # Show available gameplay WADs
  121.     printf '\n\e[1m%s\e[0m\n' "PWADS/Gameplay"
  122.     ls --color -F "$pwad_path/Gameplay"
  123.     printf '\n%s\n\n' "--------------------------------------------------------------------------------"
  124.  
  125.     # Ask user for desired gameplay
  126.     read -r -p 'Enter gameplay mod (vanilla, pretty, hd, babel... - leave blank for vanilla+):'$'\n> ' gameplay
  127.  
  128.     case "$gameplay" in
  129.         hd|hdtest|hdold|hdlite|uas|yeehaw|sci|hdstock)
  130.             unset config_file
  131.             config_file="$config_path/hd_gzdoom.ini"
  132.             [[ $map == 'dotb.zip' ]] && autopatch=( 'hd_dotb_patch.pk3' 'newrange' )
  133.             [[ $map == 'ashes' ]] && autopatch=( 'asheshdbarrelfix.pk3' 'newrange' )
  134.             #[[ $gameplay != 'hdstock' && -z $autopatch ]] && autopatch=( 'newrange' 'hd_bootcamp.zip' 'hd_bootcamp_voices.pk3' )
  135.             [[ $gameplay != 'hdstock' && -z $autopatch ]] && autopatch=( 'newrange' )
  136.             ;;&
  137.         hd)
  138.             extra=( 'hideous_destructor' 'd2spfx19_hd' 'footsteps.pk3' 'hd_insurgencysfx.pk3' 'hd_physix.pk3' 'hd_blursounds.pk3' 'focuszoom.pk3' 'darkdoomz' 'universalgibs' 'hd_translations_edit' 'hd_bubbles.pk3' 'levelinfo.pk3' )
  139.             printf '\n%s' "<Hideous Destructor> + normal submod list have been selected"
  140.             ;;
  141.         hdtest)
  142.             extra=( 'footsteps.pk3' 'vanilla44rc2.pk3' 'hideous_destructor' 'hd_insurgencysfx.pk3' 'hd_physix.pk3' 'darkdoomz' 'autoautosave' 'universalgibs' 'hd_blursounds.pk3' 'damagefloordetector.pk3' 'hd_translations_edit' 'hd_darkestdungeon.pk3' 'focuszoom.pk3' )
  143.             printf '\n%s' "<Hideous Destructor> + normal submod list have been selected"
  144.             ;;
  145.         hdold)
  146.             extra=( 'footsteps.pk3' 'vanilla44rc2.pk3' 'hideous_destructor' 'zradar' 'hd_nvshader.pk3' 'hd_insurgencysfx.pk3' 'hd_pandorasbox.pk3' 'hd_taunt.pk3' 'hd_title_lite' 'darkdoomz' 'autoautosave' 'levelinfo.pk3' 'universalgibs' 'hd_blursounds.pk3' 'damagefloordetector.pk3' 'hd_translations_edit' 'focuszoom.pk3' )
  147.             printf '\n%s' "<Hideous Destructor> + old submod list have been selected"
  148.             finalpatch=( 'hd_physix_temp.pk3' )
  149.             ;;
  150.         hdlite)
  151.             extra=( 'hideous_destructor' 'hd_insurgencysfx.pk3' 'hd_pandorasbox.pk3' 'hd_taunt.pk3' 'hd_title_lite' 'darkdoomz' 'customlibboss.zip' )
  152.             printf '\n%s' "<Hideous Destructor> + lite submod list has been selected"
  153.             ;;
  154.         uas)
  155.             extra=( 'footsteps.pk3' 'vanilla44rc2.pk3' 'hideous_destructor' 'hd_insurgencysfx.pk3' 'hd_physix.pk3' 'darkdoomz' 'autoautosave' 'universalgibs' 'hd_blursounds.pk3' 'damagefloordetector.pk3' 'hd_translations_edit' 'hd_darkestdungeon.pk3' 'ugly_as_sin' )
  156.             printf '\n%s' "<Hideous Destructor> + normal submod list have been selected"
  157.             ;;
  158.         yeehaw)
  159.             extra=( 'footsteps.pk3' 'vanilla44rc2.pk3' 'hideous_destructor' 'fistful' 'hellscape-navigator' 'zradar' 'hd_nvshader.pk3' 'hd_insurgencysfx.pk3' 'hd_pandorasbox.pk3' 'hd_taunt.pk3' 'hd_title_lite' 'darkdoomz' 'autoautosave' 'levelinfo.pk3' 'universalgibs' 'customlibboss.zip' 'yeehaw' )
  160.             printf '\n%s' "<Hideous Destructor> + yeehaw have been selected"
  161.             ;;
  162.         sci)
  163.             extra=( 'footsteps.pk3' 'vanilla44rc2.pk3' 'hideous_destructor' 'hellscape-navigator' 'zradar' 'hd_nvshader.pk3' 'hd_pandorasbox.pk3' 'hd_taunt.pk3' 'hd_title_lite' 'darkdoomz' 'autoautosave' 'levelinfo.pk3' 'universalgibs' 'customlibboss.zip' 'hl_noenemies.pk3' 'hl_scientist.pk3' )
  164.             printf '\n%s' "<Hideous Destructor> + scientist have been selected"
  165.             ;;
  166.         hdstock)
  167.             extra=( 'hideous_destructor' )
  168.             printf '\n%s' "<Hideous Destructor> has been selected"
  169.             ;;
  170.         *)
  171.             [[ $iwad == 'doom' ]] && prepatch=( 'd1_sprite_fix19' 'doomsfx' )
  172.             [[ $iwad == 'doom_complete.pk3' || $iwad == 'tnt' || $iwad == 'plutonia' || $iwad == 'doom2' ]] && prepatch=( 'd2_sprite_fix19' 'doomsfx' )
  173.             ;;&
  174.         vanilla)
  175.             extra=( 'brightmaps_plus.pk3' 'vanilla44rc2.pk3' 'fullscrn_huds' 'lostsoul_nokill' )
  176.             printf '\n%s' "<Vanilla> has been selected."
  177.             ;;
  178.         '')
  179.             extra=( 'brightmaps_plus.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' 'healthwarning.pk3' 'vanilla44rc2.pk3' 'fullscrn_huds' 'dmgdirov.pk3' 'universalgibs' 'lostsoul_nokill' )
  180.             printf '\n%s' "No option has been selected. This is vanilla+"
  181.             ;;
  182.         pretty)
  183.             extra=( 'brightmaps_plus.pk3' 'fancyworld_v2.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' 'healthwarning.pk3' 'perk_enhanced' 'vanilla44rc2.pk3' 'fullscrn_huds' 'dmgdirov.pk3' 'darkdoomz' 'universalgibs' 'lostsoul_nokill' )
  184.             printf '\n%s' "<Pretty> has been selected."
  185.             ;;
  186.         babel)
  187.             extra=( 'brightmaps_plus.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' 'babel.pk3' 'fullscrn_huds' 'dmgdirov.pk3' 'universalgibs' )
  188.             printf '\n%s' "<Babel> has been selected. This is Babel + submods"
  189.             ;;
  190.         drifter)
  191.             extra=( 'brightmaps_plus.pk3' 'spriteshadow19.pk3' 'healthwarning.pk3' 'high_noon_drifter.pk3' 'dmgdirov.pk3' 'universalgibs' )
  192.             printf '\n%s' "<Drifter> has been selected. This is High Noon Drifter + submods"
  193.             ;;
  194.         *)
  195.             extra=( 'brightmaps_plus.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' 'healthwarning.pk3' 'vanilla44rc2.pk3' 'fullscrn_huds' 'dmgdirov.pk3' "$gameplay" 'universalgibs' 'lostsoul_nokill' )
  196.             printf '\n%s' "<$gameplay> has been selected. This is $gameplay + some submods"
  197.             ;;
  198.     esac
  199.  
  200.     # Show available Cosmetic WADs
  201.     printf '\n%s\n' "--------------------------------------------------------------------------------"
  202.     printf '\n\e[1m%s\e[0m\n' "PWADS/Cosmetic"
  203.     ls --color -F "$pwad_path/Cosmetic"
  204.     printf '\n%s\n\n' "--------------------------------------------------------------------------------"
  205.  
  206.     # Ask user for desired music
  207.     read -r -p 'Enter music addon (juke, term, xpack, floppy, synth, plutmidi - leave blank for none):'$'\n> ' music
  208.  
  209.     # Load selected music pack, if any
  210.     case "$music" in
  211.         '')
  212.             printf '\n%s' "No music addon has been selected"
  213.             ;;
  214.         juke)
  215.             musicaddon='j-jukebox-v9.pk3'
  216.             printf '\n%s' "Jimmy's Jukebox has been selected"
  217.             ;;
  218.         term)
  219.             musicaddon='term_midi35.pk3'
  220.             printf '\n%s' "<Now That's What I Call MIDI!> has been selected"
  221.             ;;
  222.         xpack)
  223.             musicaddon='term_xpack.pk3'
  224.             printf '\n%s' "Expansion Pack to <Now That's What I Call MIDI!> has been selected"
  225.             ;;
  226.         floppy)
  227.             musicaddon='floppydisk_midi.zip'
  228.             printf '\n%s' "<A Floppy Disk Full of MIDI Files> has been selected"
  229.             ;;
  230.         synth)
  231.             musicaddon='synthdoom.pk3'
  232.             printf '\n%s' "<SynthDoom> has been selected"
  233.             ;;
  234.         plutmidi)
  235.             musicaddon='plutmidi'
  236.             printf '\n%s' "<Plutmidi> has been selected"
  237.             ;;
  238.         *)
  239.             printf '\n%s' "Warning: Music pack not recognized. Continuing..."
  240.             ;;
  241.     esac
  242.  
  243.     # If WAD is using custom sprites, and no compat patch is available, make sure brightmaps_plus isn't loaded
  244.     #case "$map" in
  245.         # Add WADs that you know use custom sprites here
  246.     #    name_here)
  247.     #        extra=("${extra[@]/brightmaps_plus/brightmaps}")
  248.     #        printf '\n%s' "brightmaps_plus replaced with default brightmaps"
  249.     #        ;;
  250.     #esac
  251. fi
  252.  
  253. # Ask user for final mods or cvars
  254. printf '\n%s\n\n' "--------------------------------------------------------------------------------"
  255.  
  256. [[ -z $finalpatch ]] && read -r -p 'Enter any final mods you want on top of the preset (leave blank for none):'$'\n> ' -a finalpatch
  257. read -r -p 'Enter mapname followed by additional cvars (leave blank for none):'$'\n> ' -a cvars_raw
  258. [[ -n "${cvars_raw[*]}" ]] && cvars=( '+vid_fps' '1' '+skill' '3' '+map' "${cvars_raw[*]}" ) || cvars=( '+vid_fps' '1' )
  259. #cvars=( '+sv_killbossmonst' '1' '+skill' '3' '+map' "${cvars_raw[*]}" )
  260.  
  261. # Start GZDoom with the selected variables
  262. gzd_arguments=( '-iwad' "$iwad" '-config' "$config_file" '-file' "${prepatch[@]}" "$map" "$postpatch" "${extra[@]}" "$musicaddon" "${autopatch[@]}" "${finalpatch[@]}" "${cvars[@]}" )
  263.  
  264. printf '\n%s\n' "--------------------------------------------------------------------------------"
  265. printf '\n%s' "iwad=[$iwad]" "config=[$config_file]" "prepatch=[${prepatch[*]}]" "map=[$map]" "postpatch=[$postpatch]" "extra=[${extra[*]}]" "musicaddon=[$musicaddon]" "autopatch=[${autopatch[*]}]" "finalpatch=[${finalpatch[*]}]" "cvars=[${cvars[*]}]"
  266. printf '\n\n\e[1m%s\e[0m\n' "Launching..."
  267. printf '\n%s ' "gzdoom ${gzd_arguments[*]}"
  268. printf '\n\n%s\n' "--------------------------------------------------------------------------------"
  269. $gzd_path "${gzd_arguments[@]}"
  270.  
  271. # Copyright 2020 PhysixCat
  272.  
  273. # Licensed under the Apache License, Version 2.0 (the "License");
  274. # you may not use this file except in compliance with the License.
  275. # You may obtain a copy of the License at
  276.  
  277. # http://www.apache.org/licenses/LICENSE-2.0
  278.  
  279. # Unless required by applicable law or agreed to in writing, software
  280. # distributed under the License is distributed on an "AS IS" BASIS,
  281. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  282. # See the License for the specific language governing permissions and
  283. # limitations under the License.
  284.  
Add Comment
Please, Sign In to add comment