SHARE
TWEET

gzdoom_launcher

PhysixCat Jul 6th, 2019 (edited) 399 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/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.  
  19. # Show available PWADS/IWADS
  20. printf '\e[1m%s\e[0m\n' "GZDoom launching script"
  21. printf '%s\n' "--------------------------------------------------------------------------------"
  22. printf '\n\e[1m%s\e[0m\n' "PWADS/Maps"
  23. ls --color -F -I 'in compendium' "$pwad_path/Maps"
  24. printf '\n\e[1m%s\e[0m\n' "PWADS/TotalConversions"
  25. ls --color -F "$pwad_path/TotalConversions"
  26. printf '\n\e[1m%s\e[0m\n' "IWADS/"
  27. ls --color -F -I 'doom_complete.pk3' -I 'voices.wad' "$iwad_path"
  28. printf '\n%s\n\n' "--------------------------------------------------------------------------------"
  29.  
  30. # Ask user for desired map
  31. read -r -p 'Enter WAD to play (leave blank for DOOM Complete):'$'\n> ' map
  32.  
  33. blacklist_tc=( 'ashes.zip' 'blade_of_agony.pk3' 'golden_souls2.pk3' 'paranoid.pk3' 'pirates.zip' 'rekkr.zip' 'strange_aeons.pk3' 'wolfendoom.zip' 'aliens' )
  34. blacklist_iwad=( 'strife' 'heretic' 'hexen' 'hexdd' 'chex3' 'square.pk3' )
  35. blacklist_doom=( 'doomu' 'doom2' 'tnt' 'plutonia' )
  36.  
  37. case $map in
  38.     strife|heretic|hexen|hexdd|freedoom1|freedoom2|chex3|square.pk3|doomu|doom2|tnt|plutonia)
  39.         iwad="$map"
  40.         printf '\n%s' "Selected $iwad as IWAD"
  41.         ;;
  42.     masterlevels|nerve)
  43.         iwad='doom2'
  44.         ;;&
  45.     sigil)
  46.         iwad='doomu'
  47.         ;;&
  48.     strife)
  49.         prepatch='voices'
  50.         ;;&
  51.     heretic)
  52.         prepatch='hr_sprite_fix10.zip'
  53.         ;;&
  54.     doomu|doom2|tnt|plutonia|masterlevels|nerve|sigil)
  55.         printf '\n%s' "The Doom Complete WADSmoosh already includes this..."
  56.         ;;
  57.     chex3|square.pk3)
  58.         printf '\n%s' "It will be loaded without any additional PWADs"
  59.         ;;
  60.     strife|heretic|hexen|hexdd)
  61.         extra=( 'lights.pk3' 'brightmaps.pk3' 'fancyworld_v2.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' 'healthwarning.pk3' 'fullscrn_huds' 'dmgdirov.pk3' 'damnums.pk3' 'targetspy112.pk3' 'autoautosave' )
  62.         printf '\n%s' "It will be loaded with some additional PWADs"
  63.         ;;
  64.     *)
  65.         # This is the default IWAD. If you want another, just change it here
  66.         iwad='doom_complete.pk3'
  67.         #iwad='freedoom2'
  68.         ;;&
  69.     ashes.zip|blade_of_agony.pk3|golden_souls2.pk3|paranoid.pk3|pirates.zip|rekkr.zip|strange_aeons.pk3|wolfendoom.zip|aliens)
  70.         extra=( 'lights.pk3' 'brightmaps.pk3' )
  71.         printf '\n%s' "Using $map as PWAD. It is a total conversion" "It will be loaded with some additional PWADs"
  72.         ;;
  73. esac
  74.  
  75. [[ "$iwad" == "$map" ]] && unset map
  76.  
  77. if [[ " ${blacklist_iwad[*]} " != *" $iwad "* && " ${blacklist_tc[*]} " != *" $map "* ]]; then
  78.     # Report on assigned map, add postpatches
  79.     case $map in
  80.         '')
  81.             if [[ " ${blacklist_doom[*]} " != *" $iwad "* ]]; then
  82.                 printf '\n%s' "No PWADs selected" "Defaulted to $iwad"
  83.             fi
  84.             ;;
  85.         ayy|ayylmao|ancient_aliens.zip)
  86.             map='ancient_aliens.zip'
  87.             postpatch='d2_sprite_fix_aaliens'
  88.             printf '\n%s' "Ancient Aliens by skillsaw (Paul DeBruyne)" "Using $iwad as IWAD"
  89.             ;;
  90.         *)
  91.             printf '\n%s' "Using $map as PWAD" "Using $iwad as IWAD"
  92.             ;;
  93.     esac
  94.  
  95.     printf '\n%s\n' "--------------------------------------------------------------------------------"
  96.     # Show available gameplay WADs
  97.     printf '\n\e[1m%s\e[0m\n' "PWADS/Gameplay"
  98.     ls --color -F "$pwad_path/Gameplay"
  99.     printf '\n%s\n\n' "--------------------------------------------------------------------------------"
  100.  
  101.     # Ask user for desired gameplay
  102.     read -r -p 'Enter gameplay mod (vanilla, lite, casual, d4v, babel, hd... - leave blank for vanilla+):'$'\n> ' gameplay
  103.  
  104.     case "$gameplay" in
  105.         hd|uas|hdtest|uastest|yeehaw|hdlite|uaslite|hdstock)
  106.             unset config_file
  107.             config_file="$config_path/hd_gzdoom.ini"
  108.             [[ $map == 'dotb.zip' ]] && autopatch='hd_dotb_patch.pk3 newrange'
  109.             [[ $map == 'ashes' ]] && autopatch='asheshdbarrelfix.pk3 newrange'
  110.             [[ $gameplay != 'hdstock' && -z $autopatch ]] && autopatch='newrange'
  111.             ;;&
  112.         hd)
  113.             extra=( 'lights.pk3' 'brightmaps.pk3' 'fancyworld_v2.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' 'vanilla44rc2.pk3' 'hideous_destructor' 'hellscape-navigator' 'zradar' 'hd_nvshader.pk3' 'hd_insurgencysfx.pk3' 'hd_pandorasbox.pk3' 'hd_taunt.pk3' 'hd_title_lite' 'darkdoomz' 'autoautosave' 'levelinfo.pk3' 'universalgibs' 'customlib&boss.zip' )
  114.             printf '\n%s' "<Hideous Destructor> + submod list have been selected"
  115.             ;;
  116.         uas)
  117.             extra=( 'lights.pk3' 'brightmaps.pk3' 'fancyworld_v2.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' 'vanilla44rc2.pk3' 'hideous_destructor' 'ugly_as_sin' 'hellscape-navigator' 'zradar' 'hd_nvshader.pk3' 'hd_insurgencysfx.pk3' 'hd_pandorasbox.pk3' 'hd_taunt.pk3' 'hd_title_lite' 'darkdoomz' 'autoautosave' 'levelinfo.pk3' 'universalgibs' 'customlib&boss.zip' )
  118.             printf '\n%s' "<Hideous Destructor> + <Ugly as Sin> have been selected"
  119.             ;;
  120.         hdtest)
  121.             extra=( 'lights.pk3' 'brightmaps.pk3' 'fancyworld_v2.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' 'vanilla44rc2.pk3' 'hideous_destructor' 'hellscape-navigator' 'zradar' 'hd_nvshader.pk3' 'hd_insurgencysfx.pk3' 'hd_pandorasbox.pk3' 'hd_taunt.pk3' 'hd_title_lite' 'darkdoomz' 'autoautosave' 'levelinfo.pk3' 'universalgibs' 'customlib&boss.zip' )
  122.             printf '\n%s' "<Hideous Destructor> + submod list have been selected"
  123.             ;;
  124.         uastest)
  125.             extra=( 'lights.pk3' 'brightmaps.pk3' 'fancyworld_v2.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' 'vanilla44rc2.pk3' 'hideous_destructor' 'ugly_as_sin' 'hellscape-navigator' 'zradar' 'Aces_HD_Addon.pk3' 'hd_taunt.pk3' 'hd_title_lite' 'darkdoomz' 'autoautosave' 'levelinfo.pk3' 'universalgibs' 'customlib&boss.zip' )
  126.             printf '\n%s' "<Hideous Destructor> + <Ugly as Sin> have been selected"
  127.             ;;
  128.         yeehaw)
  129.             extra=( 'lights.pk3' 'brightmaps.pk3' 'fancyworld_v2.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' 'vanilla44rc2.pk3' 'hideous_destructor' 'ugly_as_sin' 'fistful' 'hellscape-navigator' 'zradar' 'hd_nvshader.pk3' 'hd_insurgencysfx.pk3' 'hd_pandorasbox.pk3' 'hd_taunt.pk3' 'hd_title_lite' 'darkdoomz' 'autoautosave' 'levelinfo.pk3' 'universalgibs' 'customlib&boss.zip' 'yeehaw' )
  130.             printf '\n%s' "<Hideous Destructor> + submod list have been selected"
  131.             ;;
  132.         hdlite)
  133.             extra=( 'lights.pk3' 'brightmaps.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' 'vanilla44rc2.pk3' 'hideous_destructor' 'hellscape-navigator' 'zradar' 'hd_nvshader.pk3' 'hd_pandorasbox.pk3' 'hd_taunt' 'hd_title_lite' 'darkdoomz' 'autoautosave' 'levelinfo.pk3' 'universalgibs' 'customlib&boss.zip' )
  134.             printf '\n%s' "<Hideous Destructor> + lite submod list have been selected"
  135.             ;;
  136.         uaslite)
  137.             extra=( 'lights.pk3' 'brightmaps.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' 'vanilla44rc2.pk3' 'hideous_destructor' 'ugly_as_sin' 'hellscape-navigator' 'zradar' 'hd_nvshader.pk3' 'hd_pandorasbox.pk3' 'hd_taunt' 'hd_title_lite' 'darkdoomz' 'autoautosave' 'levelinfo.pk3' 'universalgibs' 'customlib&boss.zip' )
  138.             printf '\n%s' "<Hideous Destructor> + lite submod list have been selected"
  139.             ;;
  140.         hdstock)
  141.             extra=( 'lights.pk3' 'brightmaps.pk3' 'hideous_destructor' )
  142.             printf '\n%s' "<Hideous Destructor> has been selected"
  143.             ;;
  144.         d4t)
  145.             extra=( 'lights.pk3' 'brightmaps.pk3' 'fancyworld_v2.pk3' 'spriteshadow19.pk3' 'd4t21_cse_main.pk3' 'd4t21_cse_addons.pk3' 'd4_ost.zip' )
  146.             printf '\n%s' "<Death4Told> + submods have been selected"
  147.             ;;
  148.         d4v)
  149.             extra=( 'lights.pk3' 'brightmaps.pk3' 'fancyworld_v2.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' 'healthwarning.pk3' 'vanilla44rc2.pk3' 'dmgdirov.pk3' 'damnums.pk3' 'targetspy112.pk3' 'precise_crosshair14.pk3' 'd4v' 'fullscrn_huds' 'universalgibs' )
  150.             printf '\n%s' "<Doom4Vanilla> + submods have been selected"
  151.             ;;
  152.         *)
  153.             [[ $iwad == 'doomu' ]] && prepatch='d1_sprite_fix19'
  154.             [[ $iwad == 'doom_complete.pk3' || $iwad == 'tnt' || $iwad == 'plutonia' || $iwad == 'doom2' ]] && prepatch='d2_sprite_fix19'
  155.             ;;&
  156.         vanilla)
  157.             extra=( 'lights.pk3' 'brightmaps_plus.pk3' 'vanilla44rc2.pk3' 'fullscrn_huds' 'lostsoul_nokill' )
  158.             printf '\n%s' "<Vanilla> has been selected."
  159.             ;;
  160.         lite)
  161.             extra=( 'lights.pk3' 'brightmaps_plus.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' 'healthwarning.pk3' 'vanilla44rc2.pk3' 'fullscrn_huds' 'dmgdirov.pk3' 'targetspy112.pk3' 'precise_crosshair14.pk3' 'universalgibs' 'lostsoul_nokill' )
  162.             printf '\n%s' "<Lite> has been selected."
  163.             ;;
  164.         casual)
  165.             extra=( 'lights.pk3' 'brightmaps_plus.pk3' 'fancyworld_v2.pk3' 'spriteshadow19.pk3' 'doomsfx' 'caulkpc.pk3' 'footsteps.pk3' 'healthwarning.pk3' 'perk_enhanced' 'vanilla44rc2.pk3' 'fullscrn_huds' 'dmgdirov.pk3' 'damnums.pk3' 'targetspy112.pk3' 'precise_crosshair14.pk3' 'darkdoomz' 'autoautosave' 'universalgibs' )
  166.             printf '\n%s' "<Casual> has been selected."
  167.             ;;
  168.         '')
  169.             extra=( 'lights.pk3' 'brightmaps_plus.pk3' 'spriteshadow19.pk3' 'doomsfx' 'caulkpc.pk3' 'footsteps.pk3' 'healthwarning.pk3' 'perk_enhanced' 'vanilla44rc2.pk3' 'fullscrn_huds' 'dmgdirov.pk3' 'damnums.pk3' 'targetspy112.pk3' 'precise_crosshair14.pk3' 'universalgibs' 'lostsoul_nokill' )
  170.             printf '\n%s' "No option has been selected. This is vanilla+"
  171.             ;;
  172.         babel)
  173.             extra=( 'lights.pk3' 'brightmaps_plus.pk3' 'fancyworld_v2.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' 'babel.pk3' 'fullscrn_huds' 'dmgdirov.pk3' 'damnums.pk3' 'targetspy112.pk3' 'precise_crosshair14.pk3' 'universalgibs' )
  174.             printf '\n%s' "<Babel> has been selected. This is Babel + submods"
  175.             ;;
  176.         drifter)
  177.             extra=( 'lights.pk3' 'brightmaps_plus.pk3' 'fancyworld_v2.pk3' 'spriteshadow19.pk3' 'doomsfx' 'caulkpc.pk3' 'healthwarning.pk3' 'high_noon_drifter.pk3' 'dmgdirov.pk3' 'damnums.pk3' 'targetspy112.pk3' 'precise_crosshair14.pk3' 'universalgibs' )
  178.             printf '\n%s' "<Drifter> has been selected. This is High Noon Drifter + submods"
  179.             ;;
  180.         *)
  181.             extra=( 'lights.pk3' 'brightmaps_plus.pk3' 'fancyworld_v2.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' "$gameplay" 'universalgibs' )
  182.             printf '\n%s' "<$gameplay> has been selected. This is $gameplay + some submods"
  183.             ;;
  184.     esac
  185.  
  186.     # Show available Cosmetic WADs
  187.     printf '\n%s\n' "--------------------------------------------------------------------------------"
  188.     printf '\n\e[1m%s\e[0m\n' "PWADS/Cosmetic"
  189.     ls --color -F "$pwad_path/Cosmetic"
  190.     printf '\n%s\n\n' "--------------------------------------------------------------------------------"
  191.  
  192.     # Ask user for desired music
  193.     read -r -p 'Enter music addon (juke, term, xpack, floppy, synth, plutmidi - leave blank for none):'$'\n> ' music
  194.  
  195.     # Load selected music pack, if any
  196.     case "$music" in
  197.         '')
  198.             printf '\n%s' "No music addon has been selected"
  199.             ;;
  200.         juke)
  201.             musicaddon='j-jukebox-v9.pk3'
  202.             printf '\n%s' "Jimmy's Jukebox has been selected"
  203.             ;;
  204.         term)
  205.             musicaddon='term_midi35.pk3'
  206.             printf '\n%s' "<Now That's What I Call MIDI!> has been selected"
  207.             ;;
  208.         xpack)
  209.             musicaddon='term_xpack.pk3'
  210.             printf '\n%s' "Expansion Pack to <Now That's What I Call MIDI!> has been selected"
  211.             ;;
  212.         floppy)
  213.             musicaddon='floppydisk_midi.zip'
  214.             printf '\n%s' "<A Floppy Disk Full of MIDI Files> has been selected"
  215.             ;;
  216.         synth)
  217.             musicaddon='synthdoom.pk3'
  218.             printf '\n%s' "<SynthDoom> has been selected"
  219.             ;;
  220.         plutmidi)
  221.             musicaddon='plutmidi'
  222.             printf '\n%s' "<Plutmidi> has been selected"
  223.             ;;
  224.         *)
  225.             printf '\n%s' "Warning: Music pack not recognized. Continuing..."
  226.             ;;
  227.     esac
  228.  
  229.     # If WAD is using custom sprites, and no compat patch is available, make sure brightmaps_plus isn't loaded
  230.     #case "$map" in
  231.         # Add WADs that you know use custom sprites here
  232.     #    name_here)
  233.     #        extra=("${extra[@]/brightmaps_plus/brightmaps}")
  234.     #        printf '\n%s' "brightmaps_plus replaced with default brightmaps"
  235.     #        ;;
  236.     #esac
  237. fi
  238.  
  239. # Ask user for final mods or cvars
  240. printf '\n%s\n\n' "--------------------------------------------------------------------------------"
  241. read -r -p 'Enter any final mods you want on top of the preset (leave blank for none):'$'\n> ' -a finalpatch
  242. read -r -p 'Enter mapname followed by additional cvars (leave blank for none):'$'\n> ' -a cvars_raw
  243. [[ -n "${cvars_raw[*]}" ]] && cvars=( '+skill' '3' '+map' "${cvars_raw[*]}" )
  244. #cvars=( '+sv_killbossmonst' '1' '+skill' '3' '+map' "${cvars_raw[*]}" )
  245.  
  246. # Start GZDoom with the selected variables
  247. gzd_arguments=( '-iwad' "$iwad" '-config' "$config_file" '-file' "$prepatch" "$map" "$postpatch" "${extra[@]}" "$musicaddon" "$autopatch" "${finalpatch[@]}" "${cvars[@]}" )
  248.  
  249. printf '\n%s\n' "--------------------------------------------------------------------------------"
  250. printf '\n%s' "iwad=[$iwad]" "config=[$config_file]" "prepatch=[$prepatch]" "map=[$map]" "postpatch=[$postpatch]" "extra=[${extra[*]}]" "musicaddon=[$musicaddon]" "autopatch=[$autopatch]" "finalpatch=[${finalpatch[*]}]" "cvars=[${cvars[*]}]"
  251. printf '\n\n\e[1m%s\e[0m\n' "Launching..."
  252. printf '\n%s ' "gzdoom ${gzd_arguments[*]}"
  253. printf '\n\n%s\n' "--------------------------------------------------------------------------------"
  254. ~/Vidya/Native/Doom/gzdoom_build/gzdoom/build/gzdoom "${gzd_arguments[@]}"
  255.  
  256. # Copyright 2019 PhysixCat
  257.  
  258. # Licensed under the Apache License, Version 2.0 (the "License");
  259. # you may not use this file except in compliance with the License.
  260. # You may obtain a copy of the License at
  261.  
  262. # http://www.apache.org/licenses/LICENSE-2.0
  263.  
  264. # Unless required by applicable law or agreed to in writing, software
  265. # distributed under the License is distributed on an "AS IS" BASIS,
  266. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  267. # See the License for the specific language governing permissions and
  268. # limitations under the License.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top