2023-09-27 17:51:20 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Get the current user. This assumes you are running the script as the desired user.
|
|
|
|
USER=$(whoami)
|
|
|
|
|
2023-09-28 16:31:21 -04:00
|
|
|
|
|
|
|
echo $mapname
|
|
|
|
echo $bspname
|
2023-09-27 17:51:20 -04:00
|
|
|
#build the image
|
|
|
|
python timeatbuild.py
|
|
|
|
|
|
|
|
#move the build image
|
2023-09-27 20:31:07 -04:00
|
|
|
mv overlay_datetime_image.png textures/zombietextures_dev/overlay_datetime_image.png
|
2023-09-27 17:51:20 -04:00
|
|
|
|
2023-09-28 18:20:07 -04:00
|
|
|
|
|
|
|
# Loop through all .map files in the current directory
|
|
|
|
#for mapfile in *.map; do
|
|
|
|
# # The base name without extension can be derived using 'basename'
|
|
|
|
# base=$(basename "$mapfile" .map)
|
|
|
|
#
|
|
|
|
# # Convert .map to .bsp
|
|
|
|
# q3map2 -game xonotic -meta -patchmeta "$mapfile"
|
|
|
|
#
|
|
|
|
# # Ensure the .bsp file exists before converting to .obj
|
|
|
|
# if [[ -f "$base.bsp" ]]; then
|
|
|
|
# q3map2 -game xonotic -convert -format obj "$base.bsp"
|
|
|
|
# else
|
|
|
|
# echo "Error: $base.bsp does not exist!"
|
|
|
|
# fi
|
|
|
|
#done
|
|
|
|
for mapfile in *.map; do
|
|
|
|
q3map2 -game xonotic -convert -format obj -patchmeta -subdivisions 4 -readmap $mapfile
|
|
|
|
done
|
2023-09-28 16:31:21 -04:00
|
|
|
|
|
|
|
#move the map
|
2023-09-28 18:20:07 -04:00
|
|
|
mv *obj maps/
|
|
|
|
mv *mtl maps/
|
|
|
|
|
2023-10-04 18:51:05 -04:00
|
|
|
for mtl_file in maps/*mtl; do
|
2023-10-07 03:03:57 -04:00
|
|
|
sed -i '/newmtl textures\/zombietextures_dev\/tiles01_pink_clip/a d 0.0' "$mtl_file"
|
2023-10-04 18:51:05 -04:00
|
|
|
done
|
2023-10-08 02:59:28 -04:00
|
|
|
for mtl_file in maps/*mtl; do
|
|
|
|
sed -i '/newmtl textures\/zombietextures_tnhl\/fence01/a d 0.9' "$mtl_file"
|
|
|
|
done
|
|
|
|
for mtl_file in maps/*mtl; do
|
|
|
|
sed -i '/newmtl textures\/zombietextures_tnhl\/grate01/a d 0.9' "$mtl_file"
|
|
|
|
done
|
2023-09-28 18:20:07 -04:00
|
|
|
#delete bloat
|
|
|
|
#rm *srf
|
2023-09-28 16:31:21 -04:00
|
|
|
|
2023-09-27 17:51:20 -04:00
|
|
|
# Define the destination directory
|
|
|
|
DEST_DIR="/home/$USER/.xonotic/data/"
|
|
|
|
|
|
|
|
|
|
|
|
# Delete and copy zombietextures.pk3dir
|
2023-09-27 20:31:07 -04:00
|
|
|
if [ -d "../assets" ]; then
|
2023-09-27 17:51:20 -04:00
|
|
|
if [ -d "${DEST_DIR}zombietextures.pk3dir" ]; then
|
|
|
|
rm -r "${DEST_DIR}zombietextures.pk3dir"
|
|
|
|
fi
|
2023-09-27 20:31:07 -04:00
|
|
|
cp -r ../assets ${DEST_DIR}zombietextures.pk3dir
|
2023-09-27 17:51:20 -04:00
|
|
|
else
|
|
|
|
echo "Folder zombietextures.pk3dir not found!"
|
|
|
|
fi
|
|
|
|
|