Forums

[Script] Lego Rock Raiders

Auteur Réponses
LinuxScripter Samedi 19 Décembre 2015 à 15:09
LinuxScripterAnonymous

Hello. Today I created a small script to install a 1999 real-time strategy game called Lego Rock Raiders. You will most likey have to manually download d3drm.dll to prevent crashes. I have run the game installed by this script and no errors found so far.

#!/bin/bash
# Date : (2015-12-19 11:45)
# Last revision : (2016-01-01 13:06)
# Wine version used : 1.8
# Distribution used to test : Ubuntu 15.04 64bit
# Author : LinuxScripter
# Script licence : GPLv3

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TITLE="Lego Rock Raiders"
PREFIX="LegoRockRaiders"
EDITOR="Data Design Interactive"
AUTHOR="LinuxScripter"
GAME_URL=""
WORKING_WINE_VERSION="1.8"

POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/LegoRockRaiders-48x48.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/LegoRockRaiders-22x22.jpg" "$TITLE"

# Starting the script
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 32-bit prefix
POL_System_SetArch "x86"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"

POL_Call POL_Install_amstream
POL_Call POL_Install_quartz
POL_Call POL_Install_devenum
POL_Call POL_Install_directmusic
POL_Wine_OverrideDLL "native" "d3drm"

POL_SetupWindow_InstallMethod "LOCAL"

# Begin game installation
POL_SetupWindow_message "$(eval_gettext 'After instalation you have to manually download the d3drm.dll file and copy it to the /windows/system32 folder. Make sure the checksum is dde9e3b8c264957ae0a017d371293123. If the game still crashes while loading copy it to the game location as well.')" "$TITLE"
cd "$HOME"
POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE"
SETUP_EXE="$APP_ANSWER"
POL_Wine start /unix "$SETUP_EXE"
POL_Wine_WaitExit "$TITLE"

#Create shortcuts
POL_Shortcut "LegoRR.exe" "$TITLE" "" "Game;StrategyGame;"

POL_SetupWindow_Close
exit 0

 

Screenshots:

http://imgur.com/Q1eiI8J

http://imgur.com/jOQzoSz

Install resources and images:

left - http://imgur.com/2o5I8zV

top - http://imgur.com/9jnVi0r

22x22 - http://imgur.com/fnav6n1

48x48 - http://imgur.com/g1nzUX4

Edité par LinuxScripter


MTres19 Samedi 26 Décembre 2015 à 23:46
MTres19Anonymous

I would like to point out a few things to help on your script...

Using a stable version of Wine is best, so if Wine 1.8 works, it's more likely to be already downloaded than a development version of Wine.

POL_Call POL_Install_d3dx9 shouldn't be neccessary, since Lego Rock Raiders was released in 1999 and DirectX 9 wasn't released until 2002.

Also, the POL_Install_* functions should override DLLs automatically, so the POL_Wine_OverrideDLL lines also shouldn't be needed.

It appears that Lego Rock Raiders was only ever sold on CD, at least it's not on GOG.com or Steam, so you could probably remove the POL_SetupWindow_InstallMethod line---besides, POL_SetupWindow_cdrom gives the user the option to enter the location of the CD---whether it's actually a CD or just a folder.

If possible, it's best to remove start /unix on POL_Wine lines so that POL_Wine_WaitExit isn't neccessary. If start /unix is neccessary, POL_Wine_WaitBefore won't have any purpose anyway, and only POL_Wine_WaitExit will be noticable.

Wine seems to have d3drm.dll in windows/system32, so you could probably use a cp command to copy it to the installation location of Lego Rock Raiders.

POL_Wine_SetVideoDriver, if I understand correctly, is only to be used when Wine doesn't do things properly itself. Wine has gotten a lot better over the years, and this might only take more time now. If it's neccessary, though, that's fine. You might want to test just to be sure.

Lastly, POL should be able to extract the icon from the exe, so you might be able to change your POL_Shortcut line to POL_Shortcut "LegoRR.exe" "$TITLE" "" "Game;StrategyGame;"

Hopefully that helps make the script a bit easier to maintain and faster to install. Good luck!

LinuxScripter Vendredi 1 Janvier 2016 à 13:04
LinuxScripterAnonymous

