Text-Based_Launcher

Updated: 17th July 2020

The FGWALK Python based launcher is still in development. In the meantime I came up with a text based launching tool, first as a batch file, then as a menu driven text based launcher for Flight Gear. The Win 32 Command Prompt version is working at the moment (listed in the sub pages).

There are several compelling reasons for the development of a text based launcher:

1) Testing of aircraft or adding of scenery required the repeated restart of Flight Gear with the same parameters. Having a one button lunch speeds up the process considerably, and reduces the mental effort of having to move the mouse and select options each time.

2) Launching is quicker under some circumstances

3) When the standard launcher does not work properly, for example with the latest version of FG 2018 installed in Linux Mint 19 , the launcher shows only one aircraft and does not allow the selection of any options that the Win 32 version does on the same computer. So the only chance is to type in the commands or use a launcher or a script.

4) The possibility of storing past launch parameters on the file and accessing these.

5) Batch files and shell scripts are relatively easy to create and to edit, and are sure to work in each environment.

Shortcuts are essential to speeding up the launching process , these are described in each section where the script is located for the WIn 32 and the Linux shell scripts.



PYTHON LAUNCHER CODE: (Requires a file called fgl.txt)

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os

AircraftList = open('fgl.txt', 'r') 
aircraftline = AircraftList.readlines() 


i=1
for item in aircraftline:
  #print(item)
 print(str(i) + " " + item)
 i=i+1
 
number_1 = int(input("Choose startup string for FLight Gear ")) 

os.system(aircraftline[number_1-1])

fgl.txt:

fgfs --airport=PHTO   --aircraft=c172pN1234  --disable-random-objects  --enable-auto-coordination --geometry=800x600 --timeofday=noon
fgfs --airport=PHNL   --aircraft=ufo    --enable-horizon-effect   --disable-ai-models --geometry=800x600 --timeofday=noon  
fgfs --airport=PHNL  --aircraft=ch750stol      --enable-auto-coordination   --enable-horizon-effect   --disable-ai-models --geometry=800x600 --timeofday=noon  
fgfs --airport=PHNL  --aircraft=ufo    --enable-auto-coordination   --enable-horizon-effect   --disable-ai-models --geometry=800x600 --timeofday=noon
fgfs --airport=PHNL   --aircraft=ufo    --enable-auto-coordination   --enable-horizon-effect   --disable-ai-models --geometry=800x600 --timeofday=noon
fgfs --airport=PHNL  --aircraft=ufo    --enable-auto-coordination   --enable-horizon-effect   --disable-ai-models --geometry=800x600 --timeofday=noon