The forum

[Script] Baldur's Gate Enhanced

(Steam version)

Author Replies
kweepeer2 Monday 21 October 2013 at 21:49
kweepeer2Anonymous

Hello. A friend of mine gave me this game as a gift on Steam, sadly couldn't play it on Linux, so I made this script. May be useful to some of you (or if interesting enough to include it in repository, I can submit it). Mind, this is only for the steam version, I don't have any other versions.

#!/bin/bash
# Date : (2013-10-14 21:12)
# Last revision : (2013-10-14 21:12)
# Wine version used : 1.6
# Distribution used to test : Ubuntu 13.04 x64
# Author : kweepeer (Used Alien Swarm script by Ruzvenbis as template)

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TITLE="Baldur's Gate: Enhanced Edition"
PREFIX="BGEE"
WORKING_WINE_VERSION="1.6"
 
EDITOR="Overhaul Games"
GAME_URL="http://store.steampowered.com/app/228280/"
AUTHOR="kweepeer"
GAME_VMS="64"
 
# Starting the script
POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "$TITLE"
POL_SetupWindow_Init
POL_Debug_Init
 
#POL_SetupWindow_SetID xxxx ##TODO
 
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
 
# Setting prefix path
POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
 
POL_SetupWindow_message "$(eval_gettext 'When $TITLE download by Steam is finished,\nDo NOT click on Play.\n\nClose COMPLETELY the Steam interface, \nso that the installation script can continue')" "$TITLE"
 
# Installing mandatory dependencies
POL_Call POL_Install_steam
 
# Begin game installation
cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Steam" || exit 1
POL_Wine "steam.exe" steam://install/228280
POL_Wine_WaitExit "$TITLE"

# Asking about memory size of graphic card
POL_SetupWindow_VMS $GAME_VMS
 
# Making shortcut
POL_Shortcut "steam.exe" "$TITLE" "$TITLE.png" "steam://rungameid/228280"
 
POL_SetupWindow_Close
exit 0

Edited by kweepeer2

petch Monday 21 October 2013 at 22:07
petch

Hi,
The script looks good enough, there's not much to say about it actually.
The only thing I can think of, is that you should never need both POL_Wine_WaitBefore and POL_Wine_WaitExit around a single POL_Wine call.
Both commands are actually very similar, in that they display some kind of "some program is running, please wait" message. The difference is that POL_Wine_WaitExit then also waits for Wine to finish.
So, if you're running a synchronous (blocking) POL_Wine command, you must use POL_Wine_WaitBefore so that the waiting message is around while the command is running.
If you're running an asynchronous command (non blocking) like when using POL_Wine start /unix (but it sometimes happens without that), then using POL_Wine_WaitExit is sufficient.
You can use both, so that the message really starts before the command starts, but usually the command gives the control back so fast that it doesn't really make any visible difference to the user.
At least it doesn't hurt to use both ;)
kweepeer2 Monday 21 October 2013 at 22:59
kweepeer2Anonymous

Thanks for great explanation petch, I modified it ;) Cheers.
drewy Saturday 28 December 2013 at 1:22
drewyAnonymous

while for some reason this did not work for me, i used this script, a slightly modified version of the system shock 2 (steam) script provided by ruzvan:

[code language=playonlinux]
#!/bin/bash
# Date : (2013-12-27 01-13)
# Last revision : (2013-12-27 01-13)
# Wine version used : 1.7.8
# Distribution used to test : Linux Ubuntu 12.04 LTS x64
# Author : drewy
 
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TITLE="Baldurs Gate Enhanced Edition (Steam)"
PREFIX="BGEE"
WORKING_WINE_VERSION="1.7.8"
EDITOR="Overhaul Games"
GAME_URL="http://baldursgate.com/"
AUTHOR="drewy"
GAME_VMS="256"
 
# Starting the script
POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "$TITLE"
POL_SetupWindow_Init
POL_Debug_Init
 
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
 
# Setting prefix path
POL_Wine_SelectPrefix "$PREFIX"
 
# Downloading wine if necessary and creating prefix
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
 
# Installing mandatory dependencies
POL_Call POL_Install_steam
 
# Begin game installation
POL_SetupWindow_menu "$(eval_gettext 'You want install with ?')" "$TITLE" "$(eval_gettext 'Download on Steam Store-Steam Backup Restore')" "-"
 
if [ "$APP_ANSWER" = "$(eval_gettext 'Download on Steam Store')" ]; then
    cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Steam"
    POL_Wine "steam.exe" steam://install/228280
    POL_SetupWindow_message "$(eval_gettext 'When $TITLE download by Steam is finished,\nDo NOT click on Play.\n\nClose COMPLETELY the Steam interface, \nso that the installation script can continue.')" "$TITLE"
    POL_Wine_WaitExit "$TITLE"
else
    cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Steam"
    POL_Wine "steam.exe"
    POL_SetupWindow_message "$(eval_gettext 'When $TITLE Restore by Steam is finished,\nDo NOT click on Play.\n\nClose COMPLETELY the Steam interface, \nso that the installation script can continue.')" "$TITLE"
    POL_Wine_WaitExit "$TITLE"
fi
 
# Asking about memory size of graphic card
POL_SetupWindow_VMS "$GAME_VMS"
 
# Making shortcut
POL_Shortcut "bgee.exe" "$TITLE"
 
POL_SetupWindow_Close
exit 0
[/code]

edit: any hints as to why the forum steals my linebreaks? c&p'ing from nano (don't use chrome and read the stickies) :)


Edited by drewy

petch Saturday 28 December 2013 at 10:20
petch

while for some reason this did not work for me

Quote from drewy


Most likely just the Wine version, Steam now only works with Wine 1.7.8+

This site allows content generated by members, and we promptly remove any content that infringes copyright according to our Terms of Service. To report copyright infringement, please send a notice to dmca-notice@playonlinux.com