Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # GZDoom launching script
- # Author: PhysixCat
- # This is a bash script for easy launching of GZDoom on GNU/Linux or Mac
- # It allows you to select combos of WADs without much regard for load order
- # This script assumes that the user has the DOOM Complete Wadsmoosh
- # This comes included in my retro FPS repository
- # https://mega.nz/#F!GtEQTISJ!CCJGyPEEEsZasc1PMXicUA
- # If the original WADs are preferred, just default to them in the script
- # --------------------------------------------------------------------------------
- # User should change these to their own Doom directory
- iwad_path="$HOME/Vidya/Native/Doom/IWADS"
- pwad_path="$HOME/Vidya/Native/Doom/PWADS"
- config_path="$HOME/.config/gzdoom"
- config_file="$config_path/gzdoom.ini"
- # If using a dev build, specify path
- gzd_path="$HOME/Vidya/Native/Doom/gzdoom_build/gzdoom/build/gzdoom"
- [[ -z "$gzd_path" ]] && gzd_path="gzdoom"
- # Show available PWADS/IWADS
- printf '\e[1m%s\e[0m\n' "GZDoom launching script"
- printf '%s\n' "--------------------------------------------------------------------------------"
- printf '\n\e[1m%s\e[0m\n' "PWADS/Maps"
- ls --color -F -I 'in compendium' "$pwad_path/Maps"
- printf '\n\e[1m%s\e[0m\n' "PWADS/TotalConversions"
- ls --color -F "$pwad_path/TotalConversions"
- printf '\n\e[1m%s\e[0m\n' "IWADS/"
- ls --color -F -I 'doom_complete.pk3' -I 'voices.wad' "$iwad_path"
- printf '\n%s\n\n' "--------------------------------------------------------------------------------"
- # Ask user for desired map
- read -r -p 'Enter WAD to play (leave blank for DOOM Complete):'$'\n> ' map
- blacklist_tc=( 'ashes2063' 'blade_of_agony.pk3' 'golden_souls2.pk3' 'paranoid.pk3' 'pirates.zip' 'rekkr.zip' 'strange_aeons.pk3' 'wolfendoom.zip' 'aliens' )
- blacklist_iwad=( 'strife' 'heretic' 'hexen' 'hexdd' 'chex3' 'square.pk3' )
- blacklist_doom=( 'doom' 'doom2' 'tnt' 'plutonia' )
- case $map in
- strife|heretic|hexen|hexdd|freedoom1|freedoom2|chex3|square.pk3|doom|doom2|tnt|plutonia)
- iwad="$map"
- printf '\n%s' "Selected $iwad as IWAD"
- ;;
- masterlevels|nerve)
- iwad='doom2'
- ;;&
- sigil)
- iwad='doom'
- ;;&
- strife)
- prepatch='voices'
- ;;&
- heretic)
- prepatch='hr_sprite_fix10.zip'
- ;;&
- doom|doom2|tnt|plutonia|masterlevels|nerve|sigil)
- printf '\n%s' "The Doom Complete WADSmoosh already includes this..."
- ;;
- chex3|square.pk3)
- printf '\n%s' "It will be loaded without any additional PWADs"
- ;;
- strife|heretic|hexen|hexdd)
- extra=( 'fancyworld_v2.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' 'healthwarning.pk3' 'fullscrn_huds' 'dmgdirov.pk3' 'autoautosave' )
- printf '\n%s' "It will be loaded with some additional PWADs"
- ;;
- *)
- # This is the default IWAD. If you want another, just change it here
- iwad='doom_complete.pk3'
- #iwad='doom'
- #iwad='doom2'
- #iwad='freedoom2'
- #iwad='miniwad'
- #iwad=tnt
- ;;&
- ashes2063|blade_of_agony.pk3|golden_souls2.pk3|paranoid.pk3|pirates.zip|rekkr.zip|strange_aeons.pk3|wolfendoom.zip|aliens)
- printf '\n%s' "Using $map as PWAD. It is a total conversion" "It will be loaded with some additional PWADs"
- ;;
- esac
- [[ "$iwad" == "$map" ]] && unset map
- if [[ " ${blacklist_iwad[*]} " != *" $iwad "* && " ${blacklist_tc[*]} " != *" $map "* ]]; then
- # Report on assigned map, add postpatches
- case $map in
- '')
- if [[ " ${blacklist_doom[*]} " != *" $iwad "* ]]; then
- printf '\n%s' "No PWADs selected" "Defaulted to $iwad"
- fi
- ;;
- ayy|aaliens)
- map='aaliens'
- postpatch='d2_sprite_fix_aaliens'
- printf '\n%s' "Ancient Aliens by skillsaw"
- ;;
- sunlust)
- postpatch='d2_sprite_fix_sunlust'
- printf '\n%s' "Sunlust by Ribbiks & dannebubinga"
- ;;
- av)
- printf '%s\n' "Alien Vendetta"
- iwad='doom2'
- autopatch=( '-deh' 'AV.DEH' )
- ;;
- 64)
- map='consolation_64.pk3'
- printf '%s\n' "Doom 64 maps from Consolation Prize"
- ;;
- bootcamp)
- unset map
- finalpatch=( 'hd_bootcamp.zip' 'hd_bootcamp_voices.pk3' )
- ;;
- *)
- printf '\n%s' "Using $map as PWAD" "Using $iwad as IWAD"
- ;;
- esac
- printf '\n%s\n' "--------------------------------------------------------------------------------"
- # Show available gameplay WADs
- printf '\n\e[1m%s\e[0m\n' "PWADS/Gameplay"
- ls --color -F "$pwad_path/Gameplay"
- printf '\n%s\n\n' "--------------------------------------------------------------------------------"
- # Ask user for desired gameplay
- read -r -p 'Enter gameplay mod (vanilla, pretty, hd, babel... - leave blank for vanilla+):'$'\n> ' gameplay
- case "$gameplay" in
- hd|hdtest|hdold|hdlite|uas|yeehaw|sci|hdstock)
- unset config_file
- config_file="$config_path/hd_gzdoom.ini"
- [[ $map == 'dotb.zip' ]] && autopatch=( 'hd_dotb_patch.pk3' 'newrange' )
- [[ $map == 'ashes' ]] && autopatch=( 'asheshdbarrelfix.pk3' 'newrange' )
- #[[ $gameplay != 'hdstock' && -z $autopatch ]] && autopatch=( 'newrange' 'hd_bootcamp.zip' 'hd_bootcamp_voices.pk3' )
- [[ $gameplay != 'hdstock' && -z $autopatch ]] && autopatch=( 'newrange' )
- ;;&
- hd)
- 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' )
- printf '\n%s' "<Hideous Destructor> + normal submod list have been selected"
- ;;
- hdtest)
- 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' )
- printf '\n%s' "<Hideous Destructor> + normal submod list have been selected"
- ;;
- hdold)
- 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' )
- printf '\n%s' "<Hideous Destructor> + old submod list have been selected"
- finalpatch=( 'hd_physix_temp.pk3' )
- ;;
- hdlite)
- extra=( 'hideous_destructor' 'hd_insurgencysfx.pk3' 'hd_pandorasbox.pk3' 'hd_taunt.pk3' 'hd_title_lite' 'darkdoomz' 'customlibboss.zip' )
- printf '\n%s' "<Hideous Destructor> + lite submod list has been selected"
- ;;
- uas)
- 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' )
- printf '\n%s' "<Hideous Destructor> + normal submod list have been selected"
- ;;
- yeehaw)
- 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' )
- printf '\n%s' "<Hideous Destructor> + yeehaw have been selected"
- ;;
- sci)
- 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' )
- printf '\n%s' "<Hideous Destructor> + scientist have been selected"
- ;;
- hdstock)
- extra=( 'hideous_destructor' )
- printf '\n%s' "<Hideous Destructor> has been selected"
- ;;
- *)
- [[ $iwad == 'doom' ]] && prepatch=( 'd1_sprite_fix19' 'doomsfx' )
- [[ $iwad == 'doom_complete.pk3' || $iwad == 'tnt' || $iwad == 'plutonia' || $iwad == 'doom2' ]] && prepatch=( 'd2_sprite_fix19' 'doomsfx' )
- ;;&
- vanilla)
- extra=( 'brightmaps_plus.pk3' 'vanilla44rc2.pk3' 'fullscrn_huds' 'lostsoul_nokill' )
- printf '\n%s' "<Vanilla> has been selected."
- ;;
- '')
- extra=( 'brightmaps_plus.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' 'healthwarning.pk3' 'vanilla44rc2.pk3' 'fullscrn_huds' 'dmgdirov.pk3' 'universalgibs' 'lostsoul_nokill' )
- printf '\n%s' "No option has been selected. This is vanilla+"
- ;;
- pretty)
- 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' )
- printf '\n%s' "<Pretty> has been selected."
- ;;
- babel)
- extra=( 'brightmaps_plus.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' 'babel.pk3' 'fullscrn_huds' 'dmgdirov.pk3' 'universalgibs' )
- printf '\n%s' "<Babel> has been selected. This is Babel + submods"
- ;;
- drifter)
- extra=( 'brightmaps_plus.pk3' 'spriteshadow19.pk3' 'healthwarning.pk3' 'high_noon_drifter.pk3' 'dmgdirov.pk3' 'universalgibs' )
- printf '\n%s' "<Drifter> has been selected. This is High Noon Drifter + submods"
- ;;
- *)
- extra=( 'brightmaps_plus.pk3' 'spriteshadow19.pk3' 'footsteps.pk3' 'healthwarning.pk3' 'vanilla44rc2.pk3' 'fullscrn_huds' 'dmgdirov.pk3' "$gameplay" 'universalgibs' 'lostsoul_nokill' )
- printf '\n%s' "<$gameplay> has been selected. This is $gameplay + some submods"
- ;;
- esac
- # Show available Cosmetic WADs
- printf '\n%s\n' "--------------------------------------------------------------------------------"
- printf '\n\e[1m%s\e[0m\n' "PWADS/Cosmetic"
- ls --color -F "$pwad_path/Cosmetic"
- printf '\n%s\n\n' "--------------------------------------------------------------------------------"
- # Ask user for desired music
- read -r -p 'Enter music addon (juke, term, xpack, floppy, synth, plutmidi - leave blank for none):'$'\n> ' music
- # Load selected music pack, if any
- case "$music" in
- '')
- printf '\n%s' "No music addon has been selected"
- ;;
- juke)
- musicaddon='j-jukebox-v9.pk3'
- printf '\n%s' "Jimmy's Jukebox has been selected"
- ;;
- term)
- musicaddon='term_midi35.pk3'
- printf '\n%s' "<Now That's What I Call MIDI!> has been selected"
- ;;
- xpack)
- musicaddon='term_xpack.pk3'
- printf '\n%s' "Expansion Pack to <Now That's What I Call MIDI!> has been selected"
- ;;
- floppy)
- musicaddon='floppydisk_midi.zip'
- printf '\n%s' "<A Floppy Disk Full of MIDI Files> has been selected"
- ;;
- synth)
- musicaddon='synthdoom.pk3'
- printf '\n%s' "<SynthDoom> has been selected"
- ;;
- plutmidi)
- musicaddon='plutmidi'
- printf '\n%s' "<Plutmidi> has been selected"
- ;;
- *)
- printf '\n%s' "Warning: Music pack not recognized. Continuing..."
- ;;
- esac
- # If WAD is using custom sprites, and no compat patch is available, make sure brightmaps_plus isn't loaded
- #case "$map" in
- # Add WADs that you know use custom sprites here
- # name_here)
- # extra=("${extra[@]/brightmaps_plus/brightmaps}")
- # printf '\n%s' "brightmaps_plus replaced with default brightmaps"
- # ;;
- #esac
- fi
- # Ask user for final mods or cvars
- printf '\n%s\n\n' "--------------------------------------------------------------------------------"
- [[ -z $finalpatch ]] && read -r -p 'Enter any final mods you want on top of the preset (leave blank for none):'$'\n> ' -a finalpatch
- read -r -p 'Enter mapname followed by additional cvars (leave blank for none):'$'\n> ' -a cvars_raw
- [[ -n "${cvars_raw[*]}" ]] && cvars=( '+vid_fps' '1' '+skill' '3' '+map' "${cvars_raw[*]}" ) || cvars=( '+vid_fps' '1' )
- #cvars=( '+sv_killbossmonst' '1' '+skill' '3' '+map' "${cvars_raw[*]}" )
- # Start GZDoom with the selected variables
- gzd_arguments=( '-iwad' "$iwad" '-config' "$config_file" '-file' "${prepatch[@]}" "$map" "$postpatch" "${extra[@]}" "$musicaddon" "${autopatch[@]}" "${finalpatch[@]}" "${cvars[@]}" )
- printf '\n%s\n' "--------------------------------------------------------------------------------"
- printf '\n%s' "iwad=[$iwad]" "config=[$config_file]" "prepatch=[${prepatch[*]}]" "map=[$map]" "postpatch=[$postpatch]" "extra=[${extra[*]}]" "musicaddon=[$musicaddon]" "autopatch=[${autopatch[*]}]" "finalpatch=[${finalpatch[*]}]" "cvars=[${cvars[*]}]"
- printf '\n\n\e[1m%s\e[0m\n' "Launching..."
- printf '\n%s ' "gzdoom ${gzd_arguments[*]}"
- printf '\n\n%s\n' "--------------------------------------------------------------------------------"
- $gzd_path "${gzd_arguments[@]}"
- # Copyright 2020 PhysixCat
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- # http://www.apache.org/licenses/LICENSE-2.0
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
Add Comment
Please, Sign In to add comment