Outils pour utilisateurs

Outils du site


issue90:jeux_ubuntu2

Table des matières

1

Last month, I reviewed X-Plane 10; this month, I thought I’d show how to extend X-Plane using Python and several other scripts. Before doing anything else, you’ll need to install Python. I would recommend installing the package named ‘python’ via your package manager (or a terminal), but be sure to install some version of Python 2.7. As of writing, I have 2.7.5-5ubuntu3 listed in my package manager. Python Interface The Python Interface is written by Sandy Barbour and is available from http://www.xpluginsdk.org/python_interface_latest_downloads.htm. What you’ll download is a ZIP file which should be unarchived to your X-Plane plugins folder. I have X-Plane via Steam, so I unarchived the ZIP file to /home/ronnie/.local/share/Steam/SteamApps/common/X-Plane 10/Resources/plugins. You may need to show hidden folders to see the .local folder. Your desktop window manager should have an option under View for this. So, if you go into your plugins folder, you should see a folder called PythonInterface. On loading X-Plane, you should now see Python Interface mentioned in the Plugins menu at the top of the screen.

Le mois dernier, j'ai fait une critique de X-Plane 10 ; ce mois-ci, je pensais montrer comment étendre X-Plane en utilisant Python et plusieurs autres scripts.

Avant de faire quoi que ce soit d'autre, vous devez installer Python. Je recommande l'installation du paquet nommé « Python » via le gestionnaire de paquets (ou un terminal), mais assurez-vous d'installer une version de Python 2.7. Au moment où j'écris, 2.7.5-5ubuntu3 est listé dans mon gestionnaire de paquets.

L'interface Python

L'interface Python est écrite par Sandy Barbour et est disponible sur http://www.xpluginsdk.org/python_interface_latest_downloads.htm.

Ce que vous téléchargez est un fichier ZIP que vous devrez extraire vers votre dossier des extensions et greffons X-Plane. J'ai eu X-Plane par Steam et j'ai donc extrait le fichier ZIP vers /home/ronnie/.local/share/Steam/SteamApps/common/X-Plane 10/Resources/plugins. Vous devrez peut-être « Afficher les fichiers cachés » pour pouvoir voir le dossier .local. Le gestionnaire de fenêtres sur votre bureau devrait proposer une option sous Affichage pour ce faire. Ainsi, si vous allez dans votre dossier d'extensions, vous devriez voir un dossier qui est nommé PythonInterface.

Maintenant, dès que vous chargez X-Plane, Python Interface apparaîtra dans le menu des Plugins (greffons) en haut de l'écran.

2

Flight Planner I’m a complete beginner at X-Plane and flight simulations, so I like to see my position, in real-time, on a map. The site X-Plane Flight Planner is completely free, and excellent for this. It’s at http://xplane.anzui.de:3000/flight-planner. Let’s install their Python script to use X-Plane outputs to plot our location, in real-time, on a Google Maps style map. The site gives good information on installing the script (https://github.com/der-On/X-Plane-Flight-Planner/wiki/Quickstart-Guide), but here’s the basics. Download the Python file from https://github.com/der-On/X-Plane-Flight-Planner/raw/master/python_interface/PI_flight_planner.py and save/copy it to Plugins > PythonScripts (shown bottom left). If you don’t have a PythonScripts folder, then you’ll need to make one. In that same folder, save/copy the file https://github.com/der-On/X-Plane-Flight-Planner/raw/master/python_interface/flight_planner_server.sh and https://github.com/der-On/X-Plane-Flight-Planner/raw/master/python_interface/flight_planner_server.py. Now, open a terminal and cd into your PythonScripts folder. Once in there, do: ./flight_planner_server.sh Now start X-Plane. Once X-Plane has gone through some of its loading, you’ll see it start to send info in your terminal.

Flight Planner

Je débute vraiment dans le domaine de X-Plane et des simulateurs de vol et j'aimerais donc voir ma position, en temps réel, sur une carte. Le site X-Plane Flight Planner est gratuit et excellent pour cela. Vous le trouverez ici : http://xplane.anzui.de:3000/flight-planner. Installons leur script Python pour utiliser les sorties d'X-Plane pour suivre notre emplacement, en temps réel, sur une carte de style Google Maps.

