Forums

[Script] Super Mario Bros. X

Fully working now with LunaLua mod.

Auteur Réponses
MrMiketheripper Lundi 20 Juillet 2015 à 15:34
MrMiketheripper

Description

Super Mario Bros. X is a fairly popular Mario fangame created by Andrew Spinks (yes, Redigit, the same guy who now has developed Terraria) in 2009. It was coded entirely in Visual Basic 6. Development ceased in 2011 prior to the release of version 1.3, but the community has since taken over. Recently, a modification for SMBX was created called LunaDLL. This extension allowed for some assembly like code to be executed on a per level basis. Mostly memory hacks. After, Kevsoft (co-developer of SMBX successor PGE) created his own extension to LunaDLL called LunaLua. This refined the LunaDLL experience, allowing Lua code to be executed in levels. With LunaLua came modifications to use SDL for the sound drivers allowing now for full sound compatibility with Linux.

Changes Outside of POL/Wine

None needed :)

Errors and Problems

As seen in the screenshots, the launcher is unable to load the splash screen. I have talked to the supermariobrosx.org webmaster about it and he is looking into it.

Script

Note: I forked the original script author's repo and publish the latest versions of the script there. The repo is here

#!/bin/bash
# Date : (2010-04-24 20-47)
# Last revision : (2015-07-20 08-57)
# Wine version used : 1.7.45
# Distribution used to test : Ubuntu 15.04 w/ KDE 5 (not Kubuntu)
# Author : Matthew Bauer, Updated by Mike Santiago
# Script licence : GPLv3
# Program licence : N/A
# Depend :

[ "$PLAYONLINUX" = "" ] && exit 0

source "$PLAYONLINUX/lib/sources" 

scriptauthor="Matthew Bauer and Mike Santiago"

TITLE="SMBX - LunaLua"
PREFIX="smbx"
appname="SMBX - LunaLua"
shortname="smbx"
basesite="http://www.supermariobrosx.org"
appversion="1.3.0.2"
appcreator="Andrew Spinks 'Redigit', Wohlstand, Kevsoft"
zipname="lunalua-complete.zip"
download="http://mrmiketheripper.x10.mx/lunalua/lunalua-complete.zip"

POL_SetupWindow_Init

POL_Debug_Init

POL_SetupWindow_presentation "$appname" "$appcreator" "$basesite" "$scriptauthor" "$appname"

POL_Wine_SelectPrefix $PREFIX
POL_Wine_PrefixCreate "1.7.45"

POL_SetupWindow_pulsebar "Installing base applications with winetricks" "Installing"

POL_SetupWindow_pulse "1"

cd "$REPERTOIRE/ressources/"

POL_SetupWindow_pulse "23"
bash winetricks -q vb6run
POL_SetupWindow_pulse "55"
bash winetricks -q quartz
POL_SetupWindow_pulse "65"
bash winetricks -q vcrun2013
POL_SetupWindow_pulse "79"
POL_Call POL_Install_vbrun6
POL_SetupWindow_pulse "100"

POL_SetupWindow_download "Downloading $appname" "$shortname" "$download"

POL_SetupWindow_wait "$(eval_gettext 'Unzipping downloaded files. Please wait.')" "$TITLE"
echo $PREFIX
mkdir -p "$REPERTOIRE/wineprefix/$shortname/drive_c/$shortname"
unzip -o "$REPERTOIRE/ressources/$zipname" -d "$REPERTOIRE/wineprefix/$shortname/drive_c/$shortname"
rm "$REPERTOIRE/ressources/$zipname"

POL_Shortcut "smbx.exe" "$TITLE" "" ""

POL_SetupWindow_Close
exit

Screenshots

Notes

While the level editor does indeed work, it is highly recommend you use PGE as the editor. This is the successor to SMBX and retains full compatibility with SMBX's formats and is coded in C++, has native ports to Linux, and is just plain better (in my opinion anyway). PGE

Note to Moderators

I have left/top/22/64/48 icons, I'm just not sure if I should upload them imgur, submit them here, or what. That part isn't entirely clear and I apologise for this :)

Edité par MrMiketheripper

