flathub / org.ioquake3.ioquake3

https://flathub.org/apps/details/org.ioquake3.ioquake3
0 stars 1 forks source link

Cant start ioquake3 when pak file names is not lower cased #2

Closed DeivAstra closed 1 week ago

DeivAstra commented 10 months ago

Hello,

I meet a problem. My quake3 files named in upper case, so I got error message "ioquake3 needs the official Quake 3...". For examples pak0.PAK3 or PAK0.PAK3 .. etc. In fact that quake3 ignores file names case, so I think that changing startup script is good deal.

I have modified ioquake3 bash script to avoid the problem and add some improvements. Hope that the fixed script will commited to upstream. Thanks a lot!

#!/bin/bash

# Copyright 2021 Mattias Bengtsson <mattias.jc.bengtsson@gmail.com>
# SPDX-License-Identifier: GPL-3.0-or-later

BASEQ3_HOME=${XDG_DATA_HOME}/baseq3

echo "BASEQ3_HOME = ${BASEQ3_HOME}"

function error-message {
    local pak_name=${1}
    cat << EOM
File ${pak_name} not found!

ioquake3 needs the official Quake 3 .pk3-files to function
properly (specifically baseq3/pak0.pk3 … baseq3/pak8.pk3).

One way to obtain these files is to buy Quake 3 Arena on
Steam, and extract the files from the installation directory.

Once you have obtained the files, copy them to:

    ${BASEQ3_HOME}/

… and restart ioquake3
EOM
}

# Ensure ioquake3 reaches our pak-files and configs.
ln -ns "${XDG_DATA_HOME}" "${HOME}/.q3a"

mkdir -p "${XDG_DATA_HOME}"/{baseq3,missionpack}

function check_pak_files_icase {
    for i in $(seq 0 8); do
        local pak_name="pak${i}.pk3"
        echo -n "Check ${pak_name} .. "
        if [[ -n $(find ${BASEQ3_HOME} -maxdepth 1 -iname ${pak_name}) ]]; then
            echo "OK";
        else
            echo "Not found!"
            show_error_dialog ${pak_name}
            exit 2
        fi
    done
}

function show_error_dialog {
    local pak_name=${1}
    zenity --error      \
           --width=400  \
           --height=200 \
           --text="$(error-message ${pak_name})"
}

check_pak_files_icase

/app/games/quake3/ioquake3 "${@}"
AsciiWolf commented 10 months ago

Good point. :) Thanks for reporting this.

DeivAstra commented 10 months ago

@AsciiWolf Also Quake 3 is not sold on the Steam platform. I found offer on the gog.com, https://www.gog.com/en/game/quake_iii_arena, but maybe better delete text about that - "One way to obtain these files is to buy Quake 3 Arena on Steam"

AsciiWolf commented 10 months ago

I see it on Steam: https://store.steampowered.com/app/2200/Quake_III_Arena/

DeivAstra commented 10 months ago

Steam region restrictions filtered offer for me ). Ok, then no problem there.