The forum

Max Payne

A new Script that fix current issue

Author Replies
zedtux Tuesday 20 October 2009 at 18:40
zedtux

Hello, i create a new script for Max Payne to fix current issues. Works correctly, no graphic bug.

Wine version : 1.1.31
Distribution : Ubuntu 9.04
Carte Graphique : Nvidia, GeForce 8800 GTX
Drivers carte graphique : 185.18.36

Game's icon :


On my SVN repo: http://svn.zedroot.org/PlayOnLinuxScripts/max.payne.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/bin/bash
# Date : (2009-10-20)
# Last revision : (2009-10-20)
# Wine version used : 1.1.31
# Distribution used to test : Ubuntu 9.04
# Author : zedtux
# Licence : Retail
 
GAMENAME="Max Payne"
PUBLISHER="RockstarGame"
PREFIX="maxpayne"
GAMEPATHFROMPROGRAMFILES="/Max Payne"
GAMEEXECUTABLENAME="MaxPayne.exe"
NEEDEDWINEVERSION="1.1.31"
GAME_SETUP="Disk1/Setup.exe"
MENU_ACTION_INSTALL="Install the game"
MENU_ACTION_PATCH="Patch the game"
PATCH_SOURCE_LOCAL="From my computer"
PATCH_SOURCE_REMOTE="From Internet"
PATCHMIME="application/x-dosexec"
PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%"`
PROGRAMFILES=${PROGRAMFILES:3}
 
# Verify playonlinux dependencies
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
# Get Cover and convert it
wget $COVERURL --output-document="$REPERTOIRE/tmp/$PREFIX.cover.jpeg"
convert "$REPERTOIRE/tmp/$PREFIX.cover.jpeg" -scale 150x356\\! "$REPERTOIRE/tmp/left.$PREFIX.jpeg"
 
# Initialize the main window
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.$PREFIX.jpeg"
POL_SetupWindow_presentation "$GAMENAME" "$PUBLISHER" "$URL" "zedtux" "$PREFIX"
 
select_prefix "$REPERTOIRE/wineprefix/$PREFIX"
 
# Provide possibility to run install of a patch for the game
patch_game()
{
    POL_SetupWindow_menu "Select the source to patch the game" "Sources" "$PATCH_SOURCE_LOCAL~$PATCH_SOURCE_REMOTE" "~"
     
    # Install Patch from local disk
    if [ "$APP_ANSWER" == "$PATCH_SOURCE_LOCAL" ]; then
        POL_SetupWindow_browse "Select the patch file for $GAMENAME" "Patching $GAMENAME" ""
        if [ "$APP_ANSWER" != "" ] ; then
            if [ `file -bi "$APP_ANSWER"` == "$PATCHMIME" ] ; then
                POL_SetupWindow_wait_next_signal "Patching $GAMENAME..." "$GAMENAME"
                wine "$APP_ANSWER"
                POL_SetupWindow_message "$GAMENAME patched successfully" "$GAMENAME"
                POL_SetupWindow_Close
                exit
            else
                POL_SetupWindow_message_image "The file that you've selected is not a Microsoft executable." "Wrong Mime Type" "/usr/share/playonlinux/themes/tango/warning.png"
            fi
        else
            POL_SetupWindow_Close
            exit
        fi
    else
        # Install Patch from internet
        cd "$HOME/.PlayOnLinux/tmp"
        POL_SetupWindow_download "Downloading $GAMENAME patch 1.05..." "Downloading patch" "ftp://ftp.3drealms.com/patches/maxpayne1-05patch.exe"
        POL_SetupWindow_wait_next_signal "Patching $GAMENAME..." "$GAMENAME"
        wine "./maxpayne1-05patch.exe"
        rm -f "./maxpayne1-05patch.exe"
        POL_SetupWindow_message "$GAMENAME patched successfully" "$GAMENAME"
        POL_SetupWindow_Close
        exit
    fi
}
 
# Create Wine environnement before install the game
POL_SetupWindow_prefixcreate
 
#
# Make a menu to select one action
#
 
# Give the choice to user between install or patch the game
POL_SetupWindow_menu "What do you want to do?" "Actions" "$MENU_ACTION_INSTALL~$MENU_ACTION_PATCH" "~"
 
if [ "$APP_ANSWER" == "$MENU_ACTION_PATCH" ]; then
    patch_game
    POL_SetupWindow_Close
fi
 
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "$GAME_SETUP"
 
# Launching Installation
POL_SetupWindow_message_image "Please, ignore error messages, the game will work =)" "" "/usr/share/playonlinux/themes/tango/info.png"
POL_SetupWindow_wait_next_signal "Installing $GAMENAME..." "$GAMENAME"
cd "$CDROM"
wine "$GAME_SETUP"
 
# Defining options of the environnement
POL_SetupWindow_install_wine "$NEEDEDWINEVERSION"
Set_WineVersion_Assign "$NEEDEDWINEVERSION" "$GAMENAME"
 
# Creating shortcut
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES$GAMEPATHFROMPROGRAMFILES" "$GAMEEXECUTABLENAME" "" "$GAMENAME" ""
 
# Ask for patching the game
POL_SetupWindow_question "Do you want to patch the game now ?" "Max Payne Patch 1.05"
if [ "$APP_ANSWER" == "TRUE" ] ; then
    patch_game
fi
 
POL_SetupWindow_message "$GAMENAME has been installed successfully" "$GAMENAME"
 
# Close the main window !
POL_SetupWindow_Close
 
exit
zedtux Tuesday 20 October 2009 at 18:44
zedtux

Just for information, I can't create the "Max Payne" script.. it should already exist.

Someone can help me ( if the script is accepted ) ?
You are here: Index > Your creations. > Max Payne

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@playonlinux.com