MrMiketheripper Mardi 21 Juillet 2015 à 19:45
MrMiketheripper

Small script update as x10Hosting thought it would be funny to delete my lunalua-complete.zip.

 

#!/bin/bash
# Date : (2010-04-24 20-47)
# Last revision : (2015-07-20 08-57)
# Wine version used : 1.7.45
# Distribution used to test : Ubuntu 15.04 w/ KDE 5 (not Kubuntu)
# Author : Matthew Bauer, Updated by Mike Santiago
# Script licence : GPLv3
# Program licence : N/A
# Depend :

[ "$PLAYONLINUX" = "" ] && exit 0

source "$PLAYONLINUX/lib/sources"

scriptauthor="Matthew Bauer and Mike Santiago"

TITLE="SMBX - LunaLua"
PREFIX="smbx"
appname="SMBX - LunaLua"
shortname="smbx"
basesite="http://www.supermariobrosx.org"
appversion="1.3.0.2"
appcreator="Andrew Spinks 'Redigit', Wohlstand, Kevsoft"
zipname="LunaLUA_0.7.0.2-beta_smbx13_sfx_mus_fullgame.zip"
download="http://download.gna.org/pgewohlstand/dev/win32/LunaLUA/LunaLUA_0.7.0.2-beta_smbx13_sfx_mus_fullgame.zip"

POL_SetupWindow_Init

POL_Debug_Init

POL_SetupWindow_presentation "$appname" "$appcreator" "$basesite" "$scriptauthor" "$appname"

POL_Wine_SelectPrefix $PREFIX
POL_Wine_PrefixCreate "1.7.45"

POL_SetupWindow_pulsebar "Installing base applications with winetricks" "Installing"

POL_SetupWindow_pulse "1"

cd "$REPERTOIRE/ressources/"

POL_SetupWindow_pulse "23"
bash winetricks -q vb6run
POL_SetupWindow_pulse "55"
bash winetricks -q quartz
POL_SetupWindow_pulse "65"
bash winetricks -q vcrun2013
POL_SetupWindow_pulse "79"
POL_Call POL_Install_vbrun6
POL_SetupWindow_pulse "100"

POL_SetupWindow_download "Downloading $appname" "$shortname" "$download"

POL_SetupWindow_wait "$(eval_gettext 'Unzipping downloaded files. Please wait.')" "$TITLE"
echo $PREFIX
mkdir -p "$REPERTOIRE/wineprefix/$shortname/drive_c/$shortname"
unzip -o "$REPERTOIRE/ressources/$zipname" -d "$REPERTOIRE/wineprefix/$shortname/drive_c/$shortname"
rm "$REPERTOIRE/ressources/$zipname"

POL_Shortcut "smbx.exe" "$TITLE" "" ""

POL_SetupWindow_Close
exit
MrMiketheripper Mercredi 29 Juillet 2015 à 17:21
MrMiketheripper

Hopefully the last update, containing an always updated link thanks to Wohlstand.

 

#!/bin/bash
# Date : (2010-04-24 20-47)
# Last revision : (2015-07-20 08-57)
# Wine version used : 1.7.45
# Distribution used to test : Ubuntu 15.04 w/ KDE 5 (not Kubuntu)
# Author : Matthew Bauer, Updated by Mike Santiago
# Script licence : GPLv3
# Program licence : N/A
# Depend :

[ "$PLAYONLINUX" = "" ] && exit 0

source "$PLAYONLINUX/lib/sources" 

scriptauthor="Matthew Bauer and Mike Santiago"

TITLE="SMBX - LunaLua"
PREFIX="smbx"
appname="SMBX - LunaLua"
shortname="smbx"
basesite="http://www.supermariobrosx.org"
appversion="1.3.0.2"
appcreator="Andrew Spinks 'Redigit', Wohlstand, Kevsoft"
zipname="LunaLUA_0.7.0.3-beta_smbx13_sfx_mus_fullgame.zip"
download="http://engine.wohlnet.ru/LunaLua/get.php?luaver=-1&installationType=Full&base=smbx13&fbase=1"

POL_SetupWindow_Init

