Forums

[Script] Battlefield 2142

Auteur Réponses
CKDevelop Dimanche 13 Décembre 2009 à 14:20
CKDevelop

Salut à tous,
bon voilà un petit script POL pour ce bon petit jeu..

#!/bin/bash
# Date : (2009-12-13 14-11)
# Last revision : (2009-12-30 14-11)
# Wine version used : 1.1.33
# Distribution used to test : Ubuntu 9.10
# Author : Re-scripted by CKDevelop based on the script NSLW of jau Battlefield 2
# Licence : Retail
 
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TYTUL="Battlefield 2142"
PREFIX="Battlefield2142"
WORKINGWINEVERSION="1.1.33"
 
#procedure for patching Battlefield 2142
patch_battlefield2142()
{
POL_SetupWindow_browse "Select patch file downloaded from support.ea.com" "$TYTUL" ""
wine $APP_ANSWER
POL_SetupWindow_message "Patch for $TYTUL has been installed successfully" "$TYTUL"
}
 
prepare_patched_WineVesrsion()
{
POL_SetupWindow_install_wine "$1"
cd "$REPERTOIRE/WineVersions"
POL_SetupWindow_wait_next_signal "Removing old WineVersion" "$TYTUL"
rm -fr "$1-$PREFIX"
POL_SetupWindow_detect_exit
 
POL_SetupWindow_wait_next_signal "Copying WineVersion" "$TYTUL"
cp -r "$1" "$1-$PREFIX"
rm -fr "$REPERTOIRE/WineVersions/$1-$PREFIX/usr/lib/wine/wined3d.dll.so"
cp "$WINEPREFIX/drive_c/windows/temp/wined3d.dll.so" "$REPERTOIRE/WineVersions/$1-$PREFIX/usr/lib/wine/wined3d.dll.so"
POL_SetupWindow_detect_exit
}
 
 
wget http://upload.wikimedia.org/wikipedia/en/thumb/4/40/Battlefield_2142_box_art.png/256px-Battlefield_2142_box_art.png --output-document="$REPERTOIRE/tmp/leftnotscaled.png"
convert "$REPERTOIRE/tmp/leftnotscaled.png" -scale 150x356\\! "$REPERTOIRE/tmp/left.png"
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.png"
 
POL_SetupWindow_presentation "$TYTUL" "Dice" "battlefield.ea.com/battlefield/bf2142/" "CKDevelop" "$PREFIX" 
 
select_prefix "$REPERTOIRE/wineprefix/$PREFIX"
 
#asking about patching or updating Wine version
if [ -e "$REPERTOIRE/configurations/installed/$TYTUL" ]; then
POL_SetupWindow_menu "What do you want to do?" "Actions" "Patch game" "~"
 
if [ "$APP_ANSWER" == "Patch game" ]; then
	patch_battlefield2142
fi
 
POL_SetupWindow_Close
exit
fi
 
POL_SetupWindow_message "Please insert $TYTUL media into your disk drive."
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "setup.exe"
 
prepare_patched_WineVesrsion "$WORKINGWINEVERSION"
Use_WineVersion "$WORKINGWINEVERSION"
POL_SetupWindow_prefixcreate
#fetching PROGRAMFILES environmental variable
PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%"`
PROGRAMFILES=${PROGRAMFILES:3}
 
#adding CD-ROM as drive d: to winecfg
cd "$WINEPREFIX/dosdevices"
ln -s "$CDROM" d:
 
cd "$WINEPREFIX/drive_c/windows/temp/" 
echo "[HKEY_LOCAL_MACHINE\\\\Software\\\\Wine\\\\Drives]" > cdrom.reg
echo "\\"d:\\"=\\"cdrom\\"" >> cdrom.reg
regedit cdrom.reg
 
sleep 5
 
#starting installation
cd "$CDROM"
wine "setup.exe"
POL_SetupWindow_message "Click \\"Next\\" when installation will finish." "$TYTUL"
 
cd "$WINEPREFIX/drive_c/windows/temp/"
#setting OffscreenRenderingMode to fbo and Multisampling to enabled
echo "[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\Direct3D]" > fbo.reg
echo "\\"OffscreenRenderingMode\\"=\\"fbo\\"" >> fbo.reg
#echo "\\"Multisampling\\"=\\"enabled\\"" >> fbo.reg
regedit fbo.reg
 
#asking about graphic card
POL_SetupWindow_menu "What graphic card do you have got?" "Actions" "NVIDIA ATI" " "
if [ "$APP_ANSWER" == "NVIDIA" ]; then
 
	POL_SetupWindow_menu "Do you've got \\"DynamicTwinView\\" set to \\"FALSE\\" in your xorg.conf?\\nIt's recommended" "Question" "Yes No Don't-know" " "
	if [ "$APP_ANSWER" == "Yes" ]; then
	echo "Fullscreen"
	else
	Set_Desktop "On" "1920" "1440"
	fi
elif [ "$APP_ANSWER" == "ATI" ]
then
echo "\\"UseGLSL\\"=\\"disabled\\"" >> VideoDriver.reg
Set_Desktop "On" "1920" "1440"
regedit VideoDriver.reg
fi
 
