Jump to content
Sign in to follow this  
Spitfire

Vtol script available

Recommended Posts

I've just finished a VTOL (Vertical Take-Off & Landing) script using the new setVelocity-command. It works via action menu, and it's pretty crude (still beta) but it works. I have tested it with SU-25 and it may or may not need tweaking to use with other planes (the Harrier-addon, for example).

It features action commands for turning the nozzles, increasing and decreasing the vertical thrust and activating retro-thrust (needed so you can slow down more effectively when approaching the landing zone).

It's a bit tricky but you can get quite adept with it by practising a little. At least with my system, the plane tends to bank very slightly to the left when hovering in slow speeds, and I believe this cannot be fixed until BIS supplies us with means to set pitch & bank of objects.

Don't let the speed of the aircraft get below 3-5 km/h when you are landing, since it'll tip over very easily. So, right now it's VSTOL rather than true VTOL but it's good enough for now.

Please, test it as you wish, make modifications and give me some feedback. It's not perfect and I'd like to know how to make it better. Right now, this is best I can come up with at this point.

You can download a zip-file with the scripts and a sample mission from

http://www.angelfire.com/weird2/spitfire/ofp.html

edit: I just uploaded a new version of the script. It fixes the stalling of the plane near zero speeds. It's still crude but now it works a little better wink.gif

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (TYsiEK @ Oct. 15 2002,13:42)</td></tr><tr><td id="QUOTE">Hey can You test my osprey with this script ?<span id='postcolor'>

Sure, just give me a link to the download... I remember seeing an Osprey downloadable somewhere, but I can't remember where and if it was yours or not...

Now I'm going to have to rename "nozzels" to "propellers" wink.gif

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Spitfire @ Oct. 15 2002,12:52)</td></tr><tr><td id="QUOTE"></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (TYsiEK @ Oct. 15 2002,13:42)</td></tr><tr><td id="QUOTE">Hey can You test my osprey with this script ?<span id='postcolor'>

Sure, just give me a link to the download... I remember seeing an Osprey downloadable somewhere, but I can't remember where and if it was yours or not...<span id='postcolor'>

Just try to active one animation with change the VTOL to plane and to helicopter flying model smile.gif. I have rotating engines for osprey and it's should working.

The Adress from V-22 Osprey has been sent to your e-mail.

Share this post


Link to post
Share on other sites

Cool script, but when you use "retro-thrust" you can't move the plane around anywhere. Even when you press it again it still doesnt let you move. mad.gif

wow.gif PEACE

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (GAMEER_77 @ Oct. 15 2002,15:02)</td></tr><tr><td id="QUOTE">Cool script, but when you use "retro-thrust" you can't move the plane around anywhere. Even when you press it again it still doesnt let you move. mad.gif

wow.gif PEACE<span id='postcolor'>

Retro-thrust works fine for me as a toggle. Use it as an airbrake, but switch it off before your airspeed drops too low.

I think your problem is that the SU25 banks only when the speed is more than 90, and it has nothing to do with the retro-thrusters. Before your speed drops below 90, make sure your wings are level and your landing zone is in front of you. Then you can just hover and use the retro-thruster as you wish; you can't change your heading anymore with or without the retro.

Share this post


Link to post
Share on other sites

I will soonish be releasing a script which gives you 6 simultaneous and independent high-bandwidth script-accessible simulated-analog control axes via the keyboard - using the main game keys. This will solve your control problems. No need for Action Menu commands.

Prospero

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Prospero @ Oct. 15 2002,15:50)</td></tr><tr><td id="QUOTE">I will soonish be releasing a script which gives you 6 simultaneous and independent high-bandwidth script-accessible simulated-analog control axes via the keyboard - using the main game keys. This will solve your control problems. No need for Action Menu commands.<span id='postcolor'>

Sounds excellent. Simulated-analog control axes via the keyboard? Have you somehow managed to map keyboard commands so that they trigger scripts or change variables?

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Prospero @ Oct. 15 2002,13:50)</td></tr><tr><td id="QUOTE">I will soonish be releasing a script which gives you 6 simultaneous and independent high-bandwidth script-accessible simulated-analog control axes via the keyboard - using the main game keys. This will solve your control problems. No need for Action Menu commands.

Prospero<span id='postcolor'>

Yeh, how do you do this prospero? wow.gif

P.S Yeh, it needed to be above 90 mph! smile.gif

tounge.gif PEACE

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (GAMEER_77 @ Oct. 15 2002,16:09)</td></tr><tr><td id="QUOTE">P.S Yeh, it needed to be above 90 mph! smile.gif<span id='postcolor'>

I've done some testing. It works better on slow speed aircraft which have slow stall speeds. I think it's time to tweak a config.cpp of an airplane to make it more maneuverable while hovering. Giving the plane some aileron control in low speeds would make landing a LOT easier.

Share this post


Link to post
Share on other sites

Prospero it is easy to make helicopter with plane model simulation like for osprey and with some animation working at change simulation ?

Share this post


Link to post
Share on other sites

