PDA

View Full Version : The G4 Console


Joe Teibel
11-27-2007, 04:27 PM
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.

Joe Teibel
11-27-2007, 04:29 PM
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.

Joe Teibel
11-27-2007, 04:31 PM
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.

Joe Teibel
11-27-2007, 04:40 PM
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 ;)

Joe Teibel
11-27-2007, 04:43 PM
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.

nemo_uk
11-27-2007, 05:04 PM
binding destroyvehicle is fun :D

Adam Taylor
11-27-2007, 05:11 PM
binding destroyvehicle is fun :D

Haha, if I had a nickel for every plane I've made go kablooey with destroyvehicle...

arb6591
12-10-2007, 12:59 PM
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

blink4ever717
12-12-2007, 06:41 PM
Haha, if I had a nickel for every plane I've made go kablooey with destroyvehicle...
Wait so I can make stuff blow up in g4.If so then you guys are gods. :p

RookieDave
05-03-2008, 02:41 AM
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:

phrank
05-03-2008, 04:19 AM
The first screenshot is a big clue how to type the command.

Try Again?

rccardude04
05-03-2008, 10:15 AM
Basically, you don't need brackets or quotes.

-Eric

RookieDave
05-04-2008, 06:39 AM
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

Acrow
07-14-2008, 11:05 PM
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

Acrow
11-09-2008, 07:55 AM
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

makaluch
11-26-2008, 06:15 PM
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.

makaluch
11-26-2008, 06:20 PM
Nevermind...found more info in the searches.

Type 'help' and you get the list.