The forum

[Script] SonoHana 02 - Watashi no Ouji-sama

わたしの王子さま / My Dear Prince

Author Replies
markingdude Thursday 3 October 2013 at 1:45
markingdudeAnonymous

To avoid any confusion, I'm going to just post the scripts in separate threads. Hopefully that's all right.

02 - わたしの王子さま (Watashi no Ouji-sama / My Dear Prince)

Starting with this game, the user will be asked to supply an EXE file for the English translation patch. Unlike the first VN, this script supports both the original 2007 release and the 2011 remake. Nothing else was needed for this to run.

"start /unix" is needed in the installation program since English users need the instructions to install the VN. I wish there was a way to simply install the VN "silently", but I can't figure out how to do it yet.

Games 3-8 have very similar code to this one.

[code language=playonlinux]
#!/bin/bash
# Date : (2013-03-01)
# Last revision : (2013-07-09)
# Wine version used : 1.6
# Distribution used to test : Mac OS X 10.8.4
# Author : Marking

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

# Setup some needed variables
TITLE="Sono Hanabira ni Kuchizuke wo 02 - Watashi no Ouji-sama"
PREFIX="SonoHana_02"
WINEVERSION="1.6"
EDITOR="Fuguriya"
GAME_URL="http://fuguriya.sakura.ne.jp"
AUTHOR="Marking"

# Download images for installation script
POL_GetSetupImages "http://images.markinglifestyle.com/sonohana_mac/script_icons/SonoHana_02-64x64.png" "http://images.markinglifestyle.com/sonohana_mac/script_banners/SH_02.jpg" "$TITLE"

# Initialize the script, debugging, and set required version
POL_SetupWindow_Init
POL_RequiredVersion "4.1.6" || POL_Debug_Fatal "$APPLICATION_TITLE 4.1.6 is required to install $TITLE"
POL_Debug_Init
 
# Setup presentation window
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"

# Begin setting up the Wine Prefix
POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WINEVERSION"
SONOHANA="$WINEPREFIX/drive_c/$PROGRAMFILES/ふぐり屋/その花びらにくちづけを わたしの王子さま/"

# Ask user for either DVD or Local installation
POL_SetupWindow_InstallMethod "LOCAL,DVD"

if [ "$INSTALL_METHOD" = "LOCAL" ]
then
    # Ask user to find "Setup.exe"
    cd "$HOME"
    POL_SetupWindow_browse "$(eval_gettext 'Please locate installation program (Setup.exe)')" "$TITLE"
    LANG="ja_JP.UTF-8" POL_Wine start /unix "$APP_ANSWER"
        
    # Tell user what to do while the installation program is running
    POL_SetupWindow_message "$(eval_gettext 'When the install program starts, click on インストール. When a new window opens, click on インストール. When installation finishes, click on 終了 and then on はい. Click Next when you are done installing.')" "Installation instructions"
        
elif [ "$INSTALL_METHOD" = "DVD" ]
then
    # Launches the installation program from CD/DVD
    POL_SetupWindow_cdrom
    POL_SetupWindow_check_cdrom
    LANG="ja_JP.UTF-8" POL_Wine start /unix "$CDROM/Setup.exe"

    # Tell user what to do while the installation program is running
    POL_SetupWindow_message "$(eval_gettext 'When the install program starts, click on インストール. When a new window opens, click on インストール. When installation finishes, click on 終了 and then on はい. Click Next when you are done installing.')" "Installation instructions"
fi

# Tells users which language they want to use
POL_SetupWindow_menu "Which language would you like to read this in?" "Select Language" "日本語 (Japanese)|English" "|"