It's actually alarmingly simple... well it seems simple when you see how it's done. But being simple means it's very fast and works very well. The script has been sitting on my shelf for ages, since I was waiting for v1.85 to come out. The script worked back at v1.46, but it can be improved with the features of v1.85... so I'm gonna need a few days.

Regarding the Osprey, I would define it as a plane, not a helicopter and do the hovering/slow vectoring/landing/taking-off with these scripts. You could always have the engine nacelles rotate (again, controllable via script) using a custom rotation axis and setting the animate phase with the animate command, although it remains to be seen whether you could get the props to rotate at the same time - worth a go though.

I'll post a readme from an earlier version of my ProSphere script soon in this thread if there's interest.

Prospero

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Spitfire @ Oct. 15 2002,15:00)</td></tr><tr><td id="QUOTE">Sounds excellent. Simulated-analog control axes via the keyboard? Have you somehow managed to map keyboard commands so that they trigger scripts or change variables?<span id='postcolor'>

Yes. Through global variables.

Prospero

Share this post


Link to post
Share on other sites

Well folks, the reason why slower planes work better is because the aircraft FM does include some stall characteristics.

If you want to play with VTOL and stuff, what you can do is:

A.

use setvelocity to give the aircraft enough velocity to be at the edge of a stall (Real mushy controls), and use setpos to keep it in one place. This will give you better control over the aircraft as you approach hovering

B. use prospero's trig stuff to calculate the pitch and bank of the aircraft, and shoot your vectored thrust along what is normally the lift vector. That way, when you bank, you'll get some interesting effects.

C. Adjust all this for ground effect.

Share this post


Link to post
Share on other sites

Hi Dinger me old matey.

I better release the "get yaw, pitch and roll of any object" script too;) This is v1.75 specific.

I'm busy shaping the latest version of the controller script as we speak. I'm afraid it will be v1.85 specific.

Prospero

Share this post


Link to post
Share on other sites

Can i use some rotate vehicle action in your script ? I think about rotation of helicopter when i press "X" and "C" . It's very needed for flying in helicopter mode.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (TYsiEK @ Oct. 15 2002,19:18)</td></tr><tr><td id="QUOTE">Can i use some rotate vehicle action in your script ? I think about rotation of helicopter when i press "X" and "C" . It's very needed for flying in helicopter mode.<span id='postcolor'>

Yes, you can use X & C - they form one of the axes. What you choose to tie to them is up to you. So if you use an accurately timed setDir loop on your Osprey, this will probably give you what you want (rudder/yaw).

Be aware that setDir will set pitch and roll to zero by default.

The other axes are (with default key assignments):

W/S

A/D

Q/Z

PAD4/PAD6

PAD2/PAD8

E - special toggle key.

... and perhaps some other fun stuff.

Edit: Oh, and of course the Cursor/Arrow Keys also work instead of W/S and A/D. In fact this works better, as OFP has trouble with three keys pressed simultaneously if they are all "alphabetical" keys.

Prospero

Share this post


Link to post
Share on other sites

So, i think there's possible to make some tailrotor failure when i dont activate the engine rotating. But i have a problem: when i group the engines and rotors, the rotors can't rotate when i start the eingine. I think it's problem for some Oxygen topics beacuse it's about object groups in a O2.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Prospero @ Oct. 15 2002,20:28)</td></tr><tr><td id="QUOTE">Be aware that setDir will set pitch and roll to zero by default.<span id='postcolor'>

biggrin.gif Didn't know that. Thanks! That piece of information pretty much solves the stability problems of my script.

smile.gif

Share this post


Link to post
Share on other sites

Folks,

Combining all the knowledge that has been discussed this thread, looks like we are finally going to have a perfect VTOL-script after all smile.gif

Still, I would kill for setPitch/setRoll -functions wink.gif

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Spitfire @ Oct. 15 2002,20:00)</td></tr><tr><td id="QUOTE">Still, I would kill for setPitch/setRoll -functions wink.gif<span id='postcolor'>

I've been banging on about that for about a year;)

From (old) ProSphere readme:

; ProSphere Controller v1.0 for Bohemia Interactive Software's (BIS's) battlefield simulation "Operation Flashpoint" (OFP) & related software.

; What is ProSphere Controller?

; ProSphere Controller (or just "ProSphere") is a "tool" for OFP gamers, mission editors, and add-on creators. Simply put, it allows you to interact with the OFP Game World in ways that were previously impossible.

; ProSphere exploits a number of "tricks" within OFP to SIMULTANEOUSLY provide FIVE(*) fully independent, configurable, high-bandwidth, high-resolution, REAL-TIME axes of keyboard control input using the "main" game key assignments, and ALL DIRECTLY ACCESSIBLE to your OFP scripts via global variables. ProSphere therefore obviates the problem of very slow control input associated with laboriously selecting actions from the Action Menu (which is slow even when using automated macros, as is, albeit to a lesser extent, the Dialog method of input introduced in OFP v1.75). You can of course still use the Action Menu in the normal way for control input that does not require speed & resolution. Furthermore, you can combine ProSphere input with Action Menu input and / or Dialog input. The result can be very powerful.

