I've also posted this at the BIS forums:
http://www.flashpoint1985.com/cgi-bin/ikonboard301/ikonboard.cgi?s=3eb91d9d34a6ffff&act=ST&f=7&t=30070&st=I've finally gotten VTOL to work with the keyboard.
I dug up Prospero's Prosphere scripts, heavily modified them, and wrote some scripts to interface with his to take the useful variables from his scripts for my nefarious VTOL purposes.
Here's how it works:
In your options menu, where you bind the keys on the keyboard, you can use whatever keys you have bound to certain commands to use VTOL in a plane.
The keys are:
MoveUp - vertical thrust up (default Q)
MoveDown - vertical thrust down (default Z)
Turn Left - rotate left (default X)
Turn Right - rotate right (default C)
Move Back - STOL turbo brake/reverse thrust (default S)
Forward Fast - STOL turbo forward (default SHIFT+W or E)
A programmable joystick or controller pad might also work if you can program in those specific keys.
Once you go over a certain speed (depending upon the type of aircraft), VTOL disengages.
You cannot activate it while over that max speed (which is set by a variable).
Once you are back under the max VTOL speed you can reactivate it and use the STOL reverse thrust for a fast stop and landing.
The Physics right now are VERY rudimentary. I just wanted to get this working and then let others tweak the physics to their own liking. There are many other things that can be done in the VTOL script alone and I'm sure that someone
can write a much better method for forward and reverse thrust, rotation, etc. In fact, that's what I'm hoping is that someone a bit better with trigonometry, etc. can make more realistic handling. The sample mission has 3 jets and a cessna in it so you can see what I'm trying to accomplish here.
Requirements to get VTOL working in a mission:
UPGRADE TO VERSION 1.91I use the new scripting command typeOF in one of the scripts. It isn't 100% necessary, but it makes life easier. Without it, 1.85 and up should work. You really should update to 1.91 though. Your mother would be proud.
1. Player TriggerHave a trigger for each player like so:
Condition: Alive W1 (or whatever the name of the unit is)
Trigger: Repeatedly
OnActivation: [W1] exec "karr-VTOL-Player.sqs"
So if you have 12 units, whether AI or players that you want to be able to use VTOL, then create a trigger for them. There are some global vars used in the vtol scripts, so in SP or with your own AI, you might see some interesting stuff if you get them all to activate vtol at once. Of course it might be funny too. It may not even work with AI properly at all. I haven't tested it for AI, so I don't know for sure.
2. Copy all ScriptsCopy all of the scripts into your mission folder. If you already have init.sqs, simply add the lines from the included init.sqs into your own mission's init.sqs. Specifically these lines:
VTOL = TRUE
VTOLS = []
[] exec "PSinit.sqs"
All of the core scripts are prefixed with either PS or karr-vtol
3. Prosphere TriggersProsphere requires 3 triggers to be placed in the mission ON LAND NOT WATER. You can simply copy the ones from the sample mission and place them over land. These triggers must be named PS1, PS2, and PS3.
4. AdjustmentsIf you familiarize yourself with the Vtol scripts, you'll see that I filter out all vehicles except planes. You can make it even more specific, i.e. only an AV8 Harrier or something. I also created some local arrays named _jets and _planes. _jets can use vtol up to 175 kph, planes are limited to 150. This can be adjusted however you please with karr_maxvtolspeed global variable.
This can be found in the karr-vtol-Actions.sqs script.
In the PS.sqs script there are also many more variables that can be tinkered with to fine-tune physics. Most of the VTOL physics are in the karr-vtol.sqs script. I do rely upon the self-centering spring for the C-axis (rotational axis) to spring back fairly fast, but it's still a bit slow, so rotation is a bit rough at the moment.
OK, that's it (before this becomes a novel).
Thanks to Prosperus for his Prosphere Controller Lite â„¢ technology. It was and still is a biznitch to decipher, but it makes vtol work!
Here's the link to the sample mission source:
http://www.aggression.org/karr/karrvtoltest.zipI hope you enjoy!