Forums

[Script] GOG.com - Treasure Adventure Game

Auteur Réponses
MageJohn Mercredi 19 Février 2014 à 20:27
MageJohn

This is a script to install Treasure Adventure Game (TAG), from GOG.com. This is my first script, so I based it off of some other GOG.com scripts.
The only nonstandard thing it does is edit TAGs config file so it runs fullscreen, because otherwise it looks wierd. It's perfectly playable without this, but it looks much nicer to have it fullscreen.

By the way, how do I include the images in the installer before it becomes official and they can be downloaded from the server?

Any pointers as to how to improve it would be gratefully recieved!

[code language=playonlinux]
#!/bin/bash
# Date : (2014-2-19 17-40)
# Last revision : (2014-2-19 17-40)
# Wine version used : 1.7.9
# Distribution used to test : Ubuntu 13.10
# Author : MageJohn
# Script licence : GPL v.2
# Depend : None
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

GOGID="treasure_adventure_game"
PREFIX="TreasureAdventureGame_gog"
WORKING_WINE_VERSION="1.7.9"

TITLE="GOG.com - Treasure Adventure Game"
SHORTCUT_NAME="Treasure Adventure Game"

POL_SetupWindow_Init
POL_Debug_Init

POL_SetupWindow_presentation "$TITLE" "Robit Studios" "http://www.robitstudios.com/" "MageJohn" "$PREFIX"

POL_Call POL_GoG_setup "$GOGID" "7539c85cb8026b5ca87c2a985c7549d8"
 
POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"

POL_Call POL_GoG_install

# This line makes sure that the game has the proper resolution.
# Without it, it starts in a kind of windowed mode, but without decoration.
# It just changes on line of the config.ini file.
sed -i "21s/.*/Selected Resolution=0/" "$GOGROOT/Treasure Adventure Game/config.ini"

POL_Shortcut "treasure_adventure_game_1.0.exe" "$SHORTCUT_NAME"
 
POL_SetupWindow_Close

exit
[/code]

Images:

left.png
[IMG]http://i.imgur.com/xK5pr8O.png[/IMG]

top.png
[IMG]http://i.imgur.com/NdTYNLM.png[/IMG]

22x22 icon
[IMG]http://i.imgur.com/bmekIr5.png[/IMG]

48x48 icon
[IMG]http://i.imgur.com/tdbPAFE.png[/IMG]

MageJohn
petch Mercredi 19 Février 2014 à 21:26
petch

Hi MageJohn,
Not much to say about your script, beside maybe some warning about sed for PlayOnMac compatibility (BSD sed can be significantly different from GNU one).

Anyway I tried it, and it worked much better than it used to (https://github.com/petchema/playonlinux/wiki/Treasure-Adventure-Game)
Speed seems to vary significantly, and the crashed when exiting, but the display is now correct.

It would be great to have access to the setup program too, because on, say, an azerty keyboard, half of the control buttons are in weird locations
If you want an example of script that uses a configurator just to run a setup program, you can have a look at, say, the Broken Sword 3 script (l. 58-70):
http://www.playonmac.com/en/source-1102-GOGcom__Broken_Sword_3_The_Sleeping_Dragon.html
Hope it helps!
Pierre.

Edité par petch

MageJohn Samedi 22 Février 2014 à 14:42
MageJohn

Hey petch!

Thanks for the reply. I'd spent so much time on the installer I hadn't noticed the crashes! They don't seem to follow much of a pattern. Sometimes it crashes on first input, sometimes immediately on opening, and sometimes on quit. However, most of the time it appears to be perfectly playable, luckily. I've attempted it with different versions of wine, but unfortunately, they don't seem to have any effect. Either that, or the resolution is broken.

I'll look into the configurator. How does it work? I haven't encountered it before.
petch Samedi 22 Février 2014 à 17:44
petch

I'll look into the configurator. How does it work? I haven't encountered it before.

Quote from MageJohn


The install script has to write a configurator script associated with shortcut; This will create an extra button in the General tab to launch it:


One difficulty is that those are themselves PlayOnLinux style scripts, so you have to be careful with quoting to prevent, say, all variables of the configurator script from being immediately evaluated in the install script.
Easiest way to get started is to look at some examples.

Edité par petch

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 dmcayonlinux.com