#asking about memory size
POL_SetupWindow_menu_list "How much memory do your graphic card have got?" "$TYTUL" "32-64-128-256-384-512-768-890-1024-2048" "-" "256"
VMS="$APP_ANSWER"
 
echo "[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\Direct3D]" > vms.reg
echo "\\"VideoMemorySize\\"=\\"$VMS\\"" >> vms.reg
regedit vms.reg
 
#setting decorated to N
echo "[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\X11 Driver]" > decorated.reg
echo "\\"Decorated\\"=\\"N\\"" >> decorated.reg
regedit decorated.reg
 
Set_DXGrab "On"
 
#cleaning temp
cd "$WINEPREFIX/drive_c/windows/temp/"
rm -rf *
 
#making shortcut
cp "$CDROM/BF2142.ico" "$REPERTOIRE/icones/32/$TYTUL"
#cp "$CDROM/BF2142.ico" "$REPERTOIRE/icones/32/Play BF2142 Online Now!"
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Electronic Arts/Battlefield 2142" "BF2142.exe" "" "$TYTUL" "" "+menu 1 +fullscreen 1"
Set_WineVersion_Assign "$WORKINGWINEVERSION" "$TYTUL"
#POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Electronic Arts/Battlefield 2142" "BF2142.exe" "" "Play BF2142 Online Now!" "" "+playNow 1 +menu 1 +fullscreen 1"
#Set_WineVersion_Assign "$WORKINGWINEVERSION" "Play BF2142 Online Now!"
 
POL_SetupWindow_menu "What is the version of your game?" "Version" "Deluxe Normal" " "
if [ "$APP_ANSWER" == "Deluxe" ]; then
cp "$WINEPREFIX/drive_c/$PROGRAMFILES/Electronic Arts/Battlefield 2142/mods/xpack/bf2142xpack.ico" "$REPERTOIRE/icones/32/$TYTUL Special Forces"
#cp "$WINEPREFIX/drive_c/$PROGRAMFILES/Electronic Arts/Battlefield 2142/mods/xpack/bf2142xpack.ico" "$REPERTOIRE/icones/32/Play BF2142 SF Online Now!"
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Electronic Arts/Battlefield 2142" "BF2142.exe" "" "$TYTUL Special Forces" "" "+menu 1 +fullscreen 1 +modPath mods/xpack"
Set_WineVersion_Assign "$WORKINGWINEVERSION" "$TYTUL Special Forces"
#POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Electronic Arts/Battlefield 2142" "BF2142.exe" "" "Play BF2142 SF Online Now!" "" "+playNow 1 +menu 1 +fullscreen 1 +modPath mods/xpack"
#Set_WineVersion_Assign "$WORKINGWINEVERSION" "Play BF2142 SF Online Now!"
fi
 
POL_SetupWindow_message "$TYTUL has been installed successfully" "$TYTUL"
 
#asking about patching
POL_SetupWindow_question "Do you want to patch your game?" "$TYTUL"
if [ "$APP_ANSWER" == "TRUE" ] ;then
patch_battlefield2142
fi
 
POL_SetupWindow_message_image "Please note that this game has a copy protection system\\nand sadly, it prevents Wine from running the game.\\n\\nPlayOnLinux will not provide any help concerning any illegal\\nstuff." "Note about copy protection" "$PLAYONLINUX/themes/tango/warning.png"
 
POL_SetupWindow_Close
exit


voilà ++

Edité par CKDevelop

CKDevelop Dimanche 13 Décembre 2009 à 16:54
CKDevelop

Je tiens à préciser tous de même que je me suis basée sur le script de BattleField2 de NSLW qui au passage ne passe pas sur Ubuntu9.10 avec la version 1.1.21 de Wine mais il passe avec la 1.1.29.

Voilà je tiens à m'excuser pour cette oublie involontaire...
CKDevelop Lundi 14 Décembre 2009 à 14:21
CKDevelop

Bon, après quelques tests sur BF2 et BF2142 j'ai pus constater quelques bugs.

BF2:
-avec le script POL officiel (Wine 1.1.21) le jeu ne fonctionne pas sur Ubuntu 9.10 j'ai donc modifié le script avec une version 1.1.29 de wine et la sa passe sauf les textures du sol qui disparaise au bout d'un moment, j'ai donc poussé le vice et je l'ai tester avec la version 1.1.33 et la plus de souci de ce coté là. juste quelques saleté sur la texture du sol mais rien de bien dérangeant.
-la configuration des commandes ne fonctionne pas du tous.

BF2142:
-J'ai tester BF2142 avec le script POL officiel (Wine 1.1.21) de BF2 (juste les chemin d'accès à modifié et un patch à viré) et la surprise sa passe sauf qu'il n'y a pas de son donc j'ai fait pareille qu'avec BF2 je suis passé de version de Wine en version de WIne jusqu'à arriver à la 1.1.33 car à partir de la 1.1.34 sa plante direct.
-la configuration des commandes ne fonctionne pas du tous.

voilà ++

Edité par CKDevelop

killman42 Samedi 15 Mai 2010 à 15:31
killman42Anonymous

Bonjour, j'ai essayer d'installer Battlefield 2142 via le script de CKDevelop, mais POL me signale que le script n'est pas valide.
Il y a une erreur dans le script ?
Cordialement

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