Ohne game/.godot/ (gitignored) sind die globalen class_name (Dice, Auftrag, Charakter) unbekannt: effect_runner.gd, game_state.gd und main.gd scheitern beim Parsen, die Autoloads starten nicht. spielen.sh importiert deshalb einmalig vor dem Start und startet dann. Die beiden Font-Atlas-.import-Dateien tragen jetzt importer="skip", wie font8_10_atlas.png schon vorher — die Texturseite eines Bitmap-Fonts wird nicht als eigene Textur importiert. Godot setzt das beim ersten Import ohnehin so, damit ist ein frischer Klon danach sauber.
30 lines
1.2 KiB
Bash
Executable file
30 lines
1.2 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Startet das Spiel. Godot liegt auf dieser Maschine nicht im PATH, sondern
|
|
# unter /opt/godot — das Skript findet beides.
|
|
set -euo pipefail
|
|
HIER="$(cd "$(dirname "$0")" && pwd)"
|
|
if [ -n "${GODOT:-}" ]; then
|
|
:
|
|
elif command -v godot >/dev/null 2>&1; then
|
|
GODOT="$(command -v godot)"
|
|
elif [ -x "/Applications/Godot.app/Contents/MacOS/Godot" ]; then
|
|
GODOT="/Applications/Godot.app/Contents/MacOS/Godot"
|
|
elif [ -x "/opt/godot/Godot_v4.7.2-stable_linux.x86_64" ]; then
|
|
GODOT="/opt/godot/Godot_v4.7.2-stable_linux.x86_64"
|
|
else
|
|
echo "Godot nicht gefunden. Setze GODOT=/pfad/zu/godot" >&2
|
|
exit 1
|
|
fi
|
|
# Frischer Klon / neue Maschine: ohne .godot/ fehlt der Cache der globalen
|
|
# class_name (Dice, Auftrag, Charakter …) — die Skripte scheitern dann schon
|
|
# beim Parsen. Einmal importieren, dann starten.
|
|
if [ ! -f "$HIER/game/.godot/global_script_class_cache.cfg" ]; then
|
|
echo "Erster Start: importiere Assets …" >&2
|
|
IMPORT_LOG="${TMPDIR:-/tmp}/taloria-import.log"
|
|
"$GODOT" --headless --path "$HIER/game" --import >"$IMPORT_LOG" 2>&1 || {
|
|
echo "Import fehlgeschlagen — siehe $IMPORT_LOG" >&2
|
|
exit 1
|
|
}
|
|
fi
|
|
|
|
exec "$GODOT" --path "$HIER/game" "$@"
|