When I was writing this script wine 1.8 wasn't stable so I used the version I always used when testing. But 1.8 works just fine so I changed that.

I used d3dx9 just in case some dlls were needed since dx9 have a build-in support for dx6 games. But it works the same without it.

I decided to keep the local instalation option because of two reasons:

-it still allows instalation from CD

-this game might become avaible on GOG

I tried copying d3drm from windows/system32 to the folder where the game's .exe file is but it still crashes. Therefore manual download is still necessary. But now it seems you have to copy this dll to both locations in orter to prevent crash at loading the game.

The POL_Wine_SetVideoDriver was (just like d3dx9) used in case it was needed (it was a good idea to use it in scripts for newer games) but nothing changed in the way how the game works so I removed it.

I have already updated the script using your hints. Thank you for your review.


MTres19 Mercredi 27 Janvier 2016 à 21:32
MTres19Anonymous

I really don't think POL_SetupWindow_InstallMethod is neccessary, at least right now, since you only have the LOCAL option available. It would be easier to simply use POL_SetupWindow_cdrom, since scripts for GOG editions usually get a separate script, it seems.

As for crashing, it occurred to me that that's probably because you didn't remove the override for d3drm.dll, which if I understand correctly, makes Wine ignore its own version of d3drm.dll. If you simply use cp to make a copy of it in both locations and remove the override, you might have success. If that doesn't work, it might simply be better to use POL_Download in either of the locations, then copy it. Of course, if you did that, you'd have to get rid of Wine's version first.

You're welcome. Glad I could help.

LinuxScripter Lundi 8 Mai 2017 à 20:21
LinuxScripterAnonymous

After a long hiatus (mostly caused by college) I came back here and tried my old scripts using latest stable version of Wine. So far there are two issues:

1.The cutscene at the begining of the game is not playing. I found this in debugger:

err:msvideo:ICLocate Required media codec 'vidc IV50' not found!
err:msvideo:ICLocate Required media codec 'vidc IV50' not found!

2.I found an legit (as in no scams or false surveys) and not ziped link to the d3drm.dll this game needs but the script dosen't move it to the folder where the .exe file is. Probably a typo I can't narrow down.

New script:

#!/bin/bash
# Date : (2015-12-19 11:45)
# Last revision : (2017-05-08 13:06)
# Wine version used : 2.0.1
# Distribution used to test : Ubuntu 17.04 64bit
# Author : LinuxScripter
# Script licence : GPLv3
 
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TITLE="Lego Rock Raiders"
PREFIX="LegoRockRaiders"
EDITOR="Data Design Interactive"
AUTHOR="LinuxScripter"
GAME_URL=""
WORKING_WINE_VERSION="2.0.1"
 
POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/LegoRockRaiders-48x48.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/LegoRockRaiders-22x22.jpg" "$TITLE"
 
# Starting the script
POL_SetupWindow_Init
POL_Debug_Init
POL_System_TmpCreate "LegoRockRaiders"
 
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
 
# Setting prefix path
POL_Wine_SelectPrefix "$PREFIX"
 
# Downloading wine if necessary and creating 32-bit prefix
POL_System_SetArch "x86"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
 
POL_Call POL_Install_amstream
POL_Call POL_Install_quartz
POL_Call POL_Install_devenum
POL_Call POL_Install_directmusic
 
POL_SetupWindow_InstallMethod "LOCAL"
 
# Begin game installation
cd "$HOME"
POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE"
SETUP_EXE="$APP_ANSWER"
POL_Wine start /unix "$SETUP_EXE"
POL_Wine_WaitExit "$TITLE"

#Downloading the necceseary .dll files
POL_Download http://s2.pliki.info/5709/d3drm.dll 57ecb51c1682d12770ccd9b716dc4b6c
cd "$POL_System_TmpDir"
cp "$POL_System_TmpDir/d3drm.dll" "$HOME/.PlayOnLinux/wineprefix/LegoRockRaiders/drive_c/Program Files/LEGO Media/Games/Rock Raiders"
POL_System_TmpDelete
 
#Create shortcuts
POL_Shortcut "LegoRR.exe" "$TITLE" "" "Game;StrategyGame;"
 
POL_SetupWindow_Close
exit 0

Edité par LinuxScripter


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