Forums

[Script] GOG.com - Personal Nightmare

Auteur Réponses
MindLikeWater Mardi 11 Mars 2014 à 23:26
MindLikeWater

Hi everybody!

Here is my second script attempt! This time, I chose the GOG version of Adventure Soft's "Personal Nightmare". I tested it successfully on my machine and would be happy about any comments! :)

Best regards!

Script

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

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

######################
#
#  Parameters
#
######################

# PlayOnLinux

TITLE="GOG.com - Personal Nightmare"
PREFIX="PersonalNightmare_gog"
WORKING_WINE_VERSION="1.4-dos_support_0.6"
POL_ID=4711    # Will be changed after upload

# GOG

GOG_ID="personal_nightmare"
GOG_MD5="fa7e91869a5ab191af892cfb5b169a43"

# Setup window

COMPANY="Horrorsoft / Adventure Soft"
PUBLISHER_HOMEPAGE="http://www.gog.com/gamecard/$GOG_ID"
SCRIPT_AUTHOR="MindLikeWater"

# Installation details

SHORTCUT_NAME="Personal Nightmare"
SHORTCUT_CATEGORY="Game;AdventureGame;"
INSTALL_DIR="GOG Games/Personal Nightmare"
EXECUTABLE="Test.exe"   # Yes, that is the name they used...
MANUAL="manual.pdf"

######################
#
#  Installation
#
######################

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 $POL_ID
POL_Debug_Init

POL_SetupWindow_presentation \
   "$TITLE" \
   "$COMPANY" \
   "$PUBLISHER_HOMEPAGE" \
   "$SCRIPT_AUTHOR" \
   "$PREFIX"

POL_Call POL_GoG_setup "$GOG_ID" "$GOG_MD5"

POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"

POL_Call POL_GoG_install

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 \
   "$INSTALL_DIR/$EXECUTABLE" \
   "$SHORTCUT_NAME" \
   "$SHORTCUT_NAME.png" \
   "" \
   "$SHORTCUT_CATEGORY"

POL_Shortcut_InsertBeforeWine \
   "$SHORTCUT_NAME" \
   "export SDL_VIDEO_X11_DGAMOUSE=0"

POL_Shortcut_Document \
   "$SHORTCUT_NAME" \
   "$WINEPREFIX/drive_c/$INSTALL_DIR/$MANUAL"

POL_SetupWindow_Close

exit 0
[/code]

Images

left.png


top.png


22x22 icon


48x48 icons

petch Mercredi 12 Mars 2014 à 20:17
petch
Développeur

Hi,

The script looks ok.
I'm not totally convinced that putting everything into variables really does improve readability in this case, but that's rather a matter of taste...
MindLikeWater Mercredi 12 Mars 2014 à 21:04
MindLikeWater

I guess I am still trying to find my "style" ;-) I wanted to make the script a bit more readable, and clean it up in such a way that I can use it as a kind of template for similar games. Not sure if this is the holy grail already, but I keep on trying! ;-)

Here are some screenshots, which I forgot to supply:

Screen 1
Screen 2
Screen 3
Screen 4

Also, I uploaded the script to the website.

Best regards!

Edité par MindLikeWater

petch Mercredi 12 Mars 2014 à 23:02
petch
Développeur