Forums

[Script] GOG.com - Space Quest 1, 2, 3

Auteur Réponses
MindLikeWater Mardi 11 Mars 2014 à 1:11
MindLikeWater

Hi everybody!

I am completely new to PlayOnLinux, but in order to get most of my GOG collection up and running, I jumped right into creating my own script to install the GOG version of "Space Quest 1 - 3". I would be very happy to get a review, so I can improve on the script and hopefully get it approved! :-)

Best regards!

Script

[code language=playonlinux]
#!/bin/bash
# Date : (2014-03-10 22-22)
# Last revision : (2014-03-11 00-59)
# Wine version used : 1.4-dos_support_0.6
# Distribution used to test : Archlinux
# Author : Chris Top, mlw dot play at pi dot xelpara dot de
# Script licence : GPL v.2
# Program licence : Retail
# Depend :

# Note: This script is based on the install script for "Space Quest 4, 5, 6" by Pierre Etchemaite

[ -z "$PLAYONLINUX" ] && exit 0
source "$PLAYONLINUX/lib/sources"

GOGID="space_quest_1_2_3"
PREFIX="SpaceQuest123_gog"
WORKING_WINE_VERSION="1.4-dos_support_0.6"

TITLE="GOG.com - Space Quest 1, 2, 3"
SHORTCUT_NAME1="Space Quest 1: The Sarien Encounter"
SHORTCUT_NAME2="Space Quest 2: Vohaul's Revenge"
SHORTCUT_NAME3="Space Quest 3: The Pirates of Pestulon"

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_SetupWindow_SetID 1212
POL_Debug_Init

POL_SetupWindow_presentation "$TITLE" "Sierra / Activision" "http://www.gog.com/gamecard/$GOGID" "Chris Top" "$PREFIX"

POL_Call POL_GoG_setup "$GOGID" "80595875142fd25a6d088aa42809d193"

POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"

POL_Call POL_GoG_install


cd "$WINEPREFIX/drive_c/GOG Games/Space Quest 1-2-3" || POL_Debug_Fatal "Game not installed in standard path?"

SPACEQUEST1="SQ1"
SPACEQUEST2="SQ2"
SPACEQUEST3="SQ3"
mv "Space Quest 1" "$SPACEQUEST1"
mv "Space Quest 2" "$SPACEQUEST2"
mv "Space Quest 3" "$SPACEQUEST3"

POL_SetupWindow_VMS "1"

cat <<_EOFCFG_ >> "$WINEPREFIX/playonlinux_dos.cfg"
cpu_core=simple
cpu_cputype=386_slow
cpu_cycles=auto
render_aspect=true
render_frameskip=1
mixer_rate=22050
mixer_blocksize=2048
mixer_prebuffer=40
sblaster_sbtype=sb16
sblaster_sbbase=220
sblaster_irq=7
sblaster_dma=1
sblaster_hdma=5
sblaster_mixer=true
sblaster_oplmode=auto
sblaster_oplrate=22050
gus_gus=false
_EOFCFG_

POL_Shortcut "GOG Games/Space Quest 1-2-3/$SPACEQUEST1/SQ.COM" "$SHORTCUT_NAME1" "$SHORTCUT_NAME1.png" "" "Game;AdventureGame;"
POL_Shortcut_Document "$SHORTCUT_NAME1" "$WINEPREFIX/drive_c/GOG Games/Space Quest 1-2-3/$SPACEQUEST1/Manual.pdf"

POL_Shortcut "GOG Games/Space Quest 1-2-3/$SPACEQUEST2/SIERRA.COM" "$SHORTCUT_NAME2" "$SHORTCUT_NAME2.png" "" "Game;AdventureGame;"
POL_Shortcut_Document "$SHORTCUT_NAME2" "$WINEPREFIX/drive_c/GOG Games/Space Quest 1-2-3/$SPACEQUEST2/Manual.pdf"

POL_Shortcut "GOG Games/Space Quest 1-2-3/$SPACEQUEST3/SIERRA.COM" "$SHORTCUT_NAME3" "$SHORTCUT_NAME3.png" "" "Game;AdventureGame;"
POL_Shortcut_Document "$SHORTCUT_NAME3" "$WINEPREFIX/drive_c/GOG Games/Space Quest 1-2-3/$SPACEQUEST3/Manual.pdf"

POL_SetupWindow_Close

exit 0
[/code]

Images

left.png


top.png


22x22 icon


48x48 icons

petch Mardi 11 Mars 2014 à 7:10
petch
Développeur

Hi MindLikeWater,
Well, the script is very similar to the Space Quest 4+5+6 one, so if it works (can launch the games, read the docs,..) I don't have any comment about the script ;)

Regards;
Pierre.
MindLikeWater Mardi 11 Mars 2014 à 14:13
MindLikeWater

Ok, I submitted the script the script. But now I wonder: where and how can I upload the image files?
petch Mardi 11 Mars 2014 à 19:17
petch
Développeur

Hi,
I took care of pushing the gfx to the right places, and the script is now validated :)
MindLikeWater Mardi 11 Mars 2014 à 19:48
MindLikeWater

Hey petch,

thanks alot! I am really happy, now that I have the complete Space Quest saga up and running in a neat fashion on my Linux system! :)

I just have some final questions, so I understand the whole process of writing and submitting scripts better:

1. Would there have been a way for me to upload the pictures myself through the website? Or is this a "manual" task that only team members can perform?

2. What is the correct way of updating a validated script?

3. What is the purpose of the line "POL_SetupWindow_SetID 1972" in which I had to enter the script number?

4. And finally: I wondered, would it be possible / desirable to have the installers for SQ 1 - 3 and SQ 4 - 6 to put all games into a single wine prefix, called e.g. "SpaceQuestCollection_gog"? In the sense that both installers first check if this prefix already exist, and if so, use it instead of creating a new one?

Ok, so much for that! Now I will check which other games I have around, and maybe start the next script. ;-)

Best regards!

Edité par MindLikeWater

petch Mardi 11 Mars 2014 à 21:10
petch
Développeur

1. Would there have been a way for me to upload the pictures myself through the website? Or is this a "manual" task that only team members can perform?

Quote from MindLikeWater

They have to be downloaded to an FTP/S server, in the right place and under the right name, this is currently a manual operation.

2. What is the correct way of updating a validated script?

Quote from MindLikeWater

The system is currently lacking, only maintainers can update validated scripts.
So one way would be to require the script to be temporarily "unsigned" so you can edit it, then re-sign it. Not very friendly to users.
Another is to post some updated version in the forum, say in this very thread, and then a maintainer (probably me) will take care of the update.

3. What is the purpose of the line "POL_SetupWindow_SetID 1972" in which I had to enter the script number?

Quote from MindLikeWater

It's a small addition, at the bottom left of the window during installation you should now see a blue (i) icon that when clicked leads to the script page. Nothing critical.

4. And finally: I wondered, would it be possible / desirable to have the installers for SQ 1 - 3 and SQ 4 - 6 to put all games into a single wine prefix, called e.g. "SpaceQuestCollection_gog"? In the sense that both installers first check if this prefix already exist, and if so, use it instead of creating a new one?

Quote from MindLikeWater

Actually the PlayOnLinux policy is rather the other way around, one prefix per program, so the prefix can be independently tweaked or removed; But since GOG bundles the games, it's not really possible to do that.

Cheers,
Pierre.

Edité par petch

MindLikeWater Mardi 11 Mars 2014 à 21:18
MindLikeWater

Perfect, thank you for the insightful answers! :)