The G4 Console

Joe Teibel

New member
I thought I'd open a seperate thread to let you know a couple interesting things you can use the Console feature for. If you "discover" something relating to the console that other users might find useful, please add it.
 
Load your own aircraft in the trainers

When the heli and airplane hover trainers were released, an often requested feature was to be able to use your own aircraft in the trainers. In G4 you can now do this via the console. With any particular trainer open/running, open the console (press the tilde key [~] or you can access it through the Window > Gadgets > Console menu item) then type in "loadaircraft [aircraft name]". This also works in the new takeoff and landing trainers.
 

Attachments

  • ahovertrainer.jpg
    ahovertrainer.jpg
    293.8 KB · Views: 221
  • hloadaircraft.jpg
    hloadaircraft.jpg
    6.6 KB · Views: 1,279
Make custom "load aircraft hotkeys"...

RealFlight G4 has a very simplified scripting system - you can simply type console commands into a text file and then run that file as a script and the commands will be executed in the order they appear in file. Simply save the text file, with commands in it, with an "rfscript" extension and then enter "exec [script file name]" in the console. See the "exec" command help for more information (type "help exec" in the console).

Given this ability, we added a simple start up script to the initialization process (of the sim). The "startup.rfscript" (in [My Documents]\RealFlight G4\Scripts) script is run every time the sim starts up. You can verify this by opening the console right after the sim starts up and you'll see three lines:

exec startup
Executing script...
Done executing script

One of the ways our users might find this most useful is in combination with the "bind" command. The "bind" command ties a console command to a keyboard key or key combination such that any time that key or key combination is pressed, the command bound to it is executed. To verify this, type "bind y loadaircraft yak-54" into the console. Close the console and press the 'Y' key. The Yak-54 should load at that point.

So, if you have several aircraft that you use often and/or particularly like, you could add "bind" commands to the "startup.rfscript" for those aircraft and then every time you ran the sim you can load your favorite aircraft with the press of a button. Once added to the startup script, those keys will be re-bound every time you run the sim. Simply edit the previously mentioned "startup.rfscript" and add all of the bind commands you'd like, one per line.

The antithesis of "bind" is "unbind" and you can use "bindable" to see a list of keys and key combinations that are available to bind commands to.
 

Attachments

  • three lines.jpg
    three lines.jpg
    130.5 KB · Views: 155
  • bind.jpg
    bind.jpg
    27.9 KB · Views: 102
Example "startup.rfscript"

Here is an example of what the startup script referred to above might look like.

Whatever you do, don't add the "exit" command to your startup script ;)
 

Attachments

  • startup.rfscript
    453 bytes · Views: 193
Try the "help" command

For a complete list of console commands, use the "help" command. For any particular command you can type "help [command]" for specific documentation. There are several "features" available through the console only. There are several criteria for making something a console command as opposed to a feature available through the standard UI e.g. is the feature in question going to pose a lot of relatively tough decisions as far as making it "fully supported"...

In general the console commands and the extensibility of the console itself allows us to offer some things (now and in the future) we wouldn't be able to do without it.
 
Joe,

I like a lot what you just described above.
I will definitely try it tonight at home.
Very convenient way of switching to windy day etc ....

Good job KE team. ( Now I am going to be punished by others for saying nice things about KE :D )

Andrzej
 
Can't get G4 Console to load aircraft

I have a Twister Bell 47 that I downloaded from here which is working fine. I followed instructions at start of this thread to change the heli hover aircraft to the Bell. It won't work even though I have followed instruction in posting and in help

I'll copy relevant section of console buffer messages to here. Any advice please???


Dominion 3D
"loadaircraft [Twister Bell 47]"
'"loadaircraft' is not recognized as an internal or external command, operable program or batch file.
"loadaircraft[Twister Bell 47]"
'"loadaircraft[Twister' is not recognized as an internal or external command, operable program or batch file.
"loadaircraft[Twister_Bell_47]"
'"loadaircraft[Twister_Bell_47]"' is not recognized as an internal or external command, operable program or batch file.
"loadaircraft"_[Twister Bell 47]"
Could not find aircraft "_[Twister Bell 47]""
Error executing command.
"loadaircraft [Twister_Bell_47]"
'"loadaircraft' is not recognized as an internal or external command, operable program or batch file.

In my frustration I did try a few other variations as you can see. I haven't done programming for 25 years and I haven't used a scripting language for yonks.
:confused:
 
Got it now

Thanks fellas. Retyped with no quotes or brackets and remarkable transformation. Only problem, the model I'm using at the moment is Twister Bell 47 which is quite small. Once in the hover training mode, I can't zoom in to get a closer look. Is there soomething in the scripting that will allow this to be done?

Two steps up and one step back.

Cheers
 
Console Enhancement

I have bound "loadaircraft" commands to specific keys and incorporated the commands into my "startup.rfscript" file.

It allows me to select my aircraft with a single keystroke, it works well and I really enjoy using it.

What would be even better is if we could use these short cuts within the Heli Orientation Trainer as well, instead of having to run the console each time we wish to change the aircraft whilst training.

Regards

Acrow
 
Keyboard Command

Hi Tech Staff

Here is another suggestion to improve your product.

You currently have the "K" keyboard command to kill the engine. Why don't you add another keyboard command to re-start engine. "R" and "S" are already in use so how about "B" for "begin"?

Regards

Acrow
 
Can someone post a list of all console commands, or point me in the right direction to find them? I can learn syntax with 'help [command]'

Thanks fellas,

Mark M.
 
Back
Top