; Applications of ProSphere can be anything from simple interactions, like being able to walk up to a wounded squad-mate and quickly heal him / rearm him / share equipment & data with him, to manipulating multi-axis in-game 3D switches, to locking / unlocking / positioning doors, to throwing objects from vehicles, to controlling a real-time safe-cracking puzzle, to implementing complex in-game 3D menus, to placement systems for setting and planting explosives, and even to advanced concepts such as controlling your own real-time (scripted) physics models. This, in fact, is why I developed the software in the first place - to provide a means of controlling a helicopter UAV flight maths-model I had implemented in OFP's scripting language, and which I had "attached" to an object in the OFP Game World. I needed at least four script-accessible REAL-TIME ANALOG axes to control the helicopter UAV effectively - and an early version of the ProSphere concept proved the answer to this somewhat thorny problem. I then realised that the interface I had devised could be developed further to provide a rather nice feature for other OFP enthusiasts. ProSphere Controller v1.0 was the result.

; (*) In fact, ProSphere provides not FIVE axes, but SIX. However, a limitation is placed upon the use of the sixth axis (the ProSphere C-Axis), which is this: Manipulating the C-Axis at the same time as attempting to manipulate the X-Axis will have the effect that manipulation of the X-Axis is overridden. Practically speaking, it is unlikely that this will matter in the majority of cases, but do bear it in mind. This limitation is simply a consequence of what can / cannot be achieved in OFP scripting - but of course, in a perfect world I'd still like to find a work-around for this.

; ProSphere provides in-game 3D graphical "Items" to facilitate user interactions. A separate readme file is included with this distribution which explains what ProSphere "Items" are and how to use them. A demonstration mission is also included, and I highly recommend you take a look at it to start with.

; If you are using the default OFP key assignments, the ProSphere Axes are controlled as follows. If you have changed the default keys, then you use whatever you have assigned instead:

; OFP Command Key(s) ProSphere Axis Global Variable Name

; ------------- ------ -------------- --------------------

; Strafe right Right Arrow or D X-Axis + PSX

; Strafe left Left Arrow or A X-Axis - PSX

; Forwards Up Arrow or W Y-Axis + PSY

; Backwards Down Arrow or S Y-Axis - PSY

; Up Page Up or Q Z-Axis + PSZ

; Down Page Down or Z Z-Axis - PSZ

; Look right Keypad 6 A-Axis + PSA

; Look left Keypad 4 A-Axis - PSA

; Look up Keypad 8 B-Axis + PSB

; Look down Keypad 2 B-Axis - PSB

; Turn right C C-Axis + PSC

; Turn left X C-Axis - PSC

; Fast forwards E Toggle MoveLock PSplayermovelock

; In DIGITAL Mode, a ProSphere Axis provides the specific values -1, +1 or 0 as the centre point.

; In ANALOG Mode, a ProSphere Axis provides a floating point number in the range -1 to +1 with 0 being the centre point.

; Note that for a straightforward _immediate_ DIGITAL response, set the desired ProSphere axis mode to DIGITAL, and its deflection speed to 1.

; PSplayermovelock is either 0 for OFF or 1 for ON.

; ProSphere Axes may also be controlled by using a SUITABLE PROGRAMMABLE mouse. I am hoping to include a suitable freeware / shareware programmable mouse driver with this distribution at some stage in the future. It must offer driver-level keyboard emulation to work with OFP. If the demand is there, I may write one myself.

; ProSphere Axes may also be controlled by using a SUITABLE PROGRAMMABLE joystick such as the new ThrustMaster Cougar.

; You will need to create / load an appropriate profile into your particular joystick / joystick driver. I am hoping to include a suitable profile with this distribution at some stage in the future. PLEASE NOTE that this version of ProSphere is NOT really suitable for "absolute" modes of operation via joystick. This is high on my list of things to address, but I will first have to wait until I have a Cougar with which to test.

; The response of each ProSphere Axis is fully configurable (see below).

; ProSphere's response is identical regardless of which vehicle (if any) the vehicle player happens to be occupying.

; ProSphere's performance is unaffected by the pace of Game World Time (the setAccTime function etc).

; ProSphere adds one (and only one) action to the player's Action Menu - the ProSphere ON / ProSphere OFF action (toggle). It will always be the first action in the Action Menu list. Once you toggle ProSphere ON, you'll get access to the ProSphere sub-menus. Toggle ProSphere OFF at any time to return to the standard Action Menu.

Prospero

(Please bear in mind that this is an old version).

Share this post


Link to post
Share on other sites

OK, I just released another version of the VTOL script.

News: the plane ain't stallin' no more!  wink.gif  Now you can land it at zero-velocity. The side-effect is that when you take off, your pitch and roll instantly level off with the horizon, and they keep "glued" there until your speed goes past 10km/h. It happens the other way round: when you slow down to speeds less than 10, the same thing occurs. The motion may look a bit abrupt if your pitch or roll is at high angles when you approach the speed limit. However, now it's whole lot easier to land without stalling.

Share this post


Link to post
Share on other sites

So Prospero, is the "ProSphere" an application? Or is it using code from OFP itself? Please tell us more because im racking my brains as to how your doing this. sad.gif

tounge.gif PEACE

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×