#For Japanese language
if [ "$APP_ANSWER" = "日本語 (Japanese)" ]
then
    # Apply fjfix to fix the visual novel
    FJFIX_PATCH="fjfix.zip"
    cd "$SONOHANA"
    POL_Download "http://files.markinglifestyle.com/sh_files/fjfix.zip" "789634f517003c1619eca669a83306a0"
    POL_System_unzip $FJFIX_PATCH
    POL_Wine_WaitExit "the fjfix patch"        POL_Wine "fjfix.exe" -f MGD
    
    # Renames the main EXE file if installing the original version
    mv "$SONOHANA/HANABIRA2.EXE" "$SONOHANA/HANA2.EXE" 
    # Create a shortcut for easy access
    POL_Shortcut "HANA2.EXE" "その花びらにくちづけを わたしの王子さま"
    # Insert a command to run as a Japanese application
    POL_Shortcut_InsertBeforeWine "その花びらにくちづけを わたしの王子さま" "LANG=ja_JP.UTF-8"
    
#For English language    
elif [ "$APP_ANSWER" = "English" ]
then

    # Apply the English patch
    POL_SetupWindow_browse "$(eval_gettext 'Please locate English translation patch file')" "$TITLE"
    cp "$APP_ANSWER" "$SONOHANA/SH_EN.EXE"
    cd "$SONOHANA"
    POL_Wine_WaitExit "the English patch"
    LANG="ja_JP.UTF-8" POL_Wine "SH_EN.EXE"
    
    # Apply fjfix to fix the visual novel
    FJFIX_PATCH="fjfix.zip"
    cd "$SONOHANA"
    POL_Download "http://files.markinglifestyle.com/sh_files/fjfix.zip" "789634f517003c1619eca669a83306a0"
    POL_System_unzip $FJFIX_PATCH
    POL_Wine_WaitExit "the fjfix patch"        POL_Wine "fjfix.exe" -f MGD    
    # Renames the main EXE file if installing the original version
    mv "$SONOHANA/HANABIRA2.EXE" "$SONOHANA/HANA2.EXE" 
    # Create a shortcut for easy access
    POL_Shortcut "HANA2.EXE" "A Kiss for the Petals - My Dear Prince"
    # Insert a command to run as a Japanese application/fix font issues
    POL_Shortcut_InsertBeforeWine "A Kiss for the Petals - My Dear Prince" "LANG=ja_JP.UTF-8"    
fi
    POL_SetupWindow_Close
exit
[/code]

And the images:
Screenshot
22x22 icon
48x48 icon
top corner icon
left banner

Just a quick question. Is there a recommended image size for the screenshot of the game? I realize that games can have many different resolutions, so I thought I would ask.

If there are no problems, I'll submit it for approval.

Edited by markingdude

petch Thursday 3 October 2013 at 21:31
petch

Hi,
Looks like the script is ok, given it's very similar to the first one.
I'm wondering if it could be useful to include "episode" number into the shortcut names to they stay in order (they're alphabetically sorted)?

About screenshots there's not really any mandated size; We usually try to have screenshot of the program running windowed, with just a capture of the window including decorations, to give an idea of how it looks like in a Linux or Mac environment, but even that is not enforced.
markingdude Thursday 3 October 2013 at 21:54
markingdudeAnonymous

Yeah that would be something to help sort out the VNs. Didn't think about that. Thanks for the answer about the screenshots. Script has been sent for evaluation.

Edited by markingdude

petch Thursday 3 October 2013 at 22:08
petch

markingdude Friday 4 October 2013 at 1:56
markingdudeAnonymous

Thanks, but the formatting messed up the script on lines 71 and 96 of the source code.

For some reason, the final script came out as this:
POL_Wine_WaitExit "the fjfix patch"    POL_Wine "fjfix.exe" -f MGD


when it should be
POL_Wine_WaitExit "the fjfix patch"    
POL_Wine "fjfix.exe" -f MGD


I tested the script earlier and the game won't run because "fjfix.exe" never runs. If you can edit that, I would greatly appreciate it. I made sure to use Firefox to submit these scripts since Chrome has a hard time getting these right.

Edited by markingdude

petch Friday 4 October 2013 at 7:50
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 dmca-notice@playonlinux.com