Fora

Script Trainz Rairoad Simulator 2006

Autor Odpowiedzi
Jump to the page: 1 - 2
thib25 Wednesday 21 May 2008 at 14:58
thib25Anonymous

Bonjour j'ai créer , en parallèle à un script pour le jeu Richard Burns Rally voir http://www.playonlinux.com/fr/topic-1545-Demande_de_test_script_Richard_Burns_Rally.html , un script pour le jeu Trainz Railroad Simulator 2006.

J'arrive donc à le lancer , à l'installer mais une fois l'installation finit les lanceurs ne fonctionnent pas , voilà le message obtenu dans un terminal : Running TRS2006
TRS2006: line 4: cd: /home/thibault/.PlayOnLinux/wineprefix/TRS2006//drive_c/Program Files/Anuman Interactive/TRS2006/TRS2006.exe: N'est pas un dossier
wine: could not load L"C:\\windows\\system32\\4.exe": Module not found

Voilà je vous affiche quand même le script

#!/bin/bash
if [ "$PLAYONLINUX" = "" ]
then
exit 0
fi
source "$PLAYONLINUX/lib/sources"

cfg_check

#presentation du script
presentation "Trainz Railroad Simulator 2006" "Anuman Interactive" "www.anuman-interactive.com" "thib25" "TRS2006" 1 4

#Demande le chemin vers le DVD et vérifie la présence de l'installeur
Ask_For_cdrom 2 4
Check_cdrom "menu.exe"

#Création du préfixe du jeu
select_prefixe "$REPERTOIRE/wineprefix/TRS2006/"
creer_prefixe 3 4

#Lancement de l'installation avec Wine 0.9.38
Set_WineVersion_session "0.9.38"
wine $CDROM/menu.exe

#Création du lanceur et des raccourcis si l'utilisateur en veut
creer_lanceur "TRS2006" "Program Files/Anuman Interactive/TRS2006/TRS2006.exe" 4 4

end_install
exit


Donc si vous avez une idée n'hésitez pas .
Toumeno Wednesday 21 May 2008 at 15:22
Toumeno

la bonne commande est :
creer_lanceur "TRS2006" "Program Files/Anuman Interactive/TRS2006/TRS2006.exe" "" "TRS2006" 4 4
thib25 Wednesday 21 May 2008 at 19:19
thib25Anonymous

Bon j'ai rajouté le nom du lanceur mais les gros espaces dans "Program Files ..." ne viennent pas de moi ni de l'editeur de texte.

Je préfère vous remettre le script un poil corrigé

#!/bin/bash
if [ "$PLAYONLINUX" = "" ]
then
exit 0
fi
source "$PLAYONLINUX/lib/sources"

cfg_check

#presentation du script
presentation "Trainz Railroad Simulator 2006" "Anuman Interactive" "www.anuman-interactive.com" "thib25" "TRS2006" 1 4

#Demande le chemin vers le DVD et vérifie la présence de l'installeur
Ask_For_cdrom 2 4
Check_cdrom "menu.exe"

#Création du préfixe du jeu
select_prefixe "$REPERTOIRE/wineprefix/TRS2006/"
creer_prefixe 3 4

#Lancement de l'installation avec Wine 0.9.38
Set_WineVersion_session "0.9.38"
wine $CDROM/menu.exe

