The forum

[Script] GOG.com - King's Bounty: The Legend

Author Replies
savornicesei Thursday 27 March 2014 at 13:56
savorniceseiAnonymous

Hi all,
I've been working on a POL script for the GOG.com version of King's Bounty: The Legend. I took inspiration and code from the existing POL script for KBL and Gothic 2 GOG.com script.

The script installs nicely KBL, the game starts. I am able to view the logos, select a character, see the story intro but then the graphics get mingled right when starting to play the map:


I've tried with wine version 1.7.15, 1.7.6 and 1.4.1, with WinXP and Win7.

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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#!/bin/bash
# Date : (2014-03-27 21-27)
# Last revision : (2014-02-23)
# Wine version used : 1.7.15
# Distribution used to test : Fedora 20
# Author : Simona Avornicesei savornicesei@gmail.com
# Script licence : -
# Program licence : -
# Depend :
  
[ -z "$PLAYONLINUX" ] && exit 0
source "$PLAYONLINUX/lib/sources"
  
GOGID="kings_bounty_the_legend"
PREFIX="KingsBountyLegend_gog"
WORKING_WINE_VERSION="1.7.15"
  
TITLE="GOG.com - King's Bounty: The Legend"
SHORTCUT_NAME="King's Bounty: The Legend"
IMG_URL=http://upload.wikimedia.org/wikipedia/en/3/38/King%27s_Bounty.jpg
 
#needed functions, taken from King's Bounty: The Legend POL script
#return = local path to scaled image
get_image() {
        URL=$1
        wget $URL --output-document="$REPERTOIRE/tmp/leftnotscaled.jpeg"
        convert "$REPERTOIRE/tmp/leftnotscaled.jpeg" -scale 150x356\! "$REPERTOIRE/tmp/left.jpeg"
        echo "$REPERTOIRE/tmp/left.jpeg"
}
   
#return = path to game.exe
get_gameexe() {
        cd $WINEPREFIX/drive_c  && find . -name kb.exe
}
 
#set properties and forget
install_configuration(){
        Set_GLSL On
}
  
install_directx(){
        #Creator : Berillions
           
         cd "$REPERTOIRE/ressources"
        #downloading directx9
        if [ ! -e "directx_aug2009_redist.exe" ];
        then
        fi
           
        mkdir "Directx"
        cd Directx
        cabextract "../directx_aug2009_redist.exe"
           
        mkdir "d3dx9"
        cabextract -d "d3dx9" *d3dx9*x86*
           
        cd "d3dx9"
        mv *.dll "$WINEPREFIX/drive_c/windows/system32"
           
        #Réglage Directx9
        cd "$WINEPREFIX/drive_c/windows/temp"
cat << EOF > OGL.reg
[HKEY_CURRENT_USER\\Software\\Wine\\DllOverrides]
"d3dx9_24"="native"
"d3dx9_25"="native"
"d3dx9_26"="native"
"d3dx9_27"="native"
"d3dx9_28"="native"
"d3dx9_29"="native"
"d3dx9_30"="native"
"d3dx9_31"="native"
"d3dx9_32"="native"
"d3dx9_33"="native"
"d3dx9_34"="native"
"d3dx9_35"="native"
"d3dx9_36"="native"
"d3dx9_37"="native"
"d3dx9_38"="native"
"d3dx9_39"="native"
"d3dx9_40"="native"
"d3dx9_41"="native"
"d3dx9_42"="native"
EOF
        regedit OGL.reg
           
        cd "$REPERTOIRE/ressources"
        rm -rf Directx
}
  
  
#main
POL_SetupWindow_Init
POL_SetupWindow_SetID 1313
POL_Debug_Init
  
POL_SetupWindow_presentation "$TITLE" "Katauri Interactive / 1C Publishing" "http://www.gog.com/game/$GOGID" "Simona Avornicesei" "$PREFIX"
  
POL_Call POL_GoG_setup "$GOGID" --alternate "setup_$GOGID" "1" "9e21f612ed8a79394be80faa92dc28b0" "1a7b4414f4a5ac7f17c4494dc927c7a0" "0c230c27da36755136fabee4b1553294"
  
POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
  
POL_Call POL_GoG_install "/nogui"
  
  
# GoG work!
Set_OS win7
  
POL_SetupWindow_VMS "64"
 
POL_SetupWindow_wait_next_signal "Setting configuration properties" "$TITLE installation"
#install_configuration
#POL_Wine_Direct3D UseGLSL
POL_SetupWindow_detect_exit
  
#install_directx
#POL_Call POL_Install_d3dx9
#POL_Call POL_Install_d3dx9_36
 
#POL_Call POL_Install_gecko
#POL_Call POL_Install_tahoma
POL_Call POL_Install_d3dx9
POL_Call POL_Install_d3dx9_36
PoL_Call POL_Install_d3dx10
PoL_Call POL_Install_d3dx11
  
# Doesn't hurt ;)
POL_Wine_reboot
 
POL_Shortcut "kb.exe" "$SHORTCUT_NAME" "gfw_high.ico" "" "Game;StrategyGame;"
  
POL_SetupWindow_Close
  
exit 0




Nameless hero. Professional bug slayer mom.
petch Saturday 29 March 2014 at 20:37
petch


Hi,
Maybe you're experiencing some driver issue.

About the script, right now it contains lots of unused statements:

1
2
3
4
5
6
7
#return = local path to scaled image
get_image() {
        URL=$1
        wget $URL --output-document="$REPERTOIRE/tmp/leftnotscaled.jpeg"
        convert "$REPERTOIRE/tmp/leftnotscaled.jpeg" -scale 150x356\! "$REPERTOIRE/tmp/left.jpeg"
        echo "$REPERTOIRE/tmp/left.jpeg"
}

Unused code, not to mention that those days we prefer hosting images on the server rather than use ugly code in scripts. When the script is ready, just provide some link to a copy of the scaled gfx and I'll put it on the server.

1
2
3
4
#return = path to game.exe
get_gameexe() {
        cd $WINEPREFIX/drive_c  && find . -name kb.exe
}

Unused code

1
2
3
4
#set properties and forget
install_configuration(){
        Set_GLSL On
}

Unused code

1
2
install_directx(){
...

Unused and totally outdated code, use "function" scripts to install DirectX

1
2
3
4
POL_SetupWindow_wait_next_signal "Setting configuration properties" "$TITLE installation"
#install_configuration
#POL_Wine_Direct3D UseGLSL
POL_SetupWindow_detect_exit

Since this call is commented out, you can remove all that

1
2
3
#install_directx
#POL_Call POL_Install_d3dx9
#POL_Call POL_Install_d3dx9_36

Dead code

1
2
3
4
POL_Call POL_Install_d3dx9
POL_Call POL_Install_d3dx9_36
PoL_Call POL_Install_d3dx10
PoL_Call POL_Install_d3dx11

last two commands don't work because the case is wrong (must be POL in uppercase). So if installation works as-is, you didn't need them

1
POL_Shortcut "kb.exe" "$SHORTCUT_NAME" "gfw_high.ico" "" "Game;StrategyGame;"

Third parameter is the name of the file to get from the server, so a local filename doesn't work. If you get the right icon you don't need it.

Regards,
Pierre.

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