Forum

[SCRIPT] Heart Of Darkness

PC Game - Side Scroller Action

Författare Svar
lil_stenly Sunday 4 July 2010 at 20:52
lil_stenly

I think I finish it, still I may messed up something.

#!/bin/bash

# INFO

# Tested on: Linux
# Distributor ID: Ubuntu
# Release: 9.04
# Codename: Jaunty Jackalope
# Linux kernel: 2.6.28.19 - generic
# PlayOnLinux: 3.8
# WineHQ: 1.2
# Status: Working

# Presentation
TITLE="Heart Of Darkness"
CREATORS="Amazing Studio"
TITLESITE="This product no longer have a website!"
SCRIPTAUTHOR="LiL_Stenly"
# Prefix
PREFIX="HOD"
WVERSION="1.2"
# Set cd or dir
FINDINS="HeartOfDarkness.exe"
# Executables and names
TITLEEXE="HODWin32.exe"
TITLENAME="Heart Of Darkness"
# Icon and images
IMGLEFT="http://i207.photobucket.com/albums/bb127/LiL_Stenly/HOD/HODLeft.png"
IMGTOP="http://i207.photobucket.com/albums/bb127/LiL_Stenly/HOD/HODTop.png"
LOADLEFT="$REPERTOIRE/tmp/HODLeft.png"
LOADTOP="$REPERTOIRE/tmp/HODTop.png"
IMGTMP="$REPERTOIRE/tmp"
# Messages
WARN="PLEASE READ CAREFULLY!"
WARNTEXT="In the next window you will have to point \\nthe CD or Installation directory \\nthat contains $FINDINS file! \\n\\nAfter that installation will continue in silent mode! \\n\\nThank you for your attention! \\n\\nLiL_Stenly"
MSGINS="Now installing... "
MSG="Read Me (Full installation information)!"
MSGTEXT="Do you want to start '$TITLENAME' without disc? \\nThen in the next window choose *YES* \\nto make full installation of $TITLENAME \\nand that script will copy the $TITLENAME \\nneeded files from the disk to your computer! \\n\\nOtherwise you can also run the $TITLENAME with cd in your drive! \\n\\nLiL_Stenly"
INSMSG="You continued in normal installation!"
INSMSGTEXT="You will have to run $TITLENAME with disc in your drive!"

# Check
if [ "$PLAYONLINUX" = "" ]; then
   exit 0
fi

# Loading sources
source "$PLAYONLINUX/lib/sources"

# Initalization
cd $IMGTMP
rm {HODLeft,HODTop}.png
wget {"$IMGLEFT","$IMGTOP"}
POL_SetupWindow_Init "$LOADTOP" "$LOADLEFT" 

# Welcome policy window
POL_SetupWindow_presentation "$TITLE" "$CREATORS" "$TITLESITE" "$SCRIPTAUTHOR" "$PREFIX"

# Show warning message
POL_SetupWindow_message "$WARNTEXT" "$WARN"

# Checking for existing installer
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "$FINDINS"

# Setup new prefix
select_prefix "$REPERTOIRE/wineprefix/$PREFIX/"

# Installing compatible wine version
POL_SetupWindow_install_wine "$WVERSION"
Use_WineVersion "$WVERSION"

# Creating the prefix
POL_SetupWindow_prefixcreate

# Load Program files variable
POL_LoadVar_PROGRAMFILES

# Starting the installer
POL_SetupWindow_wait_next_signal "$MSGINS" "$TITLE"
cd "$CDROM"
wine "$FINDINS" /SILENT
POL_SetupWindow_detect_exit

# Setting up window resolution
Set_Desktop On 800 600

# Setting up windows version
Set_OS "Win95"

# Instructions
POL_SetupWindow_message "$MSGTEXT" "$MSG"

# Full installation option
POL_SetupWindow_menu "Do you want to make full installation?" "$TITLE" "YES! NO!" " "

# Copy movie file in the game dir
if [ "$APP_ANSWER" == "YES!" ]; then
mkdir -p "$REPERTOIRE/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/$TITLE/paf"
cp "$CDROM/paf/hod.paf" "$REPERTOIRE/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/$TITLE/paf/hod.paf"

# Adding registry to locate the new place of the movie file
pushd "$IMGTMP"
REGPATH1='.'
REGPATH2='.\\\\paf'
echo REGEDIT4 > HOD.reg
echo >> HOD.reg
echo "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Amazing Studio\\Heart Of Darkness]" >> HOD.reg
echo "\\"EXE_PATH\\"="\\"$REGPATH1\\" >> HOD.reg
echo "\\"PAF_PATH\\"="\\"$REGPATH2\\" >> HOD.reg
regedit HOD.reg
popd

# Continue playing with disc
elif [ "$APP_ANSWER" == "NO!" ]; then
POL_SetupWindow_message "$INSMSGTEXT" "$INSMSG"
fi

#Converting xpm icon to png
convert "$HOME/.local/share/icons/*_hodwin32.0.xpm" -geometry 32X32 "$REPERTOIRE/icones/32/HODWin32.png"

# Creating the game shortcut
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/$TITLE" "$TITLEEXE" "" "$TITLENAME"
Set_WineVersion_Assign "$WVERSION" "$TITLENAME"

# Removing the temp files
cd $IMGTMP
rm {HODLeft,HODTop}.png
rm HOD.reg

# Exiting
POL_SetupWindow_Close
exit


Side panel image!


Top panel image!


Download the script

NOTE: This game doesn't need cracks!
You may play it with the cd in the drive when install the game as normal or make full install and play it without disc!
The script is for Windows2000 English Version CD!

Works pretty fine, still I'm not sure how to skip the movies from the begining of the game and I think that many versions of wine have the same problem. :)

Ändrat av lil_stenly

lil_stenly Wednesday 7 July 2010 at 16:45
lil_stenly

I fixed the scrip... now it's how it should be. :)

Ändrat av lil_stenly

NSLW Sunday 1 August 2010 at 8:56
NSLW

1) Don't do that. It's up to user.
# Marking the shortcut as trusted
if [ -f "$HOME/Desktop/${TITLENAME}.desktop" ]then chmod a+rx "$HOME/Desktop/${TITLENAME}.desktop"
fi

2) Why "Program Files" here?
REGPATH1='C:\\\\Program Files\\\\Heart Of Darkness'
REGPATH2='C:\\\\Program Files\\\\Heart Of Darkness\\\\paf'

3) That's not required.
# Program Files Variable
PROGRAMFILES="Program Files"

In general the script looks good.
lil_stenly Tuesday 17 August 2010 at 4:14
lil_stenly

1) Don't do that. It's up to user.
# Marking the shortcut as trusted
if [ -f "$HOME/Desktop/${TITLENAME}.desktop" ]then chmod a+rx "$HOME/Desktop/${TITLENAME}.desktop"
fi

2) Why "Program Files" here?
REGPATH1='C:\\\\Program Files\\\\Heart Of Darkness'
REGPATH2='C:\\\\Program Files\\\\Heart Of Darkness\\\\paf'

3) That's not required.
# Program Files Variable
PROGRAMFILES="Program Files"

In general the script looks good.

Quote from NSLW


1. Sorry about the trusted shortcut, didn't know that, because wasn't mention in the tutorials.
2. Thats because of the registry, as i mention it can be '.' and '.\\\\paf' the game still will work without cd if you copy the paf (movie file) to the paf directory in the gamedir.
3. I still need to learn about all the changes around the scripts.

I already fix the issues.
Cheers!
-LS

Ändrat av lil_stenly

Deleted spam