#Création du lanceur et des raccourcis si l'utilisateur en veut
creer_lanceur "TRS2006" "Program Files/Anuman Interactive/TRS2006/TRS2006.exe" """TRS2006" 4 4 " "TRS2006" 4 4

end_install
exit


Oh c'est pas vrai quand je tape "Program Files/Anuman Interactive ..." il n'y a pas d'espace entre Program Files et Anuman Interactive mais dans l'aperçu de la réponse il fait plusieurs espaces.
Toumeno Wednesday 21 May 2008 at 20:01
Toumeno

Normal, c'est le forum qui fait ça.
Est ce que le script corrigé fonctionne ? (je n'ai pas le jeu)
thib25 Wednesday 21 May 2008 at 21:05
thib25Anonymous

J'arrive à installer le jeu mais après pour le lancer à l'aide du bouton adéquat dans Play On Linux mais rien ne se passe , quand je lance dans un terminal j'ai : "Running TRS2006
TRS2006: line 4: cd: /home/thibault/.PlayOnLinux/wineprefix/TRS2006//drive_c/Program Files/Anuman Interactive/TRS2006/TRS2006.exe: N'est pas un dossier
wine: could not load L"C:\\windows\\system32\\4.exe": Module not found"

Quand par contre je clique manuellement sur le fichier TRS2006.exe le jeu se lance.

C'est dingue les scripts que je fais , marchent mais c'est à chaque fois les lanceurs qui ne fonctionnent pas.
Toumeno Wednesday 21 May 2008 at 21:37
Toumeno

met cette ligne pour le lanceur :

creer_lanceur "TRS2006" "Program Files/Anuman Interactive/TRS2006" "TRS2006.exe" "" "Trainz Railroad Simulator 2006" 4 4

c'est du type
creer_lanceur "prefixe" "repertoire du jeu" "binairejeu.exe" "icone.png" "titre du raccourci"

tiens moi au courant
thib25 Thursday 22 May 2008 at 8:26
thib25Anonymous

Bon j'ai testé avec ce que tu m'as prposé , ça y'est le lanceur marche mais le problème vient du fait que le jeu ne se lance pas directement en effet quand on clique sur Lancer une fenêtre s'ouvre nous proposant plusieurs choix (démarrez, content manager ...) . Bref je clique sur lancer le jeu mais rien ne se passe.

Voilà ce qu'un terminal écrit:

Running Trainz Railroad Simulator 2006
X Error of failed request: BadAccess (attempt to access private resource denied)
Major opcode of failed request: 159 (Composite)
Minor opcode of failed request: 1 ()
Serial number of failed request: 31
Current serial number in output stream: 32

Donc là je suis paumé , si tu as une idée n'hésite pas.

EDIT : Finalement j'ai réussi à lancer dans la partie démarez il m'a fallut aller dans les options du jeu et de mettre sur directx au lieu de opengl. Quand on arrive au choix de ce qu'on veut faire après avoir cliquer sur démarrer il y'a un bug en effet les mots conducteur , concepteur etc... ont disparus ;.C'est pas très grave pour moi puisque je connais bien le jeu mais pour les autres Aie ...

Edytowane przez thib25

thib25 Saturday 16 August 2008 at 17:01
thib25Anonymous

Bonjour , je viens de passer le script en V3 . Alors j'arrive à installer le jeu mais j'ai un problème avec le raccourci qui ne fonctionne pas.

Donc je vous donne quand même le script :

#!/bin/bash
if [ "$PLAYONLINUX" = "" ]
then
exit 0
fi
source "$PLAYONLINUX/lib/sources"

cfg_check

POL_SetupWindow_Init

#presentation du script
POL_SetupWindow_presentation "Trainz Railroad Simulator 2006" "Anuman Interactive" "www.anuman-interactive.com" "thib25" "TRS2006"

#Création du préfixe de wine
POL_SetupWindow_prefixcreate "$REPERTOIRE/wineprefix/TRS2006/"

#Détection du cd-rom
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "menu.exe"

#Lancement de l'installation avec Wine 0.9.38
Set_WineVersion_Session "0.9.38"
wine $CDROM/menu.exe
POL_SetupWindow_detect_exit

#Création du lanceur et des raccourcis si l'utilisateur en veut
POL_SetupWindow_make_shortcut "TRS2006" "Program Files/Anuman Interactive/TRS2006" "TRS2006.exe" "" "TRS2006"

POL_SetupWindow_reboot
POL_SetupWindow_Close
exit

.
thib25 Thursday 26 February 2009 at 12:50
thib25Anonymous

Bon je viens de me remettre sérieusement à ubuntu et donc à POL, donc voilà le script censé marcher correctement :
#!/bin/bash
if [ "$PLAYONLINUX" = "" ]
then
exit 0
fi
source "$PLAYONLINUX/lib/sources"

cfg_check

POL_SetupWindow_Init
POL_SetupWindow_presentation "Trainz Railroad Simulator 2006" "Anuman Interactive" "www.trainz-simulator.com" "thib25" "TRS2006"

select_prefixe "$REPERTOIRE/wineprefix/TRS2006"
POL_SetupWindow_prefixcreate

POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "menu.exe"

cd $CDROM
POL_SetupWindow_wait_next_signal "Installation in progress..." "Trainz Railroad Simulator 2006"
wine $CDROM/menu.exe
POL_SetupWindow_detect_exit

POL_SetupWindow_make_shortcut "TRS2006" "Program Files/Anuman Interactive/TRS 2006" "TRS2006" "" "Trainz Railroad Simulator 2006"

POL_SetupWindow_reboot
POL_SetupWindow_Close
exit
Quentin PÂRIS Sunday 1 March 2009 at 22:40
Quentin PÂRISAnonymous

Tu l'as testé ?
thib25 Monday 2 March 2009 at 11:33
thib25Anonymous

Je l'ai testé mais j'ai le même problème que pour ce poste : http://www.playonlinux.com/fr/topic-2386-Impossible_dinstaller_un_jeu_avec_playonlinux_o.html . Autrement dit il n'arrive pas à copier un fichier dès le début.
Sinon j'ai essayé sans passer par POL puis en utilisant l'outil Wine import et ça marche.

J'ai aussi essayer avec la version 2007 de TRS et ça marche correctement.
thib25 Wednesday 13 January 2010 at 21:52
thib25Anonymous

Bon je déterre vraiment mon topic. Alors je me suis remis à mon script mais je bloque avec cette erreur :
/tmp/currentpolsc: line 16: Erreur de syntaxe près du symbole inattendu « else »
/tmp/currentpolsc: line 16: `else'

Voici mon script :
#!/bin/bash
# Date : (2009-07-30 18-30)
# Last revision : (2010-01-13 21-00)
# Wine version used : 1.0
# Distribution used to test : Ubuntu 9.10
# Author : thib25
# Licence : Retail

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

patch_game()
{
cd "$REPERTOIRE/tmp"
if [ ! -e "TRS2006_US_2761-3092.exe" ];then
else
POL_SetupWindow_download "$DOWNLOAD" "$SHORTNAME Service Pack 1" "$URL"
fi
POL_SetupWindow_wait_next_signal "$INSTALLATION" "$SHORTNAME Service Pack 1"
wine "TRS2006_US_2761-3092.exe"
POL_SetupWindow_detect_exit
}

NAME="Trainz Railroad Simulator 2006"
SHORTNAME="TRS 2006"
PREFIX="TRS2006"
URL="http://files.auran.com/TRS2006/servicepacks/TRS2006_US_2761-3092.exe"

if [ "$POL_LANG" == "fr" ]; then
INSTALLATION="Installation en cours..."
QPATCH="Voulez-vous installer le Service Pack 1 pour $SHORTNAME ?"
DOWNLOAD="Téléchargement du Service Pack en cours..."
else
INSTALLATION="Installation in progress..."
QPATCH="Do you want to install the Service Pack 1 for $SHORTNAME ?"
DOWNLOAD="Download of the Service Pack in progress..."
fi

wget http://baldwinconsulting.org/images/trs2006_front_large_boxshot.jpg --output-document="$REPERTOIRE/tmp/leftnotscaled.jpeg"
convert "$REPERTOIRE/tmp/leftnotscaled.jpeg" -scale 150x356\\! "$REPERTOIRE/tmp/left.jpeg"
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.jpeg"
POL_SetupWindow_presentation "$NAME" "Anuman Interactive" "www.trainz-simulator.com" "thib25" "$PREFIX"

POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "Install/setup.exe"

select_prefixe "$REPERTOIRE/wineprefix/$PREFIX/"
POL_SetupWindow_prefixcreate

POL_SetupWindow_wait_next_signal "$INSTALLATION" "$NAME"
cd "$CDROM"
wine "Install/setup.exe"
POL_SetupWindow_detect_exit

POL_SetupWindow_question "$QPATCH" "$SHORTNAME Service Pack 1"
if [ "$APP_ANSWER" == "TRUE" ] ;then
patch_game
fi

POL_SetupWindow_make_shortcut "$PREFIX" "Program Files/Anuman Interactive/TRS2006/" "TRS2006.exe" "" "$NAME" "" ""

POL_SetupWindow_install_wine "1.0"
Set_WineVersion_Assign "1.0" "$NAME"

POL_SetupWindow_Close
exit
Berillions Wednesday 13 January 2010 at 22:02
Berillions

Regarde bien cette partie :
patch_game()
{
cd "$REPERTOIRE/tmp"
if [ ! -e "TRS2006_US_2761-3092.exe" ];then
else
POL_SetupWindow_download "$DOWNLOAD" "$SHORTNAME Service Pack 1" "$URL"
fi
POL_SetupWindow_wait_next_signal "$INSTALLATION" "$SHORTNAME Service Pack 1"
wine "TRS2006_US_2761-3092.exe"
POL_SetupWindow_detect_exit
}


Tu as un else qui n'a rien à faire après le if.

thib25 Wednesday 13 January 2010 at 22:08
thib25Anonymous

Au fait ça veut dire quoi
if [ ! -e "TRS2006_US_2761-3092.exe" ];then

Car je pensais que ça voulais dire : "si le fichier x.exe est présent alors...".

Edytowane przez thib25

Berillions Wednesday 13 January 2010 at 22:23
Berillions

En C++/bash ou autre, le ! equivaut à la négation.
Donc le cas de ton patch game, si le .exe n'est pas présent dans $REPERTOIRE/tmp alors il le télécharge. :)

thib25 Wednesday 13 January 2010 at 22:30
thib25Anonymous

Bon bah faut que je retourne apprendre le C.

Voici le code final :
#!/bin/bash
# Date : (2009-07-30 18-30)
# Last revision : (2010-01-13 21-00)
# Wine version used : 1.0
# Distribution used to test : Ubuntu 9.10
# Author : thib25
# Licence : Retail

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

patch_game()
{
cd "$REPERTOIRE/tmp"
if [ ! -e "TRS2006_US_2761-3092.exe" ];then
POL_SetupWindow_download "$DOWNLOAD" "$SHORTNAME Service Pack 1" "$URL"
fi
POL_SetupWindow_wait_next_signal "$INSTALLATION" "$SHORTNAME Service Pack 1"
wine "TRS2006_US_2761-3092.exe"
POL_SetupWindow_detect_exit
}

NAME="Trainz Railroad Simulator 2006"
SHORTNAME="TRS 2006"
PREFIX="TRS2006"
URL="http://files.auran.com/TRS2006/servicepacks/TRS2006_US_2761-3092.exe"

if [ "$POL_LANG" == "fr" ]; then
INSTALLATION="Installation en cours..."
QPATCH="Voulez-vous installer le Service Pack 1 pour $SHORTNAME ?"
DOWNLOAD="Téléchargement du Service Pack en cours..."
else
INSTALLATION="Installation in progress..."
QPATCH="Do you want to install the Service Pack 1 for $SHORTNAME ?"
DOWNLOAD="Download of the Service Pack in progress..."
fi

wget http://baldwinconsulting.org/images/trs2006_front_large_boxshot.jpg --output-document="$REPERTOIRE/tmp/leftnotscaled.jpeg"
convert "$REPERTOIRE/tmp/leftnotscaled.jpeg" -scale 150x356\\! "$REPERTOIRE/tmp/left.jpeg"
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.jpeg"
POL_SetupWindow_presentation "$NAME" "Anuman Interactive" "www.trainz-simulator.com" "thib25" "$PREFIX"

POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "Install/setup.exe"

select_prefixe "$REPERTOIRE/wineprefix/$PREFIX/"
POL_SetupWindow_prefixcreate

POL_SetupWindow_wait_next_signal "$INSTALLATION" "$NAME"
cd "$CDROM"
wine "Install/setup.exe"
POL_SetupWindow_detect_exit

POL_SetupWindow_question "$QPATCH" "$SHORTNAME Service Pack 1"
if [ "$APP_ANSWER" == "TRUE" ] ;then
patch_game
fi

POL_SetupWindow_make_shortcut "$PREFIX" "Program Files/Anuman Interactive/TRS2006/" "TRS2006.exe" "" "$NAME" "" ""

POL_SetupWindow_install_wine "1.0"
Set_WineVersion_Assign "1.0" "$NAME"

POL_SetupWindow_Close
exit

A la limite je sais pas si c'est le fait que le patch est téléchargé dans tmp mais quand on le lance on a le droit le plus souvent à "le fichier x n'a pas été trouvé néanmoins un fichier du même nom a été trouvé" on est obligé d'appuyer une quinzaine de fois sur OK alors y'a t-il un moyen de remédier à ça ?

Sinon le jeu fonctionne sans problème mis à part le patch corrompu qui a dû passer le jeu en anglais et provoque des erreurs quand on lance un tracé : on ne peut pas changer de vue. Je réessayerais demain.

Edytowane przez thib25

Berillions Thursday 14 January 2010 at 7:09
Berillions

J'ai oublié de préciser que Tinou à demander aux scripteur de ne plus intégrer l'installation des patch dans les scripts des jeux.

thib25 Thursday 14 January 2010 at 8:19
thib25Anonymous

Pourquoi ?
Berillions Thursday 14 January 2010 at 11:41
Berillions

Demande le lui directement pour que ce soit plus clair.

thib25 Thursday 14 January 2010 at 19:17
thib25Anonymous

Voilà j'ai modifier mon script en enlevant la procédure de mis à jour et en modifiant quelques trucs, ça marche impec'.

#!/bin/bash
# Date : (2009-07-30 18-30)
# Last revision : (2010-01-13 21-00)
# Wine version used : 1.0
# Distribution used to test : Ubuntu 9.10
# Author : thib25
# Licence : Retail
 
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
NAME="Trainz Railroad Simulator 2006"
PREFIX="TRS2006"

 if [ "$POL_LANG" == "fr" ]; then
INSTALLATION="Installation en cours..."
else
INSTALLATION="Installation in progress..."
fi
 
wget http://img.jeuxvideopc.com/images/jeux_boites/grandformat/9233-trainz-railroad-simulator-2006-pc.jpg --output-document="$REPERTOIRE/tmp/leftnotscaled.jpeg"
convert "$REPERTOIRE/tmp/leftnotscaled.jpeg" -scale 150x356\\! "$REPERTOIRE/tmp/left.jpeg"
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.jpeg"
POL_SetupWindow_presentation "$NAME" "Anuman Interactive" "http://www.auran.com/TRS2006/index.php" "thib25" "$PREFIX"
 
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "Install/setup.exe"
 
select_prefixe "$REPERTOIRE/wineprefix/$PREFIX/"
POL_SetupWindow_prefixcreate
 
POL_SetupWindow_wait_next_signal "$INSTALLATION" "$NAME"
cd "$CDROM"
wine "Install/setup.exe"
POL_SetupWindow_detect_exit
 
POL_SetupWindow_make_shortcut "$PREFIX" "Program Files/Anuman Interactive/TRS2006/" "TRS2006.exe" "" "$NAME" "" ""
 
POL_SetupWindow_install_wine "1.0"
Set_WineVersion_Assign "1.0" "$NAME"
 
POL_SetupWindow_Close
exit

Par contre j'aimerais bien mettre une icône au raccourci. Cette icône se trouve sur le cd comment je fais pour la mettre dans le dossier qu'il faut pour pouvoir la mettre dans POL_SetupWindow_make_shortcut ?