Le site fournit de bonnes informations sur l'installation du script (https://github.com/der-On/X-Plane-Flight-Planner/wiki/Quickstart-Guide), mais voici l'essentiel.

Téléchargez le fichier Python à partir de https://github.com/der-On/X-Plane-Flight-Planner/raw/master/python_interface/PI_flight_planner.py et sauvegardez-le ou copiez-le à Plugins > PythonScripts (en bas à gauche). Si le dossier PythonScripts n'existe pas, il faudrait en créer un. Dans ce même dossier, enregistrez ou copiez les fichiers https://github.com/der-On/X-Plane-Flight-Planner/raw/master/python_interface/flight_planner_server.sh et https://github.com/der-On/X-Plane-Flight-Planner/raw/master/python_interface/flight_planner_server.py.

Maintenant, ouvrez un terminal et cd à votre dossier PythonScripts. Une fois dedans, tapez :

./flight_planner_server.sh

Puis lancez X-Plane. Une fois le chargement d'X-Plane partiellement terminé, vous verrez qu'il a commencé à envoyer des informations qui s'affichent dans votre terminal.

3

To stop the server you can run the file https://github.com/der-On/X-Plane-Flight-Planner/raw/master/python_interface/flight_planner_server_stop.sh (again from your PythonScripts folder), but I usually just stop the server by pressing CTRL+C in the terminal. Shown below left I am in X-Plane, parked up at Glasgow Airport (EGPH). Below right is the X-Plane Flight Planner site (the pink plane beside the big yellow one is me). If I was to move off from there (in X-Plane) and taxi to the runway, you’d see it in -time in the Flight Planner site. Be sure to click the + symbol and check the ‘follow’ box – so that it centers your plane on the screen. Now that you’ve got Python Interface installed, and you know how to install a Python script, I highly recommend (if your machine can handle it) installing the Fly With Lua plugin (http://forums.x-plane.org/index.php?app=downloads&showfile=17468) which extends the scripting abilities of X-Plane. With it installed, you should install Real Terra Haze (http://forums.x-plane.org/index.php?app=downloads&showfile=22387). It will give you fantastic atmospheric effects (shown in the screen capture below). Fly With Lua goes into your Plugins folder, and Real Terra Haze goes inside the Fly With Lua folder. If there’s interest in more X-Plane, then next month I’ll discuss using the X-Plane Flight Planner site to plan your route; and then how to enter it into your flight management computer (FMC).

Vous pouvez arrêter le serveur en exécutant le fichier https://github.com/der-On/X-Plane-Flight-Planner/raw/master/python_interface/flight_planner_server_stop.sh (qui se trouve comme les autres dans le dossier PythonScripts), mais moi, je le fais habituellement en appuyant sur CRL+C dans le terminal.

Ci-dessous à gauche, vous me voyez dans X-Plane, garé à l'aéroport de Glasgow (EGPH).

Ci-dessous à droite se trouve le site de X-Plane Flight Planner (moi, je suis l'avion rose à côté du gros avion jaune).

Si je commençais à bouger de là (dans X-Plane) pour rouler jusqu'à la piste de décollage, vous le verriez dans -time dans le site de Flight Planner.

Assurez-vous de cliquer sur le symbole + et de cocher la case « follow » (suivre) - afin que votre avion soit centré sur l'écran.

Maintenant que Python Interface est installée et que vous savez comment installer un script Python, je recommande vivement (si toutefois votre machine peut le gérer) l'installation du plugin (greffon) Fly With Lua (http://forums.x-plane.org/index.php?app=downloads&showfile=17468) qui augmente la capacité de X-Plane d'écrire des scripts. Une fois cela installé, vous devrez installer Real Terra Haze (http://forums.x-plane.org/index.php?app=downloads&showfile=22387). Cela vous donnera des effets d'atmosphère fantastiques (voyez la capture d'écran ci-dessous). Fly With Lua se range dans le dossier de vos Plugins et Real Terra Haze doit aller dans le dossier Fly With Lua.

S'il y a encore de l'intérêt pour X-Plane, alors le mois prochain je parlerai de l'utilisation du site X-Plane Flight Planner pour planifier votre route et ensuite je vous dirai comment l'entrer dans votre ordinateur de gestion de vol (Flight Management Computer ou FMC).

issue90/jeux_ubuntu2.txt · Dernière modification : 2015/02/19 12:13 de andre_domenech