The second instalment in the Aliens versus Predator game franchise, developed by Monolith. This game precedes the 2010 Aliens vs Predator game.
In terms of the script, you'll notice I'm using an ancient wine version. All the ones since 1.3.37 have ridiculously bad performance, as well as a menu glitch where certain lists of options become invisible if you mouse over them. 1.3.37 is buttery smooth and glitch-free. The disadvantages are a mouse bug and a lack of multi-monitor capability, fixed by maxing the in-game mouse smoothness setting, and turning on virtual desktop, respectively.
I've hand-rolled a resolution detection routine; I'm aware of POL_LoadVar_ScreenResolution, but it gives the wrong result on my multi-monitor setup (the total size of my virtual screen, not even considering the fact that some of the non-primary monitors are less tall than the primary). My script uses xrandr to get the primary monitor resolution, and if that doesn't work for whatever reason, asks the user. Let me know if that's too hacky.
#!/bin/bash
# Date : (2014-10-19T13:56Z)
# Last revision : (2014-10-19T13:56Z)
# Wine version used : 1.3.37
# Distribution used to test : Arch Linux
# Author : Alexander Borysov
# Script licence : GPLv3
# Program licence: Proprietary
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
TITLE="Aliens versus Predator 2"
PREFIX="AVP2"
POL_SetupWindow_Init
POL_Debug_Init
POL_SetupWindow_presentation "$TITLE" "Fox Interactive" "" "Alexander Borysov" "$PREFIX"
POL_Wine_SelectPrefix "$PREFIX"
POL_SetupWindow_wait "$(eval_gettext "Please wait while the wine prefix is created.")" "$TITLE"
POL_Wine_PrefixCreate "1.3.37"
POL_SetupWindow_InstallMethod "LOCAL,DVD"
if [ "$INSTALL_METHOD" = "DVD" ]; then
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "ALIEN.REZ"
POL_SetupWindow_message "$(eval_gettext "If prompted to install DirectX 8, click No")" "$TITLE"
POL_Wine_WaitBefore "$TITLE"
POL_Wine "$CDROM/Setup.exe"
elif [ "$INSTALL_METHOD" = "LOCAL" ]; then
POL_SetupWindow_browse "$(eval_gettext "Please select the setup file to run.")" "$TITLE"
POL_Wine_WaitBefore "$TITLE"
POL_Wine "$APP_ANSWER"
fi
# determine the user's resolution
RES_STR="$(xrandr -q | grep primary | grep -oE "[0-9]+x[^+]+")"
if [ "$RES_STR" = "" ]; then
# xrandr does not exist on the system
POL_SetupWindow_textbox "$(eval_gettext "What is the resolution of your primary monitor?")" "$TITLE" "1920x1080"
RES_STR="$APP_ANSWER"
fi
WIDTH=`echo "$RES_STR" | cut -d x -f 1`
HEIGHT=`echo "$RES_STR" | cut -d x -f 2`
Set_Desktop "On" "$WIDTH" "$HEIGHT"
Set_OS "win98"
POL_Wine_X11Drv "GrabFullscreen" "Y"
POL_Shortcut "AVP2.exe" "$TITLE" ""
# configure resolution
INSTALL_DIR="$(dirname "$(find_binary AVP2.exe)")"
AEX="$WINEPREFIX/drive_c/$INSTALL_DIR/autoexec.cfg"
sed -i "s/.*SCREENWIDTH.*/\"SCREENWIDTH\" \"$WIDTH\"/" "$AEX"
sed -i "s/.*SCREENHEIGHT.*/\"SCREENHEIGHT\" \"$HEIGHT\"/" "$AEX"
sed -i "s/.*GameScreenWidth.*/\"GameScreenWidth\" \"$WIDTH\"/" "$AEX"
sed -i "s/.*GameScreenHeight.*/\"GameScreenHeight\" \"$HEIGHT\"/" "$AEX"
# alas, the following step cannot be automated with sed
# the game rewrites the INPUTRATE variable on first start
POL_SetupWindow_message "$(eval_gettext "To get rid of the mouse issues, turn the mouse smoothing setting in the in-game controls up to full.")" "$TITLE"
POL_SetupWindow_Close
exit
Screenshots:
Aliens versus Predator-22x22.png
Aliens versus Predator-48x48.png
Unfortunately, there don't seem to be any passable top or left images around; even the official installer uses generic installation images.
Edited by Xenos5