POL_Debug_Init

POL_SetupWindow_presentation "$appname" "$appcreator" "$basesite" "$scriptauthor" "$appname"

POL_Wine_SelectPrefix $PREFIX
POL_Wine_PrefixCreate "1.7.45"

POL_SetupWindow_pulsebar "Installing base applications with winetricks" "Installing"

POL_SetupWindow_pulse "1"

cd "$REPERTOIRE/ressources/"

POL_SetupWindow_pulse "23"
bash winetricks -q vb6run
POL_SetupWindow_pulse "55"
bash winetricks -q quartz
POL_SetupWindow_pulse "65"
bash winetricks -q vcrun2013
POL_SetupWindow_pulse "79"
POL_Call POL_Install_vbrun6
POL_SetupWindow_pulse "100"

POL_SetupWindow_download "Downloading $appname" "$shortname" "$download"

POL_SetupWindow_wait "$(eval_gettext 'Unzipping downloaded files. Please wait.')" "$TITLE"
echo $PREFIX
mkdir -p "$REPERTOIRE/wineprefix/$shortname/drive_c/$shortname"
unzip -o "$REPERTOIRE/ressources/$zipname" -d "$REPERTOIRE/wineprefix/$shortname/drive_c/$shortname"
rm "$REPERTOIRE/ressources/$zipname"

POL_Shortcut "smbx.exe" "$TITLE" "" ""

POL_SetupWindow_Close
exit

Edité par MrMiketheripper

petch Mercredi 29 Juillet 2015 à 18:43
petch

Hi,

Ok, my script review:

PREFIX="smbx"

That's a bit short, to avoid any possibility of collisions script_checker.sh recommends at least 5 characters, but there's no good reason nowadays not to use full names like SuperMarioBrosX

POL_Wine_PrefixCreate "1.7.45"

You create lots of variables, you could have used one for the Wine version used...

POL_SetupWindow_pulsebar "Installing base applications with winetricks" "Installing"

All user-oriented messages should support localization (http://wiki.playonlinux.com/index.php/Scripting_-_Chapter_10:_Script_Translation)

cd "$REPERTOIRE/ressources/"
...
POL_SetupWindow_download "Downloading $appname" "$shortname" "$download"
...
rm "$REPERTOIRE/ressources/$zipname"

 Several things here, $REPERTOIRE is deprecated and one should use $POL_USER_ROOT instead, and POL_SetupWindow_download has been superseded by POL_Download; But most importantly since the resources cache is never trimmed, scripts should only put reusable files there, validated thru the use of a hash as in POL_Download_Resource. That's exactly the wrong place for a temporary file, either put it in $POL_USER_ROOT/tmp, or use POL_System_TmpCreate.

bash winetricks -q vb6run

 Use of winetricks is scripts has been obsoleted since at least when I learned about PlayOnLinux, almost four years ago. It can't say before that. Anyway, all those "verbs" have their "components" counterparts, just use POL_Call POL_Install_vbrun6, etc.

mkdir -p "$REPERTOIRE/wineprefix/$shortname/drive_c/$shortname"

Don't hardcode virtual drive path $POL_USER_ROOT/wineprefix/$PREFIX, use $WINEPREFIX instead

unzip -o "$REPERTOIRE/ressources/$zipname" -d "$REPERTOIRE/wineprefix/$shortname/drive_c/$shortname"

You can use POL_System_unzip instead of unzip, the added benefit is that in case of error in unzip, the user will be warned instead of the error being silently ignored.

That's it, but the use of winetricks and or the resources cache for temporary files are both no-gos for adding it to the official scripts repository.

Regards,

Pierre.

MrMiketheripper Dimanche 2 Aoüt 2015 à 3:58
MrMiketheripper

I will make those modifications asap.

 

One thing though: by downloading from the get.php link Wohlstand uses, the zip name could be different is there a way to peek at the file name either through bash scripting or POL calls?

 

EDIT: https://raw.githubusercontent.com/Luigifan/playonlinux/master/smbx.pol

 

How's this? I'm not able to access my Linux machine at the moment so I'm unable to test.

Edité par MrMiketheripper

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